Repository navigation
Conversation
Owner
Author
|
Note: for nodes with IBD complete, a manual leveldb compaction should be ran to release the storage used by the deleted data. |
allocz
force-pushed
the
prune_spendjournal_depth
branch
from
October 5, 2026 17:18
17bf5ee to
78ace52
Compare
Previously, archive nodes stored all the spend journal entries forever, ~75GiB of the ~90GiB used by leveldb was being used by the spend journal. This patch makes possible to run archive nodes with better performance in devices constrained in RAM and SSD by keeping leveldb in a small SSD to reduce IO latency, while keeping the blocks in an HDD (point --datadir to an HDD with enough available storage to store all blocks, then move the metadata directory to the SSD and replace it with a symlink). spend journal pruning can be enabled with the flag --prunespendjournal=<pruneDepthBlocks>, where the user can pass a prune depth of at least 288 blocks, which is enough to handle an unlikely chain reorg of ~2 days. If a reorg of more than prune depth blocks happen, a clean IBD is required to reach the chain tip again. Spend journal pruning is exclusive against cfindex, txindex and addrindex, this means that at least for now, these indexes must not be enabled/initialized to enable spend journal pruning. --prunespendjournal may be passed only once, as the config will be saved in the database and next btcd initializations will keep pruning the journal with the last depth passed to --prunespendjournal. As of now, after enabling spend journal pruning, it can only be disabled by deleting all node data and performing IBD again.
allocz
force-pushed
the
prune_spendjournal_depth
branch
from
November 10, 2026 19:07
78ace52 to
029c474
Compare
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.
This patch implements spend journal pruning by deleting spend journal entries older than the default target of 288 entries, this means that we can process up to 288 blocks (~2 days) of chain re-org.
Previously, archival nodes stored all the spend journal entries forever, ~75GiB of the ~90GiB used by leveldb was being used by the spend journal.
This patch makes possible to run archive nodes with better performance in devices constrained in RAM and SSD, by keeping leveldb in a small SSD and the blocks in an HDD.