-
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 7s —— View job Comprehensive Code Review CompleteI've completed a thorough review of the block pruning implementation. Below is my analysis organized by the categories you requested. 1. Code Quality & Architecture✅ Strengths
|
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
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.