Page MenuHomePhabricator

prune, import: allows pruning to work during the loadblock import process
ClosedPublic

Authored by PiRK on Dec 18 2023, 15:01.

Details

Summary

allows pruning to work during the loadblock import process.

This is a backport of core#24957

Depends on D15003

Test Plan

Backup the eCash data dir, create a bootstrap.dat file by following the instructions in contrib/linearize, then delete the content of the data dir, comment out config options that are incompatible with pruning (txindex=1) then
src/bitcoind -prune=550 -loadblock=/data/bootstrap.dat

Check while the node is importing the blocks from bootstrap.dat that the new data dir does not grow significantly larger than 550 MB (I saw it oscillates between that target and 800 MB, while the bootstrap.dat file was 21 GB of blocks 0--313000)

ninja all check-all

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Dec 18 2023, 15:01
PiRK planned changes to this revision.Dec 18 2023, 15:15

I didn't wait long enough, now the size is 1.3 GB around block 275000. I need to check if this is normal behavior when pruning.

PiRK retitled this revision from prune, import: fixes #23852 to prune, import: allows pruning to work during the loadblock import process.Dec 18 2023, 15:15
PiRK requested review of this revision.Dec 18 2023, 15:48

The blocks dir stayed below the prune target. The extra 700MB is for the chainstate data.

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/validation.cpp
5200 ↗(On Diff #43658)
5203 ↗(On Diff #43658)
This revision is now accepted and ready to land.Dec 19 2023, 08:27