This PR is a follow-up to the #22902.
Previously, the tracepoint utxocache:flush
was called, even when it was not flushing. So, the tracepoint is now scoped to write only when coins cache to disk.
This PR is a follow-up to the #22902.
Previously, the tracepoint utxocache:flush
was called, even when it was not flushing. So, the tracepoint is now scoped to write only when coins cache to disk.
Previously, the `utxocache:flush` tracepoint was in the wrong scope and
reached every time `CChainState::FlushStateToDisk` was called, even when
there was no flushing of the cache. The tracepoint is now properly scoped
and will be reached during a full flush.
Inside the scope, the `fDoFullFlush` value will always be `true`, so it
doesn't need to be logged separately. Hence, it's dropped from the
tracepoint arguments.
utxoscache:uncache
, utxoscache:add
, and utxocache:spent
tracepoint documentation that we don’t have only one ’the utxo cache’. We sometimes work with temporary UTXO caches. For example, in TestBlockValidity()
~after~ before mining or during mempool consistency checks (frequent on regtest). Tracepoints are triggered for temporary caches too. Noticed this while writing functional tests for the tracepoints.
Could add a note in the
utxoscache:uncache
,utxoscache:add
, andutxocache:spent
tracepoint documentation that we don’t have only one ’the utxo cache’. We sometimes work with temporary UTXO caches. For example, inTestBlockValidity()
after mining or during mempool consistency checks (frequent on regtest). Tracepoints are triggered for temporary caches too. Noticed this while writing functional tests for the tracepoints.
Okay, will update the docs :+1:
Feel free to squash this commit https://github.com/0xB10C/bitcoin/commit/287351a80193a24c84a245989ffa2403c15c78fe documenting this #23907 (comment) into the tracing: misc follow-ups to 22902
too (while copying the commit subject and description into the squash commit description).
I’ve cherry picked the commits from #24358 (tracepoint tests) onto this PR (currently git cherry-pick 1e8aa02ec5cc2819c67ef40a7573c4b23a4c11cc..db3a05f50ee5d3cafa226882eade531a7ebff6b1
; 0xB10C/bitcoin:2022-02-23907+tracepoint-tests) to run the tracepoint tests against this PR. Tests pass!
- mention 'Lost X events' workaround
- clarify flush tracepoint docs
- fix typo in tracepoint context
- clarify flush for prune
The documentation and examples for the `fFlushForPrune` argument
of the utxocache flush tracepoint weren't clear without looking
at the code.
See these comments: https://github.com/bitcoin/bitcoin/pull/22902#issuecomment-987094612
- doc: note that there can be temporary UTXO caches
Bitcoin Core uses temporary clones of it's _main_ UTXO cache in some
places. The utxocache:add and :spent tracepoints are triggered when
temporary caches are changed too. This is documented.