Skip to content

Commit 2e756e8

Browse files
committed
[policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB
Let's say an attacker wants to use/exhaust the network's bandwidth, and has the choice between renting resources from a commercial provider and getting the network to "spam" itself it by sending unconfirmed transactions. We'd like the latter to be more expensive than the former. The bandwidth for relaying a transaction across the network is roughly its serialized size (plus relay overhead) x number of nodes. A 1000vB transaction is 1000-4000B serialized. With 100k nodes, that's 0.1-0.4GB If the going rate for commercial services is 10c/GB, that's like 1-4c per kvB of transaction data, so a 1000vB transaction should pay at least $0.04. At a price of 120k USD/BTC, 100sat is about $0.12. This price allows us to tolerate a large decrease in the conversion rate or increase in the number of nodes. Github-Pull: bitcoin#33106 Rebased-From: 6da5de5
1 parent f8006d9 commit 2e756e8

File tree

11 files changed

+69
-67
lines changed

11 files changed

+69
-67
lines changed

src/policy/policy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static constexpr unsigned int MAX_P2SH_SIGOPS{15};
3232
/** The maximum number of sigops we're willing to relay/mine in a single tx */
3333
static constexpr unsigned int MAX_STANDARD_TX_SIGOPS_COST{MAX_BLOCK_SIGOPS_COST/5};
3434
/** Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or replacement **/
35-
static constexpr unsigned int DEFAULT_INCREMENTAL_RELAY_FEE{1000};
35+
static constexpr unsigned int DEFAULT_INCREMENTAL_RELAY_FEE{100};
3636
/** Default for -bytespersigop */
3737
static constexpr unsigned int DEFAULT_BYTES_PER_SIGOP{20};
3838
/** Default for -permitbaremultisig */
@@ -54,7 +54,7 @@ static constexpr unsigned int MAX_STANDARD_SCRIPTSIG_SIZE{1650};
5454
* outputs below the new threshold */
5555
static constexpr unsigned int DUST_RELAY_TX_FEE{3000};
5656
/** Default for -minrelaytxfee, minimum relay fee for transactions */
57-
static constexpr unsigned int DEFAULT_MIN_RELAY_TX_FEE{1000};
57+
static constexpr unsigned int DEFAULT_MIN_RELAY_TX_FEE{100};
5858
/** Default for -limitancestorcount, max number of in-mempool ancestors */
5959
static constexpr unsigned int DEFAULT_ANCESTOR_LIMIT{25};
6060
/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */

src/test/mempool_tests.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,15 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
443443
tx1.vout.resize(1);
444444
tx1.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL;
445445
tx1.vout[0].nValue = 10 * COIN;
446-
pool.addUnchecked(entry.Fee(10000LL).FromTx(tx1));
446+
pool.addUnchecked(entry.Fee(1000LL).FromTx(tx1));
447447

448448
CMutableTransaction tx2 = CMutableTransaction();
449449
tx2.vin.resize(1);
450450
tx2.vin[0].scriptSig = CScript() << OP_2;
451451
tx2.vout.resize(1);
452452
tx2.vout[0].scriptPubKey = CScript() << OP_2 << OP_EQUAL;
453453
tx2.vout[0].nValue = 10 * COIN;
454-
pool.addUnchecked(entry.Fee(5000LL).FromTx(tx2));
454+
pool.addUnchecked(entry.Fee(500LL).FromTx(tx2));
455455

456456
pool.TrimToSize(pool.DynamicMemoryUsage()); // should do nothing
457457
BOOST_CHECK(pool.exists(GenTxid::Txid(tx1.GetHash())));
@@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
469469
tx3.vout.resize(1);
470470
tx3.vout[0].scriptPubKey = CScript() << OP_3 << OP_EQUAL;
471471
tx3.vout[0].nValue = 10 * COIN;
472-
pool.addUnchecked(entry.Fee(20000LL).FromTx(tx3));
472+
pool.addUnchecked(entry.Fee(2000LL).FromTx(tx3));
473473

474474
pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4); // tx3 should pay for tx2 (CPFP)
475475
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx1.GetHash())));
@@ -481,8 +481,8 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
481481
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx2.GetHash())));
482482
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx3.GetHash())));
483483

484-
CFeeRate maxFeeRateRemoved(25000, GetVirtualTransactionSize(CTransaction(tx3)) + GetVirtualTransactionSize(CTransaction(tx2)));
485-
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 1000);
484+
CFeeRate maxFeeRateRemoved(2500, GetVirtualTransactionSize(CTransaction(tx3)) + GetVirtualTransactionSize(CTransaction(tx2)));
485+
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + DEFAULT_INCREMENTAL_RELAY_FEE);
486486

487487
CMutableTransaction tx4 = CMutableTransaction();
488488
tx4.vin.resize(2);
@@ -532,10 +532,10 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
532532
tx7.vout[1].scriptPubKey = CScript() << OP_7 << OP_EQUAL;
533533
tx7.vout[1].nValue = 10 * COIN;
534534

535-
pool.addUnchecked(entry.Fee(7000LL).FromTx(tx4));
536-
pool.addUnchecked(entry.Fee(1000LL).FromTx(tx5));
537-
pool.addUnchecked(entry.Fee(1100LL).FromTx(tx6));
538-
pool.addUnchecked(entry.Fee(9000LL).FromTx(tx7));
535+
pool.addUnchecked(entry.Fee(700LL).FromTx(tx4));
536+
pool.addUnchecked(entry.Fee(100LL).FromTx(tx5));
537+
pool.addUnchecked(entry.Fee(110LL).FromTx(tx6));
538+
pool.addUnchecked(entry.Fee(900LL).FromTx(tx7));
539539

540540
// we only require this to remove, at max, 2 txn, because it's not clear what we're really optimizing for aside from that
541541
pool.TrimToSize(pool.DynamicMemoryUsage() - 1);
@@ -544,43 +544,43 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
544544
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx7.GetHash())));
545545

546546
if (!pool.exists(GenTxid::Txid(tx5.GetHash())))
547-
pool.addUnchecked(entry.Fee(1000LL).FromTx(tx5));
548-
pool.addUnchecked(entry.Fee(9000LL).FromTx(tx7));
547+
pool.addUnchecked(entry.Fee(100LL).FromTx(tx5));
548+
pool.addUnchecked(entry.Fee(900LL).FromTx(tx7));
549549

550550
pool.TrimToSize(pool.DynamicMemoryUsage() / 2); // should maximize mempool size by only removing 5/7
551551
BOOST_CHECK(pool.exists(GenTxid::Txid(tx4.GetHash())));
552552
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx5.GetHash())));
553553
BOOST_CHECK(pool.exists(GenTxid::Txid(tx6.GetHash())));
554554
BOOST_CHECK(!pool.exists(GenTxid::Txid(tx7.GetHash())));
555555

556-
pool.addUnchecked(entry.Fee(1000LL).FromTx(tx5));
557-
pool.addUnchecked(entry.Fee(9000LL).FromTx(tx7));
556+
pool.addUnchecked(entry.Fee(100LL).FromTx(tx5));
557+
pool.addUnchecked(entry.Fee(900LL).FromTx(tx7));
558558

559559
std::vector<CTransactionRef> vtx;
560560
SetMockTime(42);
561561
SetMockTime(42 + CTxMemPool::ROLLING_FEE_HALFLIFE);
562-
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 1000);
562+
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 100);
563563
// ... we should keep the same min fee until we get a block
564564
pool.removeForBlock(vtx, 1);
565565
SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE);
566-
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/2.0));
566+
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 100)/2.0));
567567
// ... then feerate should drop 1/2 each halflife
568568

569569
SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2);
570-
BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 5 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/4.0));
570+
BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 5 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 100)/4.0));
571571
// ... with a 1/2 halflife when mempool is < 1/2 its target size
572572

573573
SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);
574-
BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 9 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/8.0));
574+
BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 9 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 100)/8.0));
575575
// ... with a 1/4 halflife when mempool is < 1/4 its target size
576576

577577
SetMockTime(42 + 7*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);
578-
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 1000);
579-
// ... but feerate should never drop below 1000
578+
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 100);
579+
// ... but feerate should never drop below 100
580580

581581
SetMockTime(42 + 8*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);
582582
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0);
583-
// ... unless it has gone all the way to 0 (after getting past 1000/2)
583+
// ... unless it has gone all the way to 0 (after getting past 100/2)
584584
}
585585

586586
inline CTransactionRef make_tx(std::vector<CAmount>&& output_values, std::vector<CTransactionRef>&& inputs=std::vector<CTransactionRef>(), std::vector<uint32_t>&& input_indices=std::vector<uint32_t>())

src/test/rbf_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ BOOST_FIXTURE_TEST_CASE(rbf_helper_functions, TestChain100Setup)
238238
BOOST_CHECK(PaysForRBF(high_fee, high_fee - 1, 1, CFeeRate(0), unused_txid).has_value());
239239
BOOST_CHECK(PaysForRBF(high_fee + 1, high_fee, 1, CFeeRate(0), unused_txid).has_value());
240240
// Additional fees must cover the replacement's vsize at incremental relay fee
241-
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 1, 2, incremental_relay_feerate, unused_txid).has_value());
242-
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 2, 2, incremental_relay_feerate, unused_txid) == std::nullopt);
243-
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 2, 2, higher_relay_feerate, unused_txid).has_value());
244-
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 4, 2, higher_relay_feerate, unused_txid) == std::nullopt);
241+
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 1, 11, incremental_relay_feerate, unused_txid).has_value());
242+
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 1, 10, incremental_relay_feerate, unused_txid) == std::nullopt);
243+
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 2, 11, higher_relay_feerate, unused_txid).has_value());
244+
BOOST_CHECK(PaysForRBF(high_fee, high_fee + 4, 20, higher_relay_feerate, unused_txid) == std::nullopt);
245245
BOOST_CHECK(PaysForRBF(low_fee, high_fee, 99999999, incremental_relay_feerate, unused_txid).has_value());
246246
BOOST_CHECK(PaysForRBF(low_fee, high_fee + 99999999, 99999999, incremental_relay_feerate, unused_txid) == std::nullopt);
247247

test/functional/feature_rbf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def test_replacement_relay_fee(self):
703703

704704
# Higher fee, higher feerate, different txid, but the replacement does not provide a relay
705705
# fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB.
706-
assert_equal(self.nodes[0].getmempoolinfo()["incrementalrelayfee"], Decimal("0.00001"))
706+
assert_equal(self.nodes[0].getmempoolinfo()["incrementalrelayfee"], Decimal("0.000001"))
707707
tx.vout[0].nValue -= 1
708708
assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex())
709709

test/functional/mempool_limit.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def test_mid_package_eviction(self):
9292
self.restart_node(0, extra_args=self.extra_args[0])
9393

9494
# Restarting the node resets mempool minimum feerate
95-
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
96-
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
95+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00000100'))
96+
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00000100'))
9797

9898
fill_mempool(self, node)
9999
current_info = node.getmempoolinfo()
@@ -122,7 +122,7 @@ def test_mid_package_eviction(self):
122122
# coin is no longer available, but the cache could still contains the tx.
123123
cpfp_parent = self.wallet.create_self_transfer(
124124
utxo_to_spend=mempool_evicted_tx["new_utxo"],
125-
fee_rate=mempoolmin_feerate - Decimal('0.00001'),
125+
fee_rate=mempoolmin_feerate / 2,
126126
confirmed_only=True)
127127
package_hex.append(cpfp_parent["hex"])
128128
parent_utxos.append(cpfp_parent["new_utxo"])
@@ -154,7 +154,7 @@ def test_mid_package_eviction(self):
154154
# Specific number of satoshis to fit within a small window. The parent_cpfp + child package needs to be
155155
# - When there is mid-package eviction, high enough feerate to meet the new mempoolminfee
156156
# - When there is no mid-package eviction, low enough feerate to be evicted immediately after submission.
157-
magic_satoshis = 1200
157+
magic_satoshis = 120
158158
cpfp_satoshis = int(cpfp_fee * COIN) + magic_satoshis
159159

160160
child = self.wallet.create_self_transfer_multi(utxos_to_spend=parent_utxos, fee_per_output=cpfp_satoshis)
@@ -182,8 +182,8 @@ def test_mid_package_replacement(self):
182182
self.restart_node(0, extra_args=self.extra_args[0])
183183

184184
# Restarting the node resets mempool minimum feerate
185-
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
186-
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
185+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00000100'))
186+
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00000100'))
187187

188188
fill_mempool(self, node)
189189
current_info = node.getmempoolinfo()
@@ -208,7 +208,7 @@ def test_mid_package_replacement(self):
208208
# coin is no longer available, but the cache could still contain the tx.
209209
cpfp_parent = self.wallet.create_self_transfer(
210210
utxo_to_spend=replaced_tx["new_utxo"],
211-
fee_rate=mempoolmin_feerate - Decimal('0.00001'),
211+
fee_rate=mempoolmin_feerate - Decimal('0.000001'),
212212
confirmed_only=True)
213213

214214
self.wallet.rescan_utxos()
@@ -256,8 +256,8 @@ def run_test(self):
256256

257257
relayfee = node.getnetworkinfo()['relayfee']
258258
self.log.info('Check that mempoolminfee is minrelaytxfee')
259-
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
260-
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
259+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00000100'))
260+
assert_equal(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00000100'))
261261

262262
fill_mempool(self, node)
263263

@@ -314,9 +314,9 @@ def run_test(self):
314314
target_weight_each = 200000
315315
assert_greater_than(target_weight_each * 2, node.getmempoolinfo()["maxmempool"] - node.getmempoolinfo()["bytes"])
316316
# Should be a true CPFP: parent's feerate is just below mempool min feerate
317-
parent_feerate = mempoolmin_feerate - Decimal("0.000001") # 0.1 sats/vbyte below min feerate
317+
parent_feerate = mempoolmin_feerate - Decimal("0.0000001") # 0.01 sats/vbyte below min feerate
318318
# Parent + child is above mempool minimum feerate
319-
child_feerate = (worst_feerate_btcvb * 1000) - Decimal("0.000001") # 0.1 sats/vbyte below worst feerate
319+
child_feerate = (worst_feerate_btcvb * 1000) - Decimal("0.0000001") # 0.01 sats/vbyte below worst feerate
320320
# However, when eviction is triggered, these transactions should be at the bottom.
321321
# This assertion assumes parent and child are the same size.
322322
miniwallet.rescan_utxos()

test/functional/mempool_package_rbf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ def test_package_rbf_additional_fees(self):
170170
self.log.info("Check replacement pays for incremental bandwidth")
171171
_, placeholder_txns3 = self.create_simple_package(coin)
172172
package_3_size = sum([tx.get_vsize() for tx in placeholder_txns3])
173-
incremental_sats_required = Decimal(package_3_size) / COIN
174-
incremental_sats_short = incremental_sats_required - Decimal("0.00000001")
173+
incremental_sats_required = (Decimal(package_3_size * 0.1) / COIN).quantize(Decimal("0.00000001"))
174+
incremental_sats_short = incremental_sats_required - Decimal("0.00000005")
175175
# Recreate the package with slightly higher fee once we know the size of the new package, but still short of required fee
176176
failure_package_hex3, failure_package_txns3 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE + incremental_sats_short)
177177
assert_equal(package_3_size, sum([tx.get_vsize() for tx in failure_package_txns3]))
178178
pkg_results3 = node.submitpackage(failure_package_hex3)
179-
assert_equal(f"package RBF failed: insufficient anti-DoS fees, rejecting replacement {failure_package_txns3[1].rehash()}, not enough additional fees to relay; {incremental_sats_short} < {incremental_sats_required}", pkg_results3["package_msg"])
179+
assert_equal(f"package RBF failed: insufficient anti-DoS fees, rejecting replacement {failure_package_txns3[1].rehash()}, not enough additional fees to relay; {incremental_sats_short:.8f} < {incremental_sats_required:.8f}", pkg_results3["package_msg"])
180180
self.assert_mempool_contents(expected=package_txns1)
181181

182182
success_package_hex3, success_package_txns3 = self.create_simple_package(coin, parent_fee=DEFAULT_FEE, child_fee=DEFAULT_CHILD_FEE + incremental_sats_required)
@@ -570,12 +570,13 @@ def test_child_conflicts_parent_mempool_ancestor(self):
570570
)
571571

572572
node.sendrawtransaction(grandparent_result["hex"])
573+
minrelayfeerate = node.getnetworkinfo()["relayfee"]
573574

574575
# Now make package of two descendants that looks
575576
# like a cpfp where the parent can't get in on its own
576577
self.ctr += 1
577578
parent_result = self.wallet.create_self_transfer(
578-
fee_rate=Decimal('0.00001000'),
579+
fee_rate=minrelayfeerate,
579580
utxo_to_spend=grandparent_result["new_utxo"],
580581
sequence=MAX_BIP125_RBF_SEQUENCE - self.ctr,
581582
)

test/functional/p2p_1p1c_network.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
from math import ceil
1414

1515
from test_framework.mempool_util import (
16+
DEFAULT_MIN_RELAY_TX_FEE,
1617
fill_mempool,
1718
)
1819
from test_framework.messages import (
20+
COIN,
1921
msg_tx,
2022
)
2123
from test_framework.p2p import (
@@ -31,9 +33,6 @@
3133
MiniWalletMode,
3234
)
3335

34-
# 1sat/vB feerate denominated in BTC/KvB
35-
FEERATE_1SAT_VB = Decimal("0.00001000")
36-
3736
class PackageRelayTest(BitcoinTestFramework):
3837
def set_test_params(self):
3938
self.setup_clean_chain = True
@@ -51,12 +50,12 @@ def raise_network_minfee(self):
5150

5251
self.log.debug("Check that all nodes' mempool minimum feerates are above min relay feerate")
5352
for node in self.nodes:
54-
assert_equal(node.getmempoolinfo()['minrelaytxfee'], FEERATE_1SAT_VB)
55-
assert_greater_than(node.getmempoolinfo()['mempoolminfee'], FEERATE_1SAT_VB)
53+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN)
54+
assert_greater_than(node.getmempoolinfo()['mempoolminfee'], Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN)
5655

5756
def create_basic_1p1c(self, wallet):
58-
low_fee_parent = wallet.create_self_transfer(fee_rate=FEERATE_1SAT_VB, confirmed_only=True)
59-
high_fee_child = wallet.create_self_transfer(utxo_to_spend=low_fee_parent["new_utxo"], fee_rate=999*FEERATE_1SAT_VB)
57+
low_fee_parent = wallet.create_self_transfer(fee_rate=Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN, confirmed_only=True)
58+
high_fee_child = wallet.create_self_transfer(utxo_to_spend=low_fee_parent["new_utxo"], fee_rate=999*Decimal(DEFAULT_MIN_RELAY_TX_FEE)/ COIN)
6059
package_hex_basic = [low_fee_parent["hex"], high_fee_child["hex"]]
6160
return package_hex_basic, low_fee_parent["tx"], high_fee_child["tx"]
6261

@@ -87,8 +86,8 @@ def create_package_2outs(self, wallet):
8786
return [low_fee_parent_2outs["hex"], high_fee_child_2outs["hex"]], low_fee_parent_2outs["tx"], high_fee_child_2outs["tx"]
8887

8988
def create_package_2p1c(self, wallet):
90-
parent1 = wallet.create_self_transfer(fee_rate=FEERATE_1SAT_VB*10, confirmed_only=True)
91-
parent2 = wallet.create_self_transfer(fee_rate=FEERATE_1SAT_VB*20, confirmed_only=True)
89+
parent1 = wallet.create_self_transfer(fee_rate=Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN * 10, confirmed_only=True)
90+
parent2 = wallet.create_self_transfer(fee_rate=Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN * 20, confirmed_only=True)
9291
child = wallet.create_self_transfer_multi(
9392
utxos_to_spend=[parent1["new_utxo"], parent2["new_utxo"]],
9493
fee_per_output=999*parent1["tx"].get_vsize(),

test/functional/p2p_ibd_txrelay.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
)
2929
from test_framework.test_framework import BitcoinTestFramework
3030

31-
MAX_FEE_FILTER = Decimal(9170997) / COIN
32-
NORMAL_FEE_FILTER = Decimal(100) / COIN
31+
MAX_FEE_FILTER = Decimal(9936506) / COIN
32+
NORMAL_FEE_FILTER = Decimal(10) / COIN
3333

3434

3535
class P2PIBDTxRelayTest(BitcoinTestFramework):
3636
def set_test_params(self):
3737
self.setup_clean_chain = True
3838
self.num_nodes = 2
3939
self.extra_args = [
40-
["-minrelaytxfee={}".format(NORMAL_FEE_FILTER)],
41-
["-minrelaytxfee={}".format(NORMAL_FEE_FILTER)],
40+
["-minrelaytxfee={:.8f}".format(NORMAL_FEE_FILTER)],
41+
["-minrelaytxfee={:.8f}".format(NORMAL_FEE_FILTER)],
4242
]
4343

4444
def run_test(self):

0 commit comments

Comments
 (0)