test: Add submitblock test in interface_ipc #33380

pull sedited wants to merge 1 commits into bitcoin:master from sedited:interface_ipc_submitblock changing 1 files +42 −1
  1. sedited commented at 5:59 PM on September 12, 2025: contributor

    Expands the ipc mining test a bit with submitting a solved block and checking its validity.

  2. DrahtBot added the label Tests on Sep 12, 2025
  3. DrahtBot commented at 5:59 PM on September 12, 2025: 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/33380.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors, marcofleon, zaidmstrr
    Stale ACK sipa

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. sipa commented at 7:02 PM on September 12, 2025: member

    utACK 557644ee9499583b6d00efda289fb65e8359e084

  5. Sjors commented at 8:27 AM on September 15, 2025: member

    ACK 557644ee9499583b6d00efda289fb65e8359e084

    Could expand it a bit:

    diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py
    index 1651b53bda..89c1fd7d31 100755
    --- a/test/functional/interface_ipc.py
    +++ b/test/functional/interface_ipc.py
    @@ -186,20 +186,33 @@ class IPCInterfaceTest(BitcoinTestFramework):
                 balance = miniwallet.get_balance()
                 coinbase.vout[0].scriptPubKey = miniwallet.get_output_script()
                 coinbase.vout[0].nValue = COIN
                 block.vtx[0] = coinbase
                 block.hashMerkleRoot = block.calc_merkle_root()
    +
    +            # Ensure the block is invalid by setting version to 0
    +            original_version = block.nVersion
    +            block.nVersion = 0
    +            block.solve()
    +            res = await mining.result.checkBlock(block.serialize(), check_opts)
    +            assert_equal(res.result, False)
    +            assert_equal(res.reason, "bad-version(0x00000000)")
    +            res = await template.result.submitSolution(ctx, block.nVersion, block.nTime, block.nNonce, coinbase.serialize())
    +            assert_equal(res.result, False)
    +
    +            block.nVersion = original_version
                 block.solve()
                 res = await mining.result.checkBlock(block.serialize(), check_opts)
                 assert_equal(res.result, True)
                 res = await template.result.submitSolution(ctx, block.nVersion, block.nTime, block.nNonce, coinbase.serialize())
                 assert_equal(res.result, True)
                 assert_equal(self.nodes[0].getchaintips()[0]["height"], current_block_height + 1)
                 miniwallet.rescan_utxos()
                 assert_equal(miniwallet.get_balance(), balance + 1)
                 res = await mining.result.checkBlock(block.serialize(), check_opts)
                 assert_equal(res.result, False)
    +            assert_equal(res.reason, "inconclusive-not-best-prevblk")
    
                 self.log.debug("Destroy template objects")
                 template.result.destroy(ctx)
    
  6. test: Add submitblock test in interface_ipc
    Co-Authored-By: Sjors Provoost <sjors@sprovoost.nl>
    0a26731c4c
  7. sedited force-pushed on Sep 15, 2025
  8. sedited commented at 1:33 PM on September 15, 2025: contributor

    Updated 557644ee9499583b6d00efda289fb65e8359e084 -> 0a26731c4cc182e887ce959cdd301227cdc752d7 (interface_ipc_submitblock_0 -> interface_ipc_submitblock_1, compare)

  9. Sjors commented at 4:10 PM on September 15, 2025: member

    ACK 0a26731c4cc182e887ce959cdd301227cdc752d7

  10. DrahtBot requested review from sipa on Sep 15, 2025
  11. marcofleon commented at 10:58 AM on September 16, 2025: contributor

    code review ACK 0a26731c4cc182e887ce959cdd301227cdc752d7

  12. fanquake requested review from ryanofsky on Sep 16, 2025
  13. zaidmstrr commented at 3:29 PM on September 16, 2025: contributor

    Tested ACK 0a26731

  14. glozow merged this on Sep 16, 2025
  15. glozow closed this on Sep 16, 2025

  16. fanquake referenced this in commit 26208b3a0c on Sep 17, 2025
  17. glozow referenced this in commit b7a722724d on Sep 17, 2025
  18. sedited referenced this in commit 3f14dd4b2a on Oct 7, 2025
  19. sedited referenced this in commit 5f9d179b8d on Oct 8, 2025
  20. sedited referenced this in commit 845b93d99e on Oct 8, 2025
  21. yuvicc referenced this in commit ccce70c31a on Oct 8, 2025
  22. sedited referenced this in commit 3b1e26d5d3 on Oct 10, 2025
  23. sedited referenced this in commit 0fa2fdaca0 on Oct 11, 2025
  24. stringintech referenced this in commit f74b275ffc on Oct 14, 2025
  25. stickies-v referenced this in commit a785fe6759 on Nov 5, 2025
  26. morozow referenced this in commit 5357c586f7 on May 8, 2026
  27. morozow referenced this in commit 48f5d00b2b on May 8, 2026
  28. Kino1994 referenced this in commit 41b2dbca70 on Jun 28, 2026
  29. BigcoinBGC referenced this in commit 5da235cf63 on Jun 30, 2026
  30. Kino1994 referenced this in commit 4e4c4a6ba4 on Aug 19, 2026
  31. bitcoin locked this on Sep 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-09-20 20:53 UTC

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