feat(store): allow rollback past included height for sync node + improve rollback cmd#2699
feat(store): allow rollback past included height for sync node + improve rollback cmd#2699julienrbrt merged 4 commits intomainfrom
Conversation
|
The latest Buf updates on your PR. Results from workflow CI and Release / 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 significantly refines the node rollback mechanism, introducing greater flexibility for sync nodes while maintaining strict data integrity for aggregator nodes. The primary purpose is to enable sync nodes to recover from potential synchronization issues by allowing them to rollback past the Data Availability (DA) included height, a capability previously restricted. This change enhances the robustness and operational control over node states, ensuring that different node types can manage their historical data appropriately without compromising the network's finalized state. 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
|
There was a problem hiding this comment.
Code Review
This pull request enhances the rollback command by adding flags for sync nodes and skipping P2P stores, and it modifies the store's Rollback logic to allow sync nodes to roll back past the DA included height. The changes are logical and well-tested. My review focuses on improving code maintainability by addressing duplication in both the command implementation and test files, fixing a critical atomicity issue in the store's rollback logic, and correcting some typos and inaccuracies in comments.
apps/testapp/cmd/rollback.go
Outdated
|
|
||
| cmd.Flags().Uint64Var(&height, "height", 0, "rollback to a specific height") | ||
| cmd.Flags().BoolVar(&syncNode, "sync-node", false, "sync node (no aggregator)") | ||
| cmd.Flags().BoolVar(&skipP2PStores, "skip-p2p-stores", false, "skip rollback p2p2 stores (goheaderstore)") |
There was a problem hiding this comment.
| err := store.SetMetadata(ctx, DAIncludedHeightKey, heightBytes) | ||
| require.NoError(err) | ||
|
|
||
| // Rollback to height below DA included height should fail |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2699 +/- ##
==========================================
- Coverage 66.14% 66.14% -0.01%
==========================================
Files 77 77
Lines 7849 7856 +7
==========================================
+ Hits 5192 5196 +4
- Misses 2174 2176 +2
- Partials 483 484 +1
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:
|
…ove rollback cmd (#2699) rollback cmd <!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
rollback cmd
Overview