mining: add submitBlock to IPC Mining interface #34644

pull w0xlt wants to merge 2 commits into bitcoin:master from w0xlt:ipc-submit-block changing 5 files +141 −1
  1. w0xlt commented at 8:47 am on February 21, 2026: contributor

    This PR adds a submitBlock method to the IPC Mining interface, equivalent to the submitblock RPC. It accepts a serialized block over IPC, validates/processes it via the normal block-processing path.

    The method uses the same result shape as checkBlock: bool + reason/debug out-params. It reports duplicate, inconclusive, and invalid-block rejection details, and initializes reason/debug on every call.

    Closes #34626

  2. mining: add submitBlock IPC method to Mining interface
    Add a submitBlock method to the Mining IPC interface, equivalent to the
    submitblock RPC. This accepts a fully assembled block, validates it, and
    if valid, adds it to the chain and relays to peers.
    
    This is needed for Stratum v2 Job Declarator Server (JDS), where accepted
    solutions may correspond to jobs not tied to a Bitcoin Core BlockTemplate.
    JDS receives PushSolution fields and reconstructs full blocks; without an
    IPC submitBlock method, final submission requires the submitblock RPC.
    
    The method returns detailed status (reason/debug strings) matching the
    checkBlock pattern, giving callers enough information to handle
    validation failures.
    7a2d88c659
  3. test: add IPC submitBlock functional test
    Test the new Mining.submitBlock IPC method with three cases:
    - Invalid block (bad version) returns failure with reason
    - Valid block is accepted and propagates to peers
    - Duplicate block returns failure with "duplicate" reason
    
    The test bootstraps a candidate block with createNewBlock(), mutates and
    serializes it, then submits it through Mining.submitBlock instead of
    BlockTemplate.submitSolution. This exercises the complete-block submission
    path and approximates the Sv2 JDS use case.
    b72108fac8
  4. DrahtBot added the label Mining on Feb 21, 2026
  5. DrahtBot commented at 8:48 am on February 21, 2026: contributor

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

    Reviews

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

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • “Like the submitblock RPC, this may add the coinbase witness nonce if missing, if the block already has a witness commitment and segwit is active for the previous block (via UpdateUncommittedBlockStructures).” -> replace second “if” with “and if” [The original uses two consecutive “if” clauses which is awkward and can impede comprehension; “and if” clarifies the conjunction of the two conditions.]

    2026-02-21 08:48:27

  6. DrahtBot added the label CI failed on Feb 21, 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-02-22 03:13 UTC

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