[test] explicitly check default -minrelaytxfee and -incrementalrelayfee
What changed, and why it matters
This commit only adds new test code that checks the default values of two Bitcoin network fee settings. It does not change any production code, wallet behavior, or network rules. There is no security issue here.
No action required; this is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces two constants in the test framework (DEFAULT_MIN_RELAY_TX_FEE and DEFAULT_INCREMENTAL_RELAY_FEE, both 1000 sat/kvB) and adds assertions in mempool_accept.py verifying that a default node’s getmempoolinfo() returns the expected BTC/kvB equivalents. This is purely a test-coverage enhancement.
Changed components
test/functional/mempool_accept.pytest/functional/test_framework/mempool_util.pyInspect captured patch +14 / −0
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py
index e225b68c..dc565b1c 100755
--- a/test/functional/mempool_accept.py
+++ b/test/functional/mempool_accept.py
@@ -10,6 +10,10 @@ import math
from test_framework.test_framework import BitcoinTestFramework
from test_framework.blocktools import MAX_STANDARD_TX_WEIGHT
+from test_framework.mempool_util import (
+ DEFAULT_MIN_RELAY_TX_FEE,
+ DEFAULT_INCREMENTAL_RELAY_FEE,
+)
from test_framework.messages import (
MAX_BIP125_RBF_SEQUENCE,
COIN,
@@ -85,6 +89,11 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
assert_equal(node.getblockcount(), 200)
assert_equal(node.getmempoolinfo()['size'], self.mempool_size)
+ self.log.info("Check default settings")
+ # Settings are listed in BTC/kvB
+ assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal(DEFAULT_MIN_RELAY_TX_FEE) / COIN)
+ assert_equal(node.getmempoolinfo()['incrementalrelayfee'], Decimal(DEFAULT_INCREMENTAL_RELAY_FEE) / COIN)
+
self.log.info('Should not accept garbage to testmempoolaccept')
assert_raises_rpc_error(-3, 'JSON value of type string is not of expected type array', lambda: node.testmempoolaccept(rawtxs='ff00baar'))
assert_raises_rpc_error(-8, 'Array must contain between 1 and 25 transactions.', lambda: node.testmempoolaccept(rawtxs=['ff22']*26))
diff --git a/test/functional/test_framework/mempool_util.py b/test/functional/test_framework/mempool_util.py
index b60c14cf..a0b6f5d0 100644
--- a/test/functional/test_framework/mempool_util.py
+++ b/test/functional/test_framework/mempool_util.py
@@ -30,6 +30,11 @@ from .wallet import (
MiniWallet,
)
+# Default for -minrelaytxfee in sat/kvB
+DEFAULT_MIN_RELAY_TX_FEE = 1000
+# Default for -incrementalrelayfee in sat/kvB
+DEFAULT_INCREMENTAL_RELAY_FEE = 1000
+
def assert_mempool_contents(test_framework, node, expected=None, sync=True):
"""Assert that all transactions in expected are in the mempool,
and no additional ones exist. 'expected' is an array of
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.