Skip to content

Add rawmr future-leaf P2MR coverage - #64

Merged
kiwidream merged 1 commit into
0.1.xfrom
rawmr-future-leaf-coverage
Jul 2, 2026
Merged

kiwidream merged 1 commit into
0.1.xfrom
rawmr-future-leaf-coverage

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

Closes #36.

Summary

  • Add an end-to-end feature_p2mr.py regression for rawmr(<future-leaf-root>) outputs.
  • Cover public descriptor derivation, wallet funding, signer refusal for the non-0xc0 leaf, standard mempool rejection, and mandatory block acceptance for the same reveal spend.
  • Mark rawmr(<merkle root>) as an expert-only arbitrary-root descriptor in deriveaddresses help text.

Testing

  • Built locally.
  • Ran focused unit or functional tests for the changed area.
  • Ran lint or formatting checks relevant to this change.
  • Not run. Reason:

Commands run:

  • git diff --check
  • python3 -m py_compile test/functional/feature_p2mr.py
  • cmake -B build -DBUILD_GUI=OFF -DBUILD_TESTS=ON -DWITH_USDT=OFF
  • cmake --build build --target qbitd qbit-cli -j 8
  • ulimit -n 1024; test/functional/feature_p2mr.py --configfile build/test/config.ini
  • cmake --build build --target test_bitcoin -j 8
  • build/bin/test_qbit --run_test=script_p2mr_tests/p2mr_reserved_leaf_versions_policy_flag
  • build/bin/test_qbit --run_test=script_p2mr_tests/p2mr_future_even_leaf_version_uses_masked_control_byte
  • build/bin/test_qbit --run_test=psbt_p2mr_tests/psbt_p2mr_signing_refuses_reserved_leaf_versions
  • build/bin/test_qbit --run_test=psbt_p2mr_tests/psbt_p2mr_finalization_refuses_reserved_leaf_versions
  • Docker lint via ci/lint_imagefile and the bitcoin-linter image

Target Branch

  • This PR targets main or a maintainer-requested release branch such as 0.1.x.

Target is 0.1.x.

Risk / Review Notes

  • Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.
  • No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.

Notes: This is coverage plus RPC help text. It intentionally does not change consensus; future even P2MR leaf versions remain consensus-valid upgrade hooks while standard policy and current signing paths reject/refuse them.

Docs / Process Impact

Choose exactly one:

  • I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation.
  • No public docs update needed. Reason:

The deriveaddresses RPC help now identifies rawmr as an expert-only arbitrary-root descriptor whose roots cannot be proved or signed by the wallet.

libbitcoinpqc Subtree Checklist (if src/libbitcoinpqc changed)

  • Source commit is reachable from an immutable release tag in Qbit-Org/qbit-libbitcoinpqc.
  • qbit imports the tagged upstream tree directly without pruning or a curated subtree branch.
  • Subtree import/update was performed with contrib/devtools/update-libbitcoinpqc-subtree.sh.
  • test/lint/libbitcoinpqc-subtree-check.sh passes locally.
  • Any default tag change in contrib/devtools/update-libbitcoinpqc-subtree.sh is intentional and matches doc/subtrees/libbitcoinpqc.md.

Not applicable: src/libbitcoinpqc was not changed.


Note

Low Risk
Test and user-visible RPC documentation only; no consensus, wallet signing, or policy logic changes.

Overview
Adds functional regression for rawmr(<merkle root>) when the committed leaf uses a reserved/future P2MR leaf version (0x8E): deriveaddresses / validateaddress, funding via sendtoaddress, incomplete signrawtransactionwithkey for that reveal path, standard mempool rejection (Taproot version reserved for soft-fork upgrades), and consensus acceptance when the same spend is included via submitblock (new make_witness_block helper).

Updates deriveaddresses RPC help so rawmr is labeled expert-only arbitrary-root descriptors that the wallet cannot prove or sign.

Reviewed by Cursor Bugbot for commit b61ed04. Bugbot is set up for automated code reviews on this repo. Configure here.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@kiwidream

Copy link
Copy Markdown
Member Author

Expediting merge for 0.1.2 release

@kiwidream
kiwidream merged commit 78ac985 into 0.1.x Jul 2, 2026
29 of 32 checks passed
djh58 pushed a commit that referenced this pull request Jul 2, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant