test: make script_combineSigs and spends_witness_prog cases independent #36794

Open
alexanderwiederin wants to merge 2 commits from script_test_split into master AGit
alexanderwiederin commented 2026-11-06 19:11:12 +00:00 (Migrated from github.com)

Part of #36692: remove test state that is shared and modified across cases.

  • script_combineSigs: The P2PKH, P2SH and multisig cases shared one funding transaction, whose scriptPubkey was modified between them, and one keystore. Each case is now its own test with its own keys, keystore and funding transaction.
  • spends_witness_prog: every output type reused the same transactions and coins view. The P2SH-wrapped cases relied on the scriptPubkey left by the previous case and had to clear the scriptSig they set. Each check now builds fresh state, and the scripts are named.

The checks are unchanged.

Part of #36692: remove test state that is shared and modified across cases. - `script_combineSigs`: The P2PKH, P2SH and multisig cases shared one funding transaction, whose `scriptPubkey` was modified between them, and one keystore. Each case is now its own test with its own keys, keystore and funding transaction. - `spends_witness_prog`: every output type reused the same transactions and coins view. The P2SH-wrapped cases relied on the `scriptPubkey` left by the previous case and had to clear the `scriptSig` they set. Each check now builds fresh state, and the scripts are named. The checks are unchanged.
DrahtBot commented 2026-11-06 19:11:23 +00:00 (Migrated from github.com)

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

External sites

Reviews

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

Type Reviewers
ACK yuvicc, janb84

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36122 (BIP460: CISA for Taproot key path spends by fjahr)
  • #35733 (sign: Remove FillableSigningProvider by achow101)

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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36794 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36794.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36794#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [yuvicc](https://github.com/bitcoin/bitcoin/pull/36794#issuecomment-6787302990), [janb84](https://github.com/bitcoin/bitcoin/pull/36794#pullrequestreview-5855973571) | 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: * [#36122](https://github.com/bitcoin/bitcoin/pull/36122) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36122.svg"></sub> (BIP460: CISA for Taproot key path spends by fjahr) * [#35733](https://github.com/bitcoin/bitcoin/pull/35733) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35733.svg"></sub> (sign: Remove FillableSigningProvider by achow101) 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-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 7358d35bb01d · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:7eebed8027c96ac27bcd79eeb7a88e35799cd96eb8fbacf34d3257986a959f64:cdc1bd61213c9363d5bb4c7b7ee073ccfd6fecdafbb2c4c18d9d9e031a6afcf8 --> <!-- ralph-base:117c54d4c575aa19027b2227bb45dc60b63b3278 --> <!-- ralph-head:7358d35bb01dfc9ba844747dbf27b58c5482b066 --> <!-- ralph-case:923c08b7cc292c156a46905dd1e3b9aae58e481e3e247a2c49688f1343365916 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`7358d35bb01d`](<https://git.fish.foo/bitcoin/bitcoin/commit/7358d35bb01dfc9ba844747dbf27b58c5482b066>) · [Review report](<https://review.fish.foo/report/36794-7358d35bb01dfc9ba844747dbf27b58c5482b066-2485-6.html>) · [Previous reports](<https://review.fish.foo/traces/36794/>) [permalink](<https://review.fish.foo/report/36794-7358d35bb01dfc9ba844747dbf27b58c5482b066-2485-6.html>)
yuvicc commented 2026-11-07 06:49:23 +00:00 (Migrated from github.com)

Concept ACK

Concept ACK
yuvicc (Migrated from github.com) reviewed 2026-11-09 14:20:14 +00:00
yuvicc (Migrated from github.com) left a comment

crACK 1f9802c192

I went through both diffs and the checks match.

Left some non-blocking nits.

crACK 1f9802c192432717d06bc0bb94d3dc22aae2ec4f I went through both diffs and the checks match. Left some non-blocking nits.
yuvicc (Migrated from github.com) commented 2026-11-09 13:22:25 +00:00

as per developer notes braces should be in the same line and ++i is preferred over i++ (link).

as per [developer notes](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/doc/developer-notes.md?plain=1#L20) braces should be in the same line and `++i` is preferred over `i++` ([link](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/doc/developer-notes.md?plain=1#L57)).
yuvicc (Migrated from github.com) commented 2026-11-09 13:14:30 +00:00

I think this comment can be moved above to CombineSigsTest as it describes all three cases?

I think this comment can be moved above to `CombineSigsTest` as it describes all three cases?
yuvicc (Migrated from github.com) commented 2026-11-09 13:26:30 +00:00

doesn't harm but we could keep the label here as well?

    SignatureData scriptSig = DataFromTransaction(txTo, /*nIn=*/0, txFrom.vout[0])
doesn't harm but we could keep the label here as well? ```suggestion SignatureData scriptSig = DataFromTransaction(txTo, /*nIn=*/0, txFrom.vout[0]) ```
alexanderwiederin (Migrated from github.com) reviewed 2026-11-09 14:35:58 +00:00
alexanderwiederin (Migrated from github.com) commented 2026-11-09 14:35:58 +00:00

Taken - thanks!

Taken - thanks!
yuvicc commented 2026-11-10 06:24:58 +00:00 (Migrated from github.com)
ACK 26d2f7625a56f2fa6804aac4a6c033eaa91eadca
janb84 (Migrated from github.com) reviewed 2026-11-10 19:13:18 +00:00
janb84 (Migrated from github.com) left a comment

ACK 26d2f7625a

It matches the recent "declarative tests" series :)
Each new test case makes the same assertions as the old code, in the same order, with the same expected values.

ACK 26d2f7625a56f2fa6804aac4a6c033eaa91eadca It matches the recent "declarative tests" series :) Each new test case makes the same assertions as the old code, in the same order, with the same expected values.
janb84 (Migrated from github.com) commented 2026-11-10 19:12:45 +00:00

Note: Old problem but this comment is not correct. Easy to check;
BOOST_CHECK_EQUAL(scriptSig.scriptSig, scriptSigCopy.scriptSig);

Not something I suggest to fix in this PR.

Note: Old problem but this comment is not correct. Easy to check; ` BOOST_CHECK_EQUAL(scriptSig.scriptSig, scriptSigCopy.scriptSig);` Not something I suggest to fix in this PR.
janb84 (Migrated from github.com) commented 2026-11-10 18:47:45 +00:00

NIT (non-blocking); with the name change of the helper, this case can be a bit confusing. A clarifying comment can help

    // P2A is a witness program, but anchor spends are excluded.
    BOOST_CHECK(!SpendsWitnessProg(p2a));
NIT (non-blocking); with the name change of the helper, this case can be a bit confusing. A clarifying comment can help ```suggestion // P2A is a witness program, but anchor spends are excluded. BOOST_CHECK(!SpendsWitnessProg(p2a)); ```
alexanderwiederin (Migrated from github.com) reviewed 2026-11-10 20:19:48 +00:00
alexanderwiederin (Migrated from github.com) commented 2026-11-10 20:19:48 +00:00

Taken - thanks!

Taken - thanks!
alexanderwiederin (Migrated from github.com) reviewed 2026-11-10 20:21:40 +00:00
alexanderwiederin (Migrated from github.com) commented 2026-11-10 20:21:40 +00:00

Thanks - good catch!

Thanks - good catch!
yuvicc commented 2026-11-11 04:47:37 +00:00 (Migrated from github.com)

re-ACK 7358d35bb0

Show signature ```bash -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512

re-ACK 7358d35bb0
-----BEGIN PGP SIGNATURE-----

iJEEARYKADkWIQRxIqfV4fHauqeDZkLHO83HCSJ4EQUCavPzBhsUgAAAAAAEAA5t
YW51MiwyLjUrMS4xMiwwLDMACgkQxzvNxwkieBH7MAEAg/CcUjT+GTywtxOE8MZr
AdPwyBUzBEIgOPLZyTBoyQcBAOuCEIcJxmBDTJyWV4PRFnqqI4gOnipGrgT7p+qt
E8oH
=53QK
-----END PGP SIGNATURE-----

</details>
re-ACK 7358d35bb01dfc9ba844747dbf27b58c5482b066 <details> <summary>Show signature</summary> ```bash -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 re-ACK 7358d35bb01dfc9ba844747dbf27b58c5482b066 -----BEGIN PGP SIGNATURE----- iJEEARYKADkWIQRxIqfV4fHauqeDZkLHO83HCSJ4EQUCavPzBhsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwwLDMACgkQxzvNxwkieBH7MAEAg/CcUjT+GTywtxOE8MZr AdPwyBUzBEIgOPLZyTBoyQcBAOuCEIcJxmBDTJyWV4PRFnqqI4gOnipGrgT7p+qt E8oH =53QK -----END PGP SIGNATURE----- ``` </details>
janb84 (Migrated from github.com) reviewed 2026-11-11 08:37:10 +00:00
janb84 (Migrated from github.com) left a comment

re ACK 7358d35bb0

Thanks for taking my suggestion. LGTM !

re ACK 7358d35bb01dfc9ba844747dbf27b58c5482b066 Thanks for taking my suggestion. LGTM !
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36794
No description provided.