Repository navigation
Add independent P2MR PQC witness vector tests - #30
Conversation
PR ReviewFindings
Consensus Impact
The PR is test-only, but it hardens coverage for P2MR/PQC Review ScopeReviewed issue #20, PR body, commit list, changed files, full diff, fixture registration, JSON vector contents, Deep Checks PerformedTraced the fixture from JSON parsing through witness extraction, Issue FitThis mostly matches #20: it adds a fixed externally described P2MR/PQC witness vector, positive interpreter-level verification, and near-miss tests for mutated signature, wrong domain, bad hashtype suffixes, committed-leaf mismatch, and wrong pubkey. The finding above is the remaining issue-fit gap for the wrong-domain vector. qbit-Specific ChecksChecked P2MR/PQC domain separation, single-leaf commitment construction, witness stack shape, default sighash handling, expected Validation ReviewedCI focused unit suites built Residual RiskI did not regenerate the fixture from the stated libbitcoinpqc seed/Python generator, and I did not rerun the full unit suite locally. Pending CI still needs to finish. |
5287f54 to
955496a
Compare
* test: add independent P2MR PQC witness vector * test: verify P2MR wrong-domain vector signature * Fix AuxPoW legacy payload disambiguation
* Accept legacy AuxPoW RPC payloads (#23) * Prevent AuxPoW signalling in permissionless GBT (#22) * wallet: defer P2MR getnewaddress keypool refill (#13) * wallet: defer P2MR getnewaddress keypool refill * wallet: bound internal P2MR keypool refill * wallet: align P2MR top-up lock ordering * wallet: schedule raw change P2MR refills * wallet: report paused P2MR refills as failed * wallet: log inline P2MR refill failures * ci: fix BuildKit helper lint * Document AuxPoW commitment order fields (#35) * Restrict explicit wallet output types on P2MR-only chains (#25) * Restrict explicit wallet output types * test: run BECH32 wallet suites on unrestricted regtest * fuzz: run wallet transaction target on unrestricted regtest * Fix BuildKit helper lint * Report missing wallet output managers accurately * Allow managerless wallets with default output options * test: add independent P2MR and CTV script vectors (#29) * Add independent P2MR PQC witness vector tests (#30) * test: add independent P2MR PQC witness vector * test: verify P2MR wrong-domain vector signature * Fix AuxPoW legacy payload disambiguation * wallet: avoid MarkUnused P2MR full top-up (#31) * wallet: avoid MarkUnused P2MR full top-up * wallet: avoid MarkUnused lock inversion * wallet: preserve P2MR recovery lookahead * Split P2MR wallet unit tests (#52) * Remove unused P2MR wallet test import (#58) * Shard P2MR wallet unit tests (#60) * Add independent CHECKDATASIGPQC vector tests (#38) * test: add P2MR data-hash proof fixtures (#43) * test: add independent P2MR commitment vectors (#47) * Reject invalid raw funding outputs (#37) * Validate witness-pruned assumevalid before wipe (#59) * Add independent CHECKDATASIGADDPQC vector tests (#42) * qt: recommend wallet encryption by default (#62) * Verify libbitcoinpqc tagged subtree imports (#41) * ci: verify libbitcoinpqc tagged subtree imports * ci: handle peeled libbitcoinpqc tag refs * ci: peel libbitcoinpqc tag objects before compare * ci: pass auth to libbitcoinpqc verifier * ci: pin libbitcoinpqc verifier inputs * ci: verify libbitcoinpqc import tree * Add P2MR PQC annex sighash vectors (#54) * Add P2MR PQC annex sighash vectors * Guard annex mutation vector test * Add P2MR data signature support to Qt Sign/Verify (#63) * qt: add P2MR data signature dialog * qt: support text data in P2MR signatures * qt: align P2MR proof verification with RPC * test: add P2MR CHECKSIGPQC sighash vectors (#55) * Add rawmr future-leaf coverage (#64) * test: cover P2MR SIGHASH_SINGLE missing outputs (#57) * test: add P2MR PQC codeseparator vectors (#56) * Fix PQC data-hash counter accounting (#46) * Fix PQC data-hash counter accounting * Fix PQC data-hash leaf error priority * Report final PQC slot failures as exhausted * doc: add v0.1.2-testnet4 release notes * build: bump version to v0.1.2-testnet4
Summary
Closes #20.
Validation
cmake --build build --target test_bitcoin -j2build/bin/test_qbit --run_test=script_p2mr_tests/p2mr_checksigpqc_accepts_independent_witness_vector --catch_system_error=no --log_level=messagebuild/bin/test_qbit --run_test=script_p2mr_tests/p2mr_checksigpqc_rejects_independent_witness_vector_near_misses --catch_system_error=no --log_level=messagebuild/bin/test_qbit --run_test=script_p2mr_tests --catch_system_error=no --log_level=messagepassed; the local environment printed repeated file-descriptor warnings, but Boost reported no test errors.commit_msg,tabs_whitespace,trailing_whitespace,trailing_newline.Full Docker lint was also attempted. It failed on existing
0.1.xfiles outside this PR (.github/actions/configure-docker/buildkit-config.shandci/checks/test_configure_docker_buildkit_config.py) for shebang permission and shell-locale checks, so that failure is unrelated to this diff.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Touches script verification (P2MR/PQC) and AuxPoW decode used by submitauxblock; changes are mostly tests plus a narrow decode disambiguation rule.
Overview
Adds externally generated P2MR/PQC witness coverage so default-sighash single-key spends can be checked without qbit’s own wallet or sighash helpers.
A new JSON fixture (
p2mr_pqc_witness_vectors.json) is wired intotest_bitcoin. script_p2mr_tests loads it and adds a passing case that checks HASHER_P2MR_SIGHASH (not Taproot’s domain), PQC verify, and full VerifyScript, plus a near-miss suite that flips signatures, wrong-domain sigs, bad hashtype suffixes, leaf/control tweaks, and pubkey/script mismatches.AuxPoW RPC decoding in
DecodeHexAuxPownow tries canonical and legacy layouts together; when both parse, it picks legacy if only the legacy coinbase merkle branch matches the parent root.AuxPowCoinbaseBranchMatchesParentimplements that check, with an auxpow_tests case for ambiguous hex.Reviewed by Cursor Bugbot for commit 955496a. Bugbot is set up for automated code reviews on this repo. Configure here.