#36013 test: Descriptor roundtrip and raw()/ addr() coverage

full analysis

https://github.com/bitcoin/bitcoin/pull/36013 · pablomartin4btc · +101/-8 in 1 files, 2 commits · labels: Tests

Goal

  • Verify that descriptors inferred from generated scripts preserve their original structure
  • Add test coverage for raw() and addr() descriptor invariants to catch parsing regressions

Revives the test-only commits from #24361, updating them against recent descriptor changes such as MuSig2 and BIP389 multipath. It adds DropKeys() to verify that descriptors inferred from generated scripts preserve original structure, and adds Check() coverage for valid raw() and addr() descriptors along with a NO_KEYS flag.

Problem: Descriptor inference and keyless descriptor types lacked explicit unit test coverage for structural roundtripping and solvability invariants.

Category: Wallet (#57 of 84)

P3 · test coverage

  • P3 because it adds unit test coverage for descriptor roundtripping and keyless types
  • Protects descriptor parsing and inference against regressions with no user-facing changes

Adds worthwhile test coverage for descriptor structure roundtrip inference and keyless descriptor types (raw and addr). While valuable for catching regressions in descriptor parsing and inference, it carries no immediate bug fix, fund safety, or user-facing impact.

Membership: Tests descriptor structure roundtripping via InferDescriptor() and covers raw() and addr() descriptors, which fall under wallet's key and descriptor management domain.

Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 1

Reviewability: Ready

  • Ready to review with passing CI and clean git state

The PR has passing CI and clean git state. Open feedback from jeanpablojp involves minor regex adjustments and extra assertions that would not invalidate code review of the current changes.

Author status: Silent for 21 days since addressing rustaceanrob's comment on 2026-08-27; open comments from jeanpablojp have been unanswered for 13 days.

Open concerns:

  • jeanpablojp noted that the multipath regex handling in DropKeys might be simplified, that sortedmulti_a is not handled, and suggested asserting the ToPrivateString negative contract when NO_KEYS is set.

Resolved concerns:

  • rustaceanrob suggested using BOOST_TEST_INFO_SCOPE instead of BOOST_TEST_INFO so the scope covers subsequent checks; author implemented this in 2d230d8.

Agreement: Positive

  • Positive sentiment with concept approval and verified test vectors
  • Concept approval without stated reasons (w0xlt)
  • Concept approval verified with test suite runs and address decoding (jeanpablojp)
  • Nonblocking suggestions for regex cleanup and extra negative assertions await reply (jeanpablojp)

Positive: Concept ACKs from w0xlt and jeanpablojp; minor nonblocking test expansion suggestions from jeanpablojp await response.

Reviewers have approved the concept and verified test vectors. Rustaceanrob's nit was addressed, and jeanpablojp's suggestions are nonblocking improvements.

  • w0xlt: Concept ACK
  • jeanpablojp: Concept ACK with independent address decoding and test suite run
  • rustaceanrob: requested BOOST_TEST_INFO_SCOPE, addressed by author

Review verdicts (DrahtBot): 0

Files

109 lines under test/bench/ci.

  • src/test/descriptor_tests.cpp +101/-8

Card

Revives test-only commits from #24361, updating them to test descriptor roundtripping via InferDescriptor() and adding unit test coverage for valid raw() and addr() descriptors. The changes protect against subtle regressions in descriptor parsing and script inference. Two reviewers have given Concept ACKs, and recent review suggestions focus on minor regex simplifications and additional negative test assertions.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:57, confidence high, input hash 153889b942b8179e