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: implement checkpoint fraud proofs #4277

Merged
merged 32 commits into from
Aug 12, 2024
Merged

feat: implement checkpoint fraud proofs #4277

merged 32 commits into from
Aug 12, 2024

Conversation

yorhodes
Copy link
Member

@yorhodes yorhodes commented Aug 7, 2024

Description

Implements 4 categories of checkpoint fraud proofs for use in future validator slashing protocol:

  1. premature: if a checkpoint index is greater than the corresponding mailbox count, it is fraudulent
  2. non local: if a checkpoint origin does not match the checkpoint's mailbox domain, it is fraudulent
  3. message id: if a checkpoint message ID differs from the actual message ID (verified by merkle proof) at the checkpoint index, it is fraudulent
  4. root: if a checkpoint root differs from the actual root (verified by merkle proof + root reconstruction) at the checkpoint index, it is fraudulent

Notably this is implemented independently from signature verification to allow for multiple checkpoint signing schemes to reuse the same checkpoint logic.

Related issues

Backward compatibility

Yes

Testing

Unit testing with fixtures in vectors/merkle.json that are generated by the rust merkle tree and proof code

Copy link

changeset-bot bot commented Aug 7, 2024

🦋 Changeset detected

Latest commit: d24ba38

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@hyperlane-xyz/cli Minor
@hyperlane-xyz/core Minor
@hyperlane-xyz/helloworld Minor
@hyperlane-xyz/sdk Minor
@hyperlane-xyz/infra Minor
@hyperlane-xyz/widgets Minor
@hyperlane-xyz/ccip-server Minor
@hyperlane-xyz/utils Minor

Not sure what this means? Click here to learn what changesets are.

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

@yorhodes yorhodes marked this pull request as ready for review August 7, 2024 15:36
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (69fba68) to head (d24ba38).
Report is 14 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4277   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          1       1           
  Lines         14      14           
=====================================
  Misses        14      14           
Components Coverage Δ
core ∅ <ø> (∅)
hooks ∅ <ø> (∅)
isms ∅ <ø> (∅)
token ∅ <ø> (∅)
middlewares ∅ <ø> (∅)

Copy link
Contributor

@ltyu ltyu left a comment

Choose a reason for hiding this comment

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

mostly makes sense. i'll come back to this

solidity/contracts/CheckpointFraudProofs.sol Outdated Show resolved Hide resolved
@yorhodes yorhodes requested a review from ltyu August 8, 2024 18:18
solidity/contracts/CheckpointFraudProofs.sol Outdated Show resolved Hide resolved
solidity/contracts/CheckpointFraudProofs.sol Show resolved Hide resolved
solidity/contracts/CheckpointFraudProofs.sol Outdated Show resolved Hide resolved
solidity/contracts/CheckpointFraudProofs.sol Show resolved Hide resolved
solidity/contracts/CheckpointFraudProofs.sol Show resolved Hide resolved
solidity/contracts/libs/Merkle.sol Show resolved Hide resolved
solidity/contracts/libs/Merkle.sol Show resolved Hide resolved
solidity/test/CheckpointFraudProofs.t.sol Outdated Show resolved Hide resolved
solidity/contracts/CheckpointFraudProofs.sol Outdated Show resolved Hide resolved
solidity/test/CheckpointFraudProofs.t.sol Show resolved Hide resolved
Copy link
Contributor

@aroralanuk aroralanuk left a comment

Choose a reason for hiding this comment

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

Looks good

@yorhodes yorhodes added this pull request to the merge queue Aug 12, 2024
Merged via the queue into main with commit cb404cb Aug 12, 2024
35 of 39 checks passed
@yorhodes yorhodes deleted the fraud-proofs branch August 12, 2024 22:15
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