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 3 files +83 −12
  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. 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.
    7fac2d1655
  3. cmpctblock: log: Log extrapool separately from mempool
    Please review carefully, though the only intented behavior change in
    this commit is related to logging, it touches compact block transaction
    counts which is quite dangerous.
    
    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.
    35b79db9fd
  4. 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).
    cef79baeb2
  5. 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
  6. 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

    Reviewers, this pull request conflicts with the following ones:

    • #35727 (blockencodings: fix extra transaction count by instagibbs)
    • #35368 (tracing: add block header and compact block tracepoints by w0xlt)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. 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

  8. davidgumberg marked this as a draft on Jul 16, 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-07-21 21:50 UTC

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