-
Notifications
You must be signed in to change notification settings - Fork 245
feat(syncer): verify force inclusion for p2p blocks #2963
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: alex/2609_hints
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 1m 32s —— View job Comprehensive Code ReviewI've reviewed this PR which adds forced inclusion transaction verification for P2P blocks using DA height hints. Overall, the implementation is solid and well-tested. Here are my findings: 1. Code Quality & Architecture ✅Strengths:
Observations:
2. Error Handling & Resilience
|
Summary of ChangesHello @julienrbrt, 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 introduces a mechanism to utilize Data Availability (DA) height hints from P2P events to enhance the verification process for forced inclusion transactions. By storing and applying these specific DA height hints, the system can more accurately and efficiently validate transactions, ensuring that the verification logic aligns with the most relevant DA information available, without introducing performance bottlenecks due to a related retriever improvement. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
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 correctly extends forced inclusion transaction verification to blocks received from P2P by using DA height hints. The changes are logical, introducing a mechanism to store and use these hints and refactoring verifyForcedInclusionTxs to be called for P2P blocks. However, I've identified a critical issue in the error handling logic. Currently, transient errors during verification are ignored, which could lead to the node accepting an invalid block. My review includes a suggestion to fix this.
| s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed") | ||
| if errors.Is(err, errMaliciousProposer) { | ||
| s.cache.RemoveHeaderDAIncluded(headerHash) | ||
| return err | ||
| } |
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.
Failure to verify forced inclusion transactions should not be ignored. Currently, only errMaliciousProposer errors are returned from trySyncNextBlock, while other errors (e.g., transient DA layer connection issues) are only logged. This could lead to the node accepting a block that is invalid because it's missing forced transactions. All errors from verifyForcedInclusionTxs should be returned so the caller can handle them, for instance by retrying the block processing later.
| s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed") | |
| if errors.Is(err, errMaliciousProposer) { | |
| s.cache.RemoveHeaderDAIncluded(headerHash) | |
| return err | |
| } | |
| s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed") | |
| if errors.Is(err, errMaliciousProposer) { | |
| s.cache.RemoveHeaderDAIncluded(headerHash) | |
| } | |
| return err |
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.
current behavior is correct. a fetch issue due to the sync node have issues or the da layer down should not crash the node.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alex/2609_hints #2963 +/- ##
====================================================
+ Coverage 0 59.24% +59.24%
====================================================
Files 0 92 +92
Lines 0 8914 +8914
====================================================
+ Hits 0 5281 +5281
- Misses 0 3041 +3041
- Partials 0 592 +592
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Blocked on #2891 being merged.
ref: #2906
Use Da height hints to verify force inclusion txs in p2p blocks.
With the retriever from #2952, this should not slow down anything (currently blocking)