Skip to content
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

Fraud reporting #1280

Merged
merged 259 commits into from
Sep 13, 2023
Merged

Fraud reporting #1280

merged 259 commits into from
Sep 13, 2023

Conversation

dwasse
Copy link
Collaborator

@dwasse dwasse commented Aug 24, 2023

Description

Adds fraud reporting functionality to the guard.

Handles these cases as well as updating agent statuses.:

Fraud type Agent Fraud proving Fraud reporting Description
Invalid Snapshot Notary/Guard verifyStateWithSnapshot submitStateReportWithSnapshot (N) Snapshot having State not matching Origin
Invalid Attestation Notary verifyAttestation submitAttestationReport Attestation that was never created in Summit
Attestation from Invalid Snapshot Notary verifyStateWithAttestation submitStateReportWithAttestation Attestation having State not matching Origin
Attestation from Invalid Snapshot Notary verifyStateWithSnapshotProof submitStateReportWithSnapshotProof (alternative way to prove/report fraud)
Invalid Receipt Notary verifyReceipt submitReceiptReport Receipt that doesn't match Destination

CryptoMaxPlanck and others added 30 commits July 7, 2023 10:14
Comment on lines +328 to +339
contractCall := func(ctx context.Context) error {
agentStatus, err = g.domains[chainID].BondingManager().GetAgentStatus(ctx, agent)
if err != nil {
return fmt.Errorf("could not get agent status: %w", err)
}

return nil
}
err = retry.WithBackoff(ctx, contractCall, g.retryConfig...)
if err != nil {
return false, fmt.Errorf("could not get agent status: %w", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly, could this be later further abstracted as DomainClient.GetAgentStatus()?

@dwasse
Copy link
Collaborator Author

dwasse commented Sep 12, 2023

One more aside, it's not a major point but can we figure out what's reordering import/doing stuff like this and disable it or find a way to make our lint workflow force standardization?

Regarding imports, my recommendation would be we add a precommit hook that runs something like this:

find . -name "*.go" -exec goimports -w {} \;

That way regardless of editor choice we will have gofmt-styled code as well as standardized import ordering (goimports is a superset of gofmt that includes import organization).

cc @trajan0x

@dwasse dwasse merged commit 1d50890 into master Sep 13, 2023
@dwasse dwasse deleted the feat/fraud-reports branch September 13, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code M-ci Module: CI size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants