test: cover submitpackage other-wtxid for same-txid-diff-witness #35893

pull mercie-ux wants to merge 1 commits into bitcoin:master from mercie-ux:test-submitpackage-other-wtxid changing 1 files +31 −0
  1. mercie-ux commented at 6:50 AM on August 5, 2026: contributor

    The specific behaviour tied to the // TODO: allow witness replacement in packages. had no functional test anywhere, just the unit test coverage, showing the underlying mempool logic and not the RPC's actual JSON output. This test submits a same-txid-different-witness transaction via submitpackage while its counterpart is already in the mempool, and asserts submitpackage correctly reports other-wtxid pointing at the transaction already in the mempool, its existing, documented behavior, not something this change introduces. Verified the test can actually fail by temporarily asserting the wrong wtxid and confirmed it fails as expected.

  2. DrahtBot added the label Tests on Aug 5, 2026
  3. DrahtBot commented at 6:50 AM on August 5, 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/35893.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK jeanpablojp, sedited, instagibbs

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

  4. instagibbs commented at 1:55 PM on August 9, 2026: member

    concept ack

  5. jeanpablojp commented at 1:04 AM on August 12, 2026: contributor

    tACK ec8a53618ebb4c71f4f71ba282fb990e45e413fc

  6. test: cover submitpackage other-wtxid for same-txid-diff-witness
    The specific behaviour tied to the `// TODO: allow witness replacement in packages.` had no functional test anywhere, just the unit test coverage, showing the underlying mempool logic and not the RPC's actual JSON output.
    This test submits a same-txid-different-witness transaction via `submitpackage` while its counterpart is already in the mempool, and asserts `submitpackage` correctly reports `other-wtxid` pointing at the transaction already in the mempool, its existing, documented behavior, not something this change introduces.
    Verified the test can actually fail by temporarily asserting the wrong wtxid and confirmed it fails as expected.
    9054f7cde4
  7. in test/functional/rpc_packages.py:113 in ec8a53618e
     108 | +            rebalance_parent_output_amount=parent_amount,
     109 | +            child_amount=child_amount,
     110 | +        )
     111 | +
     112 | +        self.wallet.sendrawtransaction(from_node=node, tx_hex=parent.serialize().hex())
     113 | +        self.generate(node, 1)
    


    jeanpablojp commented at 1:04 AM on August 12, 2026:

    this block isn't needed, the mempool takes child_one on the unconfirmed parent; deleted the line and re-ran to check. feel free to ignore


    mercie-ux commented at 3:37 AM on August 12, 2026:

    removed it, thanks


    mercie-ux commented at 3:38 AM on August 12, 2026:

    removed it, thanks

  8. mercie-ux force-pushed on Aug 12, 2026
  9. jeanpablojp commented at 8:59 AM on August 12, 2026: contributor

    reACK 9054f7cde43a264300bb0567215bda5f55803ae5

  10. sedited approved
  11. sedited commented at 2:06 PM on September 23, 2026: contributor

    ACK 9054f7cde43a264300bb0567215bda5f55803ae5

  12. fanquake requested review from instagibbs on Sep 23, 2026
  13. in test/functional/rpc_packages.py:122 in 9054f7cde4
     117 | +        self.log.info("Submit child_one to the mempool directly")
     118 | +        node.sendrawtransaction(child_one.serialize().hex())
     119 | +
     120 | +        self.log.info("Submit child_two via submitpackage; it should be reported as other-wtxid, not an error")
     121 | +        submitres = node.submitpackage([child_two.serialize().hex()])
     122 | +        result = submitres["tx-results"][child_two.wtxid_hex]
    


    instagibbs commented at 4:13 PM on September 23, 2026:

    when checking results it would be best to check that the mempool was not actually mealleated (child_two wasnt swapped in), and for return fields other things could be asserted

  14. instagibbs approved
  15. instagibbs commented at 4:13 PM on September 23, 2026: member

    ACK 9054f7cde43a264300bb0567215bda5f55803ae5

    non-blocking comments, coverage is better

  16. fanquake merged this on Sep 23, 2026
  17. fanquake closed this on Sep 23, 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 10:51 UTC

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