-
Notifications
You must be signed in to change notification settings - Fork 391
fix(aggregation_mode): merkle-tree backend openzeppelin compliant #1931
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
Conversation
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
fix: add missing new line chore: update program ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug by updating the merkle tree backend in aggregation mode to be OpenZeppelin compliant. The key changes include updating program IDs across several configuration files and modifying the hash_new_parent implementations to use sorted child nodes in the hash computation.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/script/deploy/config/**.json | Updated program IDs for consistency with new zkvm program IDs |
| batcher/aligned-sdk/src/sdk/aggregation.rs | Added sorted hash computation documented per OpenZeppelin guidelines |
| aggregation_mode/src/aggregators/mod.rs | Added sorted hash computation as above |
| aggregation_mode/programs_ids.json | Updated program IDs |
| aggregation_mode/aggregation_programs/sp1/src/lib.rs | Added sorted hash computation per OpenZeppelin guidelines |
| aggregation_mode/aggregation_programs/risc0/src/lib.rs | Added sorted hash computation; uses a different Keccak hasher variant |
Comments suppressed due to low confidence (1)
aggregation_mode/aggregation_programs/risc0/src/lib.rs:55
- [nitpick] The Risc0 implementation uses Keccak::v256() while other modules use Keccak256. Consider aligning the hasher usage or adding a comment clarifying the reason for this difference.
let mut hasher = Keccak::v256();
# Conflicts: # contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json
JuArce
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm updating the ethereum package contracts
Description
Update merkle tree backend in aggregation mode to be OpenZeppelin compliant. For it, we have to make sure that node pairs are sorted when hashing. That is:
Given node_1 and node_2:
if$node_1$ < $node_2$ $\Rightarrow$ hash($node_1$ , $node_2$ )$\Rightarrow$ hash($node_2$ , $node_1$ )
else
See OpenZeppelin reference here.
Consideration
zkvm programs ids have changed, so they must be changed in the proof aggregation contract once merged.
Type of change
Checklist
testnet, everything else tostaging