This is a follow up commit of #25203.
logging: de-duplicate logging category output for the feeest messages (e.g. where I found duplicates), as these category prefixes are now printed automatically since #24464
372@@ -373,7 +373,7 @@ double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
373 failed_within_target_perc = 100 * failBucket.withinTarget / (failBucket.totalConfirmed + failBucket.inMempool + failBucket.leftMempool);
374 }
375
376- LogPrint(BCLog::ESTIMATEFEE, "FeeEst: %d > %.0f%% decay %.5f: feerate: %g from (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\n",
377+ LogPrint(BCLog::ESTIMATEFEE, " %d > %.0f%% decay %.5f: feerate: %g from (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\n",
0 LogPrint(BCLog::ESTIMATEFEE, "%d > %.0f%% decay %.5f: feerate: %g from (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\n",
Note, the linter will fail because your commit message begins with “scripted-diff: " but doesn’t contain a scripted diff. The commit message would need to be something like this:
0scripted-diff: remove duplicate categories from LogPrint ESTIMATEFEE output
1
2-BEGIN VERIFY SCRIPT-
3s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; }
4s 'BCLog::ESTIMATEFEE, "FeeEst: ' 'BCLog::ESTIMATEFEE, "'
5-END VERIFY SCRIPT-
See https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#scripted-diffs for more info.
That said, this is the only occurrence, so if reviewers agree that this change should be done, you can just change the commit message (and PR title) from “scripted-diff:” to “logging:”.
Yes, seems better now. Though, as I wrote above, I’m not sure this should be changed. Currently, the following would be logged, and without “FeeEst:” it may not be very clear.
0[estimatefee] FeeEst: 5 > 60% decay 0.96200: feerate: 2326.67 from (2292.02 - 2925.26) 82.00% 16.3/(19.9 0 mem 0.0 out) Fail: (1979.93 - 2292.02) 56.56% 9.9/(17.3 0 mem 0.2 out)
Here are the ESTIMATEFEE logging messages:
0$ git grep BCLog::ESTIMATEFEE
1src/policy/fees.cpp:376: LogPrint(BCLog::ESTIMATEFEE, "FeeEst: %d > %.0f%% decay %.5f: feerate: %g from (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\n",
2src/policy/fees.cpp:457: LogPrint(BCLog::ESTIMATEFEE, "Reading estimates: %u buckets counting confirms up to %u blocks\n",
3src/policy/fees.cpp:476: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error, blocks ago is negative for mempool tx\n");
4src/policy/fees.cpp:484: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error, mempool tx removed from >25 blocks,bucketIndex=%u already\n",
5src/policy/fees.cpp:493: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error, mempool tx removed from blockIndex=%u,bucketIndex=%u already\n",
6src/policy/fees.cpp:566: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error mempool tx %s already being tracked\n",
7src/policy/fees.cpp:614: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error Transaction had negative blocksToConfirm\n");
8src/policy/fees.cpp:664: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy first recorded height %u\n", firstRecordedHeight);
9src/policy/fees.cpp:668: LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy estimates updated by %u of %u block txs, since last block %u of %u tracked, mempool map size %u, max target %u from %s\n",
10src/policy/fees.cpp:1014: LogPrint(BCLog::ESTIMATEFEE, "Recorded %u unconfirmed txs from mempool in %gs\n", num_entries, (endclear - startclear)*0.000001);
Though, as I wrote above, I’m not sure this should be changed
Also divided on this. The message is already hard to understand as-is, if it just begins with numbers doesn’t make it better.