AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge bitcoin/bitcoin#36591: test: deduplicate PSBT unknown-field coverage in `rpc_psbt.py`

Public commit record

What the developer wrote

Authored by merge-script

91/100 · Strong
Merge bitcoin/bitcoin#36591: test: deduplicate PSBT unknown-field coverage in `rpc_psbt.py`

ef4310097bd651497a98a9d1bb59560a7055ae01 test: combine redundant PSBT unknown field merge cases into `test_combinepsbt_preserves_unknown_fields` (nebula-21)
40eba5eb20ba0041a6328ba3482fcc26ddbe0185 test: extract unknown fields passthrough to its own method (nebula-21)

Pull request description:

I've tested some mutations related to test coverage for PSBT unknown field merging and discovered an inconsistency.
<details>

If line 71 of `psbt.cpp` "`unknown.insert(psbt.unknown.begin(), psbt.unknown.end());`" (inside `bool PartiallySignedTransaction::Merge(const PartiallySignedTransaction& psbt)` function) is removed then, the expected test fails: *"Test that combining PSBTs preserves unknown fields with the same and with distinct values per map."*

If line 434 of `psbt.cpp` "`unknown.insert(input.unknown.begin(), input.unknown.end());`" (inside `bool PSBTInput::Merge(const PSBTInput& input)` function), is removed, a different unexpected test fails: "*Test that unknown values are just passed through*".

If line 537 of `psbt.cpp` "`unknown.insert(output.unknown.begin(), output.unknown.end());`" (inside `bool PSBTOutput::Merge(const PSBTOutput& output)` function), is removed, the expected test fails: "*Test that combining PSBTs preserves unknown fields with the same and with distinct values per map.*".
</details>

This PR solves this inconsistency.
The old code did 3 different things:
1. Test the pass-through of unknown values for `walletprocesspsbt`.
2. Combine two v0 PSBTs with different unknown input keys and check that both keys survive.
3. Combine implicit v0 PSBT with explicit v0 and check that both keys survive.

Case 2 is already fully covered by the existing `test_combinepsbt_preseves_unknown_fields` so keeping it is redundant and misleading.

Commit 40eba5eb20ba0041a6328ba3482fcc26ddbe0185 moves the old code into a new method called `test_unknown_fields_passthrough` and commit ef4310097bd651497a98a9d1bb59560a7055ae01 removes the redundant code of Case 2 and moves Case 3 inside `test_combinepsbt_preserves_unknown_fields`.

ACKs for top commit:
Naomi-Gift:
tACK ef4310097bd651497a98a9d1bb59560a7055ae01
polespinasa:
ACK ef4310097bd651497a98a9d1bb59560a7055ae01

Tree-SHA512: 14476cffc28a8548fe58e42d8862d4fdb300c36d81679551fa8f9af83b49da3c65c2fe3283e9a4ec3e5c45abe3f34b8270dc2208a4f0534ff1f6062948bfcae9
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only reorganizes existing test code in Bitcoin Core's functional test suite. It moves and deduplicates tests that check how unknown PSBT fields are preserved when PSBTs are combined or processed by the wallet. No production code was changed, and no security bug was fixed or introduced.

Recommended action

No security action required. This is a routine test-maintenance refactor.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.