Repository navigation
Add independent P2MR and CTV script vectors - #29
Conversation
PR ReviewFindingsNo blocking findings from this review pass. Consensus Impact
The PR only changes Review ScopeReviewed issue #21 as the contract, PR #29 body, the full one-file diff, surrounding P2MR/CTV test helpers, Deep Checks PerformedTraced the new fixed-vector path through explicit Issue FitThe PR fits issue #21. It adds fixed-byte positive vectors for a single-leaf P2MR spend, a two-leaf P2MR branch spend, and a CTV spend, plus negative checks for mutated script bytes, leaf/control data, branch data, output program/root, CTV commitment bytes, and an qbit-Specific ChecksFor P2MR, I independently recomputed the Validation ReviewedVisible CI shows build smoke, focused unit suites, functional smoke, Windows jobs, docs, Core Checks Gate, and Cursor Bugbot passing. The focused-unit job log shows Residual RiskSome broader full-validation jobs were still pending at review time, including sanitizer/platform/lint jobs and the required merge gate. The CTV vector is fixed by a hardcoded hash and independently checked here, but the test still constructs the surrounding transaction with local test helpers rather than embedding a fully serialized transaction fixture. |
914380a to
1272af2
Compare
* 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
Why
Issue #21 identified that several P2MR and CTV script tests built expected-good spends using the same helper paths that verification relies on. These fixtures harden the script tests by anchoring accepted spends to fixed serialized bytes.
Validation
cmake --build build --target test_qbit -j 8build/bin/test_qbit --run_test=script_p2mr_testsgit diff --check HEAD~..HEAD && python3 test/lint/lint-includes.pyNote: full Docker lint was run and reaches unrelated pre-existing failures in
.github/actions/configure-docker/buildkit-config.shandci/checks/test_configure_docker_buildkit_config.pyon this base branch. This PR does not modify those files.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
Changes are limited to unit tests in
script_p2mr_tests.cpp; no consensus or production script interpreter code is modified.Overview
Hardens P2MR and CTV script-path coverage in
script_p2mr_tests.cppby anchoring good spends to fixed serialized hex instead of only deriving witnesses from the same merkle/CTV helpers used elsewhere in the suite.Adds small hex helpers (
ScriptFromHex,ParseHexBytes,Uint256FromHexBytes) and extendsBuildP2MRSpendso tests can pass an explicitscript_pubkey, not just a computed program root.New cases:
p2mr_fixed_single_leaf_vectorandp2mr_fixed_two_leaf_branch_vectorlock leaf hash, merkle root, andVerifyScriptsuccess, with negatives for wrong leaf, control byte, merkle path, and scriptPubKey.p2mr_ctv_fixed_spend_vectordoes the same for a CTV leaf (checks CTV hash, accepts spend, rejects wrong script/commitment andnLockTimemutation withSCRIPT_ERR_TEMPLATE_MISMATCH).Reviewed by Cursor Bugbot for commit 1272af2. Bugbot is set up for automated code reviews on this repo. Configure here.