From 029034a71bd6b7506b9e921ffa94d722bbe0424a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 10 Jul 2024 12:27:25 +0930 Subject: [PATCH] config: onion messages are now always enabled. Changelog-Added: Protocol: onion messages are now supported by default. Changelog-Deprecated: Config: the --experimental-onion-messages option is ignored (on by default). --- doc/developers-guide/deprecations.md | 1 + doc/lightningd-config.5.md | 9 +-------- lightningd/lightningd.c | 1 + lightningd/options.c | 14 ++++++-------- tests/test_misc.py | 1 + tests/test_pay.py | 3 ++- tests/utils.py | 4 ++-- 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/doc/developers-guide/deprecations.md b/doc/developers-guide/deprecations.md index 661fa475f..114207047 100644 --- a/doc/developers-guide/deprecations.md +++ b/doc/developers-guide/deprecations.md @@ -30,6 +30,7 @@ hidden: false | commando-blacklist | Command | v23.08 | v25.02 | replaced with `lightning-blacklistrune` | | listpeers.features.option_anchors_zero_fee_htlc_tx | Field | v24.08 | v25.08 | Renamed to `option_anchors` in the spec: check for that in `features` instead | | experimental-anchors | Config | v24.02 | v25.02 | Now the default | +| experimental-onion-messages | Config | v24.08 | v25.02 | Now the default | Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported. diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index 4dcc9f575..b1545fd5d 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -747,16 +747,9 @@ Experimental options are subject to breakage between releases: they are made available for advanced users who want to test proposed features. -* **experimental-onion-messages** - - Specifying this enables sending, forwarding and receiving onion messages, -which are in draft status in the [bolt][bolt] specifications (PR #759). -This is automatically enabled by `experimental-offers`. - * **experimental-offers** - Specifying this enables the `offers` and `fetchinvoice` plugins and -corresponding functionality, which are in draft status ([bolt][bolt] #798) as [bolt12][bolt12], as well as `experimental-onion-messages`. + Specifying this enables `offers` functionality, which is in draft status ([bolt][bolt] #798) as [bolt12][bolt12]. * **fetchinvoice-noconnect** diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 6f7a8dca5..984bbed77 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -913,6 +913,7 @@ static struct feature_set *default_features(const tal_t *ctx) OPTIONAL_FEATURE(OPT_PAYMENT_METADATA), OPTIONAL_FEATURE(OPT_SCID_ALIAS), OPTIONAL_FEATURE(OPT_ZEROCONF), + OPTIONAL_FEATURE(OPT_ONION_MESSAGES), OPTIONAL_FEATURE(OPT_CHANNEL_TYPE), OPTIONAL_FEATURE(OPT_ROUTE_BLINDING), /* Removed later for elements */ diff --git a/lightningd/options.c b/lightningd/options.c index 866294876..184d424a9 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1272,9 +1272,9 @@ static char *opt_set_splicing(struct lightningd *ld) static char *opt_set_onion_messages(struct lightningd *ld) { - feature_set_or(ld->our_features, - take(feature_set_for_feature(NULL, - OPTIONAL_FEATURE(OPT_ONION_MESSAGES)))); + if (!opt_deprecated_ok(ld, "experimental-onion-messages", NULL, + "v24.08", "v25.02")) + return "--experimental-onion-message is now enabled by default"; return NULL; } @@ -1316,7 +1316,7 @@ static char *opt_set_anchor_zero_fee_htlc_tx(struct lightningd *ld) static char *opt_set_offers(struct lightningd *ld) { ld->config.exp_offers = true; - return opt_set_onion_messages(ld); + return NULL; } static char *opt_set_db_upgrade(const char *arg, struct lightningd *ld) @@ -1499,12 +1499,10 @@ static void register_opts(struct lightningd *ld) /* This affects our features, so set early. */ opt_register_early_noarg("--experimental-onion-messages", opt_set_onion_messages, ld, - "EXPERIMENTAL: enable send, receive and relay" - " of onion messages and blinded payments"); + opt_hidden); opt_register_early_noarg("--experimental-offers", opt_set_offers, ld, - "EXPERIMENTAL: enable send and receive of offers" - " (also sets experimental-onion-messages)"); + "EXPERIMENTAL: enable send and receive of offers"); opt_register_early_noarg("--experimental-shutdown-wrong-funding", opt_set_shutdown_wrong_funding, ld, "EXPERIMENTAL: allow shutdown with alternate txids"); diff --git a/tests/test_misc.py b/tests/test_misc.py index 6cd2a9ed9..8b21b6fcb 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2372,6 +2372,7 @@ def test_list_features_only(node_factory): 'option_anchors/odd', 'option_route_blinding/odd', 'option_shutdown_anysegwit/odd', + 'option_onion_messages/odd', 'option_channel_type/odd', 'option_scid_alias/odd', 'option_zeroconf/odd'] diff --git a/tests/test_pay.py b/tests/test_pay.py index 3e8e4b27d..7a0fe8882 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -4703,7 +4703,8 @@ def test_fetchinvoice_autoconnect(node_factory, bitcoind): """We should autoconnect if we need to, to route.""" l1, l2 = node_factory.line_graph(2, wait_for_announce=True, - opts=[{}, + # No onion_message support in l1 + opts=[{'dev-force-features': -39}, {'experimental-offers': None, 'dev-allow-localhost': None}]) diff --git a/tests/utils.py b/tests/utils.py index 001cbec81..2598380c2 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 = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 45, 47, 51] + features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 39, 45, 47, 51] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29] @@ -53,7 +53,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, 45, 47, 51, 55] + features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 39, 45, 47, 51, 55] if EXPERIMENTAL_DUAL_FUND: # option_dual_fund features += [29]