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

bitcoin/bitcoin: PR #35433

9 suggestions

Earlier concerns neither republished nor resolved: 3 suggestions. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Explicit input sequences remain coupled to deprecated replaceable

The pre-existing rejection of all-non-signaling explicit inputs in send and walletcreatefundedpsbt now requires deprecated compatibility paths to bypass; no current in-tree caller producing those inputs was found.

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

Details and suggested fix

With the default wallet configuration, both RPCs pass a concrete true to ConstructTransaction when replaceable is omitted. If every supplied input has an explicit sequence above MAX_BIP125_RBF_SEQUENCE, construction rejects it as contradicting an option the caller never supplied. Previously, replaceable=false bypassed that check; it now reaches the new FundTransaction deprecation gate and requires -deprecatedrpc=bip125. The other wallet-default workaround, -walletrbf=0, is also deprecated. Only the all-non-signaling case is affected, not BIP68 relative-locktime sequences.

Separate default sequence selection for inputs without an explicit sequence from the contradiction check, and run that check only when replaceable was explicitly supplied. This preserves caller-chosen sequences without retaining the deprecated convenience option. createrawtransaction already accepts such sequences with the option omitted, so construction there followed by fundrawtransaction remains an alternative. If restricting these wallet RPCs is intentional, document that restriction before removing the compatibility paths.


Link

[suggestion] · The compatibility test no longer distinguishes wallet defaults from overrides

The rewrite removes the omitted-replaceable check for -walletrbf=0, while running every successful send under that false default also masks an ignored replaceable=False override.

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

Details and suggested fix

The previous sendall assertion checked that -walletrbf=0 produced a non-signaling transaction without an RPC override. Every successful send now supplies replaceable explicitly. Keeping the startup warning but dropping the assignment to m_signal_rbf would therefore escape these assertions. Conversely, ignoring a false override produces the expected result when the wallet default is already false. Restore one omitted-option sendall assertion after the restart, and run the explicit-false send cases on a second node or restart with only -deprecatedrpc=bip125, leaving the wallet default true. Both checks can remain in this dedicated compatibility test.


Link

[suggestion] · Default rebumping of a non-signaling transaction loses coverage

The removed test checked bumpfee without replaceable on a non-signaling original; the relocated cases explicitly request True and live in the compatibility file scheduled for deletion.

Location: test/functional/wallet_bumpfee.py:709 (base).

Details and suggested fix

test_nonrbf_bumpfee_succeeds does not fill this gap: its sendtoaddress call uses the true wallet default, so the original already signals. Keep a case in wallet_bumpfee.py that constructs and funds a wallet transaction with an explicit input sequence of 0xfffffffe, signs and broadcasts it, then calls bumpfee without replaceable and checks that the replacement inputs use MAX_BIP125_RBF_SEQUENCE. Omitting replaceable from createrawtransaction accepts that explicit sequence without deprecated flags. This keeps coverage of non-signaling replacement and its default output sequences independent of the deprecated argument's lifecycle.


Link

[suggestion] · The BIP174-labeled creator fixture is rewritten instead of preserving its sequences

The creator expectation now uses 0xfffffffd sequences, while explicit final sequences would preserve the existing reference PSBT without the deprecated replaceable argument.

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

Details and suggested fix

Removing replaceable=False makes the creator use the signaling default, so this change rewrites the expected unsigned transaction while the following signer fixture retains the original final sequences. Restore the previous result and add "sequence": 4294967295 to both creator inputs. AddInputs honors those explicit values, and omitting replaceable skips the contradiction check. That preserves the existing BIP174-labeled reference fixture without depending on the deprecated argument.


Link

[suggestion] · The fee-bump deprecation gate lacks flag-off coverage

All bumpfee and psbtbumpfee calls run after enabling -deprecatedrpc=bip125, so the test does not check rejection by their separate deprecation gate.

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

Details and suggested fix

The flag-off sends exercise the shared FundTransaction gate, but not the independent check in bumpfee_helper. Removing that check would leave the later successful fee-bump assertions unaffected. Before the restart, create an in-mempool wallet transaction and assert that both fee-bump RPCs reject an explicit replaceable with RPC_METHOD_DEPRECATED. The send loop can also use assert_raises_rpc_error(-32, DEPRECATED_RPC_MESSAGE, rpc, True) directly: its current broad exception handler catches its own missing-exception assertion and relabels it as an unexpected AssertionError.


Link

[suggestion] · Non-signaling preset and wallet-added inputs no longer get checked together

The removed walletcreatefundedpsbt case forced an additional input with replaceable=False; its compatibility replacement covers only preset inputs, missing agreement between the two sequence-assignment paths.

Location: test/functional/rpc_psbt.py:1209 (base).

Details and suggested fix

The original case used unspent["amount"] + 1, add_inputs=True, and a nonzero locktime. Preset inputs received MAX_SEQUENCE_NONFINAL through AddInputs, while funding assigned sequences to additional inputs through CreateTransactionInternal. The compatibility replacement spends only 1 BTC from a preset input and does not enable additional inputs. It therefore misses a regression where the preset input remains non-signaling but wallet-added inputs signal. Move the original forced-funding case into wallet_deprecated_rbf.py, run it with -deprecatedrpc=bip125 and the true wallet default so the false override is distinguishable, and assert that every input uses MAX_SEQUENCE_NONFINAL.


Link

[suggestion] · The non-signaling assertion also accepts signaling sequences

check_rbf_signalling(..., False) accepts values below MAX_BIP125_RBF_SEQUENCE, so some signaling constructor outputs would pass their only signaling check.

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

Details and suggested fix

assert_not_equal rejects only 0xfffffffd; a result such as 0xfffffffc still signals BIP125 but passes. The false createrawtransaction result is then overwritten, and the false createpsbt result is only decoded, so subsequent wallet-status assertions do not catch this. Use assert_greater_than(input["sequence"], MAX_BIP125_RBF_SEQUENCE) instead. It accepts both legitimate non-signaling outcomes, SEQUENCE_FINAL and MAX_SEQUENCE_NONFINAL, without accepting lower signaling values.


Link

[suggestion] · The replaceable help omits its compatibility flag

RPC help marks replaceable deprecated but does not explain that -deprecatedrpc=bip125 re-enables it during the compatibility period.

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

Details and suggested fix

The flag appears in the runtime rejection and release note, but someone reading the argument help cannot discover the startup requirement before making a failing call. doc/developer-notes.md explicitly requires deprecation help to name the re-enabling flag. Add a sentence such as “Start bitcoind with -deprecatedrpc=bip125 to continue using this argument” to the affected descriptions, including the shared FundTxDoc and CreateTxDoc descriptions.


Link

[suggestion] · Compatibility coverage arrives after the commits that relocate its callers

The RPC-gating commits remove or adjust legacy cases, but their matching compatibility cases arrive only in the later test commit, making behavior-preservation review require jumping across the series.

Location: test/functional/wallet_bumpfee.py:104 at 1413784e815c (parent of d2eff09d9c00) (commit).

Details and suggested fix

d2eff09d9c00e5533f974be671a09593066842e2, whose direct parent is 1413784e815c7c8ff947e57c0e907c37b9314d16, adds the fee-bump gate and removes test_rebumping_not_replaceable. dbe1c91eb55ef919f7a398cffe86aaa67d66df03 and fa2304b8a9a506774eb56637f7f9eb170a8e78ea add the funding/send gates and adjust affected tests. 0ea171964adb9b9ecf971947d298365a7aeeb1c0 adds the raw/PSBT gates and removes the sequence-contradiction assertion. At that commit, wallet_deprecated_rbf.py still contains only its original startup-option case; the new compatibility cases arrive in af1f7368f1a8e6417c914e86c112ecd16a5d39e6.

Move the matching subsets from that final test commit into their respective gating commits, introducing shared helpers first and keeping each rejection assertion with its gate. This preserves the per-RPC boundaries and the single disposable compatibility file, while letting each commit demonstrate its compatibility behavior. It is a review-flow improvement with no change to the final tree.


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 motivating distinction was between signaling replaceability and actually being replaceable under full-RBF policy. Issue #32661 proposed retiring the wallet option, RPC arguments, and reporting fields because full-RBF made the opt-in configuration redundant.

This explains why retaining replaceable=false temporarily concerns transaction-construction compatibility, not a promise that the network will refuse replacement. The supplied extension gates the signaling argument rather than reinstating opt-in-only replacement policy.

Source 1

The issue proposed a staged transition over multiple releases: deprecate the replaceable arguments and bip125-replaceable reporting first, then remove the arguments, fields, and remaining opt-in detection logic later. It proposed MAX-2 as the normal transaction-creation sequence.

The supplied extension follows that general shape by retaining the arguments behind -deprecatedrpc=bip125 instead of immediately deleting their handling. However, the inspected issue is a proposal, not sufficient evidence of a settled promise about every legacy argument combination or an exact removal release.

Source 1

Predecessor PR #35381 explicitly intended ordinary wallet tests to run without -deprecatedrpc=bip125 and -walletrbf, while consolidating tests of those temporary options in wallet_deprecated_rbf.py so they could be removed easily after deprecation.

This directly explains the extension’s test relocation: legacy signaling and rebumping cases move into the dedicated compatibility test, while general tests stop explicitly supplying deprecated arguments. The historical rationale is test-lifecycle separation, not abandonment of all legacy behavior during the compatibility window.

Source 1

Ralph's inferences

The supplied patch is consistent with an escape-hatch transition: explicit true and false require -deprecatedrpc=bip125, and once enabled their existing values still reach transaction construction or fee-bumping logic. Its compatibility tests also retain -walletrbf=0 as a functioning wallet default rather than treating the deprecated option as inert.

On the visible evidence, the extension preserves access to explicit non-signaling construction during deprecation while making continued use deliberate. The retrieved history supports temporary compatibility and isolated testing, but does not establish a stronger guarantee that every preexisting invocation remains accepted without the startup flag.

Source 1 · Source 2

Caller-supplied sequences and actual replacement eligibility remain distinct from the deprecated convenience argument. In the supplied patch, the raw-transaction gates precede the existing constructor call without changing its sequence handling; the sequence/replaceable contradiction test is relocated. The compatibility test also continues exercising replacement of a non-signaling transaction.

These visible changes are consistent with preserving legacy sequence semantics behind the flag and with full-RBF allowing rebumping despite replaceable=false. They do not establish an independently verified, detailed transition contract: the historical discussions defining those edge cases and the complete construction and fee-bumping implementations were not retrieved.

Source 1 · Source 2