Skip to content

Conversation

petertodd
Copy link
Contributor

There is no technical reason to prevent this, though of course, non-signalling transactions are less likely to actually get mined. There is no consensus over the mempool, and especially in times of congestion, a higher fee transaction may be able to replace a lower fee one regardless of fee rate.

No changes to the tests were required, as this case is not tested. If -mempoolfullrbf (#25353) is enabled, the replacement is of course added to the mempool. If not, the replacement is added to the wallet and may be broadcast later.

Question: What would be the best way to force the transaction to be added to the mempool, with broadcast?

There is no technical reason to prevent this, though of course, non-signalling
transactions are less likely to actually get mined. There is no consensus over
the mempool, and especially in times of congestion, a higher fee transaction
may be able to replace a lower fee one regardless of fee rate.
@fanquake fanquake added the Wallet label Nov 4, 2022
@maflcko maflcko changed the title Allow bumpfee for txs that don't signal BIP-125 wallet: Allow bumpfee for txs that don't signal BIP-125 Nov 4, 2022
@ghost
Copy link

ghost commented Nov 4, 2022

Concept ACK

Will it be better if bumpfee RPC had an argument force false by default and if true would replace transaction irrespective of signalling?

Example: bitcoin-cli -named bumpfee txid=<txid> force=true

@achow101
Copy link
Member

achow101 commented Nov 4, 2022

In our wallet, we try not to make transactions that are unlikely to be propagated around the network. One of the ways that we do this is to make sure that a transaction is accepted into our own mempool. So we also (try to) adhere to mempool options as well. Thus this should respect the -mempoolfullrbf option.

Additionally, in line with the above principle, we generally don't make changes to the wallet involving relay policy until it is clear that a new policy has been adopted by the network. So this change should wait until -mempoolfullrbf=1 is the default and has wide enough adoption that such transactions propagate well.

This also needs tests for the specific behavior.

No changes to the tests were required, as this case is not tested

CI seems to disagree.

@kristapsk
Copy link
Contributor

kristapsk commented Nov 4, 2022

Will it be better if bumpfee RPC had an argument force false by default and if true would replace transaction irrespective of signalling?

Sounds right thing to do here to me. Also could have extra confirmation warning dialog in Qt GUI when trying to bump non-BIP125 tx.

@luke-jr
Copy link
Member

luke-jr commented Nov 4, 2022

I like the idea of an explicit force parameter. But it shouldn't be a positional argument.

@petertodd
Copy link
Contributor Author

petertodd commented Nov 4, 2022 via email

@ghost
Copy link

ghost commented Nov 4, 2022

FWIW I ran make check as the docs suggested. I haven't done Core development in years, so I was going by what the README said.

Functional test is failing and make check only works for unit tests.

https://github.com/bitcoin/bitcoin/blob/master/test/README.md

test/functional/test_runner.py to run the standard test suite (try test/functional/test_runner.py -j 60 or a similar high number to run the tests more quickly in parallel)
test/functional/.py to run an individual test file
test/functional/test_runner.py --extended to run the extended test suite
test/functional/test_runner.py --help to see the various options for running tests 

https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests

@achow101
Copy link
Member

achow101 commented Nov 4, 2022

This isn't a matter of "respect": BIP 125 isn't a contract. We have a transaction that we would like to get mined that isn't getting mined. A fee bump is improving our chances.

It's not going to help if our own mempool isn't going to accept it. If that's the case, we can't even rebroadcast it unless we somehow store that the transaction needs to be unconditionally broadcast, or we go back unconditionally broadcasting all wallet transactions. But there's potential for a privacy leak there.

The most likely scenario where this is relevant is congestion. In that scenario the minimum relay fee rate is not going to be the same on all nodes. So your fee bumped transaction genuinely has a higher chance of getting mined. Indeed, your own node may not be accepting the original to the mempool due to a higher than default relay fee.

In that scenario, we should be checking the conditions for whether a transaction can be abandoned before allowing fee bumping. In such a situation, the same effect can be achieved by abandoning the transaction and recreating it.

@petertodd
Copy link
Contributor Author

petertodd commented Nov 4, 2022 via email

@maflcko
Copy link
Member

maflcko commented Nov 5, 2022

I don't think it makes sense to show this option unless the mempool takes and broadcasts the transaction, that is -mempoolfullrbf is on. Moreover it would be good to have tests to check or describe how this interacts with -spendzeroconfchange (Spend unconfirmed change when sending transactions (default: 1))

@zndtoshi
Copy link

zndtoshi commented Nov 11, 2022

Allow bumpfee in GUI and the first time a user tries to do it change the mempool policy fullrbf to 1 as that's the implicit intention of the user. This could be an option in the settings menu as well.

@Sjors
Copy link
Member

Sjors commented Nov 11, 2022

I don't think it makes sense to show this option unless the mempool takes and broadcasts the transaction, that is -mempoolfullrbf is on.

Agreed. I have some experience with how the GUI handles transactions that don't get into our own mempool, and it's no fun. A user might have sent a transaction without RBF, not know about the -mempoolfullrbf setting and then naively call bumpfee. The result would be thoroughly confusing.

No changes to the tests were required, as this case is not tested.

All the more reason to add test coverage for it.

/test/functional/wallet_bumpfee.py", line 233, in test_nonrbf_bumpfee_fails
                                       assert_raises_rpc_error(-4, "Transaction is not BIP 125 replaceable", peer_node.bumpfee, not_rbfid)
                                     File /test/functional/test_framework/util.py", line 130, in assert_raises_rpc_error
                                       assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"

Enabling this ability for users who manually turned on mempoolfullrbf=1 is fine with me, though the documentation should warn that the transaction will only propagate to peers that also have this enabled (i.e. it's an advanced feature).

@ghost
Copy link

ghost commented Nov 18, 2022

Agreed. I have some experience with how the GUI handles transactions that don't get into our own mempool, and it's no fun. A user might have sent a transaction without RBF, not know about the -mempoolfullrbf setting and then naively call bumpfee. The result would be thoroughly confusing.

I tried this today on signet. It wasn't confusing for me because Tx1 got mined soon and Tx2 was marked as conflicted.

Enabling this ability for users who manually turned on mempoolfullrbf=1 is fine with me, though the documentation should warn that the transaction will only propagate to peers that also have this enabled (i.e. it's an advanced feature).

Agreed. Tested this as well by running 2 signet nodes and replacing Tx1 with Tx2 on one. It was relayed to the peer I added manually but not visible in explorers as they might not be running nodes with mempoolfullrbf=1. Tx1 was mined in a few minutes so I am assuming none of my automatic outbound connections and signet miners (@ajtowns and @kallewoof) are using full rbf.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 18, 2022

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

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK 1440000bytes

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@bitcoin bitcoin deleted a comment from andrew66626 Nov 19, 2022
@petertodd
Copy link
Contributor Author

I don't think it makes sense to show this option unless the mempool takes and broadcasts the transaction, that is -mempoolfullrbf is on.

So, how about I add a full-rbf flag to the Chain interface then? IIUC that's the sanest way for CWallet to get access to that setting.

@petertodd
Copy link
Contributor Author

Allow bumpfee in GUI and the first time a user tries to do it change the mempool policy fullrbf to 1 as that's the implicit intention of the user. This could be an option in the settings menu as well.

Well, at least I can mention mempoolfullrbf=1 in the error message.

@luke-jr
Copy link
Member

luke-jr commented Nov 20, 2022

Can we make the bump transaction and then abort if our own mempool rejects it?

(Further GUI UX stuff belongs in a separate PR IMO)

@petertodd
Copy link
Contributor Author

petertodd commented Nov 21, 2022 via email

@Sjors
Copy link
Member

Sjors commented Nov 23, 2022

@petertodd:

So, how about I add a full-rbf flag to the Chain interface then?

That seems a reasonable place for that.

@maflcko
Copy link
Member

maflcko commented Jan 26, 2023

Are you still working on this? (CI is red) Maybe close or mark as draft, if not.

@bitcoin bitcoin deleted a comment Jan 26, 2023
@petertodd petertodd marked this pull request as draft February 4, 2023 16:50
@petertodd
Copy link
Contributor Author

Converted to draft. Thanks for the reminder!

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 3, 2023

There hasn't been much activity lately. What is the status here?

Finding reviewers may take time. However, if the patch is no longer relevant, please close this pull request. If the author lost interest or time to work on this, please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@maflcko
Copy link
Member

maflcko commented Aug 3, 2023

Closing for now due to prolonged inactivity and red CI since this pull was opened. Please leave a comment in this thread, so that it can be reopened, once and if you start working on this again.

@maflcko maflcko closed this Aug 3, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants