feat(wallet)!: enable RBF by default on TxBuilder#1616
feat(wallet)!: enable RBF by default on TxBuilder#1616notmandatory merged 1 commit intobitcoindevkit:masterfrom
Conversation
|
Thanks for working on this @luisschwab |
|
I am inclined to think everyone with production applications will have |
ValuedMammal
left a comment
There was a problem hiding this comment.
I have a slightly different take but I think we agree on the end goal of making RBF the default for new transactions. I think the place to address it is by fixing the logic in create_tx to first check the value of requirements.csv, then allow any Sequence value passed in by the user, or else fall back to the new default ENABLE_RBF_NO_LOCKTIME (0xFFFFFFFD). To make it simple RbfValue should implement Default but maybe not strictly necessary.
Instead of disable_rbf I think we should have a method nsequence that accepts a Sequence and internally sets the rbf value. If we go this way, it's likely we'd then have to remove the error CreateTxError::RbfSequence that tries to stop you from setting an rbf value too high. Let me know what you think.
|
I added this to the 1.0.0-beta milestone since it's an breaking API change that should be done for 1.0. |
|
How's it going on this @luisschwab ? I hope we didn't derail progress too much with the previous discussion. I like that you made an effort not to change the existing API - for what it's worth, the bdk team had a talk and determined that if we're going to break the API as it relates to enabling RBF then it's better to do it now while still in beta. While the implementation here looks correct I'd prefer that we get the API sorted out rather than postpone it. After thinking more about it I want to update my suggestion to instead change the TxParams |
|
Sorry, I've been busy these last few days, but will resume work on this later today. Yes, since we're still in beta it's best to get it right rather than breaking the API later. |
|
@ValuedMammal I agree with your thinking. |
|
Sounds good, I'll update the PR taking this into consideration. |
|
@luisschwab how is progress on this so far? Do you need a hand with this? |
ff0a0a2 to
7b9a3f4
Compare
ValuedMammal
left a comment
There was a problem hiding this comment.
Try to fix the formatting checks caught by CI, and also I left a few comments that I wonder if you or anyone has an opinion on.
7b9a3f4 to
8910189
Compare
|
Forgot to rename some things. |
668bb82 to
eb1a248
Compare
|
Rebased due to 519728c |
eb1a248 to
f6fa15e
Compare
|
Re-added test and squashed commits. |
f6fa15e to
f15551b
Compare
|
This change was also recommended by external code audit: "RBF signalling should probably be turned on by default. First because it could be misinterpreted by users as "this way my transaction has significantly less chances of getting replaced" while most of the network hashrate runs with full-RBF and from 28.0 it's also the Bitcoin Core default (nodes will relay replacements for transaction not explicitly signalling RBF). It is also a fingerprint as around 70% of transactions signal RBF right now, and this number is growing." |
Description
Closes #791
This PR enables RBF by default on
TxBuilderNotes to the reviewers
Changelog notice
rbfbecomessequenceset_exact_sequence(), so the user can define an arbitrary sequence valuen_sequencenow defaults to0xFFFFFFFDChecklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
Bugfixes: