-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet, rpc: Opt in to RBF by default #25610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Concept ACK |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::optional<bool> rbf; | |
| if (!request.params[3].isNull()) { | |
| rbf = request.params[3].isTrue(); | |
| } | |
| const bool rbf{request.params[3].isNull() ? true : request.params[3].getBool()}; |
Seems complicated to use optional<bool> when it is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of the optional was done to allow for the current behavior with user defined sequence numbers to work. There is a check in ConstructTransaction that the sequence numbers match the replaceable option. It will throw an error if non-RBF sequences are used, but replaceable is true. Additionally, if replacable is either not specified or false (which is the same thing currently), setting a RBF sequence does not result in an error. If the default is just changed to true, then this check fails when the user sets non-RBF sequence numbers and does not specify replaceable at all. By using an optional we can retain the behavior that sequences are not checked against replaceable when replaceable is not specified.
|
I've closed #25602, so Concept ACK on this change to take over. |
|
concept ACK |
|
Concept ACK |
theStack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Should these changes of defaults be mentioned in the release notes?
|
concept ACK |
|
No strong feelings. Needs a clear release note, because there may still be systems that rely on RBF being off by default. Could also document that the two ways to work around the change are to set |
|
Maybe there could be a global |
|
Added some release notes. |
darosior
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 6b59d754644a5eda6ff8b4378de5320f31cc8111
Happy to reACK if you take Marco's nit.
6b59d75 to
ab3c06d
Compare
|
reACK ab3c06d |
luke-jr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
I find it strange that the RPCs don't default to the -walletrbf setting. Was there a reason for that?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ab3c06d.
I verified that the rpc wallet option replaceable is enabled by default and the wallet RBF feature is enabled by default as well.
Would it make sense to remove -walletrbf=1 in the test below, to make use of this change?
bitcoin/test/functional/rpc_psbt.py
Line 38 in ab3c06d
| ["-walletrbf=1", "-addresstype=bech32", "-changetype=bech32"], #TODO: Remove address type restrictions once taproot has psbt extensions |
glozow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| if (rbf && rawTx.vin.size() > 0 && !SignalsOptInRBF(CTransaction(rawTx))) { | ||
| if (rbf.has_value() && rbf.value() && rawTx.vin.size() > 0 && !SignalsOptInRBF(CTransaction(rawTx))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understanding this as: ConstructTransaction uses rbf to both determine sequence numbers and enforce signaling on the resulting transaction, and since default rbf is true, it will require rbf on every transaction by default, even if the inputs were entirely specified by the user. We don't want to force users to now specify rbf=false if they want to manually construct a transaction that doesn't signal rbf. So this is why we change it to a tristate to represent "tx should signal rbf" vs "rbf signal doesn't matter."
One could argue that tests should document what settings they rely on, even if the value they rely on is the default value, so it could also be left as-is, but I don't have a strong opinion. |
|
Post-merge ACK |
The GUI currently opts in to RBF by default, but RPCs do not, and
-walletrbfis default disabled. This PR makes the default in those two places to also opt in.The last time this was proposed (#9527), the primary objections were the novelty at the time, the inability to bump transactions, and the gui not having the option to disable rbf. In the 5 years since, RBF usage has steadily grown, with ~27% of txs opting in. The GUI has the option to enable/disable RBF, and is also defaulted to having it enabled. And we have the ability to bump RBF'd transactions in both the RPC and the GUI. So I think it makes sense to finally change the default to always opt in to RBF.