wallet: change incremental fee for RBF

Sets WALLET_INCREMENTAL_RELAY_FEE to 1/10th of the default
recommended minimum fee, to encourage using RBF over CPFP and
saving the additional blockspace required for child transactions
spending parent transactions.

The previous value was based off a 1 DOGE recommended fee and did
not make sense with the current minimum fee recommendation.
This commit is contained in:
Patrick Lodder 2021-09-25 20:01:34 +02:00
parent bde7442526
commit c31ff0f095
No known key found for this signature in database
GPG key ID: 2D3A345B98D0DC1F
2 changed files with 15 additions and 7 deletions

View file

@ -202,7 +202,7 @@ def test_settxfee(rbf_node, dest_address):
rbftx = rbf_node.gettransaction(rbfid)
rbf_node.settxfee(Decimal("5.00000000"))
bumped_tx = rbf_node.bumpfee(rbfid)
assert_equal(bumped_tx["fee"], abs(rbftx["fee"]) + Decimal("0.50000000"))
assert_equal(bumped_tx["fee"], abs(rbftx["fee"]) + Decimal("0.00100000"))
rbf_node.settxfee(Decimal("0.00000000")) # unset paytxfee
@ -210,18 +210,18 @@ def test_rebumping(rbf_node, dest_address):
# check that re-bumping the original tx fails, but bumping the bumper succeeds
rbf_node.settxfee(Decimal("10.00000000"))
rbfid = create_fund_sign_send(rbf_node, {dest_address: 8.00000000})
bumped = rbf_node.bumpfee(rbfid, {"totalFee": 1050000000})
assert_raises_jsonrpc(-4, "already bumped", rbf_node.bumpfee, rbfid, {"totalFee": 11000})
rbf_node.bumpfee(bumped["txid"], {"totalFee": 1100000000})
bumped = rbf_node.bumpfee(rbfid, {"totalFee": 1000100000})
assert_raises_jsonrpc(-4, "already bumped", rbf_node.bumpfee, rbfid, {"totalFee": 1000100000})
rbf_node.bumpfee(bumped["txid"], {"totalFee": 1000200000})
rbf_node.settxfee(Decimal("0.00000000"))
def test_rebumping_not_replaceable(rbf_node, dest_address):
# check that re-bumping a non-replaceable bump tx fails
rbfid = create_fund_sign_send(rbf_node, {dest_address: 7.00000000})
bumped = rbf_node.bumpfee(rbfid, {"totalFee": 150000000, "replaceable": False})
bumped = rbf_node.bumpfee(rbfid, {"totalFee": 100100000, "replaceable": False})
assert_raises_jsonrpc(-4, "Transaction is not BIP 125 replaceable", rbf_node.bumpfee, bumped["txid"],
{"totalFee": 200000000})
{"totalFee": 100200000})
def test_unconfirmed_not_spendable(rbf_node, rbf_node_address):

View file

@ -57,7 +57,15 @@ static const CAmount DEFAULT_FALLBACK_FEE = RECOMMENDED_MIN_TX_FEE;
//! -mintxfee default
static const CAmount DEFAULT_TRANSACTION_MINFEE = RECOMMENDED_MIN_TX_FEE;
//! minimum recommended increment for BIP 125 replacement txs
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = RECOMMENDED_MIN_TX_FEE * 50;
/*
* Dogecoin: Scaled to 1/10th of the recommended transaction fee to make RBF
* cheaper than CPFP. This reduces onchain pollution by encouraging transactions
* to be replaced in the mempool, rather than be respent by another transaction
* which then both would have to be mined, taking up block space and increasing
* the amount of data that needs to be synchronized when validating the chain.
* This way, replacements for fee bumps are transient rather than persisted.
*/
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = RECOMMENDED_MIN_TX_FEE / 10;
//! target minimum change amount
static const CAmount MIN_CHANGE = RECOMMENDED_MIN_TX_FEE;
//! final minimum change amount after paying for fees