log: move CreateNewBlock() log line behind a new mining category #36336

pull ismaelsadeeq wants to merge 1 commits into bitcoin:master from ismaelsadeeq:09-2026-mining-log-category changing 4 files +10 −1
  1. ismaelsadeeq commented at 3:27 PM on September 25, 2026: member

    Fixes #36334

    The "CreateNewBlock(): block weight: ..." line was logged unconditionally and could not be turned off, filling the debug log when block templates are built frequently.

    Move it behind a new "mining" logging category, enabled with -debug=mining.

  2. log: move CreateNewBlock() log line behind a new mining category
    The "CreateNewBlock(): block weight: ..." line was logged unconditionally
    and could not be turned off, filling the debug log when block templates are
    built frequently.
    
    Move it behind a new "mining" logging category, enabled with -debug=mining.
    e7d91c2034
  3. DrahtBot added the label Utils/log/libs on Sep 25, 2026
  4. DrahtBot commented at 3:27 PM on September 25, 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/36336.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    Concept ACK sedited, l0rinc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited commented at 3:32 PM on September 25, 2026: contributor

    Concept ACK

  6. in test/functional/mining_basic.py:427 in e7d91c2034
     423 | @@ -424,6 +424,12 @@ def test_height_in_locktime(self):
     424 |          assert_equal(block["tx"][0]["locktime"], block["height"] - 1)
     425 |          assert_equal(block["tx"][0]["vin"][0]["sequence"], MAX_SEQUENCE_NONFINAL)
     426 |  
     427 | +    def test_mining_log_category(self):
    


    l0rinc commented at 6:51 PM on September 25, 2026:

    I don't think this is useful, it's not the same abstraction level as test_murch_zawy_mintime and test_pruning and test_height_in_locktime


    ismaelsadeeq commented at 9:48 AM on September 28, 2026:

    Not sure what the suggestion is here, based on the current state of the PR, the test tests a feature added by the PR and fails after running without the production code. AFAICT, it belongs in that file because tests of the same caliber are there as well, like blockmintxfee_parameter etc.

  7. in src/logging/categories.h:48 in e7d91c2034
      44 | @@ -45,6 +45,7 @@ enum LogFlags : CategoryMask {
      45 |      TXPACKAGES = (CategoryMask{1} << 27),
      46 |      KERNEL = (CategoryMask{1} << 28),
      47 |      PRIVBROADCAST = (CategoryMask{1} << 29),
      48 | +    MINING = (CategoryMask{1} << 30),
    


    l0rinc commented at 6:57 PM on September 25, 2026:

    Adding a whole new log category for a single debug line seems excessive, could we put this behind an existing close-enough category instead? Mempool seems like the natural home: this line is reporting what got pulled from the mempool into the template, and anyone debugging fee/tx-selection issues already runs -debug=mempool. We can add a new category when the examples demonstrate a need.


    ismaelsadeeq commented at 9:52 AM on September 28, 2026:

    This was discussed in the issue #36334 in comparison with other alternatives, which aren't ideal. I think using the mempool category for mining code here is incorrect.

    New logs will likely be added in the future; see project #33758.

  8. l0rinc changes_requested
  9. l0rinc commented at 6:58 PM on September 25, 2026: contributor

    Concept ACK, but approach seems excessive

  10. ismaelsadeeq commented at 9:52 AM on September 28, 2026: member

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-09-28 10:51 UTC

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