When running with -debug=validation
the log is filled with:
02023-03-19T12:46:01Z [validation] Enqueuing TransactionAddedToMempool: txid=37c8e1ef87d75a67fbaf44e116018fbc70d9c4ef0e27e2ae56861395101f9b8e wtxid=24e2d76012f9cde451d085ead4feab136feddae6cb55d37221a81aac6c0eaf42
12023-03-19T12:46:01Z [validation] TransactionAddedToMempool: txid=37c8e1ef87d75a67fbaf44e116018fbc70d9c4ef0e27e2ae56861395101f9b8e wtxid=24e2d76012f9cde451d085ead4feab136feddae6cb55d37221a81aac6c0eaf42
These log entries are more appropriate for -debug=mempool
.
This change limits -debug=validation
to messages that are related to blocks and headers. It also downgrades Enqueuing
messages to the Trace
level.
It makes it easier to run for a long time without excessive log file growth. This debug category is particularly useful for keeping track of problematic headers that were seen, the timing of reorgs, see also #27276.
Since this PR touches validationinterface.cpp
anyway, it also includes a commit to drop function names from log messages, since we now have -logsourcelocations
.
Similarly, though less important, I moved [validation] Pre-allocating up to position 0x… in rev….dat
messages to blockstorage. This reduces the number of [validation]
log messages further. to 3 per (normal) block.
The volume of log messages could also have been reduced by changing the log level of these messages to trace
. Doing so would prevent a whack-a-mole game of moving log messages to different categories. However in this case I think the change in log category would be justified even if it didn’t have a big impact on noise. I.e. someone running with -debug=mempool
would expect to see the TransactionAddedToMempool
messages and someone running with -debug=blockstorage
would perhaps be surprised to not see the Pre-allocating
message.