#35286 rpc: add testsubmitpackage for 1p1c test submissions
| Reviewability | Reviews | Agreement | Size | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| #35286 rpc: add testsubmitpackage for 1p1c test submissions | Ready | 0 | Strong | 287 + 716 tests | ||||||
|
|
|
|
| ||||||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | ||||||||||
Goal
Adds the testsubmitpackage RPC method to dry-run validation of a single transaction or a 1-parent-1-child (1p1c) package without mutating the mempool. Updates mempool validation internals to support package feerate aggregation and RBF replacement detection during dry-run validation. Shared JSON serialization logic between submitpackage and testsubmitpackage is unified into a common helper.
Problem: Wallets constructing CPFP fee-bumping packages or evaluating package RBF have no way to pre-flight test package acceptance without actually modifying the mempool. The testmempoolaccept RPC does not calculate aggregate package feerates or sibling eviction across unconfirmed transactions, while submitpackage immediately inserts valid transactions into the mempool.
Evidence of importance:
- PR description: 'Intended as a wallet pre-flight check for CPFP fee-bumping packages. Enables rbf and sibling eviction evaluation, just like submitpackage.'
- PR description: 'This is a partial addressing of https://github.com/bitcoin/bitcoin/issues/32160, hopefully addressing most of the missing functionality people are requesting.'
Scope: The PR intentionally limits multi-transaction testing to strict 1p1c bundles where the parent cannot enter the mempool on its own, avoiding the need for complex state unrolling of accepted subpackages.
Risk of a mistake: medium (mempool_policy, rpc_api, validation). Modifies mempool acceptance logic in validation.cpp, where logic errors or violated assertions during dry-run package evaluation could cause node crashes or return misleading fee and replacement results to wallets.
Changed since the previous assessment: Added a commit ('validation: match submission in package test-accept') that aligns test acceptance with submitpackage by disallowing sibling eviction in the multi-transaction acceptance path and waiting to report transaction success until the entire package passes script checks.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- author: response to review feedback and suggestions from ismaelsadeeq, dergoegge, and andrewtoth 2026-10-21
Agreement
Strong
substantive support, no open objection (ismaelsadeeq)
Thread notes: Added andrewtoth's suggestion to split out the internal dry-run of ProcessNewPackage if there is no demand for the RPC.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| ismaelsadeeq (member) | suggestion, maintenance | deduplicate shared code, args collection, help text, and logic between testsubmitpackage and submitpackage in rpc/mempool.cpp | open | answered | no | 2026-05-29: 'there are still opportunities to dedup things in `rpc/mempool.cpp` shared code of `testsubmitpackage` and `submitpackage`' |
| ismaelsadeeq (member) | question, approach | why allow_sibling_eviction is tied to test_accept | open | answered | no | 2026-05-29: 'why is `allow_sibling_eviction` tied to `test_accept`?' |
| ismaelsadeeq (member) | suggestion, maintenance | deduplicate the loop copying staged removals into replaced transactions across both test_accept sites with a helper | open | answered | no | 2026-05-29: 'The loop that copies staged removals into replaced transactions is duplicated at both `test_accept` sites. A helper like `CollectStagedRemovals() `would dedup things' |
| ismaelsadeeq (member) | suggestion, maintenance | make changeset access guarding consistent across both test_accept sites | open | answered | no | 2026-05-29: 'The two sites guard the changeset access inconsistently' |
| ismaelsadeeq (member) | suggestion, maintenance | split the individual-evaluation dry-run path out of ProcessNewPackage into its own function | open | answered | no | 2026-05-29: 'I think this is a good time to split the individual-evaluation dry-run path out of ProcessNewPackage into its own function.' |
| ismaelsadeeq (member) | suggestion, maintenance | fold test_no_mempool_mutation_on_success into test_basic_1p1c_cpfp | open | answered | no | 2026-05-29: 'Can we fold `test_no_mempool_mutation_on_success` into `test_basic_1p1c_cpfp`' |
| ismaelsadeeq (member) | suggestion, maintenance | consider using unit tests or an evict RPC instead of generating blocks or restarting nodes to evict mempool transactions in tests | open | answered | no | 2026-05-29: 'It seems like a hack to always generate a block when we want to remove a transaction or restart the node' |
| ajtowns (member) | question, scope | whether it is possible to test transactions with nSequence relative locktimes spending out-of-mempool transactions | answered · author pointed to issue 32142 | answered | yes | 2026-06-16: 'Would it be possible to somehow test txs with nSequence relative locktimes spending currently out-of-mempool txs?' Status from: 2026-06-17: instagibbs: '@ajtowns https://github.com/bitcoin/bitcoin/issues/32142 I think?' |
| dergoegge (member) | suggestion, usefulness | have users who want this RPC state so explicitly to help decide whether to maintain it | open | answered | no | 2026-07-01: 'it'd be helpful for users that want this to say so explicitly here, to help us decide if we should maintain this.' |
| andrewtoth (member) | suggestion, scope | split out just the internal dry-run of ProcessNewPackage into its own change if there is not yet indication of buy-in for the RPC | open | answered | no | 2026-10-21: 'If there is not yet indication of buy-in for the RPC, could we instead split out just the internal dry-run of `ProcessNewPackage` into its own change?' |
Support:
- ismaelsadeeq (member) (Concept ACK, 2026-05-29): users normally test run submissions to see whether they will get through; so having `testsubmitpackage` rpc to test run 1p1c package is very useful.
- w0xlt (contributor) (Concept ACK, 2026-06-24): (no reason given) [not substantive]
Participants:
- ismaelsadeeq (member, support, 9 statements 2026-05-29 to 2026-06-16): Concept ACK citing value of pre-flight testing; suggested code deduplication and refactoring
- ajtowns (member, question, 1 statements 2026-06-16 to 2026-06-16): asked whether testing out-of-mempool relative locktimes could be supported
- w0xlt (contributor, support, 1 statements 2026-06-24 to 2026-06-24): Concept ACK without elaboration
- dergoegge (member, neutral, 1 statements 2026-07-01 to 2026-07-01): suggested confirming downstream demand before maintaining the RPC, and asked for an update
- andrewtoth (member, neutral, 1 statements 2026-10-21 to 2026-10-21): noted relevance for private broadcast, questioned RPC demand, and suggested splitting out the internal dry-run
Files
716 lines under test/bench/ci.
- test/functional/rpc_testsubmitpackage.py +714/-0
- src/rpc/mempool.cpp +220/-52
- src/validation.cpp +59/-21
- src/validation.h +5/-1
- src/rpc/client.cpp +3/-0
- src/test/fuzz/rpc.cpp +1/-0
- test/functional/test_runner.py +1/-0
Card
The short text the ranking pass compares across PRs.
Adds the testsubmitpackage RPC command to test-validate a single transaction or a 1-parent-1-child package without mutating mempool state. Wallets constructing CPFP fee-bumps or testing replacement rules currently cannot dry-run package validation with aggregate package feerates and sibling eviction without actually submitting transactions to the mempool. To avoid complex state unrolling, it restricts packages to strict two-transaction child-with-parent topologies where the parent does not pass mempool acceptance on its own. The author notes this partially addresses issue #32160 by providing the package pre-flight testing functionality users requested.
Data
thread read through 2026-10-21 (16 statements), head 98cdef3526
labels: RPC/REST/ZMQ · draft
Categories
Mempool and policy
P3 · new feature
Enables dry-run validation of 1p1c package acceptance and RBF evaluation without mutating mempool state. While worthwhile for package validation logic and wallet tooling, it does not alter core mempool policy, DoS limits, or relay rules.
Membership: Modifies mempool acceptance and package validation internals in src/validation.cpp to support package feerate aggregation and RBF replacement detection during dry-run validation.
Factors: security/stability 0, bug 0, performance 0, user value 2, leverage 1
RPC / REST / ZMQ
P2 · user request
Adds the requested testsubmitpackage RPC method to address an established gap where wallets could not pre-flight test CPFP packages or package RBF without mutating the mempool. The PR directly addresses user demand tracked in #32160, providing a significant missing capability for wallet developers.
Membership: Labeled RPC/REST/ZMQ and implements the new testsubmitpackage JSON-RPC method in src/rpc/mempool.cpp.
Factors: security/stability 0, bug 0, performance 0, user value 2, leverage 1