-
Notifications
You must be signed in to change notification settings - Fork 246
feat: block Pruning #2984
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?
feat: block Pruning #2984
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @pthmas's task in 2m 20s —— View job Comprehensive Code ReviewI've completed a thorough analysis of the block pruning feature across all focus areas. Here's my detailed review: ✅ StrengthsArchitecture & Design
Configuration
🔴 Critical Issues1. Blocking Synchronous Pruning in Critical Path
|
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.
Given we have a lot of different stores and keys. Are we planning to prune as well:
- metadatas?
- go-header store? (there are settings to be looked at)
- execution/evm store (https://github.com/evstack/ev-node/blob/main/execution/evm/store.go)
(and eventually ev-abci store)
It will be inconsistent if we don't allow height pruning of all those stores (at once).
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.
I've updated this PR to prune metadats, go-header store and evm store ✅
I'm happy to work on prunning ev-abci next, but I would probably do it in another PR to prevent this PR from getting too big if that's ok.
3e1e8e0 to
ed66fe6
Compare
7708393 to
a5110b1
Compare
369a149 to
26628f5
Compare
26628f5 to
4d65b1e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2984 +/- ##
==========================================
- Coverage 55.55% 55.37% -0.18%
==========================================
Files 116 116
Lines 11477 11557 +80
==========================================
+ Hits 6376 6400 +24
- Misses 4401 4439 +38
- Partials 700 718 +18
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:
|
Overview
/h/{height},/d/{height},/c/{height},/i/{hash}up to a target height.height → DA heightmapping) for pruned heights./s/{height}(state),/t(current height), and global metadata keys untouched.last-pruned-block-heightmetadata key so pruning is monotonic and idempotent.store.PruneBlockssynchronously.PruningKeepRecent * BlockTimeso header/data retention matches ev-node’s window.EVMStoreexposesPruneExecMetato delete per-heightExecMetaentries up to a target height.ExecMetaPrunerinterface, and the block executor calls it from the same pruning hook.Config
New node config fields / flags:
--evnode.node.pruning_enabled--evnode.node.pruning_keep_recent--evnode.node.pruning_intervalPruning actually runs only when all three are set to non-trivial values (enabled, keep_recent > 0, interval > 0).
Design trade-offs
Runs in the critical path:
Pruning is called synchronously in
produceBlock. On pruning heights, block production will incur extra latency proportional to the amount of data pruned and underlying storage performance.Best-effort pruning:
If pruning fails, we log the error but do not fail the block. This avoids halting the node but means disk usage can grow silently if pruning keeps failing; operators will need to watch logs/metrics.
Scope:
This PR prunes ev-node’s own store, the go-header store, and EVM
ExecMeta. Pruning of ABCI state (ev-abci) is out of scope and will be added in a follow-up once ev-abci exposes its own pruning API.