Skip to content

Commit

Permalink
config: onion messages are now always enabled.
Browse files Browse the repository at this point in the history
Changelog-Added: Protocol: onion messages are now supported by default.
Changelog-Deprecated: Config: the --experimental-onion-messages option is ignored (on by default).
  • Loading branch information
rustyrussell authored and vincenzopalazzo committed Jul 10, 2024
1 parent 5d42600 commit 029034a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
1 change: 1 addition & 0 deletions doc/developers-guide/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
1 change: 1 addition & 0 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
14 changes: 6 additions & 8 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}])

Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit 029034a

Please sign in to comment.