-
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 56s —— View job Comprehensive Code Review - Complete ✅I've completed a detailed review of this refactoring. The PR successfully unifies the store architecture by replacing the go-header store with ev-node store adapters, eliminating data duplication. Here's my analysis: SummaryThis is a significant architectural improvement that:
Critical Issues1. context.Background() Usage in Constructors
Using Impact: Medium - Could cause issues during shutdown or if the store operation blocks unexpectedly. Recommendation: Pass a context parameter to constructors, or document why 2. Tail() Performance for Pruned Nodes
The Impact: High for pruned nodes - Could cause significant performance degradation on large chains with aggressive pruning. Status: Already acknowledged with TODO comment at line 233. The author plans to optimize this in PR #2984 by storing the pruned tail in state. Recommendation: Ensure PR #2984 is prioritized and merged before this becomes a bottleneck in production. 3. Potential Data Loss in Append() Without Error Propagation
The Impact: Low - Could make debugging difficult if blocks are unexpectedly not appearing in the pending cache. Recommendation: Add debug-level logging or metrics when items are skipped to aid in troubleshooting. Concurrency Safety Analysis✅ Well-Implemented Thread Safety
|
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.48% 55.96% +0.48%
==========================================
Files 117 117
Lines 11685 11838 +153
==========================================
+ Hits 6483 6625 +142
- Misses 4480 4484 +4
- Partials 722 729 +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 in #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.
tac0turtle
left a comment
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.
Do we still need to do writetostoreandbroadcast in the sync loop if we have this ?
We shouldn't need it indeed 👍 |
Overview
Attempt to replace go-header default store by ev-node store.
This avoids duplication of blocks.