-
Notifications
You must be signed in to change notification settings - Fork 248
refactor(store): replace go-header store by ev-node store #3036
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
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 3m 2s —— View job Comprehensive Code ReviewI've completed a thorough review of this PR's store refactoring. This is an excellent architectural improvement that successfully consolidates the storage layer. Below is my detailed analysis across multiple dimensions. 🎯 OverviewThis PR successfully refactors the block storage architecture by introducing store adapters that wrap the ev-node store to satisfy go-header's Key Changes:
✅ StrengthsArchitecture & Design
Concurrency & Synchronization
Testing
|
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 refactors the node's data storage strategy by centralizing all block-related data within the 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
The pull request successfully refactors the store integration for go-header by introducing DataStoreAdapter and HeaderStoreAdapter. This change eliminates data duplication by allowing the go-header P2P infrastructure to directly utilize the ev-node store. The rollback commands have been updated to reflect this unified store approach, and comprehensive tests have been added for the new adapter implementations. This is a significant improvement in architecture and efficiency.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3036 +/- ##
==========================================
+ Coverage 55.33% 55.88% +0.54%
==========================================
Files 117 117
Lines 11685 11848 +163
==========================================
+ Hits 6466 6621 +155
- Misses 4494 4495 +1
- Partials 725 732 +7
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:
|
| // For ev-node, this is typically the genesis/initial height. | ||
| // If pruning has occurred, it walks up from initialHeight to find the first available item. | ||
| // TODO(@julienrbrt): Optimize this when pruning is enabled. | ||
| func (a *StoreAdapter[H]) Tail(ctx context.Context) (H, error) { |
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.
It is O(1) for non pruned node, and O(n) for pruned nodes, so we should improve this by saving the pruned tail in state and #2984
| var errElapsedHeight = errors.New("elapsed height") | ||
|
|
||
| // defaultPendingCacheSize is the default size for the pending headers/data LRU cache. | ||
| const defaultPendingCacheSize = 1000 |
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.
This should leave enough header/data for p2p syncing nodes before they executes the block.
We can think of making it bigger otherwise.
Overview
Attempt to replace go-header default store by ev-node store.
This avoids duplication of blocks.