From 9281d70ff686647e9b91919cdbc55d2d8119a173 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 13 Dec 2023 14:52:07 +1030 Subject: [PATCH] options: make anchors enabled by default, add dev-disable-anchors. We still want to test non-anchor channels, as we still support them, but we've made it non-experimental. To test non-anchor channels, we use dev-force-features: -23. Many tests change, as fees change, and we keep an emergency reserve. Changelog-Added: Protocol: `option_anchors_zero_fee_htlc_tx` enabled, no longer experimental. Changelog-Changed: Config: `experimental-anchors` now does nothing (it's enabled by default). Signed-off-by: Rusty Russell --- contrib/pyln-testing/pyln/testing/utils.py | 23 +++- doc/lightningd-config.5.md | 13 +- lightningd/hsm_control.c | 2 +- lightningd/lightningd.c | 1 + lightningd/options.c | 21 ++- tests/test_bookkeeper.py | 3 +- tests/test_closing.py | 148 +++++++++++---------- tests/test_connection.py | 79 +++++------ tests/test_misc.py | 23 ++-- tests/test_opening.py | 31 ++--- tests/test_pay.py | 40 ++---- tests/test_plugin.py | 4 +- tests/utils.py | 4 +- 13 files changed, 204 insertions(+), 188 deletions(-) diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 7f39637d2c76..8ef611ef15f3 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -940,10 +940,10 @@ def fundbalancedchannel(self, remote_node, total_capacity=FUNDAMOUNT, announce=T else: total_capacity = int(total_capacity) - self.fundwallet(total_capacity + 10000) + self.fundwallet(total_capacity + 35000) if remote_node.config('experimental-dual-fund'): - remote_node.fundwallet(total_capacity + 10000) + remote_node.fundwallet(total_capacity + 35000) # We cut the total_capacity in half, since the peer's # expected to contribute that same amount chan_capacity = total_capacity // 2 @@ -1275,6 +1275,25 @@ def mock_estimatesmartfee(r): } self.daemon.rpcproxy.mock_rpc('estimatesmartfee', mock_estimatesmartfee) + def mock_getmempoolinfo(r): + return { + 'id': r['id'], + 'error': None, + 'result': { + 'mempoolminfee': Decimal(feerates[4] * 4) / 10**8, + 'minrelaytxfee': Decimal(feerates[4] * 4) / 10**8, + }, + } + + # Did they want to set minfee as well? + if len(feerates) > 4: + assert len(feerates) == 5 + self.daemon.rpcproxy.mock_rpc('getmempoolinfo', mock_getmempoolinfo) + + if wait_for_effect: + wait_for(lambda: + self.rpc.feerates(style='perkb')['perkb']['floor'] == feerates[4] * 4) + # Technically, this waits until it's called, not until it's processed. # We wait until all four levels have been called. if wait_for_effect: diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index 8a039ac1d789..89403da5ce9e 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -452,7 +452,10 @@ specified multuple times. (Added in v23.08). * **min-emergency-msat**=*msat* This is the amount of funds to keep in the wallet to close anchor channels (which don't carry their own transaction fees). It defaults to 25000sat, and is only maintained if there are any anchor channels (or, when opening an anchor channel). This amount may be insufficient for multiple closes at once, however. - + +* **dev-disable-anchors** + + This disabled anchor channel support, mainly useful for testing. ### Cleanup control options: @@ -785,13 +788,7 @@ this option. * **experimental-anchors** - Specifying this option turns on the `option_anchors_zero_fee_htlc_tx` -feature, meaning we can open anchor-based channels. This will become -the default for new channels in future, after more testing. Anchor-based -channels use larger commitment transactions, with the trade-off that they -don't have to use a worst-case fee, but can bump the commitment transaction -if it's needed. Note that this means that we need to keep -some funds aside: see `min-emergency-msat`. + This was enabled by default in v23.11, and no longer has an effect. BUGS ---- diff --git a/lightningd/hsm_control.c b/lightningd/hsm_control.c index 8d1b6c536a7e..bec16df89788 100644 --- a/lightningd/hsm_control.c +++ b/lightningd/hsm_control.c @@ -163,7 +163,7 @@ struct ext_key *hsm_init(struct lightningd *ld) if (feature_offered(ld->our_features->bits[INIT_FEATURE], OPT_ANCHORS_ZERO_FEE_HTLC_TX) && !hsm_capable(ld, WIRE_HSMD_SIGN_ANCHORSPEND)) { - fatal("--experimental-anchors needs HSM capable of signing anchors!"); + fatal("anchors needs HSM capable of signing anchors!"); } if (feature_offered(ld->our_features->bits[INIT_FEATURE], diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index d74c7cf7c490..57d5f79c1bf8 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -886,6 +886,7 @@ static struct feature_set *default_features(const tal_t *ctx) OPTIONAL_FEATURE(OPT_ZEROCONF), OPTIONAL_FEATURE(OPT_CHANNEL_TYPE), OPTIONAL_FEATURE(OPT_ROUTE_BLINDING), + OPTIONAL_FEATURE(OPT_ANCHORS_ZERO_FEE_HTLC_TX), }; for (size_t i = 0; i < ARRAY_SIZE(features); i++) { diff --git a/lightningd/options.c b/lightningd/options.c index dddd5d736573..0bc5b5c32100 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -766,6 +766,15 @@ static char *opt_force_featureset(const char *optarg, return NULL; } +static char *opt_unset_anchor_zero_fee_htlc_tx(struct lightningd *ld) +{ + feature_set_sub(ld->our_features, + take(feature_set_for_feature(NULL, + OPTIONAL_FEATURE(OPT_ANCHORS_ZERO_FEE_HTLC_TX)))); + + return NULL; +} + static void dev_register_opts(struct lightningd *ld) { /* We might want to debug plugins, which are started before normal @@ -782,6 +791,10 @@ static void dev_register_opts(struct lightningd *ld) opt_set_bool, &ld->plugins->dev_builtin_plugins_unimportant, "Make builtin plugins unimportant so you can plugin stop them."); + clnopt_noarg("--dev-disable-anchors", OPT_EARLY|OPT_DEV, + opt_unset_anchor_zero_fee_htlc_tx, ld, + "Disable option_anchors_zero_fee_htlc_tx" + " to open zero-fee-anchor channels"); clnopt_noarg("--dev-no-reconnect", OPT_DEV, opt_set_invbool, &ld->reconnect, @@ -1235,10 +1248,7 @@ static char *opt_set_quiesce(struct lightningd *ld) static char *opt_set_anchor_zero_fee_htlc_tx(struct lightningd *ld) { - /* Requires static_remotekey, but we always set that */ - feature_set_or(ld->our_features, - take(feature_set_for_feature(NULL, - OPTIONAL_FEATURE(OPT_ANCHORS_ZERO_FEE_HTLC_TX)))); + /* FIXME: deprecated_apis! */ return NULL; } @@ -1446,8 +1456,7 @@ static void register_opts(struct lightningd *ld) " channels."); opt_register_early_noarg("--experimental-anchors", opt_set_anchor_zero_fee_htlc_tx, ld, - "EXPERIMENTAL: enable option_anchors_zero_fee_htlc_tx" - " to open zero-fee-anchor channels"); + opt_hidden); clnopt_witharg("--announce-addr-dns", OPT_EARLY|OPT_SHOWBOOL, opt_set_bool_arg, opt_show_bool, &ld->announce_dns, diff --git a/tests/test_bookkeeper.py b/tests/test_bookkeeper.py index 9614942e863d..e4b9a6669880 100644 --- a/tests/test_bookkeeper.py +++ b/tests/test_bookkeeper.py @@ -344,8 +344,7 @@ def test_bookkeeping_missed_chans_leases(node_factory, bitcoind): opts = {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'plugin': str(coin_mvt_plugin), - 'disable-plugin': 'bookkeeper', - 'experimental-anchors': None} + 'disable-plugin': 'bookkeeper'} l1, l2 = node_factory.get_nodes(2, opts=opts) diff --git a/tests/test_closing.py b/tests/test_closing.py index 28e40fac0944..a997df79aa4f 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -355,8 +355,10 @@ def feerate_for(target, minimum=0, maximum=10000000): orate = feerate_for(21000) # closing fee negotiation starts at 21000 prate = feerate_for(20000) # closing fee negotiation starts at 20000 - opener, peer = node_factory.line_graph(2, opts=[{'feerates': (orate, orate, orate, orate)}, - {'feerates': (prate, prate, prate, prate)}]) + opener, peer = node_factory.line_graph(2, opts=[{'feerates': (orate, orate, orate, orate), + 'dev-disable-anchors': None}, + {'feerates': (prate, prate, prate, prate), + 'dev-disable-anchors': None}]) opener_id = opener.info['id'] peer_id = peer.info['id'] @@ -495,8 +497,8 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams, anchors): # Feerates identical so we don't get gratuitous commit to update them opts = {'dev-disable-commit-after': 1, 'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # FIXME: | for dicts was added in Python 3.9 apparently. l1, l2 = node_factory.line_graph(2, opts=[{**opts, **{'may_fail': True, @@ -626,8 +628,8 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams, anchors) opts = {'dev-disable-commit-after': 3, 'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # First we need to get funds to l2, so suppress after second. # Feerates identical so we don't get gratuitous commit to update them @@ -758,11 +760,9 @@ def test_channel_lease_falls_behind(node_factory, bitcoind): their blockheight, the lessor fails the channel ''' opts = [{'funder-policy': 'match', 'funder-policy-mod': 100, - 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'experimental-anchors': None}, + 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100}, {'funder-policy': 'match', 'funder-policy-mod': 100, - 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'experimental-anchors': None}] + 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100}] l1, l2, = node_factory.get_nodes(2, opts=opts) amount = 500000 @@ -799,8 +799,7 @@ def test_channel_lease_post_expiry(node_factory, bitcoind, chainparams): opts = {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'may_reconnect': True, 'plugin': coin_mvt_plugin, - 'dev-no-reconnect': None, - 'experimental-anchors': None} + 'dev-no-reconnect': None} l1, l2, = node_factory.get_nodes(2, opts=opts) @@ -903,8 +902,7 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind): ''' opts = {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'funder-lease-requests-only': False, - 'experimental-anchors': None} + 'funder-lease-requests-only': False} l1, l2, l3 = node_factory.get_nodes(3, opts=opts) # Allow l2 some warnings @@ -1014,12 +1012,10 @@ def test_channel_lease_lessor_cheat(node_factory, bitcoind, chainparams): opts = [{'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'may_reconnect': True, 'allow_warning': True, - 'experimental-anchors': None, 'plugin': balance_snaps}, {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'may_reconnect': True, 'allow_broken_log': True, - 'experimental-anchors': None, 'plugin': balance_snaps}] l1, l2, = node_factory.get_nodes(2, opts=opts) @@ -1186,21 +1182,25 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams, anchors): coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') balance_snaps = os.path.join(os.getcwd(), 'tests/plugins/balance_snaps.py') + opts = {'may_reconnect': True, + 'dev-no-reconnect': None} + if anchors: + commitfee = 3755 + else: + commitfee = 11005 + opts = {**opts, 'dev-force-features': "-23"} + l1, l2, l3, l4 = node_factory.line_graph(4, opts=[{'disconnect': ['-WIRE_UPDATE_FULFILL_HTLC'], - 'may_reconnect': True, - 'dev-no-reconnect': None}, + **opts}, {'plugin': [coin_mvt_plugin, balance_snaps], 'disable-mpp': None, - 'dev-no-reconnect': None, - 'may_reconnect': True, + **opts, 'allow_broken_log': True}, {'plugin': [coin_mvt_plugin, balance_snaps], - 'dev-no-reconnect': None, - 'may_reconnect': True, + **opts, 'allow_broken_log': True}, - {'dev-no-reconnect': None, - 'may_reconnect': True}], + opts], wait_for_announce=True) channel_id = first_channel_id(l2, l3) @@ -1251,7 +1251,7 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams, anchors): # reconnect with l1, which will fulfill the payment l2.rpc.connect(l1.info['id'], 'localhost', l1.port) - l2.daemon.wait_for_log('got commitsig .*: feerate 11005, blockheight: 0, 0 added, 1 fulfilled, 0 failed, 0 changed') + l2.daemon.wait_for_log('got commitsig .*: feerate {}, blockheight: 0, 0 added, 1 fulfilled, 0 failed, 0 changed'.format(commitfee)) # l2 moves on for closed l3 bitcoind.generate_block(1) @@ -1397,9 +1397,9 @@ def test_penalty_htlc_tx_timeout(node_factory, bitcoind, chainparams, anchors): 'allow_broken_log': True, } ] - if anchors: + if anchors is False: for opt in opts: - opt['experimental-anchors'] = None + opt['dev-disable-anchors'] = None l1, l2, l3, l4, l5 = node_factory.get_nodes(5, opts=opts) @@ -1580,8 +1580,8 @@ def test_penalty_rbf_normal(node_factory, bitcoind, executor, chainparams, ancho coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') to_self_delay = 10 opts = {'dev-disable-commit-after': 1} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # l1 is the thief, which causes our honest upstanding lightningd # code to break, so l1 can fail. @@ -1931,8 +1931,8 @@ def test_onchain_timeout(node_factory, bitcoind, executor, chainparams, anchors) coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') opts = {'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # HTLC 1->2, 1 fails just after it's irrevocably committed disconnects = ['+WIRE_REVOKE_AND_ACK*3', 'permfail'] @@ -2056,8 +2056,8 @@ def test_onchain_middleman_simple(node_factory, bitcoind, chainparams, anchors): coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') opts = {'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # HTLC 1->2->3, 1->2 goes down after 2 gets preimage from 3. disconnects = ['-WIRE_UPDATE_FULFILL_HTLC', 'permfail'] @@ -2191,8 +2191,8 @@ def test_onchain_middleman_their_unilateral_in(node_factory, bitcoind, chainpara coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') opts = {'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1_disconnects = ['=WIRE_UPDATE_FULFILL_HTLC', 'permfail'] l2_disconnects = ['-WIRE_UPDATE_FULFILL_HTLC'] @@ -2321,8 +2321,8 @@ def test_onchain_their_unilateral_out(node_factory, bitcoind, chainparams, ancho # We track channel balances, to verify that accounting is ok. coin_mvt_plugin = os.path.join(os.getcwd(), 'tests/plugins/coin_movements.py') opts = {'plugin': coin_mvt_plugin} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None disconnects = ['-WIRE_UPDATE_FAIL_HTLC', 'permfail'] @@ -2633,8 +2633,9 @@ def test_onchain_different_fees(node_factory, bitcoind, executor): l2.daemon.wait_for_log('htlc 1: SENT_ADD_ACK_COMMIT->RCVD_ADD_ACK_REVOCATION') # Restart with different feerate for second HTLC. - l1.set_feerates((5000, 5000, 5000, 3750)) - l1.restart() + l1.stop() + l1.set_feerates((5000, 5000, 5000, 5000), wait_for_effect=False) + l1.start() l1.daemon.wait_for_log('peer_out WIRE_UPDATE_FEE') p3 = executor.submit(l1.pay, l2, 800000000) @@ -2650,21 +2651,34 @@ def test_onchain_different_fees(node_factory, bitcoind, executor): # Both sides should have correct feerate assert l1.db_query('SELECT min_possible_feerate, max_possible_feerate FROM channels;') == [{ - 'min_possible_feerate': 5005, - 'max_possible_feerate': 11005 + 'min_possible_feerate': 3750, + 'max_possible_feerate': 5005 }] assert l2.db_query('SELECT min_possible_feerate, max_possible_feerate FROM channels;') == [{ - 'min_possible_feerate': 5005, - 'max_possible_feerate': 11005 + 'min_possible_feerate': 3750, + 'max_possible_feerate': 5005 }] bitcoind.generate_block(5) - # Three HTLCs, and one for the to-us output. - l1.daemon.wait_for_logs(['sendrawtx exit 0'] * 4) - # We use 3 blocks for "reasonable depth" - bitcoind.generate_block(3) + # We will, over the next few blocks, spend the to-us and the HTLCs. + # We don't have enough outputs, so the results are a bit random, + # but we will make progress every block! + mark = l1.daemon.logsearch_start + + r = re.compile('sendrawtx exit 0') + def count_successful_txs(): + l1.daemon.logs_catchup() + return sum([r.search(l) is not None for l in l1.daemon.logs[mark:]]) + + # First iteration we expect one HTLC-tx and the to-us, then two more htlc txs + num_successful = 1 + while num_successful < 3 + 1: + wait_for(lambda: count_successful_txs() > num_successful) + num_successful = count_successful_txs() + bitcoind.generate_block(1) + # This takes at least 3 blocks: now payments can fail with pytest.raises(Exception): p1.result(10) with pytest.raises(Exception): @@ -2672,9 +2686,12 @@ def test_onchain_different_fees(node_factory, bitcoind, executor): with pytest.raises(Exception): p3.result(10) - # Two more for HTLC timeout tx to be spent. - bitcoind.generate_block(2) - l1.daemon.wait_for_logs(['sendrawtx exit 0'] * 3) + # Now we need the return-to-wallet spending the htlc tx. + bitcoind.generate_block(4) + while num_successful < 3 + 3 + 1: + wait_for(lambda: count_successful_txs() > num_successful) + num_successful = count_successful_txs() + bitcoind.generate_block(1) # Now, 100 blocks it should be done. bitcoind.generate_block(100) @@ -2971,6 +2988,8 @@ def test_permfail_htlc_in(node_factory, bitcoind, executor): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.fundchannel(l2, 10**6) + # Give it some sats for anchor spend! + l2.fundwallet(25000, mine_block=False) # This will fail at l2's end. t = executor.submit(l1.pay, l2, 200000000) @@ -3331,8 +3350,8 @@ def test_closing_higherfee(node_factory, bitcoind, executor, anchors): opts = {'may_reconnect': True, 'dev-no-reconnect': None, 'feerates': (7500, 7500, 7500, 7500)} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None # We change the feerate before it starts negotiating close, so it aims # for *higher* than last commit tx. @@ -3564,11 +3583,9 @@ def save_notifications(message, progress, request, **kwargs): def test_close_twice(node_factory, executor): # First feerate is too low, second fixes it. - l1, l2 = node_factory.line_graph(2, opts=[{'allow_warning': True, - 'may_reconnect': True}, - {'allow_warning': True, - 'may_reconnect': True, - 'feerates': (15000, 15000, 15000, 15000)}]) + l1, l2 = node_factory.line_graph(2, opts={'allow_warning': True, + 'may_reconnect': True, + 'feerates': (15000, 15000, 15000, 15000)}) # This makes it disconnect, since feerate is too low. fut = executor.submit(l1.rpc.close, l2.info['id'], feerange=['253perkw', '500perkw']) @@ -3708,10 +3725,8 @@ def test_closing_anchorspend_htlc_tx_rbf(node_factory, bitcoind): # We want an outstanding HTLC for l1, so it uses anchor to push. # Set feerates to lowball for now. l1, l2 = node_factory.line_graph(2, opts=[{'feerates': (1000,) * 4, - 'experimental-anchors': None, 'min-emergency-msat': 546000}, {'feerates': (1000,) * 4, - 'experimental-anchors': None, 'disconnect': ['-WIRE_UPDATE_FAIL_HTLC']}]) assert 'anchors_zero_fee_htlc_tx/even' in only_one(l1.rpc.listpeerchannels()['channels'])['channel_type']['names'] @@ -3790,9 +3805,9 @@ def test_closing_anchorspend_htlc_tx_rbf(node_factory, bitcoind): def test_htlc_no_force_close(node_factory, bitcoind, anchors): """l2<->l3 force closes while an HTLC is in flight from l1, but l2 can't timeout because the feerate has spiked. It should do so anyway.""" opts = [{}, {}, {'disconnect': ['-WIRE_UPDATE_FULFILL_HTLC']}] - if anchors: + if anchors is False: for opt in opts: - opt['experimental-anchors'] = None + opt['dev-disable-anchors'] = None l1, l2, l3 = node_factory.line_graph(3, opts=opts) @@ -3902,10 +3917,8 @@ def test_closing_minfee(node_factory, bitcoind): def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams): """Test that we use anchor on peer's commit to CPFP tx""" l1, l2, l3 = node_factory.line_graph(3, opts=[{}, - {'experimental-anchors': None, - 'min-emergency-msat': 546000}, - {'experimental-anchors': None, - 'disconnect': ['-WIRE_UPDATE_FULFILL_HTLC']}], + {'min-emergency-msat': 546000}, + {'disconnect': ['-WIRE_UPDATE_FULFILL_HTLC']}], wait_for_announce=True) # We splinter l2's funds so it's forced to use more than one UTXO to push. @@ -3965,7 +3978,7 @@ def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams): def test_closing_cpfp(node_factory, bitcoind): - l1, l2 = node_factory.line_graph(2) + l1, l2 = node_factory.line_graph(2, opts={'min-emergency-msat': '2500sat'}) # We want to ignore l1's change output change = only_one(l1.rpc.listfunds()['outputs']) @@ -3991,4 +4004,5 @@ def test_closing_cpfp(node_factory, bitcoind): # They should now see a single additional output each sync_blockheight(bitcoind, [l1, l2]) assert len(l1.rpc.listfunds()['outputs']) == 2 - assert len(l2.rpc.listfunds()['outputs']) == 1 + # This one will also have emergency change + assert len(l2.rpc.listfunds()['outputs']) == 2 diff --git a/tests/test_connection.py b/tests/test_connection.py index 570faaa54bbc..5fccdba39ed2 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -401,9 +401,9 @@ def test_opening_tiny_channel(node_factory, anchors): {'min-capacity-sat': l2_min_capacity, 'dev-no-reconnect': None}, {'min-capacity-sat': l3_min_capacity, 'dev-no-reconnect': None}, {'min-capacity-sat': l4_min_capacity, 'dev-no-reconnect': None}] - if anchors: + if anchors is False: for opt in opts: - opt['experimental-anchors'] = None + opt['dev-disable-anchors'] = None l1, l2, l3, l4 = node_factory.get_nodes(4, opts=opts) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.rpc.connect(l3.info['id'], 'localhost', l3.port) @@ -450,8 +450,8 @@ def test_channel_abandon(node_factory, bitcoind): SATS = 10**6 - # Add some for fees - l1.fundwallet(SATS + 10000) + # Add some for fees/emergency-reserve + l1.fundwallet(SATS + 35000) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.rpc.fundchannel(l2.info['id'], SATS, feerate='1875perkw') @@ -1083,8 +1083,9 @@ def test_funding_all(node_factory, bitcoind): l1.rpc.fundchannel(l2.info['id'], "all") + # Keeps emergency reserve! outputs = l1.db_query('SELECT value FROM outputs WHERE status=0;') - assert len(outputs) == 0 + assert outputs == [{'value': 25000}] @pytest.mark.openchannel('v1') @@ -1095,7 +1096,7 @@ def test_funding_all_too_much(node_factory): # l2 isn't wumbo, so channel should not be! l1, l2 = node_factory.line_graph(2, fundchannel=False, opts=[{}, {'dev-force-features': '-19'}]) - addr, txid = l1.fundwallet(2**24 + 10000) + addr, txid = l1.fundwallet(2**24 + 35000) l1.rpc.fundchannel(l2.info['id'], "all") assert l1.daemon.is_in_log("'all' was too large for non-wumbo channel, trimming") @@ -2059,8 +2060,8 @@ def test_multifunding_feerates(node_factory, bitcoind, anchors): commitment_tx_feerate = str(commitment_tx_feerate_int) + 'perkw' opts = {'log-level': 'debug'} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1, l2, l3 = node_factory.get_nodes(3, opts=opts) l1.fundwallet(1 << 26) @@ -2418,7 +2419,7 @@ def test_update_fee(node_factory, bitcoind): # Make payments. l1.pay(l2, 200000000) # First payment causes fee update. - l2.daemon.wait_for_log('peer updated fee to 11005') + l2.daemon.wait_for_log('peer updated fee to 3755') l2.pay(l1, 100000000) # Now shutdown cleanly. @@ -2458,24 +2459,26 @@ def test_fee_limits(node_factory, bitcoind): # L1 asks for stupid low fee (will actually hit the floor of 253) l1.stop() l1.set_feerates((15, 15, 15, 15), False) + # We need to increase l2's floor, so it rejects l1. + l2.set_feerates((15000, 11000, 7500, 3750, 2000)) l1.start() - l1.daemon.wait_for_log('Received WARNING .*: update_fee 258 outside range 1875-75000') + l1.daemon.wait_for_log('Received WARNING .*: update_fee 1255 outside range 2000-75000') # They hang up on *us* l1.daemon.wait_for_log('Peer transient failure in CHANNELD_NORMAL: channeld: Owning subdaemon channeld died') # Disconnects, but does not error. Make sure it's noted in their status though. # FIXME: does not happen for l1! # assert 'update_fee 253 outside range 1875-75000' in only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['status'][0] - assert 'update_fee 258 outside range 1875-75000' in only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])['status'][0] + assert 'update_fee 1255 outside range 2000-75000' in only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])['status'][0] - assert only_one(l2.rpc.listpeerchannels()['channels'])['feerate']['perkw'] != 258 + assert only_one(l2.rpc.listpeerchannels()['channels'])['feerate']['perkw'] != 1255 # Make l2 accept those fees, and it should recover. assert only_one(l2.rpc.setchannel(l1.get_channel_scid(l2), ignorefeelimits=True)['channels'])['ignore_fee_limits'] is True assert only_one(l2.rpc.listpeerchannels()['channels'])['ignore_fee_limits'] is True # Now we stay happy (and connected!) - wait_for(lambda: only_one(l2.rpc.listpeerchannels()['channels'])['feerate']['perkw'] == 258) + wait_for(lambda: only_one(l2.rpc.listpeerchannels()['channels'])['feerate']['perkw'] == 1255) assert only_one(l2.rpc.listpeerchannels()['channels'])['peer_connected'] is True l1.rpc.close(l2.info['id']) @@ -2489,7 +2492,7 @@ def test_fee_limits(node_factory, bitcoind): # Trying to open a channel with too low a fee-rate is denied l1.rpc.connect(l4.info['id'], 'localhost', l4.port) - with pytest.raises(RpcError, match='They sent (ERROR|WARNING) .* feerate_per_kw 253 below minimum'): + with pytest.raises(RpcError, match='They sent (ERROR|WARNING) .* feerate_per_kw 1250 below minimum'): l1.fundchannel(l4, 10**6) # Restore to normal. @@ -2506,7 +2509,7 @@ def test_fee_limits(node_factory, bitcoind): # Try stupid high fees l1.stop() - l1.set_feerates((15000, 11000 * 10, 7500, 3750), False) + l1.set_feerates((15000, 15000, 15000, 15000, 15000), False) l1.start() l3.daemon.wait_for_log('peer_in WIRE_UPDATE_FEE') @@ -2536,8 +2539,14 @@ def test_update_fee_dynamic(node_factory, bitcoind): with pytest.raises(RpcError, match='Cannot estimate fees'): l1.fundchannel(l2, 10**6) - # Explicit feerate works. - l1.fundchannel(l2, 10**6, feerate='10000perkw') + # Explicit feerate does not work still (doesn't apply for anchors!) + # We could make it, but we need a separate commitment feerate for + # anchors vs non-anchors, so easier after anchors are compulsory. + with pytest.raises(RpcError, match='Cannot estimate fees'): + l1.fundchannel(l2, 10**6, feerate='10000perkw') + + l1.set_feerates((2000, 2000, 2000, 2000)) + l1.fundchannel(l2, 10**6) l1.set_feerates((15000, 11000, 7500, 3750)) @@ -2557,7 +2566,7 @@ def test_update_fee_dynamic(node_factory, bitcoind): inv = l2.rpc.invoice(5000, 'test_update_fee_dynamic2', 'test_update_fee_dynamic2')['bolt11'] l1.rpc.pay(inv) - # Won't update fee. + # Won't update fee.r assert not l2.daemon.is_in_log('peer_in.*UPDATE_FEE', start=l2.daemon.logsearch_start) @@ -2588,7 +2597,7 @@ def test_update_fee_reconnect(node_factory, bitcoind): # Make l1 send out feechange; triggers disconnect/reconnect. # (Note: < 10% change, so no smoothing here!) - l1.set_feerates((14000, 14000, 14000, 3750)) + l1.set_feerates((14000, 14000, 14000, 14000)) l1.daemon.wait_for_log('Setting REMOTE feerate to 14005') l2.daemon.wait_for_log('Setting LOCAL feerate to 14005') l1.daemon.wait_for_log(r'dev_disconnect: \+WIRE_COMMITMENT_SIGNED') @@ -2889,18 +2898,10 @@ def test_no_fee_estimate(node_factory, bitcoind, executor): with pytest.raises(RpcError, match=r'Cannot estimate fees'): l1.rpc.fundchannel(l2.info['id'], 10**6, 'slow') - # Can with manual feerate. + # With anchors, not even with manual feerate! l1.rpc.withdraw(l2.rpc.newaddr()['bech32'], 10000, '1500perkb') - l1.rpc.fundchannel(l2.info['id'], 10**6, '2000perkw', minconf=0) - - # Make sure we clean up cahnnel for later attempt. - l1.daemon.wait_for_log('sendrawtx exit 0') - l1.rpc.dev_fail(l2.info['id']) - l1.daemon.wait_for_log('Failing due to dev-fail command') - l1.wait_for_channel_onchain(l2.info['id']) - bitcoind.generate_block(6) - wait_for(lambda: only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['state'] == 'ONCHAIN') - wait_for(lambda: only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])['state'] == 'ONCHAIN') + with pytest.raises(RpcError, match=r'Cannot estimate fees'): + l1.rpc.fundchannel(l2.info['id'], 10**6, '2000perkw', minconf=0) # But can accept incoming connections. l1.rpc.connect(l2.info['id'], 'localhost', l2.port) @@ -3353,14 +3354,14 @@ def test_feerate_spam(node_factory, chainparams): l1.pay(l2, 10**9 - slack) # It will send this once (may have happened before line_graph's wait) - wait_for(lambda: l1.daemon.is_in_log('Setting REMOTE feerate to 11005')) + wait_for(lambda: l1.daemon.is_in_log('Setting REMOTE feerate to 3755')) wait_for(lambda: l1.daemon.is_in_log('peer_out WIRE_UPDATE_FEE')) # Now change feerates to something l1 can't afford. - l1.set_feerates((100000, 100000, 100000, 100000)) + l1.set_feerates((200000, 200000, 200000, 200000)) - # It will raise as far as it can (48000) - maxfeerate = 48000 + # It will raise as far as it can (30000) + maxfeerate = 30000 l1.daemon.wait_for_log('Setting REMOTE feerate to {}'.format(maxfeerate)) l1.daemon.wait_for_log('peer_out WIRE_UPDATE_FEE') @@ -3538,8 +3539,8 @@ def test_wumbo_channels(node_factory, bitcoind): @pytest.mark.openchannel('v2') @pytest.mark.parametrize("anchors", [False, True]) def test_channel_features(node_factory, bitcoind, anchors): - if anchors: - opts = {'experimental-anchors': None} + if anchors is False: + opts = {'dev-disable-anchors': None} else: opts = {} l1, l2 = node_factory.line_graph(2, fundchannel=False, opts=opts) @@ -3691,7 +3692,7 @@ def test_openchannel_init_alternate(node_factory, executor): def test_upgrade_statickey(node_factory, executor): """l1 doesn't have option_static_remotekey, l2 offers it.""" l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True, - 'dev-force-features': ["-13"], + 'dev-force-features': ["-13", "-23"], 'experimental-upgrade-protocol': None}, {'may_reconnect': True, 'experimental-upgrade-protocol': None}]) @@ -3722,7 +3723,7 @@ def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind): """We test penalty before/after, and unilateral before/after""" l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True, 'dev-no-reconnect': None, - 'dev-force-features': ["-13"], + 'dev-force-features': ["-13", "-23"], 'experimental-upgrade-protocol': None, # We try to cheat! 'allow_broken_log': True}, @@ -3863,7 +3864,7 @@ def test_upgrade_statickey_fail(node_factory, executor, bitcoind): 'dev-no-reconnect': None, 'disconnect': l1_disconnects, 'experimental-upgrade-protocol': None, - 'dev-force-features': ["-13"], + 'dev-force-features': ["-13", "-23"], # Don't have feerate changes! 'feerates': (7500, 7500, 7500, 7500)}, {'may_reconnect': True, diff --git a/tests/test_misc.py b/tests/test_misc.py index 9bea5e75e3fd..0ef773babd96 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -295,15 +295,15 @@ def test_htlc_sig_persistence(node_factory, bitcoind, executor): _, txid, blocks = l1.wait_for_onchaind_tx('OUR_HTLC_TIMEOUT_TO_US', 'THEIR_UNILATERAL/OUR_HTLC') assert blocks == 5 + bitcoind.generate_block(5) bitcoind.generate_block(1, wait_for_mempool=txid) l1.daemon.wait_for_logs([ r'Owning output . (\d+)sat .SEGWIT. txid', ]) - # We should now have a) the change from funding, b) the - # unilateral to us, and c) the HTLC respend to us - assert len(l1.rpc.listfunds()['outputs']) == 3 + # We should now have 1) the unilateral to us, and b) the HTLC respend to us + assert len(l1.rpc.listfunds()['outputs']) == 2 def test_htlc_out_timeout(node_factory, bitcoind, executor): @@ -385,6 +385,8 @@ def test_htlc_in_timeout(node_factory, bitcoind, executor): options={'dev-no-reconnect': None}, feerates=(7500, 7500, 7500, 7500)) l2 = node_factory.get_node() + # Give it some sats for anchor spend! + l2.fundwallet(25000, mine_block=False) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) chanid, _ = l1.fundchannel(l2, 10**6) @@ -1588,8 +1590,8 @@ def test_ipv4_and_ipv6(node_factory): def test_feerates(node_factory, anchors): opts = {'log-level': 'io', 'dev-no-fake-fees': True} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1 = node_factory.get_node(options=opts, start=False) l1.daemon.rpcproxy.mock_rpc('estimatesmartfee', { @@ -2041,8 +2043,8 @@ def mock_fail(*args): def test_bitcoind_feerate_floor(node_factory, bitcoind, anchors): """Don't return a feerate less than minrelaytxfee/mempoolminfee.""" opts = {} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1 = node_factory.get_node(options=opts) assert l1.rpc.feerates('perkb') == { @@ -2252,6 +2254,7 @@ def test_list_features_only(node_factory): 'option_payment_secret/even', 'option_basic_mpp/odd', 'option_support_large_channel/odd', + 'option_anchors_zero_fee_htlc_tx/odd', 'option_route_blinding/odd', 'option_shutdown_anysegwit/odd', 'option_channel_type/odd', @@ -3849,9 +3852,9 @@ def test_set_feerate_offset(node_factory, bitcoind): l1.pay(l2, 200000000) # First payment causes fee update, which should reflect the feerate offset. - l1.daemon.wait_for_log('lightningd: update_feerates: feerate = 11100, ' - 'min=1875, max=150000, penalty=7500') - l2.daemon.wait_for_log('peer updated fee to 11100') + l1.daemon.wait_for_log('lightningd: update_feerates: feerate = 3850, ' + 'min=253, max=150000, penalty=7500') + l2.daemon.wait_for_log('peer updated fee to 3850') l2.pay(l1, 100000000) # Now shutdown cleanly. diff --git a/tests/test_opening.py b/tests/test_opening.py index 25ff00fd1eb7..7e169e3d49f4 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -21,8 +21,7 @@ def find_next_feerate(node, peer): @pytest.mark.openchannel('v2') def test_queryrates(node_factory, bitcoind): - opts = {'dev-no-reconnect': None, - 'experimental-anchors': None} + opts = {'dev-no-reconnect': None} l1, l2 = node_factory.get_nodes(2, opts=opts) @@ -580,7 +579,6 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams): opts = {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'experimental-anchors': None, 'may_reconnect': True} l1, l2 = node_factory.get_nodes(2, opts=opts) @@ -1553,13 +1551,11 @@ def test_inflight_dbload(node_factory, bitcoind): disconnects = ["@WIRE_COMMITMENT_SIGNED"] opts = [{'experimental-dual-fund': None, 'dev-no-reconnect': None, - 'may_reconnect': True, 'disconnect': disconnects, - 'experimental-anchors': None}, + 'may_reconnect': True, 'disconnect': disconnects}, {'experimental-dual-fund': None, 'dev-no-reconnect': None, 'may_reconnect': True, 'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', - 'lease-fee-basis': 100, - 'experimental-anchors': None}] + 'lease-fee-basis': 100}] l1, l2 = node_factory.get_nodes(2, opts=opts) @@ -1864,12 +1860,10 @@ def test_v2_replay_bookkeeping(node_factory, bitcoind): opts = [{'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'rescan': 10, 'funding-confirms': 6, 'may_reconnect': True, - 'experimental-anchors': None}, + 'rescan': 10, 'funding-confirms': 6, 'may_reconnect': True}, {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'may_reconnect': True, - 'experimental-anchors': None}] + 'may_reconnect': True}] l1, l2, = node_factory.get_nodes(2, opts=opts) amount = 500000 @@ -1927,12 +1921,10 @@ def test_buy_liquidity_ad_check_bookkeeping(node_factory, bitcoind): opts = [{'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'rescan': 10, 'disable-plugin': 'bookkeeper', - 'funding-confirms': 6, 'may_reconnect': True, - 'experimental-anchors': None}, + 'funding-confirms': 6, 'may_reconnect': True}, {'funder-policy': 'match', 'funder-policy-mod': 100, 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, - 'may_reconnect': True, - 'experimental-anchors': None}] + 'may_reconnect': True}] l1, l2, = node_factory.get_nodes(2, opts=opts) amount = 500000 @@ -2421,7 +2413,7 @@ def test_no_anchor_liquidity_ads(node_factory, bitcoind): 'lease-fee-base-sat': '100sat', 'lease-fee-basis': 100, 'may_reconnect': True, 'funder-lease-requests-only': False} l1_opts = l2_opts.copy() - l1_opts['experimental-anchors'] = None + l2_opts['dev-no-anchors'] = None l1, l2 = node_factory.get_nodes(2, opts=[l1_opts, l2_opts]) feerate = 2000 @@ -2452,8 +2444,8 @@ def test_no_anchor_liquidity_ads(node_factory, bitcoind): @pytest.mark.parametrize("anchors", [False, True]) def test_commitment_feerate(bitcoind, node_factory, anchors): opts = {} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1, l2 = node_factory.get_nodes(2, opts=opts) @@ -2503,8 +2495,7 @@ def test_commitment_feerate(bitcoind, node_factory, anchors): @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd has different tx costs') def test_anchor_min_emergency(bitcoind, node_factory): - l1, l2 = node_factory.line_graph(2, opts={'experimental-anchors': None}, - fundchannel=False) + l1, l2 = node_factory.line_graph(2, fundchannel=False) addr = l1.rpc.newaddr()['bech32'] bitcoind.rpc.sendtoaddress(addr, 5000000 / 10**8) diff --git a/tests/test_pay.py b/tests/test_pay.py index 919ac39c5836..81131aa4afbf 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -279,7 +279,7 @@ def test_pay_disconnect(node_factory, bitcoind): l1.set_feerates((10**6, 10**6, 10**6, 10**6), False) # Wait for l1 notice - l1.daemon.wait_for_log(r'WARNING .*: update_fee \d+ outside range 1875-75000') + l1.daemon.wait_for_log(r'WARNING .*: update_fee \d+ outside range 253-75000') # They hang up on us l1.daemon.wait_for_log(r'Peer transient failure in CHANNELD_NORMAL') @@ -752,8 +752,8 @@ def test_wait_sendpay(node_factory, executor): def test_sendpay_cant_afford(node_factory, anchors): # Set feerates the same so we don't have to wait for update. opts = {'feerates': (15000, 15000, 15000, 15000)} - if anchors: - opts['experimental-anchors'] = None + if anchors is False: + opts['dev-disable-anchors'] = None l1, l2 = node_factory.line_graph(2, fundamount=10**6, opts=opts) @@ -2674,15 +2674,13 @@ def test_lockup_drain(node_factory, bitcoind): def test_htlc_too_dusty_outgoing(node_factory, bitcoind, chainparams): """ Try to hit the 'too much dust' limit, should fail the HTLC """ - feerate = 10000 # elements txs are bigger so they become dusty faster - max_dust_limit_sat = 100000 if chainparams['elements'] else 50000 - non_dust_htlc_val_sat = 20000 if chainparams['elements'] else 10000 - htlc_val_sat = 10000 if chainparams['elements'] else 5000 + max_dust_limit_sat = 1000 if chainparams['elements'] else 500 + non_dust_htlc_val_sat = 2000 if chainparams['elements'] else 1000 + htlc_val_sat = 250 l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, - 'feerates': (feerate, feerate, feerate, feerate), 'max-dust-htlc-exposure-msat': '{}sat'.format(max_dust_limit_sat), 'allow_warning': True}) @@ -2725,42 +2723,26 @@ def test_htlc_too_dusty_outgoing(node_factory, bitcoind, chainparams): res = only_one(l1.rpc.listsendpays(payment_hash=inv['payment_hash'])['payments']) assert res['status'] == 'pending' - # Ok, adjust our feerate upward, so the non-dust htlcs are now dust - # note that this is above the buffer we've been keeping, so the channel - # should automatically fail - l1.set_feerates([feerate * 2] * 4, False) - l1.restart() - - # Make sure fails before we try sending htlc! - l1.daemon.wait_for_log('Too much dust to update fee') - - # the channel should start warning -- too much dust - inv = l2.rpc.invoice(htlc_val_msat, str(num_dusty_htlcs + 1), str(num_dusty_htlcs + 1)) - with pytest.raises(RpcError, match=r'WIRE_TEMPORARY_CHANNEL_FAILURE'): - l1.rpc.sendpay(route, inv['payment_hash'], payment_secret=inv['payment_secret']) def test_htlc_too_dusty_incoming(node_factory, bitcoind): """ Try to hit the 'too much dust' limit, should fail the HTLC """ - feerate = 30000 l1, l2, l3 = node_factory.line_graph(3, opts=[{'may_reconnect': True, - 'feerates': (feerate, feerate, feerate, feerate), 'max-dust-htlc-exposure-msat': '200000sat'}, {'may_reconnect': True, - 'feerates': (feerate, feerate, feerate, feerate), - 'max-dust-htlc-exposure-msat': '100000sat', + 'max-dust-htlc-exposure-msat': '1000sat', 'fee-base': 0, 'fee-per-satoshi': 0}, - {'max-dust-htlc-exposure-msat': '500000sat'}], + {'max-dust-htlc-exposure-msat': '1000sat'}], wait_for_announce=True) # on the l2->l3, and l3 holds all the htlcs hostage # have l3 hold onto all the htlcs and not fulfill them l3.rpc.dev_ignore_htlcs(id=l2.info['id'], ignore=True) - # l2's max dust limit is set to 100k - max_dust_limit_sat = 100000 - htlc_val_sat = 10000 + # l2's max dust limit is set to 1k + max_dust_limit_sat = 1000 + htlc_val_sat = 250 htlc_val_msat = htlc_val_sat * 1000 num_dusty_htlcs = max_dust_limit_sat // htlc_val_sat route = l1.rpc.getroute(l3.info['id'], htlc_val_msat, 1)['route'] diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 7ec59adebc2f..ccca3c7af0c4 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -674,7 +674,7 @@ def test_openchannel_hook(node_factory, bitcoind): expected.update({ 'channel_id': '.*', 'channel_max_msat': 2100000000000000000, - 'commitment_feerate_per_kw': '7500', + 'commitment_feerate_per_kw': 3750, 'funding_feerate_per_kw': '7500', 'feerate_our_max': '150000', 'feerate_our_min': '1875', @@ -685,7 +685,7 @@ def test_openchannel_hook(node_factory, bitcoind): else: expected.update({ 'channel_reserve_msat': 1000000, - 'feerate_per_kw': '7500', + 'feerate_per_kw': 3750, 'funding_msat': 100000000, 'push_msat': 0, }) diff --git a/tests/utils.py b/tests/utils.py index 7e71af0de023..776245e7829b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -36,7 +36,7 @@ def hex_bits(features): def expected_peer_features(extra=[]): """Return the expected peer features hexstring for this configuration""" - features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 25, 27, 45, 47, 51] + features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 23, 25, 27, 45, 47, 51] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29] @@ -50,7 +50,7 @@ def expected_peer_features(extra=[]): # features for the 'node' and the 'peer' feature sets def expected_node_features(extra=[]): """Return the expected node features hexstring for this configuration""" - features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 25, 27, 45, 47, 51, 55] + features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 23, 25, 27, 45, 47, 51, 55] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29]