-
Notifications
You must be signed in to change notification settings - Fork 130
feat(l1): handle parallel merkleization edge case #5389
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
Lines of code reportTotal lines added: Detailed view |
Benchmark for 1c64f8bClick to view benchmark
|
80c8ae9 to
537f761
Compare
Benchmark for 2793c76Click to view benchmark
|
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 handles an edge case in parallel merkleization where the state trie root becomes a branch node with fewer than 2 children after merkleization. Previously, this scenario was not supported (marked as TODO). The PR refactors the branch collapsing logic into a reusable function and implements proper handling for branch nodes with 0 or 1 children.
Key changes:
- Extracted branch collapse logic into a new public
collapse_branchfunction - Added handling for edge cases where the root branch has 0 or 1 children after parallel merkleization
- Properly handles empty trie state when no children remain
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/common/trie/node/branch.rs | Refactored branch collapse logic into a reusable collapse_branch function |
| crates/common/trie/node.rs | Exported the new collapse_branch function from the branch module |
| crates/blockchain/blockchain.rs | Implemented edge case handling for root branches with 0 or 1 children in parallel merkleization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Benchmark for cb1eadfClick to view benchmark
|
Benchmark for 58a51e3Click to view benchmark
|
Benchmark for 7b67329Click to view benchmark
|
Benchmark for 0859652Click to view benchmark
|
Benchmark for 5a7e7b0Click to view benchmark
|
Benchmark for 15815b9Click to view benchmark
|
Benchmark for c9f4b34Click to view benchmark
|
Benchmark for 8980a3bClick to view benchmark
|
Benchmark for cdb5468Click to view benchmark
|
Benchmark for 7b48096Click to view benchmark
|
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
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Benchmark for b272ca8Click to view benchmark
|
This PR adds handling for a specific edge case in the parallel merkleization implementation added in #5377
Closes #5387