diff --git a/doc/getting-started/getting-started/configuration.md b/doc/getting-started/getting-started/configuration.md index 6f1ed2631cfd..90973fd39828 100644 --- a/doc/getting-started/getting-started/configuration.md +++ b/doc/getting-started/getting-started/configuration.md @@ -292,10 +292,6 @@ The [`lightning-listconfigs`](ref:lightning-listconfigs) command will output a v ### Lightning channel and HTLC options -- **large-channels** - - Removes capacity limits for channel creation. Version 1.0 of the specification limited channel sizes to 16777215 satoshi. With this option (which your node will advertize to peers), your node will accept larger incoming channels and if the peer supports it, will open larger channels. Note: this option is spelled **large-channels** but it's pronounced **wumbo**. - - **watchtime-blocks**=_BLOCKS_ How long we need to spot an outdated close attempt: on opening a channel we tell our peer that this is how long they'll have to wait if they perform a unilateral close. @@ -512,4 +508,4 @@ A build _with_ `--enable-experimental-features` flag hard-codes some of below op - **experimental-websocket-port**=_PORT_ - Specifying this enables support for accepting incoming WebSocket connections on that port, on any IPv4 and IPv6 addresses you listen to ([bolt](https://github.com/lightning/bolts) #891). The normal protocol is expected to be sent over WebSocket binary frames once the connection is upgraded. \ No newline at end of file + Specifying this enables support for accepting incoming WebSocket connections on that port, on any IPv4 and IPv6 addresses you listen to ([bolt](https://github.com/lightning/bolts) #891). The normal protocol is expected to be sent over WebSocket binary frames once the connection is upgraded. diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md index 667198b7c50e..30ef45e3a8ad 100644 --- a/doc/lightning-listconfigs.7.md +++ b/doc/lightning-listconfigs.7.md @@ -427,7 +427,7 @@ EXAMPLE JSON RESPONSE "always-use-proxy": false, "daemon": "false", "wallet": "sqlite3:///media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/testnet/lightningd.sqlite3", - "wumbo": false, + "wumbo": true, "rgb": "03ad98", "alias": "BRUCEWAYN-TES-DEV", "pid-file": "/media/vincent/Maxtor/sanboxTestWrapperRPC/lightning_dir_dev/lightningd-testne...", diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index 0a91c2bb24a5..4445a8c447c7 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -389,13 +389,9 @@ use the RPC call lightning-setchannel(7). ### Lightning channel and HTLC options -* **large-channels** +* **large-channels** (deprecated in v23.11) - Removes capacity limits for channel creation. Version 1.0 of the specification -limited channel sizes to 16777215 satoshi. With this option (which your -node will advertize to peers), your node will accept larger incoming channels -and if the peer supports it, will open larger channels. Note: this option -is spelled **large-channels** but it's pronounced **wumbo**. + As of v23.11, this is the default (and thus, the option is ignored). Previously if you didn't specify this, channel sizes were limited to 16777215 satoshi. Note: this option is spelled **large-channels** but it's pronounced **wumbo**. * **watchtime-blocks**=*BLOCKS* diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 71e9b05aaa26..3f45aaa0321c 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -873,6 +873,7 @@ static struct feature_set *default_features(const tal_t *ctx) COMPULSORY_FEATURE(OPT_VAR_ONION), COMPULSORY_FEATURE(OPT_PAYMENT_SECRET), OPTIONAL_FEATURE(OPT_BASIC_MPP), + OPTIONAL_FEATURE(OPT_LARGE_CHANNELS), OPTIONAL_FEATURE(OPT_GOSSIP_QUERIES_EX), OPTIONAL_FEATURE(OPT_STATIC_REMOTEKEY), OPTIONAL_FEATURE(OPT_SHUTDOWN_ANYSEGWIT), diff --git a/lightningd/options.c b/lightningd/options.c index 2b8536cfef15..cfc84a4f65a7 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1150,9 +1150,7 @@ static bool opt_show_sat(char *buf, size_t len, const struct amount_sat *sat) static char *opt_set_wumbo(struct lightningd *ld) { - feature_set_or(ld->our_features, - take(feature_set_for_feature(NULL, - OPTIONAL_FEATURE(OPT_LARGE_CHANNELS)))); + /* Wumbo is now the default, FIXME: depreacted_apis! */ return NULL; } @@ -1392,7 +1390,7 @@ static void register_opts(struct lightningd *ld) /* This affects our features, so set early. */ opt_register_early_noarg("--large-channels|--wumbo", opt_set_wumbo, ld, - "Allow channels larger than 0.16777215 BTC"); + opt_hidden); opt_register_early_noarg("--experimental-dual-fund", opt_set_dual_fund, ld, diff --git a/tests/test_connection.py b/tests/test_connection.py index 93802c289157..a5b1d00b06f5 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1090,7 +1090,8 @@ def test_funding_all(node_factory, bitcoind): def test_funding_all_too_much(node_factory): """Add more than max possible funds, fund a channel using all funds we can. """ - l1, l2 = node_factory.line_graph(2, fundchannel=False) + # 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) l1.rpc.fundchannel(l2.info['id'], "all") @@ -1162,7 +1163,7 @@ def test_funding_fail(node_factory, bitcoind): def test_funding_toolarge(node_factory, bitcoind): """Try to create a giant channel""" l1 = node_factory.get_node() - l2 = node_factory.get_node() + l2 = node_factory.get_node(options={'dev-force-features': '-19'}) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) # Send funds. @@ -1301,11 +1302,10 @@ def test_funding_external_wallet_corners(node_factory, bitcoind): l1, l2 = node_factory.get_nodes(2, opts={'may_reconnect': True, 'dev-no-reconnect': None}) + # We have Wumbo, it's ok! amount = 2**24 l1.fundwallet(amount + 10000000) - amount = amount - 1 - # make sure we can generate PSBTs. addr = l1.rpc.newaddr()['bech32'] bitcoind.rpc.sendtoaddress(addr, (amount + 1000000) / 10**8) @@ -1326,10 +1326,6 @@ def test_funding_external_wallet_corners(node_factory, bitcoind): with pytest.raises(RpcError, match=r'No channel funding in progress.'): l1.rpc.fundchannel_complete(l2.info['id'], psbt) - # Fail to open (too large) - with pytest.raises(RpcError, match=r'Amount exceeded 16777215'): - l1.rpc.fundchannel_start(l2.info['id'], amount + 1) - start = l1.rpc.fundchannel_start(l2.info['id'], amount) with pytest.raises(RpcError, match=r'Already funding channel'): l1.rpc.fundchannel(l2.info['id'], amount) @@ -1423,11 +1419,10 @@ def test_funding_v2_corners(node_factory, bitcoind): l1 = node_factory.get_node(may_reconnect=True) l2 = node_factory.get_node(may_reconnect=True) + # We have wumbo, it's OK amount = 2**24 l1.fundwallet(amount + 10000000) - amount = amount - 1 - # make sure we can generate PSBTs. addr = l1.rpc.newaddr()['bech32'] bitcoind.rpc.sendtoaddress(addr, (amount + 1000000) / 10**8) @@ -1449,10 +1444,6 @@ def test_funding_v2_corners(node_factory, bitcoind): with pytest.raises(RpcError, match=r'Unknown channel'): l1.rpc.openchannel_signed(nonexist_chanid, psbt) - # Fail to open (too large) - with pytest.raises(RpcError, match=r'Amount exceeded 16777215'): - l1.rpc.openchannel_init(l2.info['id'], amount + 1, psbt) - start = l1.rpc.openchannel_init(l2.info['id'], amount, psbt) # We can abort a channel l1.rpc.openchannel_abort(start['channel_id']) @@ -2030,12 +2021,10 @@ def test_multifunding_disconnect(node_factory): @pytest.mark.openchannel('v2') def test_multifunding_wumbo(node_factory): ''' - Test wumbo channel imposition in multifundchannel. + Test wumbo channel imposition in multifundchannel. l3 not wumbo :( ''' - l1, l2, l3 = node_factory.get_nodes(3, - opts=[{'large-channels': None}, - {'large-channels': None}, - {}]) + l1, l2, l3 = node_factory.get_nodes(3, opts=[{}, {}, + {'dev-force-features': '-19'}]) l1.fundwallet(1 << 26) @@ -3473,13 +3462,11 @@ def test_pay_disconnect_stress(node_factory, executor): @pytest.mark.openchannel('v1') @pytest.mark.openchannel('v2') def test_wumbo_channels(node_factory, bitcoind): - l1, l2, l3 = node_factory.get_nodes(3, - opts=[{'large-channels': None}, - {'large-channels': None}, - {}]) + # l3 is not wumbo. + l1, l2, l3 = node_factory.get_nodes(3, opts=[{}, {}, {'dev-force-features': '-19'}]) conn = l1.rpc.connect(l2.info['id'], 'localhost', port=l2.port) - expected_features = expected_peer_features(wumbo_channels=True) + expected_features = expected_peer_features() assert conn['features'] == expected_features assert only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['features'] == expected_features @@ -3500,7 +3487,7 @@ def test_wumbo_channels(node_factory, bitcoind): # Make sure channel features are right from channel_announcement assert ([c['features'] for c in l3.rpc.listchannels()['channels']] - == [expected_channel_features(wumbo_channels=True)] * 2) + == [expected_channel_features()] * 2) # Make sure we can't open a wumbo channel if we don't agree. with pytest.raises(RpcError, match='Amount exceeded'): diff --git a/tests/test_misc.py b/tests/test_misc.py index ffcad5ee2594..9367157cdcd6 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -726,7 +726,7 @@ def test_listconfigs(node_factory, bitcoind, chainparams): assert c[valfield] == val assert 'plugin' not in c - # These are aliases, but we don't print the (unofficial!) wumbo. + # We don't print the (unofficial!) wumbo assert 'wumbo' not in configs assert configs['large-channels']['set'] is True assert configs['large-channels']['source'] == 'cmdline' @@ -2228,6 +2228,7 @@ def test_list_features_only(node_factory): 'option_static_remotekey/odd', 'option_payment_secret/even', 'option_basic_mpp/odd', + 'option_support_large_channel/odd', 'option_route_blinding/odd', 'option_shutdown_anysegwit/odd', 'option_channel_type/odd', diff --git a/tests/test_opening.py b/tests/test_opening.py index 8a10fa846017..c2554a2a436d 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -278,7 +278,7 @@ def test_v2_open_sigs_restart_while_dead(node_factory, bitcoind): @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2') def test_v2_rbf_single(node_factory, bitcoind, chainparams): - l1, l2 = node_factory.get_nodes(2, opts={'wumbo': None}) + l1, l2 = node_factory.get_nodes(2) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) amount = 2**24 @@ -377,8 +377,7 @@ def test_v2_rbf_single(node_factory, bitcoind, chainparams): @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2') def test_v2_rbf_abort_retry(node_factory, bitcoind, chainparams): - l1, l2 = node_factory.get_nodes(2, opts={'wumbo': None, - 'allow_warning': True}) + l1, l2 = node_factory.get_nodes(2, opts={'allow_warning': True}) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) amount = 2**24 diff --git a/tests/test_pay.py b/tests/test_pay.py index 2163db5d6fc7..7e22eb8f8b83 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2585,7 +2585,8 @@ def test_channel_spendable_large(node_factory, bitcoind): def test_channel_spendable_receivable_capped(node_factory, bitcoind): """Test that spendable_msat and receivable_msat is capped at 2^32-1""" sats = 16777215 - l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=False) + l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=False, + opts={'dev-force-features': '-19'}) assert l1.rpc.listpeerchannels()['channels'][0]['spendable_msat'] == Millisatoshi(0xFFFFFFFF) assert l2.rpc.listpeerchannels()['channels'][0]['receivable_msat'] == Millisatoshi(0xFFFFFFFF) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index aee64ecf6bb7..17820dd48e15 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -673,7 +673,7 @@ def test_openchannel_hook(node_factory, bitcoind): # openchannel2 var checks expected.update({ 'channel_id': '.*', - 'channel_max_msat': 16777215000, + 'channel_max_msat': 2100000000000000000, 'commitment_feerate_per_kw': '7500', 'funding_feerate_per_kw': '7500', 'feerate_our_max': '150000', @@ -1771,8 +1771,7 @@ def test_bitcoin_bad_estimatefee(node_factory, bitcoind): plugin = os.path.join(os.getcwd(), "tests/plugins/badestimate.py") l1 = node_factory.get_node(options={"disable-plugin": "bcli", "plugin": plugin, - "badestimate-badorder": True, - "wumbo": None}, + "badestimate-badorder": True}, start=False, may_fail=True, allow_broken_log=True) l1.daemon.start(wait_for_initialized=False, stderr_redir=True) @@ -1783,8 +1782,7 @@ def test_bitcoin_bad_estimatefee(node_factory, bitcoind): l1.start() l2 = node_factory.get_node(options={"disable-plugin": "bcli", - "plugin": plugin, - "wumbo": None}) + "plugin": plugin}) # Give me some funds. bitcoind.generate_block(5) l1.fundwallet(100 * 10**8) diff --git a/tests/utils.py b/tests/utils.py index 0a75342abe0a..7e71af0de023 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -34,11 +34,9 @@ def hex_bits(features): return res.hex -def expected_peer_features(wumbo_channels=False, extra=[]): +def expected_peer_features(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 wumbo_channels: - features += [19] + features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 25, 27, 45, 47, 51] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29] @@ -50,11 +48,9 @@ def expected_peer_features(wumbo_channels=False, extra=[]): # With the addition of the keysend plugin, we now send a different set of # features for the 'node' and the 'peer' feature sets -def expected_node_features(wumbo_channels=False, extra=[]): +def expected_node_features(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 wumbo_channels: - features += [19] + features = [1, 5, 7, 8, 11, 13, 14, 17, 19, 25, 27, 45, 47, 51, 55] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29] @@ -64,7 +60,7 @@ def expected_node_features(wumbo_channels=False, extra=[]): return hex_bits(features + extra) -def expected_channel_features(wumbo_channels=False, extra=[]): +def expected_channel_features(extra=[]): """Return the expected channel features hexstring for this configuration""" features = [] return hex_bits(features + extra)