Skip to content

fix: update key hashing in sparse merkle proof contract#2472

Open
VGau wants to merge 7 commits intomainfrom
fix/update-key-hashing-sparse-merkle-proof
Open

fix: update key hashing in sparse merkle proof contract#2472
VGau wants to merge 7 commits intomainfrom
fix/update-key-hashing-sparse-merkle-proof

Conversation

@VGau
Copy link
Contributor

@VGau VGau commented Feb 23, 2026

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

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 SparseMerkleProof to add hashAccountKey(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.

@VGau VGau requested a review from a team as a code owner February 23, 2026 15:57
thedarkjester
thedarkjester previously approved these changes Feb 23, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.62%. Comparing base (b1ab230) to head (772968c).
⚠️ Report is 3 commits behind head on main.

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           
Flag Coverage Δ *Carryforward flag
hardhat 96.74% <ø> (ø)
kotlin 50.88% <ø> (ø) Carriedforward from 258eef5

*This pull request uses carry forward flags. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

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.

3 participants