-
Notifications
You must be signed in to change notification settings - Fork 246
refactor: use state da height as well #2872
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
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
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 refines the initialization process for the Data Availability (DA) height within the syncer component. By incorporating the 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 @julienrbrt's task —— View job Code Review CompleteI've completed a comprehensive code review of this PR. This is a small but important refactoring that improves the robustness of DA height initialization. Summary of ChangesThis PR adds
Files Changed:
Code Review Findings✅ Strengths
💡 Observations & Minor Suggestions
🔍 Architecture & Design ReviewConcurrency Safety: ✅ The change maintains thread-safety. State Management: ✅ The three-source approach (genesis, cache, state) creates a robust hierarchy:
Error Recovery: ✅ This change significantly improves error recovery. Previously, clearing the cache would lose track of fetched DA heights, potentially causing re-processing or skipped blocks. Now the state serves as a persistent record. 🔒 Security Review✅ No security concerns identified:
⚡ Performance Review✅ No performance concerns:
🧪 Testing ConsiderationsCurrent Coverage: The change is straightforward, but consider adding test cases for:
Test File Location: Tests would likely go in 📚 Documentation Review✅ Inline Documentation: Excellent - the comment clearly explains the logic and recovery scenario.
Overall AssessmentVerdict: ✅ Approve - High Quality Change This is a well-thought-out refactoring that:
The change is production-ready. The minor suggestions above are optional enhancements that could be addressed in follow-up work if desired. Recommended Actions:
Related ContextThis PR builds on #2870 which introduced |
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 enhances the DA height initialization logic by incorporating the DA height from the persisted state. This change improves the syncer's robustness, especially during restarts. The implementation is sound. I have provided one suggestion to improve the clarity and conciseness of the accompanying code comment.
| // we get the max from the genesis da height, the state da height and the cache (fetched) da height | ||
| // if a user has messed up and sync da too far ahead, on restart they can clear the cache (--clear-cache) and the retrieve will restart fetching from the last known block synced and executed from DA or the set genesis da height. |
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 existing comment is a bit informal and verbose. A more concise and professional comment would improve code clarity and maintainability.
| // we get the max from the genesis da height, the state da height and the cache (fetched) da height | |
| // if a user has messed up and sync da too far ahead, on restart they can clear the cache (--clear-cache) and the retrieve will restart fetching from the last known block synced and executed from DA or the set genesis da height. | |
| // Set DA height to the maximum of the genesis start height, the state's DA height, and the cached DA height. | |
| // This ensures we resume from the highest known DA height, even if the cache is cleared on restart. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2872 +/- ##
=======================================
Coverage 64.94% 64.94%
=======================================
Files 81 81
Lines 7262 7262
=======================================
Hits 4716 4716
Misses 2001 2001
Partials 545 545
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:
|
* main: chore: fix some comments (#2874) chore: bump node in evm-single (#2875) refactor(syncer,cache): use compare and swap loop and add comments (#2873) refactor: use state da height as well (#2872) refactor: retrieve highest da height in cache (#2870) chore: change from event count to start and end height (#2871)
quick follow-up of #2870