refactor: deduplicate block validation state catcher #36469

pull enirox001 wants to merge 1 commits into bitcoin:master from enirox001:08_10_deduplicate_submit changing 4 files +50 −67
  1. enirox001 commented at 10:44 AM on October 8, 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

    Replaces #36389 with the same commit on a dedicated branch.

  2. DrahtBot added the label Refactoring on Oct 8, 2026
  3. DrahtBot commented at 10:44 AM on October 8, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK ismaelsadeeq
    Concept ACK sedited, Grace-Ujah, 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)
    • #35300 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35300.svg"></sub> (mining: add precious option to IPC block submission by w0xlt)
    • #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):

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

    <sup>2026-10-08 15:06:00</sup>

  4. sedited commented at 10:48 AM on October 8, 2026: contributor

    Concept ACK

  5. Grace-Ujah commented at 1:31 PM on October 8, 2026: none

    Concept ACK 5852e3d35a42749d267f2783269a9568bf67e53d

  6. 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
    c9cccf6d68
  7. enirox001 force-pushed on Oct 8, 2026
  8. DrahtBot added the label CI failed on Oct 8, 2026
  9. enirox001 force-pushed on Oct 8, 2026
  10. w0xlt commented at 3:26 PM on October 8, 2026: contributor

    Concept ACK

  11. DrahtBot removed the label CI failed on Oct 8, 2026
  12. ismaelsadeeq approved
  13. ismaelsadeeq commented at 3:55 AM on October 9, 2026: member

    ACK c9cccf6d68c682e533876b4450f5ad7044a79f10

    dedup is clean.

  14. DrahtBot requested review from sedited on Oct 9, 2026
  15. DrahtBot requested review from Grace-Ujah on Oct 9, 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-10-11 09:51 UTC

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