From 50f294968fad2d2a806b9fbc8dbc318df030141c Mon Sep 17 00:00:00 2001 From: enaples Date: Mon, 26 Jan 2026 14:46:05 +0100 Subject: [PATCH 1/4] tests: opening channel forcing feerate while lightningd unable to estimate fees --- tests/test_opening.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_opening.py b/tests/test_opening.py index a8090f9ac697..7463fad66436 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -17,6 +17,27 @@ def find_next_feerate(node, peer): chan = only_one(node.rpc.listpeerchannels(peer.info['id'])['channels']) return chan['next_feerate'] +@pytest.mark.openchannel('v1') +@unittest.skipIf(TEST_NETWORK != 'regtest', "requires regtest") +def test_open_with_unknown_feerates(node_factory, bitcoind): + """ + Test openchannel when feerates are unknown (like on signet/testnet with empty mempool). + """ + opts = { + 'ignore-fee-limits': True, + 'feerates': {252, 252, 252, 252}, + 'dev-no-fake-fees': True, + } + + l1, l2 = node_factory.line_graph(2, opts=[opts, opts]) + + # Verify fee estimation is failing + l1.daemon.wait_for_log('Unable to estimate any fees') + l2.daemon.wait_for_log('Unable to estimate any fees') + + with pytest.raises(RpcError): + l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate=100, minconf=0) + @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2') From aae122f8ad56d3a73b153b62e07bf2b9ceb0ff70 Mon Sep 17 00:00:00 2001 From: enaples Date: Mon, 26 Jan 2026 17:12:11 +0100 Subject: [PATCH 2/4] tests: fixing `fundchannel` call with right feerate style --- tests/test_opening.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 7463fad66436..fdfd17299af0 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -19,13 +19,13 @@ def find_next_feerate(node, peer): @pytest.mark.openchannel('v1') @unittest.skipIf(TEST_NETWORK != 'regtest', "requires regtest") -def test_open_with_unknown_feerates(node_factory, bitcoind): +def test_opening_with_unknown_feerates(node_factory, bitcoind): """ Test openchannel when feerates are unknown (like on signet/testnet with empty mempool). """ opts = { 'ignore-fee-limits': True, - 'feerates': {252, 252, 252, 252}, + 'feerates': None, 'dev-no-fake-fees': True, } @@ -35,8 +35,8 @@ def test_open_with_unknown_feerates(node_factory, bitcoind): l1.daemon.wait_for_log('Unable to estimate any fees') l2.daemon.wait_for_log('Unable to estimate any fees') - with pytest.raises(RpcError): - l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate=100, minconf=0) + with pytest.raises(RpcError) as e: + l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate='252perkw', minconf=0) @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') From ae810b6abfa98056f1f339408d3a3f4e9aa6df23 Mon Sep 17 00:00:00 2001 From: enaples Date: Tue, 27 Jan 2026 10:52:36 +0100 Subject: [PATCH 3/4] tests: improve test logic --- tests/test_opening.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index fdfd17299af0..53e843a29fa2 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -18,25 +18,32 @@ def find_next_feerate(node, peer): return chan['next_feerate'] @pytest.mark.openchannel('v1') +@pytest.mark.xfail(strict=True) @unittest.skipIf(TEST_NETWORK != 'regtest', "requires regtest") def test_opening_with_unknown_feerates(node_factory, bitcoind): """ Test openchannel when feerates are unknown (like on signet/testnet with empty mempool). """ opts = { - 'ignore-fee-limits': True, 'feerates': None, 'dev-no-fake-fees': True, } - l1, l2 = node_factory.line_graph(2, opts=[opts, opts]) + l1, l2 = node_factory.get_nodes(2, opts=[opts, {}]) - # Verify fee estimation is failing + # Verify fee estimation is failing only on l1 l1.daemon.wait_for_log('Unable to estimate any fees') - l2.daemon.wait_for_log('Unable to estimate any fees') - with pytest.raises(RpcError) as e: - l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate='252perkw', minconf=0) + # Connect nodes and fund l1 + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + l1.fundwallet(10000000) + + # Opening should fail due to unknown feerates + with pytest.raises(RpcError, match=r"Cannot estimate fees"): + l1.rpc.fundchannel(l2.info['id'], 1000000, minconf=0) + + # Opening should work fine since fees are specified manually + l1.rpc.fundchannel(l1.info['id'], 1000000, feerate='1perkw',minconf=0) @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') From 30dd20ac6cac25463682a81aa28102200573a5a4 Mon Sep 17 00:00:00 2001 From: enaples Date: Tue, 27 Jan 2026 11:17:04 +0100 Subject: [PATCH 4/4] tests: fixing typo on `fundchannel` `id` parameter --- tests/test_opening.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 53e843a29fa2..fb0fa33e4148 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -43,7 +43,7 @@ def test_opening_with_unknown_feerates(node_factory, bitcoind): l1.rpc.fundchannel(l2.info['id'], 1000000, minconf=0) # Opening should work fine since fees are specified manually - l1.rpc.fundchannel(l1.info['id'], 1000000, feerate='1perkw',minconf=0) + l1.rpc.fundchannel(l2.info['id'], 1000000, feerate='1perkw', minconf=0) @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')