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 authored and nepet committed Nov 2, 2023
1 parent 10bac49 commit f004952
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 60 deletions.
6 changes: 1 addition & 5 deletions doc/getting-started/getting-started/configuration.md
Original file line number Diff line number Diff line change
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 @@ -517,4 +513,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
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,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
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,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 @@ -1414,7 +1412,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
37 changes: 12 additions & 25 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,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 @@ -1146,7 +1147,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.
Expand Down Expand Up @@ -1285,11 +1286,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 @@ -1310,10 +1310,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 @@ -1406,11 +1402,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 @@ -1432,10 +1427,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 @@ -2013,12 +2004,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 @@ -3453,13 +3442,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 @@ -3480,7 +3467,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
3 changes: 2 additions & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
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 Expand Up @@ -2251,6 +2251,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',
Expand Down
5 changes: 2 additions & 3 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2641,7 +2641,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)

Expand Down
8 changes: 3 additions & 5 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -1776,8 +1776,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 @@ -1788,8 +1787,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
Original file line number Diff line number Diff line change
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 f004952

Please sign in to comment.