wallet: deprecate replaceable argument from transaction (and psbt) creation (and modification) RPCs

bitcoin/bitcoin: PR #35433

1 minor finding · 7 suggestions

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

Findings

Link

[minor] · Explicit non-signalling inputs still depend on deprecated replaceable=false

For send, sendall, and walletcreatefundedpsbt, all-non-signalling explicit inputs still need replaceable=false, now gated behind a startup flag; no current caller producing this input was found.

Location: src/wallet/rpc/spend.cpp:1485 (head).

Details and suggested fix

With the normal wallet default and neither deprecated startup option enabled, supply a nonempty input list whose explicit sequence values are all 4294967294 or 4294967295. These three RPCs pass the wallet's default true to ConstructTransaction, which rejects the inputs because none signals BIP125. Omitting replaceable already failed this way before the PR, but passing replaceable=false succeeded. The new gates reject that workaround with -32 unless -deprecatedrpc=bip125 is enabled; the alternative wallet default requires the already-deprecated -walletrbf=0. Thus the documented explicit-sequence feature remains dependent on deprecated controls, even when the caller is not asking the wallet to choose sequences.

Separate default-sequence selection from contradiction enforcement: retain the wallet default for unspecified sequences, but enforce the contradiction check only when the caller explicitly supplies replaceable. Add omitted-argument tests for these three RPCs with every input set to 4294967294, and update the sequence help accordingly.


Optional improvements

Link

[suggestion] · Fee-bump deprecation rejection is not tested

The disabled-flag phase never calls bumpfee or psbtbumpfee with replaceable, so removing their separate gate would leave the current assertions passing.

Location: test/functional/wallet_deprecated_rbf.py:60 (head).

Details and suggested fix

Both fee-bump RPCs parse replaceable through bumpfee_helper, independently of the gates exercised by the raw-creation and send rejection checks. Their current test calls run only after enabling -deprecatedrpc=bip125. Before that restart, create an ordinary unconfirmed wallet transaction without replaceable and assert that both fee-bump RPCs return -32 with DEPRECATED_RPC_MESSAGE when given replaceable=True. Confirm that transaction and refresh the funding fixture before continuing the existing cases.


Link

[suggestion] · The test no longer verifies the -walletrbf=0 default

The rewritten test checks explicit replaceable overrides and the startup warning, but loses the assertion that -walletrbf=0 affects transactions created without an override.

Location: test/functional/wallet_deprecated_rbf.py:30 (base).

Details and suggested fix

The removed sendall case omitted replaceable and asserted bip125-replaceable == "no". Every post-restart send case now supplies the argument explicitly. The remaining omitted-option fundrawtransaction call receives an already-signalling preset input whose sequence funding preserves, so it does not test the wallet default. Restore an omitted-option sendall or sendtoaddress case under -walletrbf=0, assert that it reports "no", and mine it before the later cases.


Link

[suggestion] · Wallet-added inputs lose replaceable=false coverage

The forced-funding walletcreatefundedpsbt case now tests signalling defaults, while its compatibility replacement adds no inputs and runs under -walletrbf=0, masking an ignored false override.

Location: test/functional/rpc_psbt.py:1250 (head).

Details and suggested fix

The old case spent unspent["amount"] + 1 with add_inputs=True and checked that both preset and wallet-added inputs were non-signalling. The replacement spends 1 BTC using a preset input without allowing additional selection. Moreover, added inputs use coin_control.m_signal_bip125_rbf.value_or(wallet.m_signal_rbf), so the replacement's false wallet default would hide an ignored replaceable=false override. Restore a forced-funding case in the compatibility test with -deprecatedrpc=bip125, a true wallet default and enough mature UTXOs. Request more than the preset input's amount with add_inputs=True and replaceable=False, then assert that every resulting input is non-signalling.


Link

[suggestion] · The non-signalling test accepts signalling sequences

check_rbf_signalling(..., rbf_signalling=False) excludes only 0xfffffffd, so lower sequence values that still signal BIP125 pass the assertion.

Location: test/functional/wallet_deprecated_rbf.py:43 (head).

Details and suggested fix

SignalsOptInRBF treats every sequence at or below MAX_BIP125_RBF_SEQUENCE as signalling. A false-path regression producing 0xfffffffc would therefore pass the new raw-transaction and PSBT checks despite violating their intended invariant. Use assert_greater_than(input["sequence"], MAX_BIP125_RBF_SEQUENCE) in the false branch, as the previous forced-funding PSBT assertion did.


Link

[suggestion] · The Creator fixture changes with the default instead of retaining its vector

The Creator check in the BIP 174 test-vector section now expects default signalling sequences rather than its original final-sequence transaction.

Location: test/functional/data/rpc_psbt.json:236 (head).

Details and suggested fix

Dropping replaceable=False changes both input sequences from 0xffffffff to 0xfffffffd, and this patch changes the expected PSBT to match. The signer fixtures remain independent, so this is a vector-fidelity issue rather than a signing failure. Add "sequence": 4294967295 to both Creator inputs and restore the original encoded result. AddInputs honors explicit sequences, and omitting replaceable in createpsbt leaves the contradiction check disabled, so the original fixture needs no deprecated argument.


Link

[suggestion] · replaceable help omits the required compatibility flag

RPC help marks replaceable deprecated without explaining that explicitly supplying it requires -deprecatedrpc=bip125.

Location: src/wallet/rpc/spend.cpp:460 (head).

Details and suggested fix

The changed descriptions add only (DEPRECATED), although the handlers reject the argument by default. Users discover the enabling flag from a failed call or the release note, rather than from the argument documentation. Add a short “requires -deprecatedrpc=bip125” note to each affected description, including shared FundTxDoc and CreateTxDoc. The existing encryptwallet help documents its compatibility flag this way.


Link

[suggestion] · Gate commits remove coverage before replacement tests arrive

The RPC gate commits precede their centralized tests, making reviewers trace later patches to validate rejection and compatibility behavior.

Location: test/functional/wallet_bumpfee.py:97 at 908803a8b798 (parent of 363647ebc757) (commit).

Details and suggested fix

363647ebc7570edc84d8312f9caf05ecc663fe98, relative to parent 908803a8b7987756f0a4abb4b49bb81d5a767e01, adds the fee-bump gate and removes test_rebumping_not_replaceable. 2abeff74dd93dbec19f092399f42fb5e776373ee adds funding/send gates, and 1eae0144c2a2efec9d71713dd7e0809141f6cef0 adds the positional send gates. bdee957d27895d94734d69f46e209e767394841e then adds the raw-creation gates and removes the sequence-mismatch assertion, while wallet_deprecated_rbf.py still contains only the original sendall case. The centralized rejection checks, restored mismatch assertion and explicit false/true fee-bump checks arrive in e46c20e24272dc61691b0143ebc9c66a44a17963.

Move the shared test scaffolding into 363647ebc7570edc84d8312f9caf05ecc663fe98, then distribute the relevant fragments from e46c20e24272dc61691b0143ebc9c66a44a17963 alongside each RPC's gate. Keep the disposable compatibility tests centralized, but do not move rejection assertions ahead of their gates. This would make each behavior change independently reviewable without changing the final layout. The later fee-bump checks use explicit true, so they do not restore the deleted omitted-option rebump assertion.


Coverage details

Earlier concerns

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

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

The intended destination was removal of caller-controlled BIP125 signalling, but through a staged RPC transition rather than immediate removal. Issue #32661 proposed deprecating replaceable parameters and bip125-replaceable results first, then removing them in a future release. Its rationale was that full-RBF made the signalling controls redundant.

This distinguishes temporary API compatibility from a promise that replaceable=false prevents replacement. The proposed argument deprecation belongs to the first stage; it is not itself the planned final removal.

Source 1

Avoiding abrupt upgrade failures was an explicit compatibility concern. In predecessor PR #34917, w0xlt objected that removing -walletrbf registration would stop nodes with existing configurations or service arguments from starting. The author subsequently changed the approach to deprecate the option instead.

The transition was deliberately adjusted to leave a migration window for existing callers and configurations. However, the suggestion to accept the option as a no-op was an objection's proposed remedy, not evidence that silently ignoring its value became the compatibility contract.

Source 1 · Source 2 · Source 3