pytest: remove EXPERIMENTAL_FEATURES as a consideration.

This currently means anchors tests are disabled, awaiting the
PR which implements zero-fee-htlc anchors to reenable them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-05-22 10:21:44 +09:30
parent b8aa3a579e
commit c11ae1aa34
6 changed files with 23 additions and 59 deletions

View file

@ -5,7 +5,7 @@ from pyln.testing.utils import SLOW_MACHINE
from utils import ( from utils import (
only_one, sync_blockheight, wait_for, TIMEOUT, only_one, sync_blockheight, wait_for, TIMEOUT,
account_balance, first_channel_id, closing_fee, TEST_NETWORK, 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_utxos_channel, anchor_expected, check_coin_moves,
check_balance_snaps, mine_funding_to_announce, check_inspect_channel, check_balance_snaps, mine_funding_to_announce, check_inspect_channel,
first_scid first_scid
@ -418,7 +418,6 @@ def closing_negotiation_step(node_factory, bitcoind, chainparams, opts):
assert opts['expected_close_fee'] == fee_mempool 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") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees")
def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams): def test_closing_negotiation_step_30pct(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 30%""" """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) 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") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees")
def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams): def test_closing_negotiation_step_100pct(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 100%""" """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) 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") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees")
def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams): def test_closing_negotiation_step_1sat(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 1sat""" """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) 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") @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Different closing fees")
def test_closing_negotiation_step_700sat(node_factory, bitcoind, chainparams): def test_closing_negotiation_step_700sat(node_factory, bitcoind, chainparams):
"""Test that the closing fee negotiation step works, 700sat""" """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) 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") @pytest.mark.developer("needs to set dev-disconnect")
def test_closing_higherfee(node_factory, bitcoind, executor): def test_closing_higherfee(node_factory, bitcoind, executor):
"""With anchor outputs we can ask for a *higher* fee than the last commit tx""" """With anchor outputs we can ask for a *higher* fee than the last commit tx"""

View file

@ -9,7 +9,7 @@ from utils import (
expected_channel_features, expected_channel_features,
check_coin_moves, first_channel_id, account_balance, basic_fee, check_coin_moves, first_channel_id, account_balance, basic_fee,
scriptpubkey_addr, default_ln_port, scriptpubkey_addr, default_ln_port,
EXPERIMENTAL_FEATURES, mine_funding_to_announce, first_scid, mine_funding_to_announce, first_scid,
anchor_expected, CHANNEL_SIZE anchor_expected, CHANNEL_SIZE
) )
from pyln.testing.utils import SLOW_MACHINE, VALGRIND, EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT 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)) l1.set_feerates((100000, 100000, 100000, 100000))
# It will raise as far as it can (48000) (30000 for option_anchor_outputs) # 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('Setting REMOTE feerate to {}'.format(maxfeerate))
l1.daemon.wait_for_log('peer_out WIRE_UPDATE_FEE') 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. # We should see features in unconfirmed channels.
chan = only_one(l1.rpc.listpeerchannels()['channels']) chan = only_one(l1.rpc.listpeerchannels()['channels'])
assert 'option_static_remotekey' in chan['features'] assert 'option_static_remotekey' in chan['features']
if EXPERIMENTAL_FEATURES: if anchor_expected(l1, l2):
assert 'option_anchor_outputs' in chan['features'] assert 'option_anchor_outputs' in chan['features']
# l2 should agree. # l2 should agree.
@ -3589,7 +3589,7 @@ def test_channel_features(node_factory, bitcoind):
chan = only_one(l1.rpc.listpeerchannels()['channels']) chan = only_one(l1.rpc.listpeerchannels()['channels'])
assert 'option_static_remotekey' in chan['features'] assert 'option_static_remotekey' in chan['features']
if EXPERIMENTAL_FEATURES: if anchor_expected(l1, l2):
assert 'option_anchor_outputs' in chan['features'] assert 'option_anchor_outputs' in chan['features']
# l2 should agree. # l2 should agree.

View file

@ -9,10 +9,9 @@ from pyln.testing.utils import (
wait_for, TailableProc, env, mine_funding_to_announce wait_for, TailableProc, env, mine_funding_to_announce
) )
from utils import ( 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 ephemeral_port_reserve import reserve
from utils import EXPERIMENTAL_FEATURES
import json import json
import os import os
@ -1651,7 +1650,7 @@ def test_feerates(node_factory):
assert feerate['perkw'] assert feerate['perkw']
assert 'perkb' not in feerate assert 'perkb' not in feerate
if EXPERIMENTAL_FEATURES: if anchor_expected(l1):
# option_anchor_outputs # option_anchor_outputs
assert htlc_timeout_cost == htlc_feerate * 666 // 1000 assert htlc_timeout_cost == htlc_feerate * 666 // 1000
assert htlc_success_cost == htlc_feerate * 706 // 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.""" """Don't return a feerate less than minrelaytxfee/mempoolminfee."""
l1 = node_factory.get_node() l1 = node_factory.get_node()
anchors = EXPERIMENTAL_FEATURES anchors = anchor_expected(l1)
assert l1.rpc.feerates('perkb') == { assert l1.rpc.feerates('perkb') == {
"perkb": { "perkb": {
"opening": 30000, "opening": 30000,
@ -2148,23 +2147,12 @@ def test_list_features_only(node_factory):
'option_static_remotekey/odd', 'option_static_remotekey/odd',
'option_payment_secret/even', 'option_payment_secret/even',
'option_basic_mpp/odd', 'option_basic_mpp/odd',
] 'option_route_blinding/odd',
if EXPERIMENTAL_FEATURES: 'option_shutdown_anysegwit/odd',
expected += ['option_anchor_outputs/odd'] 'option_channel_type/odd',
expected += ['option_route_blinding/odd'] 'option_scid_alias/odd',
expected += ['option_shutdown_anysegwit/odd'] 'option_zeroconf/odd',
expected += ['option_quiesce/odd'] 'supports_open_accept_channel_type']
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']
assert features == expected assert features == expected

View file

@ -2,7 +2,7 @@ from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK from fixtures import TEST_NETWORK
from pyln.client import RpcError, Millisatoshi from pyln.client import RpcError, Millisatoshi
from utils import ( 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 from pathlib import Path
@ -2133,7 +2133,7 @@ def test_openchannel_no_unconfirmed_inputs_accepter(node_factory, bitcoind):
_verify_utxos(l1, utxo_lookups) _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.developer("dev-force-features, dev-queryrates required")
@pytest.mark.openchannel('v2') @pytest.mark.openchannel('v2')
def test_no_anchor_liquidity_ads(node_factory, bitcoind): def test_no_anchor_liquidity_ads(node_factory, bitcoind):

View file

@ -7,7 +7,7 @@ from pyln.proto.onion import TlvPayload
from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT, scid_to_int from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT, scid_to_int
from utils import ( from utils import (
DEVELOPER, wait_for, only_one, sync_blockheight, TIMEOUT, 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 copy
import os import os
@ -726,7 +726,7 @@ def test_sendpay_cant_afford(node_factory):
# assert False # assert False
# This is the fee, which needs to be taken into account for l1. # This is the fee, which needs to be taken into account for l1.
if EXPERIMENTAL_FEATURES: if anchor_expected(l1, l2):
# option_anchor_outputs # option_anchor_outputs
available = 10**9 - 44700000 available = 10**9 - 44700000
else: else:
@ -4367,7 +4367,6 @@ def test_mpp_overload_payee(node_factory, bitcoind):
l1.rpc.pay(inv) l1.rpc.pay(inv)
@unittest.skipIf(EXPERIMENTAL_FEATURES, "this is always on with EXPERIMENTAL_FEATURES")
def test_offer_needs_option(node_factory): def test_offer_needs_option(node_factory):
"""Make sure we don't make offers without offer command""" """Make sure we don't make offers without offer command"""
l1 = node_factory.get_node() l1 = node_factory.get_node()
@ -4797,13 +4796,8 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind):
def test_fetchinvoice_autoconnect(node_factory, bitcoind): def test_fetchinvoice_autoconnect(node_factory, bitcoind):
"""We should autoconnect if we need to, to route.""" """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, l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
opts=[opts1, opts=[{},
{'experimental-offers': None, {'experimental-offers': None,
'dev-allow-localhost': None}]) 'dev-allow-localhost': None}])

View file

@ -5,7 +5,6 @@ from pyln.client import Millisatoshi
from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND
import time import time
EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1"
COMPAT = env("COMPAT", "1") == "1" COMPAT = env("COMPAT", "1") == "1"
# Big enough to make channels with 10k effective capacity, including Elements channels # 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] return network_map[network]
def anchor_expected(): def anchor_expected(*args):
return EXPERIMENTAL_FEATURES """Would this/these nodes all support anchors?"""
return False
def hex_bits(features): def hex_bits(features):
@ -42,13 +42,6 @@ def hex_bits(features):
def expected_peer_features(wumbo_channels=False, extra=[]): def expected_peer_features(wumbo_channels=False, extra=[]):
"""Return the expected peer features hexstring for this configuration""" """Return the expected peer features hexstring for this configuration"""
features = [1, 5, 7, 8, 11, 13, 14, 17, 25, 27, 45, 47, 51] 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: if wumbo_channels:
features += [19] features += [19]
if EXPERIMENTAL_DUAL_FUND: if EXPERIMENTAL_DUAL_FUND:
@ -62,13 +55,6 @@ def expected_peer_features(wumbo_channels=False, extra=[]):
def expected_node_features(wumbo_channels=False, extra=[]): def expected_node_features(wumbo_channels=False, extra=[]):
"""Return the expected node features hexstring for this configuration""" """Return the expected node features hexstring for this configuration"""
features = [1, 5, 7, 8, 11, 13, 14, 17, 25, 27, 45, 47, 51, 55] 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: if wumbo_channels:
features += [19] features += [19]
if EXPERIMENTAL_DUAL_FUND: if EXPERIMENTAL_DUAL_FUND: