Page MenuHomePhabricator

validation: pruning for multiple chainstates
ClosedPublic

Authored by PiRK on Fri, Apr 4, 13:24.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCa81f203d3013: 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)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Fri, Apr 4, 13:24
Fabien requested changes to this revision.Mon, Apr 7, 09:42
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/node/blockstorage.h
31 ↗(On Diff #53372)

it's not used

This revision now requires changes to proceed.Mon, Apr 7, 09:42
PiRK edited the test plan for this revision. (Show Details)

remove unused forward-declaration, add monitoring the datadir size to the test plan

This revision is now accepted and ready to land.Mon, Apr 7, 11:42