Repository navigation
Reject non-P2MR raw funding outputs - #37
Conversation
4d280fb to
ba0ae99
Compare
PR ReviewFindingsNo blocking findings from this review pass. Consensus Impact
This does not change consensus validation itself, but it moves restricted-output consensus allowlist checks into the wallet RPC funding path for Review ScopeReviewed backing issue #33, the PR body, commit Deep Checks PerformedTraced the raw transaction path from Issue FitThe PR matches issue #33’s requested behavior: prebuilt legacy, P2SH-SegWit, v0, and v1 raw recipient outputs are rejected before wallet funding; P2MR, OP_RETURN, and PayToAnchor raw outputs remain accepted; and the implementation reuses the restricted-output consensus helper rather than duplicating a wallet-only allowlist. I did not see scope drift outside qbit-Specific ChecksFocused on P2MR/restricted-output wallet safety and RPC behavior. AuxPoW, ASERT, PHOTON, release signing, and P2P surfaces are not touched. The change keeps consensus validation unchanged and aligns wallet preflight behavior with the existing restricted-output consensus checks. Validation ReviewedAuthor-reported validation includes Residual RiskI did not locally rerun the full |
ba0ae99 to
5464e55
Compare
5464e55 to
d6e5c65
Compare
d6e5c65 to
f394576
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
Fixes #33
Summary
fundrawtransactionoutputs that are not allowed in restricted-output mode before wallet fundingRoot Cause
On P2MR-only chains,
fundrawtransactionconverted decoded raw transaction outputs intoCRecipients and clearedtx.voutwithout validating the original recipient scripts against restricted-output mode. Wallet funding then rebuilt those non-P2MR recipient scripts and only failed later at mempool validation.Tests
python3 -m py_compile test/functional/wallet_p2mr.pygit diff --checkcmake --build build_issue33 --target qbitd qbit-cli -j 10ulimit -n 256; build_issue33/test/functional/test_runner.py wallet_p2mr.pyDOCKER_BUILDKIT=1 docker run --rm -v "$(pwd)":/bitcoin -v /Users/miller/conductor/repos/qbit-v1/.git:/Users/miller/conductor/repos/qbit-v1/.git bitcoin-linterNeed help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Changes wallet transaction-building policy on P2MR-only chains; scope is limited to
fundrawtransaction’s new pre-funding check, not broader auth or consensus code.Overview
fundrawtransactionon restricted-output chains now validates the decoded raw transaction’svoutscripts before wallet funding, instead of only failing later at mempool acceptance.Wallet RPC funding adds
RejectRestrictedOutputModeDisallowedOutput, which keeps the existing reserved-witness rejection and, whenfRestrictedOutputModeis active, rejects outputs that failConsensus::IsRestrictedOutputModeConsensusOutputat the next block height. The RPCFundTransactionhelper takes an optionaloriginal_outputspointer;fundrawtransactionsnapshotstx.vout, clears it for the existing recipient path, and passes that snapshot so prebuilt recipient scripts are checked even though funding no longer readstx.vout.Functional coverage in
wallet_p2mr.pyasserts RPC errors for legacy, P2SH-SegWit, v0, and v1 raw recipients, and successful funding for P2MR, OP_RETURN, and PayToAnchor prebuilt outputs.Reviewed by Cursor Bugbot for commit f394576. Bugbot is set up for automated code reviews on this repo. Configure here.