cmpctblock: Improve logging of `cmpctblock` message reconstruction statistics [part of prefill series] #35724

pull davidgumberg wants to merge 3 commits into bitcoin:master from davidgumberg:2026-07-14-cb-logging changing 4 files +95 −14
  1. davidgumberg commented at 9:33 PM on July 14, 2026: contributor

    Split from #35558, this makes it easier to observe compact block reconstruction performance by:

    • At debuglevel=trace logging all missing TX's in a CMPCTBLOCK, and all missing TX's requested from us.
    • Logging the sizes and counts of tx's used from the prefill, mempool, and extrapool.
    • Logging the sizes and sources of redundant transactions in the prefill section of received CMPCTBLOCKs.
  2. DrahtBot renamed this:
    cmpctblock: Improve logging of `cmpctblock` message reconstruction statistics [part of prefill series]
    cmpctblock: Improve logging of `cmpctblock` message reconstruction statistics [part of prefill series]
    on Jul 14, 2026
  3. DrahtBot commented at 9:33 PM on July 14, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35724.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. in src/blockencodings.cpp:164 in 35b79db9fd
     159 | @@ -161,15 +160,14 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
     160 |                  if (txn_available[idit->second] &&
     161 |                          txn_available[idit->second]->GetWitnessHash() != extra_txn[i].second->GetWitnessHash()) {
     162 |                      txn_available[idit->second].reset();
     163 | -                    mempool_count--;
    


    w0xlt commented at 9:46 PM on July 15, 2026:

    If I understand correctly, removing this decrement assumes that the existing candidate came from the extrapool. However, it may have been inserted during the earlier mempool scan. Would it make sense to track the candidate’s source and decrement the corresponding counter?


    l0rinc commented at 9:52 PM on July 15, 2026:

    Seems tangentially related to https://github.com/bitcoin/bitcoin/pull/35727


    davidgumberg commented at 6:27 PM on July 16, 2026:

    yeah, thanks for catching @w0xlt, I'll fix this after #35727, as that will make this change easier to make correct, marking this pr as draft for now

  5. davidgumberg marked this as a draft on Jul 16, 2026
  6. DrahtBot added the label Needs rebase on Jul 21, 2026
  7. cmpctblock: log: debuglevel=trace print TXID's of all missing tx'es.
    It doesn't make that much sense to log here only when there's a few
    transactions, since either a user is interested in what tx'es caused
    reconstruction to fail or they aren't, so log all txid's and this a
    trace-level log message.
    a01d69f8ec
  8. cmpctblock: log: Log extrapool separately from mempool
    Previously, in the log message and in the `InitData()` logic, the
    mempool was treated as a superset that includes the extra pool, it makes
    more sense to treat them as separate pools.
    
    This commit also separates the reconstruction critical logic of the
    found transaction count from the logging specific counting of tx
    sources.
    78715aab94
  9. cmpctblock: log: Print sizes of all tx types and prefill redundancies
    At block reconstruction time, log the counts and sizes of prefilled
    transactions, transactions pulled from the mempool, transactions from
    the extrapool, and missing transactions that were acquired via
    `GETBLOCKTXN`.
    
    Also log the count and size of prefilled transactions that were
    redundant and their source (mempool or extrapool).
    43bc34af72
  10. davidgumberg force-pushed on Aug 4, 2026
  11. davidgumberg marked this as ready for review on Aug 4, 2026
  12. davidgumberg commented at 10:45 PM on August 4, 2026: contributor

    Reworked after #35727 merged, this is ready for review.

  13. DrahtBot removed the label Needs rebase on Aug 4, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-11 10:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me