refactor: deduplicate block validation state catcher #36389

pull enirox001 wants to merge 1 commits into bitcoin:master from enirox001:master changing 4 files +47 −67
  1. enirox001 commented at 11:37 AM on September 30, 2026: contributor

    As mentioned in #34644 (review) and #35675 (review), the validation state catchers were defined in the block template manager, submitblock rpc and mining test helpers, even though they do the same thing.

    Moved this helper into node/block_validation_state_catcher.h and reuse it across all three callers. An optional validation state replaces the separate found flag where used, preserving each caller's registration and result handling

  2. DrahtBot added the label Refactoring on Sep 30, 2026
  3. DrahtBot commented at 11:38 AM on September 30, 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/36389.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    Concept ACK w0xlt

    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.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36356 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36356.svg"></sub> (mining: move getblocktemplate cache into BlockTemplateManager by w0xlt)
    • #35671 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35671.svg"></sub> (mining: add TxCollection to bandwidth-efficiently validate external block templates by Sjors)
    • #33922 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/33922.svg"></sub> (mining: add getMemoryLoad() and track template non-mempool memory footprint by Sjors)

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

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • ProcessNewBlock(block, true, true, &new_block) in src/test/util/mining.cpp

    <sup>2026-09-30 11:50:19</sup>

  4. enirox001 force-pushed on Sep 30, 2026
  5. DrahtBot added the label CI failed on Sep 30, 2026
  6. DrahtBot commented at 11:42 AM on September 30, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/36709743890/job/109868408911</sub> <sub>LLM reason (✨ experimental): CI failed due to lint errors in src/node/block_validation_state_catcher.h—missing the required include guard and using quote-based #include instead of bracket syntax.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. enirox001 force-pushed on Sep 30, 2026
  8. refactor: deduplicate block validation state catcher
    Move the shared BlockValidationStateCatcher into a dedicated header
    and reuse it it in the block template manager, submitblock rpc, and
    mining test helpers
    
    Use an optional validation state instead of a separate 'found' flag,
    preserving each caller's existing result handling
    5852e3d35a
  9. enirox001 force-pushed on Sep 30, 2026
  10. DrahtBot removed the label CI failed on Sep 30, 2026
  11. w0xlt commented at 5:36 PM on September 30, 2026: contributor

    Concept ACK

  12. enirox001 closed this on Oct 8, 2026

  13. enirox001 commented at 10:45 AM on October 8, 2026: contributor

    Had opened this on the wrong branch, closing this in favor of #36469


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

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