feat: add snapshot prune-block for offline ancient block pruning#138
Closed
viaweb3 wants to merge 2 commits into
Closed
feat: add snapshot prune-block for offline ancient block pruning#138viaweb3 wants to merge 2 commits into
viaweb3 wants to merge 2 commits into
Conversation
Introduce a new `geth snapshot prune-block` subcommand that advances the freezer tail in place via the existing ethdb.AncientWriter.TruncateTail primitive, releasing historical block data (headers, bodies, receipts, TDs, canonical hashes) while keeping only the most recent --block-amount-reserved blocks. The feature is targeted at validator nodes and other non-RPC-serving full nodes that do not need to answer historical queries and want to reclaim the tens of gigabytes typically held by the ancient/ directory. BlockPruner enforces a hard minimum of params.FullImmutabilityThreshold + 10000 = 100000 blocks to safely cover the POSA snapshot reconstruction walk-back distance (see consensus/posa/posa.go snapshot()). After truncation it also advances TxIndexTail so the background transaction indexer does not walk into the freshly pruned range on next startup, and runs a full-range LevelDB compaction to defragment the LSM tree. The operation is idempotent and requires geth to be stopped while it runs. https://claude.ai/code/session_01GfSEZQsF89ksKKEtyGP6gC
Delve's latest release (v1.26.0+) raised its minimum Go toolchain requirement to 1.24, which breaks the Dockerfile's `go install .../dlv@latest` step since the builder stage uses golang:1.21-alpine. The failure is unrelated to any user code and blocks every PR's CI. Pin dlv to v1.22.1, the last release line that still supports Go 1.21. When the golang base image is eventually bumped, this pin can be relaxed as noted in the accompanying comment. https://claude.ai/code/session_01GfSEZQsF89ksKKEtyGP6gC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a new
geth snapshot prune-blocksubcommand that advances the freezer tail in place via the existing ethdb.AncientWriter.TruncateTail primitive, releasing historical block data (headers, bodies, receipts, TDs, canonical hashes) while keeping only the most recent --block-amount-reserved blocks.The feature is targeted at validator nodes and other non-RPC-serving full nodes that do not need to answer historical queries and want to reclaim the tens of gigabytes typically held by the ancient/ directory.
BlockPruner enforces a hard minimum of params.FullImmutabilityThreshold
The operation is idempotent and requires geth to be stopped while it runs.
https://claude.ai/code/session_01GfSEZQsF89ksKKEtyGP6gC