Skip to content

audit improvements #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 14, 2023
Merged

audit improvements #454

merged 10 commits into from
Feb 14, 2023

Conversation

adecaro
Copy link
Contributor

@adecaro adecaro commented Feb 13, 2023

ttx.audit: store transiant as soon as possible
zkatdlog driver: better logs

Linked to hyperledger-labs/fabric-smart-client#453

Signed-off-by: Angelo De Caro [email protected]

zkatdlog driver: better logs

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
@adecaro adecaro requested a review from KElkhiyaoui February 13, 2023 14:31
@adecaro adecaro self-assigned this Feb 13, 2023
@adecaro adecaro added the bug Something isn't working label Feb 13, 2023
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
@@ -16,13 +16,15 @@ import (

// AuditorCheck verifies if the passed tokenRequest matches the tokenRequestMetadata
func (s *Service) AuditorCheck(tokenRequest *driver.TokenRequest, tokenRequestMetadata *driver.TokenRequestMetadata, txID string) error {
logger.Debugf("check token request validity...")
logger.Debugf("[%s] check token request validity, number of transfer action [%d]...", txID, len(tokenRequestMetadata.Transfers))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number of transfer actions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Signed-off-by: Angelo De Caro <[email protected]>
inputs, err := s.TokenCommitmentLoader.GetTokenOutputs(transfer.TokenIDs)
if err != nil {
return errors.Wrapf(err, "failed getting token outputs to perform auditor check")
}
logger.Debugf("[%s] transfer action [%d] contains [%d] inputs, loaded corresponding outputs [%d]", txID, i, len(transfer.TokenIDs), len(inputs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contains [%d] token IDs, loaded corresponding inputs [%d]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
auditInfo, err := htlc.GetOwnerAuditInfo(t.Owner, s)
if err != nil {
return nil, nil, errors.Wrapf(err, "failed getting audit info for sender identity [%s]", view.Identity(t.Owner).String())
}
if len(auditInfo) == 0 {
logger.Errorf("empty audit info for token [%s] ith owner [%s]", ids[i].String(), view.Identity(t.Owner))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the owner [%s] of the i^th token [%s]

if err := view2.GetRegistry(context).RegisterResponder(r.AuditView, &AuditingViewInitiator{}); err != nil {
return nil, errors.Wrapf(err, "failed to register auditor view")
}

// enable processing all token transactions for the given network and namespace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable processing of all token transactions for the given...

Signed-off-by: Angelo De Caro <[email protected]>
}
net := network.GetInstance(context, tms.Network(), tms.Channel())
if tms == nil {
return nil, errors.Errorf("cannot find netowkr for [%s]", tms.ID())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot find network

Signed-off-by: Angelo De Caro <[email protected]>
@adecaro adecaro merged commit d80fe91 into main Feb 14, 2023
@adecaro adecaro deleted the f-audit-fix branch February 14, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants