mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 08:07:33 +02:00
Merge bitcoin/bitcoin#33680: validation: do not wipe utxo cache for stats/scans/snapshots
c6ca2b85a3validation: do not wipe utxo cache for stats/scans/snapshots (Pieter Wuille)7099e93d0arefactor: rename `FlushStateMode::ALWAYS` to `FORCE_FLUSH` (Lőrinc) Pull request description: Revival of https://github.com/bitcoin/bitcoin/pull/30610#issuecomment-3432564955 with the remaining comments applied on top > Since #28280, the cost of a non-wiping sync of the UTXO cache is only proportional to the number of dirty entries, rather than proportional to the size of the entire cache. Because of that, there is no reason to perform a wiping flush in case the contents of the cache is still useful. > > Split the `FlushStateMode::ALWAYS` mode into a FORCE_SYNC (non-wiping) and a FORCE_FLUSH (wiping), and then use the former in `scantxoutset`, `gettxoutsetinfo`, snapshot creation. (slightly updated after #30214) ACKs for top commit: optout21: reACKc6ca2b85a3cedwies: reACKc6ca2b8(trivial) achow101: ACKc6ca2b85a3sedited: ACKc6ca2b85a3Tree-SHA512: f3525a85dc512db4a0a9c749ad47c0d3fa44085a121aa54cd77646260a719c71f754ec6570ae77779c0ed68a24799116f79c686e7a17ce57a26f6a598f7bf926
This commit is contained in:
@@ -457,12 +457,13 @@ enum DisconnectResult
|
||||
class ConnectTrace;
|
||||
|
||||
/** @see Chainstate::FlushStateToDisk */
|
||||
inline constexpr std::array FlushStateModeNames{"NONE", "IF_NEEDED", "PERIODIC", "ALWAYS"};
|
||||
inline constexpr std::array FlushStateModeNames{"NONE", "IF_NEEDED", "PERIODIC", "FORCE_FLUSH", "FORCE_SYNC"};
|
||||
enum class FlushStateMode: uint8_t {
|
||||
NONE,
|
||||
IF_NEEDED,
|
||||
PERIODIC,
|
||||
ALWAYS
|
||||
FORCE_FLUSH,
|
||||
FORCE_SYNC,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -735,8 +736,8 @@ public:
|
||||
FlushStateMode mode,
|
||||
int nManualPruneHeight = 0);
|
||||
|
||||
//! Unconditionally flush all changes to disk.
|
||||
void ForceFlushStateToDisk();
|
||||
//! Flush all changes to disk.
|
||||
void ForceFlushStateToDisk(bool wipe_cache = true);
|
||||
|
||||
//! Prune blockfiles from the disk if necessary and then flush chainstate changes
|
||||
//! if we pruned.
|
||||
|
||||
Reference in New Issue
Block a user