Skip to content

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

Open
rkrux wants to merge 7 commits into
bitcoin:masterfrom
rkrux:deprecaterbf
Open

rkrux wants to merge 7 commits into
bitcoin:masterfrom
rkrux:deprecaterbf

Conversation

@rkrux

@rkrux rkrux commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #32661.

The replaceable argument in several wallet RPC requests
has been marked deprecated and for now users have the
option to use this argument via the -deprecatedrpc=bip125
startup option. Affected RPCs are createrawtransaction,
fundrawtransaction, createpsbt, walletcreatefundedpsbt,
send, sendtoaddress, sendmany, sendall, bumpfee,
and psbtbumpfee.

This builds upon the existing issue of removing the option for
users to signal replaceability because fullrbf is the default policy
and prevalent in the network (since bitcoin core v28 was released
in late 2024) that makes every transaction replaceable by default,
making this user option unnecessary.

@DrahtBot

DrahtBot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK polespinasa, w0xlt
Stale ACK achow101

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36990 (test: replace hard-coded RPC error codes by l0rinc)
  • #36257 (qa: assert_equal -> assert_true/assert_false by hodlinator)
  • #36114 (wallet: harden external signer psbt processing, revamp mock by Sjors)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • doc/release-notes-35433.md: Effected RPCs → Affected RPCs [wrong word: “affected” means the RPCs impacted by the change]

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • test/functional/wallet_balance.py: node.createrawtransaction(inputs, outputs, 0)
  • test/functional/rpc_psbt.py: walletcreatefundedpsbt(..., block_height+2, {"add_inputs": True}, False)
  • test/functional/rpc_psbt.py: walletcreatefundedpsbt(..., block_height, {"add_inputs": True}, True)
  • test/functional/wallet_signer.py: walletcreatefundedpsbt([], {dest:0.5}, 0, {}, True)

2026-11-23 08:46:47

@rkrux

rkrux commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

I will add test case for bumpfee and psbtbumpfee along with release note.

@rkrux rkrux changed the title Deprecaterbf wallet: deprecate replaceable argument from transaction ( and psbt) creation (and modification) RPCs Jun 1, 2026
@DrahtBot DrahtBot added the Wallet label Jun 1, 2026
@rkrux rkrux changed the title wallet: deprecate replaceable argument from transaction ( and psbt) creation (and modification) RPCs wallet: deprecate replaceable argument from transaction (and psbt) creation (and modification) RPCs Jun 1, 2026
@DrahtBot

DrahtBot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/26763283466/job/78882570147
LLM reason (✨ experimental): CI failed because the Python lint (ruff) reported an error—an unused import MAX_BIP125_RBF_SEQUENCE in test/functional/rpc_psbt.py.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@rkrux

rkrux commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

I will add test case for bumpfee and psbtbumpfee along with release note.

Done now.

@rkrux

rkrux commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Updated the PR to not depend on #35405, removed the two commit from that PR.

@rkrux

rkrux commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Pushed the last two testing related commits of PR #35442 here as per this review comment #35442 (comment).

Edit: Reverted as they are dependent on #35405 as well slightly.

@polespinasa

polespinasa commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Ideally deprecated RPC testing should be added to test file rpc_reprecated.py

This has been discussed before here: #35381 (review)

Oh right, I knew we discussed this before but I couldn't find the conversation.

Anyway I think you should be able to move this block adding the self.is_wallet_compiled, the tests passes locally for me compiling without a wallet:

        if self.is_wallet_compiled():
            self.log.info("Test without -deprecatedrpc=bip125")
            DEPRECATED_RPC_MESSAGE = "Deprecated \"replaceable\" argument passed. Run with -deprecatedrpc=bip125 startup option to use it."
            node = self.nodes[0]
            node.createwallet("deprecated_optinrbf")
            wallet = node.get_wallet_rpc("deprecated_optinrbf")
            self.generatetoaddress(node, nblocks=101, address=wallet.getnewaddress(), sync_fun=self.no_op)

            # helper functions
            def get_largest_unspent():
              return max(wallet.listunspent(), key=lambda unspent: unspent["amount"])

            def check_rbf_signalling(inputs, rbf_signalling=True):
              for input in inputs:
                if rbf_signalling:
                  assert_equal(input["sequence"], MAX_BIP125_RBF_SEQUENCE)
                else:
                  assert_not_equal(input["sequence"], MAX_BIP125_RBF_SEQUENCE)

            def assert_rbf_signalling_in_wallet_tx(tx_id):
              wallet_mempool_tx = wallet.gettransaction(tx_id)
              assert_equal("bip125-replaceable" in wallet_mempool_tx, True)
              assert_equal(wallet_mempool_tx["bip125-replaceable"], "yes")

            send_rpcs = [
              lambda: wallet.send(outputs=[{wallet.getnewaddress(): 1}], options={"replaceable": True})["txid"],
              lambda: wallet.sendtoaddress(address=wallet.getnewaddress(), amount=1, replaceable=True),
              lambda: wallet.sendmany(amounts={wallet.getnewaddress():1, wallet.getnewaddress():1}, replaceable=True),
              lambda: wallet.sendall(recipients=[wallet.getnewaddress()], replaceable=True)["txid"],
            ]
    
            # check for errors regarding usage of deprecated arguments without -deprecatedrpc startup option
            unspent = get_largest_unspent()
            assert_raises_rpc_error(-32, DEPRECATED_RPC_MESSAGE, wallet.createrawtransaction, inputs=[unspent], outputs=[{wallet.getnewaddress(): 1}], replaceable=True)
            assert_raises_rpc_error(-32, DEPRECATED_RPC_MESSAGE, wallet.createpsbt, inputs=[unspent], outputs=[{wallet.getnewaddress(): 1}], replaceable=True)
            for rpc in send_rpcs:
              try:
                rpc()
              except JSONRPCException as e:
                assert_equal(e.error["code"], -32)
                assert_equal(e.error["message"], DEPRECATED_RPC_MESSAGE)
              except Exception as e:
                raise AssertionError("Unexpected exception raised: " + type(e).__name__)

Another nit on the tests, #35433 (comment) still apply

@polespinasa polespinasa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed 3d06f13

Comment thread test/functional/wallet_bumpfee.py Resolved
Comment thread src/wallet/rpc/spend.cpp Resolved
Comment thread test/functional/wallet_sendall.py Resolved
Comment thread test/functional/rpc_psbt.py Resolved
Comment thread doc/release-notes-34917.md Resolved
@sedited

sedited commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Ping for rebase @rkrux.

@achow101

achow101 commented Nov 4, 2026

Copy link
Copy Markdown
Member

ACK dc62ab2

Comment thread doc/release-notes-35433.md Resolved
@DrahtBot
DrahtBot requested a review from polespinasa November 12, 2026 12:31
@fanquake fanquake added this to the 33.0 milestone Nov 23, 2026
…spend.cpp

This comment is an explanation for why such a value was chosen in
the now outdated BIP-125 opt-in signalling flow, so moving it to where
this constant is defined seems more appropriate instead of it being present
deep in a nested transaction creation flow in the wallet.

It also serves as a documentation for this constant now, which is helpful.
@rkrux

rkrux commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased over master to remove usage of replaceable argument added in the recently merged PR #36040 that was causing test failures.

@polespinasa polespinasa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/wallet/rpc/spend.cpp
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used")), RPCArgOptions{.also_positional = true}},
{
"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Marks this transaction as BIP125-replaceable.\n"
"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "(DEPRECATED) Marks this transaction as BIP125-replaceable.\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in 2abeff7 wallet, rpc: deprecate replaceable in sendall, walletcreatefundedpsbt, fundrawtransaction, send

This should mention the -deprecatedrpc command that re-enables this feature. See the developer guidelines

@DrahtBot
DrahtBot requested a review from achow101 November 23, 2026 11:21

@w0xlt w0xlt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cb12ebf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wallet, node: Redundant opt-in RBF wallet config and RPC parameters

9 participants