Page MenuHomePhabricator

blockstorage: segment normal/assumedvalid blockfiles
Needs ReviewPublic

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

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

When using an assumedvalid (snapshot) chainstate along with a background
chainstate, we are syncing two very different regions of the chain
simultaneously. If we use the same blockfile space for both of these
syncs, wildly different height blocks will be stored alongside one
another, making pruning ineffective.

This change implements a separate blockfile cursor for the assumedvalid
chainstate when one is in use.

This is a partial backport of core#27596 and core#28562
https://github.com/bitcoin/bitcoin/pull/27596/commits/7fcd21544a333ffdf1910b65c573579860be6a36
https://github.com/bitcoin/bitcoin/pull/28562/commits/82e48d20f1243fb7733e872a29661b151ab5d523
https://github.com/bitcoin/bitcoin/pull/28562/commits/a47fbe7d49e8921214ac159c558ff4ca19f98dce (partial)

Depends on D17895

Test Plan

ninja all check-all

Run a full IBD with assumeutxo and pruning

Event Timeline

PiRK requested review of this revision.Fri, Apr 4, 13:29
PiRK planned changes to this revision.Fri, Apr 4, 13:37

there are some changes to be added from core#28562

PiRK edited the summary of this revision. (Show Details)

squash couple of commits from core#28562