HomePhabricator

validation: pruning for multiple chainstates

Description

validation: pruning for multiple chainstates

Summary:
Introduces ChainstateManager::GetPruneRange().

The prune budget is split evenly between the number of chainstates,
however the prune budget may be exceeded if the resulting shares are
beneath MIN_DISK_SPACE_FOR_BLOCK_FILES.

This is a partial backport of core#27596
https://github.com/bitcoin/bitcoin/pull/27596/commits/1019c399825b0d512c1fd751c376d46fed4992b9

Depends on D17894

The release note will be added together with the release note for loadtxoutset, to guarantee that both notes will be associated with the same release.

Test Plan:
ninja all check-all

Run an IBD with assumeutxo and pruning (3GB) enabled. Prior to loadtxoutset the blocks dir should reach 3GB, then on loadtxoutset returning it should shrink to slightly above 1.5 GB (1.5GB allocated for the background IBD, and the same allocated for the snapshot chain but mostly unused)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17895

Details

Provenance
James O'Beirne <james.obeirne@gmail.com>Authored on Sep 16 2019, 20:34
PiRKCommitted on Apr 7 2025, 13:56
PiRKPushed on Apr 7 2025, 13:56
Reviewer
Restricted Project
Differential Revision
D17895: validation: pruning for multiple chainstates
Parents
rABC963062a18938: validation: indexing changes for assumeutxo
Branches
Unknown
Tags
Unknown