Review report

core: PR #36367

3 suggestions

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

Optional improvements

Link

[suggestion] · RPC help omits the new fee-delta limits

The prioritisetransaction help describes addition and subtraction without explaining the new accepted range or that successful calls can apply less than the requested adjustment.

Location: src/rpc/mining.cpp:564 (head).

Details and suggested fix

The RPC now rejects individual deltas outside ±MAX_MONEY and clamps the accumulated delta to those bounds, but its help still describes only addition or subtraction. It returns true even when the cap discards part of a request. For example, starting from zero, two +MAX_MONEY calls followed by -MAX_MONEY now leave zero rather than MAX_MONEY. Document the inclusive range of -2,100,000,000,000,000 through +2,100,000,000,000,000 satoshis and the cumulative cap in the fee_delta description. Also point callers to getprioritisedtransactions to read back the effective delta.


Link

[suggestion] · The fee-delta test never reaches the cumulative lower bound

The negative calls only cancel positive deltas, so removing the -MAX_MONEY floor would leave the new assertions unaffected.

Location: test/functional/mining_prioritisetransaction.py:114 (head).

Details and suggested fix

Repeated +MAX_MONEY calls exercise upper saturation, but the final -MAX_MONEY call on each transaction only returns its delta to zero. Rejecting -MAX_MONEY-1 at the RPC boundary does not exercise the cumulative lower clamp or modified-fee accounting at that bound. Add repeated -MAX_MONEY calls to an in-mempool transaction starting from zero. Check that its stored delta stops at -MAX_MONEY and its modified fee equals the base fee minus Decimal(MAX_MONEY) / COIN. Then apply +MAX_MONEY and assert that the delta is cleared and the modified fee returns to the base fee. This covers both lower saturation and accounting when moving away from the floor.


Link

[suggestion] · Persisted int64-extreme deltas lack boundary assertions

The new regression test rejects oversized RPC inputs before mempool arithmetic, leaving the clamp's handling of raw int64 deltas from mempool.dat without deterministic boundary coverage.

Location: test/functional/mining_prioritisetransaction.py:98 (head).

Details and suggested fix

LoadMempool passes raw int64 deltas directly to PrioritiseTransaction for transaction records and trailing mapDeltas entries, bypassing the RPC range check. importmempool reaches this path when apply_fee_delta_priority is true. The new test therefore cannot distinguish SaturatingAdd from plain addition: every input that reaches the method is bounded by MAX_MONEY. The validation_load_mempool fuzz target also has no assertions on the resulting deltas. Add a focused CTxMemPool unit test that supplies INT64_MAX and INT64_MIN, both from zero and on top of same-sign existing deltas, before and after the transaction enters the mempool. Assert that the stored delta remains within ±MAX_MONEY and that the modified fee equals the base fee plus the stored delta.


Coverage details

Earlier concerns

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