diff --git a/tests/test_closing.py b/tests/test_closing.py index 022daf2fc..b58fa1d43 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -5,7 +5,7 @@ from pyln.testing.utils import SLOW_MACHINE from utils import ( only_one, sync_blockheight, wait_for, TIMEOUT, account_balance, first_channel_id, closing_fee, TEST_NETWORK, - scriptpubkey_addr, calc_lease_fee, EXPERIMENTAL_FEATURES, + scriptpubkey_addr, calc_lease_fee, check_utxos_channel, anchor_expected, check_coin_moves, check_balance_snaps, mine_funding_to_announce, check_inspect_channel, first_scid @@ -418,7 +418,6 @@ def closing_negotiation_step(node_factory, bitcoind, chainparams, opts): assert opts['expected_close_fee'] == fee_mempool -@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees") def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams): """Test that the closing fee negotiation step works, 30%""" @@ -434,7 +433,6 @@ def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams): closing_negotiation_step(node_factory, bitcoind, chainparams, opts) -@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees") def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams): """Test that the closing fee negotiation step works, 100%""" @@ -455,7 +453,6 @@ def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams): closing_negotiation_step(node_factory, bitcoind, chainparams, opts) -@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees") def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams): """Test that the closing fee negotiation step works, 1sat""" @@ -471,7 +468,6 @@ def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams): closing_negotiation_step(node_factory, bitcoind, chainparams, opts) -@unittest.skipIf(EXPERIMENTAL_FEATURES, "anchors uses quick-close, not negotiation") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees") def test_closing_negotiation_step_700sat(node_factory, bitcoind, chainparams): """Test that the closing fee negotiation step works, 700sat""" @@ -3301,7 +3297,7 @@ Try a range of future segwit versions as shutdown scripts. We create many nodes l1.rpc.fundchannel(l2.info['id'], 10**6) -@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Needs anchor_outputs") +@unittest.skip("Needs anchor_outputs") @pytest.mark.developer("needs to set dev-disconnect") def test_closing_higherfee(node_factory, bitcoind, executor): """With anchor outputs we can ask for a *higher* fee than the last commit tx""" diff --git a/tests/test_connection.py b/tests/test_connection.py index 97670b5c8..d2aa4167c 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -9,7 +9,7 @@ from utils import ( expected_channel_features, check_coin_moves, first_channel_id, account_balance, basic_fee, scriptpubkey_addr, default_ln_port, - EXPERIMENTAL_FEATURES, mine_funding_to_announce, first_scid, + mine_funding_to_announce, first_scid, anchor_expected, CHANNEL_SIZE ) from pyln.testing.utils import SLOW_MACHINE, VALGRIND, EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT @@ -3384,7 +3384,7 @@ def test_feerate_spam(node_factory, chainparams): l1.set_feerates((100000, 100000, 100000, 100000)) # It will raise as far as it can (48000) (30000 for option_anchor_outputs) - maxfeerate = 30000 if EXPERIMENTAL_FEATURES else 48000 + maxfeerate = 30000 if anchor_expected(l1, l2) else 48000 l1.daemon.wait_for_log('Setting REMOTE feerate to {}'.format(maxfeerate)) l1.daemon.wait_for_log('peer_out WIRE_UPDATE_FEE') @@ -3576,7 +3576,7 @@ def test_channel_features(node_factory, bitcoind): # We should see features in unconfirmed channels. chan = only_one(l1.rpc.listpeerchannels()['channels']) assert 'option_static_remotekey' in chan['features'] - if EXPERIMENTAL_FEATURES: + if anchor_expected(l1, l2): assert 'option_anchor_outputs' in chan['features'] # l2 should agree. @@ -3589,7 +3589,7 @@ def test_channel_features(node_factory, bitcoind): chan = only_one(l1.rpc.listpeerchannels()['channels']) assert 'option_static_remotekey' in chan['features'] - if EXPERIMENTAL_FEATURES: + if anchor_expected(l1, l2): assert 'option_anchor_outputs' in chan['features'] # l2 should agree. diff --git a/tests/test_misc.py b/tests/test_misc.py index c4b0ff076..66b17a977 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -9,10 +9,9 @@ from pyln.testing.utils import ( wait_for, TailableProc, env, mine_funding_to_announce ) from utils import ( - account_balance, scriptpubkey_addr, check_coin_moves + account_balance, scriptpubkey_addr, check_coin_moves, anchor_expected ) from ephemeral_port_reserve import reserve -from utils import EXPERIMENTAL_FEATURES import json import os @@ -1651,7 +1650,7 @@ def test_feerates(node_factory): assert feerate['perkw'] assert 'perkb' not in feerate - if EXPERIMENTAL_FEATURES: + if anchor_expected(l1): # option_anchor_outputs assert htlc_timeout_cost == htlc_feerate * 666 // 1000 assert htlc_success_cost == htlc_feerate * 706 // 1000 @@ -1950,7 +1949,7 @@ def test_bitcoind_feerate_floor(node_factory, bitcoind): """Don't return a feerate less than minrelaytxfee/mempoolminfee.""" l1 = node_factory.get_node() - anchors = EXPERIMENTAL_FEATURES + anchors = anchor_expected(l1) assert l1.rpc.feerates('perkb') == { "perkb": { "opening": 30000, @@ -2148,23 +2147,12 @@ def test_list_features_only(node_factory): 'option_static_remotekey/odd', 'option_payment_secret/even', 'option_basic_mpp/odd', - ] - if EXPERIMENTAL_FEATURES: - expected += ['option_anchor_outputs/odd'] - expected += ['option_route_blinding/odd'] - expected += ['option_shutdown_anysegwit/odd'] - expected += ['option_quiesce/odd'] - expected += ['option_onion_messages/odd'] - expected += ['option_channel_type/odd'] - expected += ['option_scid_alias/odd'] - expected += ['option_zeroconf/odd'] - expected += ['supports_open_accept_channel_type'] - else: - expected += ['option_route_blinding/odd'] - expected += ['option_shutdown_anysegwit/odd'] - expected += ['option_channel_type/odd'] - expected += ['option_scid_alias/odd'] - expected += ['option_zeroconf/odd'] + 'option_route_blinding/odd', + 'option_shutdown_anysegwit/odd', + 'option_channel_type/odd', + 'option_scid_alias/odd', + 'option_zeroconf/odd', + 'supports_open_accept_channel_type'] assert features == expected diff --git a/tests/test_opening.py b/tests/test_opening.py index bc9b97f92..a45c6bdb6 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -2,7 +2,7 @@ from fixtures import * # noqa: F401,F403 from fixtures import TEST_NETWORK from pyln.client import RpcError, Millisatoshi from utils import ( - only_one, wait_for, sync_blockheight, first_channel_id, calc_lease_fee, check_coin_moves, anchor_expected, EXPERIMENTAL_FEATURES + only_one, wait_for, sync_blockheight, first_channel_id, calc_lease_fee, check_coin_moves, anchor_expected ) from pathlib import Path @@ -2133,7 +2133,7 @@ def test_openchannel_no_unconfirmed_inputs_accepter(node_factory, bitcoind): _verify_utxos(l1, utxo_lookups) -@unittest.skipIf(not EXPERIMENTAL_FEATURES, "anchors not available") +@unittest.skip("anchors not available") @pytest.mark.developer("dev-force-features, dev-queryrates required") @pytest.mark.openchannel('v2') def test_no_anchor_liquidity_ads(node_factory, bitcoind): diff --git a/tests/test_pay.py b/tests/test_pay.py index 2c7b2a543..724fed3d9 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -7,7 +7,7 @@ from pyln.proto.onion import TlvPayload from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT, scid_to_int from utils import ( DEVELOPER, wait_for, only_one, sync_blockheight, TIMEOUT, - EXPERIMENTAL_FEATURES, VALGRIND, mine_funding_to_announce, first_scid + VALGRIND, mine_funding_to_announce, first_scid, anchor_expected ) import copy import os @@ -726,7 +726,7 @@ def test_sendpay_cant_afford(node_factory): # assert False # This is the fee, which needs to be taken into account for l1. - if EXPERIMENTAL_FEATURES: + if anchor_expected(l1, l2): # option_anchor_outputs available = 10**9 - 44700000 else: @@ -4367,7 +4367,6 @@ def test_mpp_overload_payee(node_factory, bitcoind): l1.rpc.pay(inv) -@unittest.skipIf(EXPERIMENTAL_FEATURES, "this is always on with EXPERIMENTAL_FEATURES") def test_offer_needs_option(node_factory): """Make sure we don't make offers without offer command""" l1 = node_factory.get_node() @@ -4797,13 +4796,8 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): def test_fetchinvoice_autoconnect(node_factory, bitcoind): """We should autoconnect if we need to, to route.""" - if EXPERIMENTAL_FEATURES: - # We have to force option_onion_messages off! - opts1 = {'dev-force-features': '-39'} - else: - opts1 = {} l1, l2 = node_factory.line_graph(2, wait_for_announce=True, - opts=[opts1, + opts=[{}, {'experimental-offers': None, 'dev-allow-localhost': None}]) diff --git a/tests/utils.py b/tests/utils.py index c93f6b024..2c9b5b061 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -5,7 +5,6 @@ from pyln.client import Millisatoshi from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND import time -EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" COMPAT = env("COMPAT", "1") == "1" # Big enough to make channels with 10k effective capacity, including Elements channels @@ -25,8 +24,9 @@ def default_ln_port(network: str) -> int: return network_map[network] -def anchor_expected(): - return EXPERIMENTAL_FEATURES +def anchor_expected(*args): + """Would this/these nodes all support anchors?""" + return False def hex_bits(features): @@ -42,13 +42,6 @@ def hex_bits(features): def expected_peer_features(wumbo_channels=False, extra=[]): """Return the expected peer features hexstring for this configuration""" features = [1, 5, 7, 8, 11, 13, 14, 17, 25, 27, 45, 47, 51] - if EXPERIMENTAL_FEATURES: - # OPT_ONION_MESSAGES - features += [39] - # option_anchor_outputs - features += [21] - # option_quiesce - features += [35] if wumbo_channels: features += [19] if EXPERIMENTAL_DUAL_FUND: @@ -62,13 +55,6 @@ def expected_peer_features(wumbo_channels=False, extra=[]): def expected_node_features(wumbo_channels=False, extra=[]): """Return the expected node features hexstring for this configuration""" features = [1, 5, 7, 8, 11, 13, 14, 17, 25, 27, 45, 47, 51, 55] - if EXPERIMENTAL_FEATURES: - # OPT_ONION_MESSAGES - features += [39] - # option_anchor_outputs - features += [21] - # option_quiesce - features += [35] if wumbo_channels: features += [19] if EXPERIMENTAL_DUAL_FUND: