#36626 test: check `PSBT_GLOBAL_VERSION` validation on decode
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36626 test: check `PSBT_GLOBAL_VERSION` validation on decode | Ready | 0 | Positive | 0 + 16 tests | |||
|
|
|
|
| |||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Adds two functional test cases to rpc_psbt.py verifying global PSBT version decoding behavior. One test checks that an unsupported version number in PSBT_GLOBAL_VERSION causes decodepsbt to fail, and the other verifies that omitting the version field causes the PSBT to be parsed as version 0.
Problem: Global PSBT version decoding behavior lacked test coverage. Regressions or unintended changes to PSBT version limits or default version-0 fallback handling would pass test suites undetected.
Evidence of importance:
- Author diff demonstrations showing that modifying PSBT_HIGHEST_VERSION or removing the missing-tx check for version 0 in psbt.h triggered zero existing test failures.
Risk of a mistake: low (tests). Touches only functional test code for PSBT RPC parsing.
Changed since the previous assessment: Now includes the diff, confirming these are Python functional tests in rpc_psbt.py rather than C++ unit tests.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- author: author response to test refactoring suggestions and additional test case proposed by Bicaru20 2026-10-29
Agreement
Positive
support without stated reasons, no open objection (Bicaru20)
Thread notes: Added a suggestion from Bicaru20 proposing an additional test case for PSBT version 1 error handling.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| Bicaru20 (contributor) | suggestion, approach | combine both test cases into one function to reuse the PSBT | open | answered | no | 2026-10-27: 'I beleive it is good to separate the test into functions, but in this case I think we could do it with one function that covers both cases, that way we can reuse the PSBT.' |
| Bicaru20 (contributor) | suggestion, maintenance | explicitly specify psbt_version=2 when creating the PSBT in test_psbt_unsupported_version_field in case the default ever changes | open | answered | no | 2026-10-27: 'Since the test is for PSBTv2, I think it's better to explicity add the psbt version in case the default it is ever changed.' |
| Bicaru20 (contributor) | suggestion, maintenance | explicitly specify psbt_version=2 when creating the PSBT in test_psbt_missing_version_field | open | answered | no | 2026-10-27: 'Same as before' |
| Bicaru20 (contributor) | suggestion, scope | add test coverage for decoding a PSBT with PSBT_GLOBAL_VERSION set to 1 | open | answered | no | 2026-10-29: 'there is a case that is not coverd and we could add to this test' |
Support:
- Bicaru20 (contributor) (Concept ACK, 2026-10-27): no reason given [not substantive]
Participants:
- Bicaru20 (contributor, support, 4 statements 2026-10-27 to 2026-10-29): Concept ACK; suggested combining test functions, explicitly specifying psbt_version, and adding test coverage for PSBT version 1
Files
16 lines under test/bench/ci.
- test/functional/rpc_psbt.py +16/-0
Card
The short text the ranking pass compares across PRs.
Adds functional test coverage for global PSBT version decoding in rpc_psbt.py. It verifies that PSBTs with unsupported global version numbers are rejected on decode and that omitting the version field triggers fallback parsing as PSBT version 0. The author demonstrates that mutating PSBT version checks in psbt.h previously triggered no test failures.
Data
thread read through 2026-10-29 (4 statements), head eeb4782bda
labels: Tests
Categories
RPC / REST / ZMQ
P3 · test coverage
Adds test coverage verifying that decodepsbt properly rejects unsupported PSBT_GLOBAL_VERSION values and falls back to version 0. The author demonstrated that modifying PSBT_HIGHEST_VERSION triggered zero existing test failures, making this worthwhile coverage against RPC decode regressions.
Membership: Adds functional tests for the decodepsbt RPC method in test/functional/rpc_psbt.py.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0