From 1b413502e04de52948957fd2aa36ca6f859441f4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 18 Nov 2024 15:49:10 +1030 Subject: [PATCH] lightningd: deprecate experimental-offers option. Signed-off-by: Rusty Russell Changelog-Deprecated: Config: `experimental-offers` (it's now the default). --- .msggen.json | 4 +- cln-rpc/src/model.rs | 38 ++++++++++--------- contrib/msggen/msggen/schema.json | 8 ++++ doc/developers-guide/deprecations.md | 1 + .../plugin-development/hooks.md | 2 - .../getting-started/configuration.md | 11 ------ doc/lightningd-config.5.md | 4 -- doc/schemas/lightning-listconfigs.json | 8 ++++ lightningd/options.c | 7 +++- 9 files changed, 44 insertions(+), 39 deletions(-) diff --git a/.msggen.json b/.msggen.json index 6f8b217656a6..b711e91a55c3 100644 --- a/.msggen.json +++ b/.msggen.json @@ -7071,7 +7071,7 @@ }, "ListConfigs.configs.experimental-offers": { "added": "pre-v0.10.1", - "deprecated": null + "deprecated": "v24.11" }, "ListConfigs.configs.experimental-offers.set": { "added": "pre-v0.10.1", @@ -7083,7 +7083,7 @@ }, "ListConfigs.configs.experimental-onion-messages": { "added": "pre-v0.10.1", - "deprecated": null + "deprecated": "v24.08" }, "ListConfigs.configs.experimental-onion-messages.set": { "added": "pre-v0.10.1", diff --git a/cln-rpc/src/model.rs b/cln-rpc/src/model.rs index 798bcaf76e53..222bbbe2b980 100644 --- a/cln-rpc/src/model.rs +++ b/cln-rpc/src/model.rs @@ -8816,6 +8816,18 @@ pub mod responses { pub path: String, } + #[derive(Clone, Debug, Deserialize, Serialize)] + pub struct ListconfigsConfigsExperimentaloffers { + pub set: bool, + pub source: String, + } + + #[derive(Clone, Debug, Deserialize, Serialize)] + pub struct ListconfigsConfigsExperimentalonionmessages { + pub set: bool, + pub source: String, + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ListconfigsConfigsMaxlocktimeblocks { pub source: String, @@ -8984,18 +8996,6 @@ pub mod responses { pub source: String, } - #[derive(Clone, Debug, Deserialize, Serialize)] - pub struct ListconfigsConfigsExperimentaloffers { - pub set: bool, - pub source: String, - } - - #[derive(Clone, Debug, Deserialize, Serialize)] - pub struct ListconfigsConfigsExperimentalonionmessages { - pub set: bool, - pub source: String, - } - #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ListconfigsConfigsExperimentalpeerstorage { pub set: bool, @@ -9304,6 +9304,14 @@ pub mod responses { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ListconfigsConfigs { + #[deprecated] + #[serde(rename = "experimental-offers")] + #[serde(skip_serializing_if = "Option::is_none")] + pub experimental_offers: Option, + #[deprecated] + #[serde(rename = "experimental-onion-messages")] + #[serde(skip_serializing_if = "Option::is_none")] + pub experimental_onion_messages: Option, #[deprecated] #[serde(rename = "max-locktime-blocks")] #[serde(skip_serializing_if = "Option::is_none")] @@ -9371,12 +9379,6 @@ pub mod responses { #[serde(rename = "experimental-dual-fund")] #[serde(skip_serializing_if = "Option::is_none")] pub experimental_dual_fund: Option, - #[serde(rename = "experimental-offers")] - #[serde(skip_serializing_if = "Option::is_none")] - pub experimental_offers: Option, - #[serde(rename = "experimental-onion-messages")] - #[serde(skip_serializing_if = "Option::is_none")] - pub experimental_onion_messages: Option, #[serde(rename = "experimental-peer-storage")] #[serde(skip_serializing_if = "Option::is_none")] pub experimental_peer_storage: Option, diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 1788bde95120..13dce938a268 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -18687,6 +18687,10 @@ } }, "experimental-onion-messages": { + "deprecated": [ + "v24.08", + "v25.02" + ], "type": "object", "additionalProperties": false, "required": [ @@ -18711,6 +18715,10 @@ "experimental-offers": { "type": "object", "additionalProperties": false, + "deprecated": [ + "v24.11", + "v25.05" + ], "required": [ "set", "source" diff --git a/doc/developers-guide/deprecations.md b/doc/developers-guide/deprecations.md index 4239951d3ede..ebe6ae1b0e43 100644 --- a/doc/developers-guide/deprecations.md +++ b/doc/developers-guide/deprecations.md @@ -36,6 +36,7 @@ hidden: false | decodepay | Command | v24.11 | v25.11 | Use `decode` which is more powerful (since v23.05) | | close.tx | Field | v24.11 | v25.11 | Use txs array instead | | close.txid | Field | v24.11 | v25.11 | Use txids array instead | +| experimental-offers | Config | v24.11 | v25.05 | 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/developers-guide/plugin-development/hooks.md b/doc/developers-guide/plugin-development/hooks.md index ca39faedc742..95e6f1b1bb76 100644 --- a/doc/developers-guide/plugin-development/hooks.md +++ b/doc/developers-guide/plugin-development/hooks.md @@ -596,8 +596,6 @@ Because this is a chained hook, the daemon expects the result to be `{'result': ### `onion_message_recv` and `onion_message_recv_secret` -> 🚧 experimental-offers only - These two hooks are almost identical, in that they are called when an onion message is received. `onion_message_recv` is used for unsolicited messages (where the source knows that it is sending to this node), and `onion_message_recv_secret` is used for messages which use a blinded path we supplied. The latter hook will have a `pathsecret` field, the former never will. diff --git a/doc/getting-started/getting-started/configuration.md b/doc/getting-started/getting-started/configuration.md index 3e9767f366b2..5fc9ad6f3c78 100644 --- a/doc/getting-started/getting-started/configuration.md +++ b/doc/getting-started/getting-started/configuration.md @@ -492,17 +492,6 @@ Supported features can be listed with `lightningd --list-features-only` A build _with_ `--enable-experimental-features` flag hard-codes some of below options as enabled, ignoring their command line flag. It may also add support for even more features. The safest way to determine the active configuration is by checking `listconfigs` or by looking at `our_features` (bits) in `getinfo`. -- **experimental-onion-messages** - - Specifying this enables sending, forwarding and receiving onion messages, which are in draft status in the [bolt](https://github.com/lightning/bolts) specifications (PR #759). A build with `--enable-experimental-features` usually enables this via - experimental-offers, see below. - -- **experimental-offers** - - Specifying this enables the `offers` and `fetchinvoice` plugins and corresponding functionality, which are in draft status [bolt](https://github.com/lightning/bolts)#798 as [bolt12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md). - A build with `--enable-experimental-features` enables this permanently and usually - enables experimental-onion-messages as well. - - **fetchinvoice-noconnect** Specifying this prevents `fetchinvoice` and `sendinvoice` from trying to connect directly to the offering node as a last resort. diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index 25f80e8e4f7c..2e370bfa6c80 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -770,10 +770,6 @@ Experimental options are subject to breakage between releases: they are made available for advanced users who want to test proposed features. -* **experimental-offers** - - Specifying this enables `offers` functionality, which is in draft status ([bolt][bolt] #798) as [bolt12][bolt12]. - * **fetchinvoice-noconnect** Specifying this prevents `fetchinvoice`, `sendinvoice` and replying diff --git a/doc/schemas/lightning-listconfigs.json b/doc/schemas/lightning-listconfigs.json index 5224d80fc952..90698dadceb0 100644 --- a/doc/schemas/lightning-listconfigs.json +++ b/doc/schemas/lightning-listconfigs.json @@ -552,6 +552,10 @@ } }, "experimental-onion-messages": { + "deprecated": [ + "v24.08", + "v25.02" + ], "type": "object", "additionalProperties": false, "required": [ @@ -576,6 +580,10 @@ "experimental-offers": { "type": "object", "additionalProperties": false, + "deprecated": [ + "v24.11", + "v25.05" + ], "required": [ "set", "source" diff --git a/lightningd/options.c b/lightningd/options.c index d7c64a09aa94..f1395726bf8a 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1312,7 +1312,10 @@ static char *opt_set_anchor_zero_fee_htlc_tx(struct lightningd *ld) static char *opt_set_offers(struct lightningd *ld) { - /* FIXME: Deprecate */ + if (!opt_deprecated_ok(ld, "experimental-offers", NULL, + "v24.11", "v25.05")) + return "--experimental-offers has been deprecated (now the default)"; + return NULL; } @@ -1499,7 +1502,7 @@ static void register_opts(struct lightningd *ld) opt_hidden); opt_register_early_noarg("--experimental-offers", opt_set_offers, ld, - "EXPERIMENTAL: enable send and receive of offers"); + opt_hidden); opt_register_early_noarg("--experimental-shutdown-wrong-funding", opt_set_shutdown_wrong_funding, ld, "EXPERIMENTAL: allow shutdown with alternate txids");