bitcoin/src
Pieter Wuille 0fe4ba2a85 validation: Use dirty entry count in flush warnings and disk space checks
Changes flush warnings to use the actual number of dirty entries being written rather than total cache size or memory usage:
* Moves warning from `FlushStateToDisk` to `CCoinsViewDB::BatchWrite` so it applies to both regular flushes and `AssumeUTXO` snapshot writes
* Changes threshold from `WARN_FLUSH_COINS_SIZE` (1 GiB) to `WARN_FLUSH_COINS_COUNT` (10M entries), approximately equivalent - this also helps with the confusion caused by UTXO size difference on-disk vs in-memory
* Moves benchmark logging to `BatchWrite` where the actual disk I/O occurs to make sure AssumeUTXO also warns
* Uses dirty count for disk space check (48 bytes per entry estimate)
* Removes redundant `changed` counter since `dirty_count` is now tracked

This ensures users are warned appropriately even when only a fraction of the cache is dirty, and provides accurate warnings during `AssumeUTXO` loads.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2025-10-07 22:36:43 -05:00
..
bench Merge bitcoin/bitcoin#32998: Bump SCRIPT_VERIFY flags to 64 bit 2025-10-07 14:51:22 -07:00
common Merge bitcoin/bitcoin#33229: multiprocess: Don't require bitcoin -m argument when IPC options are used 2025-09-25 14:36:40 -07:00
compat net: remove unnecessary casts in socket operations 2025-09-16 06:26:01 -04:00
consensus script/interpreter: introduce script_verify_flags typename 2025-08-14 10:17:32 +10:00
crc32c Update crc32c subtree to latest upstream master 2025-08-07 09:27:25 +01:00
crypto Fix benchmark CSV output 2025-09-08 18:39:55 +01:00
index clang-tidy: Fix critical warnings 2025-09-07 17:28:31 +02:00
init init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests 2025-09-17 04:57:09 -04:00
interfaces init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests 2025-09-17 04:57:09 -04:00
ipc Merge commit '535fa0ad0d2637f845beae92ea9dbbbbbe377c74' into pr/subtree-5 2025-09-17 05:30:43 -04:00
kernel Merge bitcoin/bitcoin#33321: kernel: make blockTip index const 2025-09-11 13:46:20 -07:00
leveldb Update leveldb subtree to latest upstream 2025-05-30 16:51:49 +01:00
logging scripted-diff: modernize outdated trait patterns - values 2025-02-21 10:43:01 +01:00
minisketch Update minisketch subtree to latest upstream 2025-05-13 18:07:47 +01:00
node Merge bitcoin/bitcoin#33475: bugfix: miner: fix `addPackageTxs` unsigned integer overflow 2025-09-25 08:18:20 -04:00
policy Merge bitcoin/bitcoin#32998: Bump SCRIPT_VERIFY flags to 64 bit 2025-10-07 14:51:22 -07:00
primitives refactor: Move `transaction_identifier.h` to primitives 2025-08-11 16:47:51 +01:00
qt Merge bitcoin-core/gui#886: Avoid pathological QT text/markdown behavior... 2025-09-10 12:26:58 +01:00
rpc Merge bitcoin/bitcoin#32998: Bump SCRIPT_VERIFY flags to 64 bit 2025-10-07 14:51:22 -07:00
script script/verify_flags: extend script_verify_flags to 64 bits 2025-08-14 10:17:32 +10:00
secp256k1 Update secp256k1 subtree to latest master 2025-07-22 09:35:01 +01:00
support [allocators] Apply manual ASan poisoning to PoolResource 2025-05-23 10:09:39 +01:00
test coins: Keep track of number of dirty entries in `CCoinsViewCache` 2025-10-07 22:36:43 -05:00
univalue Merge bitcoin/bitcoin#31179: RPC: Add reserve member function to `UniValue` and use it in `blockToJSON` function 2025-07-23 13:29:07 -07:00
util Merge bitcoin/bitcoin#28584: Fuzz: extend CConnman tests 2025-09-30 15:59:09 -07:00
wallet wallet, log: reduce unconditional logging during load 2025-09-29 13:59:44 -04:00
zmq refactor: Convert remaining instances from uint256 to Txid 2025-08-11 16:47:43 +01:00
.clang-format
.clang-tidy clang-tidy: Apply modernize-deprecated-headers 2025-06-03 15:13:54 +02:00
CMakeLists.txt bitcoin: Make wrapper not require -m 2025-09-17 04:57:09 -04:00
addrdb.cpp log: Properly log warnings with warn loglevel in addrdb 2025-07-10 11:24:40 +02:00
addrdb.h
addresstype.cpp policy: Add OP_1 <0x4e73> as a standard output type 2024-07-30 14:06:58 -04:00
addresstype.h refactor: deduplicate anchor witness program bytes (`0x4e,0x73`) 2025-03-23 21:58:39 +01:00
addrman.cpp addrman: cap the `max_pct` to not exceed the maximum number of addresses 2024-11-11 12:47:53 -03:00
addrman.h addrman: cap the `max_pct` to not exceed the maximum number of addresses 2024-11-11 12:47:53 -03:00
addrman_impl.h Merge bitcoin/bitcoin#30568: addrman: change internal id counting to int64_t 2024-09-20 12:55:22 -04:00
arith_uint256.cpp Add a fuzz test for Num3072 multiplication and inversion 2025-01-09 10:11:46 -05:00
arith_uint256.h common: Make arith_uint256 trivially copyable 2025-09-11 16:50:26 +02:00
attributes.h
banman.cpp log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
banman.h doc: remove For ... comments 2025-05-19 16:40:33 +01:00
base58.cpp clang-tidy: Apply modernize-deprecated-headers 2025-06-03 15:13:54 +02:00
base58.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
bech32.cpp scripted-diff: Bump copyright headers after include changes 2025-06-03 15:13:57 +02:00
bech32.h scripted-diff: Bump copyright headers after include changes 2025-06-03 15:13:57 +02:00
bip324.cpp refactor: Sort includes of touched source files 2025-06-03 19:56:55 +02:00
bip324.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
bitcoin-chainstate.cpp kernel: make blockTip index const 2025-09-05 15:46:44 +01:00
bitcoin-cli-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoin-cli.cpp netinfo: return shortened services, if peers list requested 2025-08-04 15:33:25 -06:00
bitcoin-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoin-tx-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoin-tx.cpp bitcoin-tx: Reject + sign in MutateTxDel* 2025-05-17 09:36:25 +02:00
bitcoin-util-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoin-util.cpp refactor: Use TranslateFn type consistently 2025-01-15 12:15:40 +01:00
bitcoin-wallet-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoin-wallet.cpp Remove create options from wallet tool 2025-05-09 15:07:04 +02:00
bitcoin.cpp bitcoin: Make wrapper not require -m 2025-09-17 04:57:09 -04:00
bitcoind-res.rc doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" 2025-06-10 15:14:24 +02:00
bitcoind.cpp init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests 2025-09-17 04:57:09 -04:00
blockencodings.cpp Revert "[refactor] rewrite vTxHashes as a vector of CTransactionRef" 2025-08-27 03:33:32 +10:00
blockencodings.h Revert "refactor: Simplify `extra_txn` to be a vec of CTransactionRef instead of a vec of pair<Wtxid, CTransactionRef>" 2025-08-27 03:33:32 +10:00
blockfilter.cpp
blockfilter.h
chain.cpp chain: make use of pskip in LastCommonAncestor (optimization) 2025-10-02 10:34:12 -04:00
chain.h interfaces, chain, refactor: Remove unused getTipLocator 2025-08-13 00:08:37 -03:00
chainparams.cpp log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
chainparams.h
chainparamsbase.cpp scripted-diff: Bump copyright headers after include changes 2025-06-03 15:13:57 +02:00
chainparamsbase.h net, init: derive default onion port if a user specified a -port 2024-11-14 13:41:02 -05:00
chainparamsseeds.h contrib: update fixed seeds 2025-09-03 11:23:30 +01:00
checkqueue.h validation: use a lock for CCheckQueueControl 2025-05-19 22:06:48 +00:00
clientversion.cpp doc: update MIT license URL 2025-05-20 09:30:41 +01:00
clientversion.h windows: Use predefined `RC_INVOKED` macro instead of custom one 2025-05-29 11:18:36 +01:00
cluster_linearize.h txgraph: track amount of work done in linearization (preparation) 2025-07-14 09:41:17 -04:00
coins.cpp coins: Keep track of number of dirty entries in `CCoinsViewCache` 2025-10-07 22:36:43 -05:00
coins.h validation: Use dirty entry count in flush warnings and disk space checks 2025-10-07 22:36:43 -05:00
compressor.cpp
compressor.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
core_io.h rpc: add getdescriptoractivity 2024-11-26 20:47:08 -05:00
core_memusage.h
core_read.cpp refactor: starts/ends_with changes for clang-tidy 20 2025-04-22 13:16:54 +01:00
core_write.cpp rpc: reserve space for `UniValue` variables in `blockToJSON` 2025-01-22 17:31:22 -05:00
cuckoocache.h doc: remove For ... comments 2025-05-19 16:40:33 +01:00
dbwrapper.cpp Merge bitcoin/bitcoin#33039: refactor,test: follow-ups to multi-byte block obfuscation 2025-08-06 15:46:18 -07:00
dbwrapper.h refactor: rename `OBFUSCATION_KEY_KEY` 2025-07-22 10:26:15 -07:00
deploymentinfo.cpp scripted-diff: rename gbt_force and gbt_force_name 2025-04-30 14:51:21 +02:00
deploymentinfo.h Move mapFlagNames and FormatScriptFlags logic to script/interpreter.h 2025-08-14 10:17:30 +10:00
deploymentstatus.cpp scripted-diff: modernize outdated trait patterns - types 2025-02-21 10:41:27 +01:00
deploymentstatus.h versionbits: Simplify VersionBitsCache API 2025-01-21 00:38:03 +10:00
dummywallet.cpp log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
external_signer.cpp refactor: Remove Span operator==, Use std::ranges::equal 2024-08-13 07:44:31 +02:00
external_signer.h
flatfile.cpp flatfile: check whether the file has been closed successfully 2025-06-16 15:33:19 +02:00
flatfile.h refactor: Add FlatFileSeq member variables in BlockManager 2024-07-24 09:39:35 +02:00
hash.cpp scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
hash.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
headerssync.cpp kernel: update headersync params 2025-09-02 11:59:48 +01:00
headerssync.h refactor: Convert remaining instances from uint256 to Txid 2025-08-11 16:47:43 +01:00
httprpc.cpp remove RPCTimerInterface and RPCRunLater 2025-07-03 06:26:23 -04:00
httprpc.h
httpserver.cpp net: remove unnecessary casts in socket operations 2025-09-16 06:26:01 -04:00
httpserver.h rpc: increase the defaults for -rpcthreads and -rpcworkqueue 2024-11-04 17:08:21 +01:00
i2p.cpp fuzz: make it possible to mock (fuzz) CThreadInterrupt 2025-06-09 14:17:33 +02:00
i2p.h fuzz: make it possible to mock (fuzz) CThreadInterrupt 2025-06-09 14:17:33 +02:00
indirectmap.h
init.cpp Merge bitcoin/bitcoin#33453: docs: Undeprecate datacarrier and datacarriersize configuration options 2025-09-30 15:23:20 -07:00
init.h refactor: introduce a more general LockDirectories for init 2025-01-16 21:06:21 +00:00
key.cpp key: use static context for libsecp256k1 calls where applicable 2025-09-16 21:46:18 +02:00
key.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
key_io.cpp scripted-diff: Bump copyright headers after include changes 2025-06-03 15:13:57 +02:00
key_io.h
logging.cpp log: make m_limiter a shared_ptr 2025-08-12 11:28:36 -04:00
logging.h config: add DEBUG_ONLY -logratelimit 2025-08-12 11:28:36 -04:00
mapport.cpp net: Add interrupt to pcp retry loop 2025-09-08 11:18:51 +02:00
mapport.h mapport: turn -natpmp to on by default 2025-07-17 12:43:04 -04:00
memusage.h memusage: Add DynamicUsage for std::string 2024-11-04 18:46:40 +01:00
merkleblock.cpp refactor: Convert RPCs and `merkleblock` from uint256 to Txid 2025-08-11 15:53:34 +01:00
merkleblock.h refactor: Move `transaction_identifier.h` to primitives 2025-08-11 16:47:51 +01:00
musig.cpp Add MuSig2 Keyagg Cache helper functions 2025-06-11 11:11:48 -07:00
musig.h refactor: Use immediate lambda to work around GCC bug 117966 2025-08-01 12:07:26 +01:00
net.cpp Merge bitcoin/bitcoin#33454: net: support overriding the proxy selection in ConnectNode() 2025-10-06 12:43:14 -04:00
net.h Merge bitcoin/bitcoin#33454: net: support overriding the proxy selection in ConnectNode() 2025-10-06 12:43:14 -04:00
net_permissions.cpp
net_permissions.h scripted-diff: modernize outdated trait patterns - types 2025-02-21 10:41:27 +01:00
net_processing.cpp Merge bitcoin/bitcoin#33464: p2p: Use network-dependent timers for inbound inv scheduling 2025-10-03 23:45:17 +01:00
net_processing.h rpc/net: report per-peer last_inv_sequence 2025-09-22 10:46:26 +10:00
net_types.cpp rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
net_types.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
netaddress.cpp doc: update URLs 2025-06-03 08:09:21 +01:00
netaddress.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
netbase.cpp net: remove unnecessary casts in socket operations 2025-09-16 06:26:01 -04:00
netbase.h test: Add unit test coverage for Init and Shutdown code 2025-08-04 13:38:26 -04:00
netgroup.cpp
netgroup.h
netmessagemaker.h
noui.cpp log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
noui.h log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
outputtype.cpp wallet, rpc: Use `OUTPUT_TYPES` to describe the output types instead of hardcoding them 2025-06-18 18:11:28 -03:00
outputtype.h wallet, rpc: Use `OUTPUT_TYPES` to describe the output types instead of hardcoding them 2025-06-18 18:11:28 -03:00
pow.cpp fuzz: enable running fuzz test cases in Debug mode 2025-04-22 17:11:24 +10:00
pow.h scripted-diff: Bump copyright headers after include changes 2025-06-03 15:13:57 +02:00
prevector.h refactor: extract `STATIC_SIZE` constant to prevector 2025-07-25 16:23:37 -07:00
protocol.cpp scripted-diff: Replace GenTxidVariant with GenTxid 2025-07-08 20:00:51 +01:00
protocol.h scripted-diff: Replace GenTxidVariant with GenTxid 2025-07-08 20:00:51 +01:00
psbt.cpp psbt: use sighash type field to determine whether to remove non-witness utxos 2025-05-14 14:00:43 -07:00
psbt.h psbt: use sighash type field to determine whether to remove non-witness utxos 2025-05-14 14:00:43 -07:00
pubkey.cpp XOnlyPubKey: Add GetCPubKeys 2025-05-21 10:44:26 -07:00
pubkey.h XOnlyPubKey: Add GetCPubKeys 2025-05-21 10:44:26 -07:00
random.cpp log: [refactor] Use info level for init logs 2025-07-25 09:50:50 +02:00
random.h random: add fixed-size `std::array` generation 2025-07-16 13:19:18 -07:00
randomenv.cpp build: simplify *ifaddr handling 2025-05-08 16:49:58 +01:00
randomenv.h
rest.cpp mempool, refactor: Convert uint256 to Txid 2025-08-11 16:26:35 +01:00
rest.h
scheduler.cpp thread-safety: fix annotations with REVERSE_LOCK 2025-06-16 18:09:14 +00:00
scheduler.h
semaphore_grant.h threading: semaphore: move CountingSemaphoreGrant to its own header 2025-05-10 03:31:30 +00:00
serialize.h cleanup: remove unused `ser_writedata16be` and `ser_readdata16be` 2025-07-29 16:25:47 -07:00
signet.cpp script/interpreter: introduce script_verify_flags typename 2025-08-14 10:17:32 +10:00
signet.h
span.h scripted-diff: Bump copyright headers after std::span changes 2025-03-12 19:46:54 +01:00
streams.cpp refactor: encapsulate `vector`/`array` keys into `Obfuscation` 2025-07-16 14:33:07 -07:00
streams.h refactor: encapsulate `vector`/`array` keys into `Obfuscation` 2025-07-16 14:33:07 -07:00
sync.cpp threading: remove unused template instantiations 2025-08-22 14:25:39 +00:00
sync.h threading: remove obsolete critsect macros 2025-08-22 14:25:39 +00:00
threadsafety.h thread-safety: modernize thread safety macros 2025-05-08 20:13:46 +00:00
tinyformat.h refactor: Introduce struct to hold a runtime format string 2025-01-15 12:16:08 +01:00
torcontrol.cpp config: allow setting -proxy per network 2025-05-13 12:09:40 +02:00
torcontrol.h config: allow setting -proxy per network 2025-05-13 12:09:40 +02:00
txdb.cpp validation: Use dirty entry count in flush warnings and disk space checks 2025-10-07 22:36:43 -05:00
txdb.h kernel: Move default cache constants to caches 2025-01-15 15:44:55 +01:00
txgraph.cpp txgraph: use enum Level instead of bool main_only 2025-09-10 08:03:17 -04:00
txgraph.h txgraph: use enum Level instead of bool main_only 2025-09-10 08:03:17 -04:00
txmempool.cpp Revert "[refactor] rewrite vTxHashes as a vector of CTransactionRef" 2025-08-27 03:33:32 +10:00
txmempool.h Revert "[refactor] rewrite vTxHashes as a vector of CTransactionRef" 2025-08-27 03:33:32 +10:00
txrequest.cpp refactor: miscellaneous GenTxid followups 2025-07-23 15:01:18 +01:00
txrequest.h refactor: miscellaneous GenTxid followups 2025-07-23 15:01:18 +01:00
uint256.cpp refactor: Remove SetHexDeprecated 2025-04-09 15:59:59 +01:00
uint256.h refactor: Remove SetHexDeprecated 2025-04-09 15:59:59 +01:00
undo.h
validation.cpp validation: Use dirty entry count in flush warnings and disk space checks 2025-10-07 22:36:43 -05:00
validation.h Merge bitcoin/bitcoin#32998: Bump SCRIPT_VERIFY flags to 64 bit 2025-10-07 14:51:22 -07:00
validationinterface.cpp kernel: improve BlockChecked ownership semantics 2025-08-01 15:12:37 +02:00
validationinterface.h kernel: improve BlockChecked ownership semantics 2025-08-01 15:12:37 +02:00
versionbits.cpp scripted-diff: rename gbt_force and gbt_force_name 2025-04-30 14:51:21 +02:00
versionbits.h scripted-diff: rename gbt_force and gbt_force_name 2025-04-30 14:51:21 +02:00
versionbits_impl.h tests: refactor versionbits fuzz test 2025-01-21 00:38:03 +10:00
walletinitinterface.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00