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

feat: checkpoint syncer fraud flag #4587

Merged
merged 8 commits into from
Oct 4, 2024
Merged

feat: checkpoint syncer fraud flag #4587

merged 8 commits into from
Oct 4, 2024

Conversation

daniel-savu
Copy link
Contributor

@daniel-savu daniel-savu commented Sep 27, 2024

Upon detection of a merkle root mismatch between the local merkle tree (built from indexed events) and the onchain one, reorg diagnostic data is posted to checkpoint storage.

This PR focuses on the submitter logic and leaves two things for a follow up PR:

  • adding logic to not spin up the validator if a fraud flag has been posted
  • integration testing with S3 and GCP

I assume rolling out to validators will happen after the follow up PR, but running with logic from this PR will already mean the reorg diagnostic flag is posted to S3 (though not tested).

Copy link

changeset-bot bot commented Sep 27, 2024

⚠️ No Changeset found

Latest commit: c549c68

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.89%. Comparing base (e2b5a4c) to head (c549c68).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4587   +/-   ##
=======================================
  Coverage   73.89%   73.89%           
=======================================
  Files         100      100           
  Lines        1421     1421           
  Branches      180      180           
=======================================
  Hits         1050     1050           
  Misses        350      350           
  Partials       21       21           
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 75.71% <ø> (ø)
isms 79.20% <ø> (ø)
token 88.23% <ø> (ø)
middlewares 77.39% <ø> (ø)

@daniel-savu daniel-savu changed the title wip: checkpoint syncer fraud flag feat: checkpoint syncer fraud flag Oct 3, 2024
Copy link
Collaborator

@tkporter tkporter left a comment

Choose a reason for hiding this comment

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

very nice!

rust/main/agents/validator/src/submit.rs Show resolved Hide resolved
rust/main/agents/validator/src/submit.rs Show resolved Hide resolved
rust/main/hyperlane-core/src/types/reorg.rs Show resolved Hide resolved
rust/main/hyperlane-base/src/types/gcs_storage.rs Outdated Show resolved Hide resolved
rust/main/agents/validator/src/submit.rs Show resolved Hide resolved
@daniel-savu daniel-savu enabled auto-merge October 4, 2024 17:01
@daniel-savu daniel-savu added this pull request to the merge queue Oct 4, 2024
Merged via the queue into main with commit 8809f37 Oct 4, 2024
35 of 36 checks passed
@daniel-savu daniel-savu deleted the dan/fraud-flag branch October 4, 2024 17:29
github-merge-queue bot pushed a commit that referenced this pull request Oct 7, 2024
### Description

Builds on top of
#4587

Adds a check in the `CheckpointSubmitter` builder which emits a panic if
a reorg flag was posted, since this potentially signals fraud

### Drive-by changes

`CheckpointSubmitter::build` was made private, so any use of it is now
replaced by the `build_and_submit` flow

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

Yes

### Testing

Unit Tests - which is enough as long as `CheckpointSubmitter::build` is
kept private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants