fix: update key hashing in sparse merkle proof contract#2472
Open
fix: update key hashing in sparse merkle proof contract#2472
Conversation
thedarkjester
previously approved these changes
Feb 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2472 +/- ##
=========================================
Coverage 55.62% 55.62%
Complexity 1479 1479
=========================================
Files 444 444
Lines 17820 17820
Branches 1954 1954
=========================================
Hits 9912 9912
Misses 7290 7290
Partials 618 618
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements issue(s) #
Checklist
Note
Medium Risk
Touches cryptographic key hashing used in sparse Merkle proofs; a mismatch would break proof verification and state inclusion checks. Changes are small and covered by added test vectors, but correctness is critical.
Overview
Updates
SparseMerkleProofto addhashAccountKey(address)that hashes an account key via Poseidon2 using gnark-compatible padding/word packing, ensuring the on-chain key hash matches external proof generation.Extends the Hardhat test suite with new account-key test vectors and assertions, and refactors existing hash/leaf tests to use shared expected constants rather than hardcoded hashes.
Written by Cursor Bugbot for commit 66ca370. This will update automatically on new commits. Configure here.