From 4e94a6cb2b10ddace0c0bad77e73f5d88192e04f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 27 Jun 2025 14:12:18 +0930 Subject: [PATCH] lightningd: make option_channel_type compulsory. As per BOLT recommendation https://github.com/lightning/bolts/pull/1232, this means we will insist on this being available. For CLN, we added this in 0.12.0 (2022-08-23), though there were fixes as late as 24.02. Either way that's well outside our support window. Signed-off-by: Rusty Russell Closes: https://github.com/ElementsProject/lightning/issues/8152 Changelog-Changed: Protocol: We now insist that peers support `option_channel_type` (in CLN since 0.12.0 in late 2022, similar for other implementations). --- lightningd/lightningd.c | 2 +- tests/test_misc.py | 2 +- tests/utils.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index b75a3087c..0d7faa0dc 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -926,7 +926,7 @@ static struct feature_set *default_features(const tal_t *ctx) OPTIONAL_FEATURE(OPT_ZEROCONF), OPTIONAL_FEATURE(OPT_QUIESCE), OPTIONAL_FEATURE(OPT_ONION_MESSAGES), - OPTIONAL_FEATURE(OPT_CHANNEL_TYPE), + COMPULSORY_FEATURE(OPT_CHANNEL_TYPE), OPTIONAL_FEATURE(OPT_ROUTE_BLINDING), OPTIONAL_FEATURE(OPT_PROVIDE_STORAGE), /* Removed later for elements */ diff --git a/tests/test_misc.py b/tests/test_misc.py index ed6ff3893..5f2ffb394 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2405,7 +2405,7 @@ def test_list_features_only(node_factory): 'option_quiesce/odd', 'option_onion_messages/odd', 'option_provide_storage/odd', - 'option_channel_type/odd', + 'option_channel_type/even', 'option_scid_alias/odd', 'option_zeroconf/odd'] expected += ['supports_open_accept_channel_type'] diff --git a/tests/utils.py b/tests/utils.py index 5b682c6c3..ed1e12a73 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -41,7 +41,7 @@ def hex_bits(features): def expected_peer_features(extra=[]): """Return the expected peer features hexstring for this configuration""" - features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 43, 45, 47, 51] + features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 43, 44, 47, 51] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29] @@ -57,7 +57,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 = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 43, 45, 47, 51, 55] + features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 43, 44, 47, 51, 55] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29]