Skip to content

Conversation

0xClandestine
Copy link
Member

@0xClandestine 0xClandestine commented Aug 11, 2025

Motivation:

Recent audits identified a lack of direct testing on the Merkle library, and we want to fix that.

Modifications:

  • Differential test against Murky (the most commonly used test implementation) for root and inclusion proofs.
  • TODO: Differential test against OZ for inclusion proofs.

Result:

More confidence, more coverage.

Comment on lines 14 to 112
function test_verifyInclusion_ValidProof() public {
assertValidProofs();
}

function test_verifyInclusion_EmptyProofs() public {
proofs = new bytes[](proofs.length);
assertInvalidProofs();
}
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE: Adding tests to MerkleBaseTest will automatically test both sha256 and keccak tree variants.

@0xClandestine 0xClandestine marked this pull request as ready for review August 12, 2025 19:38
Comment on lines +83 to +84
# If enabled, allows internal expectRevert calls to be used in tests.
allow_internal_expect_revert = true
Copy link
Member Author

Choose a reason for hiding this comment

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

This allows us to test library reverts without needing a harness.

Copy link
Collaborator

@nadir-akhtar nadir-akhtar left a comment

Choose a reason for hiding this comment

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

Overall looks good -- just wanna get more intermediate coverage as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants