Review report

core: PR #35286

4 suggestions

Earlier concerns neither republished nor resolved: 1 minor finding. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · The CPFP preflight is outside package validation

The preflight can report the wrong rejection reason when a parent exceeds the caller’s maxfeerate, and package test mode can report the child as missing inputs when the parent passes alone.

Location: src/rpc/mempool.cpp:1716 (head).

Details and suggested fix

The rule rejecting a package whose parent passes mempool acceptance on its own is enforced only by the RPC preflight; ProcessNewPackage(test_package_feerates=true) does not enforce it. In test mode, AcceptPackage can record a parent that passes alone as VALID without adding it, then evaluate the child without the parent’s outputs and report missing inputs. The header does not document this precondition.

The preflight also uses SingleAccept arguments, which do not apply client_maxfeerate. A valid parent above the caller’s maxfeerate therefore gets the “does not require CPFP” error, while submitpackage reports “max feerate exceeded.” Both reject the package, but the reason differs, and the parent is validated twice.

Enforce the parent-must-need-CPFP rule in AcceptPackage when args.m_test_accept && args.m_package_feerates, returning a package-level policy error that the RPC maps to its existing error, and remove the preflight. The per-transaction step already uses SingleInPackageAccept with client_maxfeerate, and dedup handles a parent already in the mempool.


Link

[suggestion] · The new test-accept package mode lacks fuzz and unit coverage

Parity with submitpackage and the no-mutation guarantee are not checked by unit or fuzz tests for this mode.

Location: src/validation.cpp:1846 (head).

Details and suggested fix

With test_package_feerates=true, test-accept routes through AcceptPackage with package feerates. No unit or fuzz target exercises this combination: tx_package_eval, tx_pool, and txpackage_tests call the five-argument ProcessNewPackage, while the RPC fuzz target cannot build valid packages. Two divergences from submitpackage in this mode were fixed in the second commit: sibling eviction and partial success reported after a script failure. Further differences may remain.

In tx_package_eval, add a test-accept call with test_package_feerates=true before the real ProcessNewPackage(test_accept=false) call. Assert that mempool size and GetSequence() remain unchanged, then compare per-wtxid result types and reject reasons with real submission. Skip the known exceptions: a parent that passes on its own and “mempool full” evictions.


Link

[suggestion] · The parameter documentation contradicts an assertion

A future caller following the documented instruction to ignore test_package_feerates when test_accept is false would abort the node; no current caller does this.

Location: src/validation.h:283 (head).

Details and suggested fix

The parameter is documented as honored only when test_accept is true and ignored otherwise, but ProcessNewPackage asserts !test_package_feerates || test_accept. Assertions are enabled in Bitcoin Core builds, so passing test_accept=false, test_package_feerates=true aborts the process instead of ignoring the flag. Document this combination as a precondition violation, or change the code to ignore the flag as documented.


Link

[suggestion] · The constructor comment contradicts the sibling-eviction invariant

The comment says sibling eviction may occur with package feerates, but the following assertions and constructor arguments prohibit it.

Location: src/validation.cpp:574 (head).

Details and suggested fix

The comment says, “Sibling eviction may still trigger in specific testing path,” but the following Assume(!m_allow_sibling_eviction) applies whenever m_package_feerates is set. PackageChildWithParents passes allow_sibling_eviction=false, including in test mode. Sibling eviction occurs only in the per-transaction SingleInPackageAccept step, which uses package_feerates=false. The comment could mislead a reader into changing the assertion. Restore the base wording, “It also means sibling eviction is not permitted,” or state the actual invariant.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.