Skip to content

Commit

Permalink
lightningd: wumbo is now the default, setting has no effect.
Browse files Browse the repository at this point in the history
"Patrick, I'm sorry I doubted you."

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Config: `large-channels` is now the default, wumbology for all.
  • Loading branch information
rustyrussell committed Oct 19, 2023
1 parent e938999 commit 6094f6c
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 57 deletions.
6 changes: 1 addition & 5 deletions doc/getting-started/getting-started/configuration.md
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
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.
2 changes: 1 addition & 1 deletion doc/lightning-listconfigs.7.md
Expand Up @@ -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...",
Expand Down
8 changes: 2 additions & 6 deletions doc/lightningd-config.5.md
Expand Up @@ -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*

Expand Down
1 change: 1 addition & 0 deletions lightningd/lightningd.c
Expand Up @@ -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),
Expand Down
6 changes: 2 additions & 4 deletions lightningd/options.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
Expand Down
35 changes: 11 additions & 24 deletions tests/test_connection.py
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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'])
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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'):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.py
Expand Up @@ -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'
Expand Down
5 changes: 2 additions & 3 deletions tests/test_opening.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/test_plugin.py
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
14 changes: 5 additions & 9 deletions tests/utils.py
Expand Up @@ -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]
Expand All @@ -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]
Expand All @@ -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)
Expand Down

0 comments on commit 6094f6c

Please sign in to comment.