#36626 test: check `PSBT_GLOBAL_VERSION` validation on decode

ReviewabilityReviewsAgreementSize
#36626 nebula-21 test: check `PSBT_GLOBAL_VERSION` validation on decodeReady0Positive0 + 16 tests
  • Catch regressions in PSBT decoding by testing unsupported version numbers and missing version fallbacks
  • Ensure decodepsbt rejects invalid global versions and correctly defaults omitted versions to version 0
  • Ready to review as nothing known would invalidate a review now
  • Concept approval without stated reasons (Bicaru20)
  • Suggested combining tests, explicitly setting psbt_version=2, and adding coverage for version 1 (Bicaru20)
  • 0 lines added or modified outside tests
  • 16 lines added or modified in tests
  • 0 lines removed in total
  • 1 files, 1 commits
RPC / REST / ZMQ#48 of 55
P3 · test coverage
  • P3 because it adds test coverage verifying decodepsbt rejects unsupported global PSBT versions
  • Modifying version limits or fallback checks previously triggered zero existing test failures
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:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
Bicaru20 (contributor)suggestion, approachcombine both test cases into one function to reuse the PSBTopenansweredno2026-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, maintenanceexplicitly specify psbt_version=2 when creating the PSBT in test_psbt_unsupported_version_field in case the default ever changesopenansweredno2026-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, maintenanceexplicitly specify psbt_version=2 when creating the PSBT in test_psbt_missing_version_fieldopenansweredno2026-10-27: 'Same as before'
Bicaru20 (contributor)suggestion, scopeadd test coverage for decoding a PSBT with PSBT_GLOBAL_VERSION set to 1openansweredno2026-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

dossier JSON · extract JSON · model ledger, generated 2026-10-30T01:14, confidence high, input hash 8b36114d4678848b
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