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:
10 files changed
+38
-35
No files matched your search
+2
-2
@@ -185,8 +185,8 @@ Is called *after* the in-memory UTXO cache is flushed.
|
||||
|
||||
Arguments passed:
|
||||
1. Time it took to flush the cache microseconds as `int64`
|
||||
2. Flush state mode as `uint32`. It's an enumerator class with values `0`
|
||||
(`NONE`), `1` (`IF_NEEDED`), `2` (`PERIODIC`), `3` (`ALWAYS`)
|
||||
2. Flush state mode as `uint32`. It's an enumerator class with values
|
||||
`0` (`NONE`), `1` (`IF_NEEDED`), `2` (`PERIODIC`), `3` (`FORCE_FLUSH`), `4` (`FORCE_SYNC`)
|
||||
3. Cache size (number of coins) before the flush as `uint64`
|
||||
4. Cache memory usage in bytes as `uint64`
|
||||
5. If pruning caused the flush as `bool`
|
||||
|
||||
Reference in new issue
Block a user