Skip to content
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

mempool: turn on replace by fee by default #737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tynes
Copy link
Member

@tynes tynes commented Mar 25, 2019

This matches Bitcoin Core's policy of allowing transactions to be replaced via replace by fee in the mempool by default. Turning off this policy results in many transactions being rejected from the mempool. bitcoind refers to this setting as -mempoolreplacement. See bitcoind v0.12.0 release notes:

https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.12.0.md

See https://github.com/bitcoin/bitcoin/blob/master/src/validation.h#L125-L126

/** Default for -mempoolreplacement */
static const bool DEFAULT_ENABLE_REPLACEMENT = true;

Thanks to @pinheadmz for finding the code snippet in bitcoind

This matches Bitcoin Core's policy of allowing transactions
to be replaced via replace by fee in the mempool by default.
Turning off this policy results in many transactions being
rejected from the mempool. `bitcoind` refers to this setting
as `-mempoolreplacement`. See `bitcoind` v0.12.0 release notes:
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.12.0.md
@tynes tynes added docs UI isn't clear or documented guidance needed quick Can be fixed quickly, code change less than 10 lines compatibility Incompatibility with other implementations mempool Related to the mempool ready for review Ready to be reviewed labels Mar 25, 2019
@codecov-io
Copy link

Codecov Report

Merging #737 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   55.46%   55.45%   -0.02%     
==========================================
  Files         104      104              
  Lines       27724    27724              
  Branches     4749     4749              
==========================================
- Hits        15377    15373       -4     
- Misses      12347    12351       +4
Impacted Files Coverage Δ
lib/mempool/mempool.js 47.64% <100%> (-0.09%) ⬇️
lib/primitives/tx.js 82.95% <0%> (-0.48%) ⬇️
lib/coins/compress.js 56.32% <0%> (+1.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b2e53d...2f69a3d. Read the comment docs.

@pinheadmz
Copy link
Member

utACK - I think electrum wallet also does RBF by default. And since all CSV transactions are RBF, we are rejecting a good amount of traffic.

@tynes tynes removed the ready for review Ready to be reviewed label Mar 25, 2019
@tynes
Copy link
Member Author

tynes commented Mar 25, 2019

According to @BluSyn, defaulting to false was an intentional design decision and the wallet may act differently depending on its setting. Need to investigate more deeply to prevent any regressions in behavior

@tynes tynes removed the quick Can be fixed quickly, code change less than 10 lines label Mar 25, 2019
@braydonf
Copy link
Contributor

Also, as indication of lack of testing around it, the value was changed, and zero tests needed to be changed. This is also an option for the node, not the wallet, it's not clear how that is related. For the wallet, a "bump the fee" option for a transaction may be an improvement to clear a stuck transaction.

@pinheadmz
Copy link
Member

It sounds like before enabling RBF on the node, we should prepare the wallet for RBF as well. I think it would be great to support RBF features similar to Core and Electrum:

  • Indicate to user if a received tx is flagged as non-final. (should also be indicated in UI like bterm)
  • Avoid spending from non-final UTXO (?)
  • Allow user to send RBF transactions
  • Allow user to bump fees and replace transactions on the network before confirmation.

@tynes
Copy link
Member Author

tynes commented Apr 1, 2019

It looks like increaseFee exists on the Wallet, but is not exposed anywhere:

async increaseFee(hash, rate, passphrase) {

Hey @turbomaze, this could be useful for you for getting transactions unstuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Incompatibility with other implementations docs UI isn't clear or documented guidance needed mempool Related to the mempool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants