splice script: Update tests to use dynamic fees
What changed, and why it matters
This commit only changes test files. It updates splicing-related tests to use dynamic fee estimation instead of hardcoded fee rates, removes the `force_feerate=True` flag from splice script tests, fixes a typo in a comment, and splits one large test into smaller named tests. There is no change to production code, so it does not introduce or fix a security vulnerability in the software users run.
No security action required. This is a test-only maintenance/refactoring change. Reviewers may verify CI passes with the new dynamic fee settings.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is confined to four Python test files under tests/. It replaces hardcoded fundpsbt calls using explicit ‘slow’/166 sat/vbyte-style parameters with calls using 0, 0 (dynamic fee estimation) and adjusts amounts from 109000/209000 to 105790 satoshis to match expected dynamic fees. It removes force_feerate=True from test_splice.py script-style splice calls. It also corrects a comment typo (‘subjtracting’ -> ‘subtracting’) and refactors test_splice_insane into separate functions test_splice_insane_a through test_splice_insane_f. No C/Rust/Python production code is modified.
Changed components
tests/test_splice.pytests/test_splicing.pytests/test_splicing_disconnect.pytests/test_splicing_insane.pyInspect captured patch +64 / −19
diff --git a/tests/test_splice.py b/tests/test_splice.py
index 9ed7b4c4..ad2e8854 100644
--- a/tests/test_splice.py
+++ b/tests/test_splice.py
@@ -27,7 +27,7 @@ def test_script_splice_out(node_factory, bitcoind, chainparams):
# Splice out 100k from first channel, explicitly putting result less fees into onchain wallet
spliceamt = 100000
- l1.rpc.splice(f"*:? -> {spliceamt}; 100%-fee -> wallet", force_feerate=True, debug_log=True)
+ l1.rpc.splice(f"*:? -> {spliceamt}; 100%-fee -> wallet", debug_log=True)
p1 = only_one(l1.rpc.listpeerchannels(peer_id=l2.info['id'])['channels'])
p2 = only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])
@@ -123,7 +123,7 @@ def test_script_splice_in(node_factory, bitcoind, chainparams):
withdraw_amt = 200000
starting_wallet_msat = withdraw_amt * 10000
- l1.rpc.splice(f"wallet -> {withdraw_amt}; {spliceamt} -> *:?", force_feerate=True, debug_log=True)
+ l1.rpc.splice(f"wallet -> {withdraw_amt}; {spliceamt} -> *:?", debug_log=True)
p1 = only_one(l1.rpc.listpeerchannels(peer_id=l2.info['id'])['channels'])
p2 = only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])
assert p1['inflight'][0]['splice_amount'] == spliceamt
diff --git a/tests/test_splicing.py b/tests/test_splicing.py
index f563ba17..d91886d2 100644
--- a/tests/test_splicing.py
+++ b/tests/test_splicing.py
@@ -17,7 +17,7 @@ def test_splice(node_factory, bitcoind):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -59,7 +59,7 @@ def test_two_chan_splice_in(node_factory, bitcoind):
chan_id2 = l2.get_channel_id(l3)
# add extra sats to pay fee
- funds_result = l2.rpc.fundpsbt("209000sat", "slow", 166, excess_as_change=True)
+ funds_result = l2.rpc.fundpsbt("205790sat", 0, 0, excess_as_change=True)
# Intiate splices to both channels
result = l2.rpc.splice_init(chan_id1, 100000, funds_result['psbt'])
@@ -130,7 +130,7 @@ def test_splice_rbf(node_factory, bitcoind):
funds_result = l1.rpc.addpsbtoutput(100000)
- # Pay with fee by subjtracting 5000 from channel balance
+ # Pay with fee by subtracting 5000 from channel balance
result = l1.rpc.splice_init(chan_id, -105000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
assert(result['commitments_secured'] is False)
@@ -150,8 +150,8 @@ def test_splice_rbf(node_factory, bitcoind):
funds_result = l1.rpc.addpsbtoutput(100000)
- # Pay with fee by subjtracting 5000 from channel balance
- result = l1.rpc.splice_init(chan_id, -110000, funds_result['psbt'])
+ # Pay with fee by subtracting 5790 from channel balance
+ result = l1.rpc.splice_init(chan_id, -105790, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
assert(result['commitments_secured'] is False)
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -189,7 +189,7 @@ def test_splice_nosign(node_factory, bitcoind):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -214,7 +214,7 @@ def test_splice_gossip(node_factory, bitcoind):
pre_splice_scid = first_scid(l1, l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -277,7 +277,7 @@ def test_splice_listnodes(node_factory, bitcoind):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -373,7 +373,7 @@ def test_invalid_splice(node_factory, bitcoind):
assert l1.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 0
# Now we do a real splice to confirm everything works after restart
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -469,7 +469,7 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -515,7 +515,7 @@ def test_route_by_old_scid(node_factory, bitcoind):
route = l1.rpc.getroute(l3.info['id'], 10000000, 1, cltv=16)['route']
# Do a splice
- funds_result = l2.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l2.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
chan_id = l2.get_channel_id(l3)
result = l2.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l2.rpc.splice_update(chan_id, result['psbt'])
@@ -535,7 +535,7 @@ def test_route_by_old_scid(node_factory, bitcoind):
# Let's splice again, so the original scid is two behind the times.
l3.fundwallet(200000)
- funds_result = l3.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l3.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
chan_id = l3.get_channel_id(l2)
result = l3.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l3.rpc.splice_update(chan_id, result['psbt'])
@@ -568,7 +568,7 @@ def test_splice_unannounced(node_factory, bitcoind):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
assert(result['commitments_secured'] is False)
diff --git a/tests/test_splicing_disconnect.py b/tests/test_splicing_disconnect.py
index fd3c09fb..faa3f8f4 100644
--- a/tests/test_splicing_disconnect.py
+++ b/tests/test_splicing_disconnect.py
@@ -26,7 +26,7 @@ def test_splice_disconnect_sig(node_factory, bitcoind):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -85,7 +85,7 @@ def test_splice_disconnect_commit(node_factory, bitcoind, executor):
chan_id = l1.get_channel_id(l2)
# add extra sats to pay fee
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
diff --git a/tests/test_splicing_insane.py b/tests/test_splicing_insane.py
index 4f15e603..29dc33d1 100644
--- a/tests/test_splicing_insane.py
+++ b/tests/test_splicing_insane.py
@@ -9,7 +9,7 @@ def make_pending_splice(node_factory):
chan_id = l1.get_channel_id(l2)
- funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
+ funds_result = l1.rpc.fundpsbt("105790sat", 0, 0, excess_as_change=True)
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
result = l1.rpc.splice_update(chan_id, result['psbt'])
@@ -50,7 +50,7 @@ def wait_for_restart(l1, l2):
@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
-def test_splice_insane(node_factory, bitcoind):
+def test_splice_insane_a(node_factory, bitcoind):
nodes = []
l1, l2 = make_pending_splice(node_factory)
@@ -60,6 +60,15 @@ def test_splice_insane(node_factory, bitcoind):
nodes.append(l1)
nodes.append(l2)
+ confirm_funding_not_spent(nodes)
+
+
+@pytest.mark.openchannel('v1')
+@pytest.mark.openchannel('v2')
+@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
+def test_splice_insane_b(node_factory, bitcoind):
+ nodes = []
+
l1, l2 = make_pending_splice(node_factory)
l1.restart()
wait_for_restart(l1, l2)
@@ -67,6 +76,15 @@ def test_splice_insane(node_factory, bitcoind):
nodes.append(l1)
nodes.append(l2)
+ confirm_funding_not_spent(nodes)
+
+
+@pytest.mark.openchannel('v1')
+@pytest.mark.openchannel('v2')
+@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
+def test_splice_insane_c(node_factory, bitcoind):
+ nodes = []
+
l1, l2 = make_pending_splice(node_factory)
l1.restart()
wait_for_restart(l1, l2)
@@ -74,6 +92,15 @@ def test_splice_insane(node_factory, bitcoind):
nodes.append(l1)
nodes.append(l2)
+ confirm_funding_not_spent(nodes)
+
+
+@pytest.mark.openchannel('v1')
+@pytest.mark.openchannel('v2')
+@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
+def test_splice_insane_d(node_factory, bitcoind):
+ nodes = []
+
l1, l2 = make_pending_splice(node_factory)
l2.restart()
wait_for_restart(l1, l2)
@@ -81,6 +108,15 @@ def test_splice_insane(node_factory, bitcoind):
nodes.append(l1)
nodes.append(l2)
+ confirm_funding_not_spent(nodes)
+
+
+@pytest.mark.openchannel('v1')
+@pytest.mark.openchannel('v2')
+@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
+def test_splice_insane_e(node_factory, bitcoind):
+ nodes = []
+
l1, l2 = make_pending_splice(node_factory)
confirm_and_wait(l1, l2, bitcoind)
l1.restart()
@@ -88,6 +124,15 @@ def test_splice_insane(node_factory, bitcoind):
nodes.append(l1)
nodes.append(l2)
+ confirm_funding_not_spent(nodes)
+
+
+@pytest.mark.openchannel('v1')
+@pytest.mark.openchannel('v2')
+@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
+def test_splice_insane_f(node_factory, bitcoind):
+ nodes = []
+
l1, l2 = make_pending_splice(node_factory)
confirm_and_wait(l1, l2, bitcoind)
l2.restart()
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.