-
Notifications
You must be signed in to change notification settings - Fork 7
chore: remove hash ignoring #89
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @tac0turtle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial upgrade to how block hashes are handled, enabling a transition to canonical Keccak block hashes for newer networks. By introducing a configurable activation height, the system can gracefully move away from legacy application-level hashes that caused issues with upstream tooling. This change ensures more consistent and standard block hash validation post-activation, improving compatibility and reliability, while preserving functionality for existing chains. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Claude finished @tac0turtle's task —— View job Code Review CompleteI've thoroughly reviewed this PR that introduces configurable canonical block hash enforcement. Here's my comprehensive feedback: Tasks:
Overall AssessmentThis PR implements a well-designed solution to address block hash compatibility issues between ev-node and Ethereum tooling. The code quality is high with good documentation, comprehensive tests, and a clear migration strategy. Code Quality & Best Practices ✅Strengths:
Minor suggestion: Security Concerns ✅Well-handled:
No security issues identified. Performance Considerations ✅Efficient implementation:
Potential Issues - 1 Minor Concern
|
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.
Code Review
This pull request introduces a configurable mechanism to switch between legacy and canonical block hashes, which is a significant improvement for compatibility with standard Ethereum tooling. The changes are well-structured across configuration, the payload builder, and the validator, and are supported by good documentation and tests. I have one suggestion to refactor the payload sealing logic in crates/node/src/builder.rs for better efficiency and clarity.
crates/node/src/builder.rs
Outdated
| let mut sealed_block = block.sealed_block().clone(); | ||
|
|
||
| if !self.config.is_hash_rewire_active_for_block(block_number) { | ||
| let legacy_hash = sealed_block.header().state_root; | ||
| let legacy_block = sealed_block.clone_block(); | ||
| sealed_block = SealedBlock::new_unchecked(legacy_block, legacy_hash); | ||
| } |
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.
The current implementation for sealing the block can be made more efficient and readable. It involves cloning the SealedBlock and then potentially cloning the inner Block again, which is unnecessary.
A better approach is to decide which hash to use (legacy or canonical) and then seal the UnsealedBlock just once using the appropriate hash. This avoids intermediate clones and makes the logic more direct.
| let mut sealed_block = block.sealed_block().clone(); | |
| if !self.config.is_hash_rewire_active_for_block(block_number) { | |
| let legacy_hash = sealed_block.header().state_root; | |
| let legacy_block = sealed_block.clone_block(); | |
| sealed_block = SealedBlock::new_unchecked(legacy_block, legacy_hash); | |
| } | |
| let sealed_block = if !self.config.is_hash_rewire_active_for_block(block_number) { | |
| // Use the legacy hash (state root). | |
| let legacy_hash = block.header.state_root; | |
| block.seal(legacy_hash) | |
| } else { | |
| // Use the canonical keccak hash of the header. | |
| block.sealed_block() | |
| }; |
95f2751 to
79f1c81
Compare
Description
Type of Change
Related Issues
Fixes #(issue)
Checklist
Testing
Additional Notes