This is part of the assumeutxo project:
Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal
In certain circumstances, we may want to flush chainstate data to disk without
emptying cacheCoins
, which affects performance. UTXO snapshot
activation is one such case, as we populate cacheCoins
with the snapshot
contents and want to persist immediately afterwards but also enter IBD.
See also #15265, which makes the case that under normal operation a flush-without-erase doesn’t necessarily add much benefit. I open this PR even in light of the previous discussion because (i) flush-without-erase almost certainly provides benefit in the case of snapshot activation (especially on spinning disk hardware) and (ii) this diff is fairly small and gives us convenient options for more granular cache management without changing existing policy.
See also #15218.