mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
splice: Move splice to experimental feature bit
This was recommended by @t-bast: if the final spec commits to something compatible, we can simply advertize and accept both features, but if it does change in incompatible ways we won't cause problems for nodes who implement the official spec. (I split this, so first, we remove the OPT_SPLICE entirely, to make sure we caught them all. --RR) Suggested-by: @t-bast Changelog-None
This commit is contained in:
parent
5f8b77480c
commit
c50e93d9fb
@ -1494,7 +1494,7 @@ static u8 *send_commit_part(struct peer *peer,
|
||||
* send unless negotiated */
|
||||
if (feature_negotiated(peer->our_features,
|
||||
peer->their_features,
|
||||
OPT_SPLICE)) {
|
||||
OPT_EXPERIMENTAL_SPLICE)) {
|
||||
status_debug("send_commit_part(splice: %d, remote_splice: %d)",
|
||||
(int)splice_amnt, (int)remote_splice_amnt);
|
||||
|
||||
|
@ -142,7 +142,7 @@ static const struct feature_style feature_styles[] = {
|
||||
{ OPT_PROVIDE_PEER_BACKUP_STORAGE,
|
||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } },
|
||||
{ OPT_SPLICE,
|
||||
{ OPT_EXPERIMENTAL_SPLICE,
|
||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
|
||||
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT} },
|
||||
@ -491,6 +491,41 @@ const char *feature_name(const tal_t *ctx, size_t f)
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 100/101 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 110/111 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 120/121 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 130/131 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 140/141 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 150/151 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 160/161 */
|
||||
"option_experimental_splice", /* https://github.com/lightning/bolts/pull/863 */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* 170/171 */
|
||||
};
|
||||
|
||||
if (f / 2 >= ARRAY_SIZE(fnames) || !fnames[f / 2])
|
||||
|
@ -136,7 +136,11 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
||||
#define OPT_SHUTDOWN_ANYSEGWIT 26
|
||||
#define OPT_CHANNEL_TYPE 44
|
||||
#define OPT_PAYMENT_METADATA 48
|
||||
#define OPT_SPLICE 62
|
||||
|
||||
/* BOLT-splice #9:
|
||||
* | 62/63 | `option_splice` | ... IN ...
|
||||
*/
|
||||
#define OPT_EXPERIMENTAL_SPLICE 162
|
||||
|
||||
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #9:
|
||||
* | 28/29 | `option_dual_fund` | ... IN9 ...
|
||||
|
@ -74,6 +74,7 @@ class LnFeatureBits(object):
|
||||
OPTION_PROPOSED_UPFRONT_FEE = 56 # IN9 #1052
|
||||
OPTION_PROPOSED_CLOSING_REJECTED = 60 # IN #1016
|
||||
OPTION_PROPOSED_SPLICE = 62 # IN #863
|
||||
OPTION_PROPOSED_EXPERIMENTAL_SPLICE = 162 # IN #863
|
||||
|
||||
|
||||
def _parse_features(featurebytes):
|
||||
|
@ -1869,7 +1869,7 @@ static struct command_result *param_channel_for_splice(struct command *cmd,
|
||||
|
||||
if (!feature_negotiated(cmd->ld->our_features,
|
||||
(*channel)->peer->their_features,
|
||||
OPT_SPLICE))
|
||||
OPT_EXPERIMENTAL_SPLICE))
|
||||
return command_fail(cmd, SPLICE_NOT_SUPPORTED,
|
||||
"splicing not supported");
|
||||
|
||||
|
@ -1196,7 +1196,7 @@ static char *opt_set_splicing(struct lightningd *ld)
|
||||
OPTIONAL_FEATURE(OPT_QUIESCE))));
|
||||
feature_set_or(ld->our_features,
|
||||
take(feature_set_for_feature(NULL,
|
||||
OPTIONAL_FEATURE(OPT_SPLICE))));
|
||||
OPTIONAL_FEATURE(OPT_EXPERIMENTAL_SPLICE))));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1911,7 +1911,7 @@ void add_config_deprecated(struct lightningd *ld,
|
||||
json_add_bool(response, name0,
|
||||
feature_offered(ld->our_features
|
||||
->bits[INIT_FEATURE],
|
||||
OPT_SPLICE));
|
||||
OPT_EXPERIMENTAL_SPLICE));
|
||||
} else if (opt->cb == (void *)opt_set_onion_messages) {
|
||||
json_add_bool(response, name0,
|
||||
feature_offered(ld->our_features
|
||||
|
@ -44,7 +44,7 @@ def expected_peer_features(wumbo_channels=False, extra=[]):
|
||||
features += [29]
|
||||
if EXPERIMENTAL_SPLICING:
|
||||
features += [35] # option_quiesce
|
||||
features += [63] # option_splice
|
||||
features += [163] # option_experimental_splice
|
||||
return hex_bits(features + extra)
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ def expected_node_features(wumbo_channels=False, extra=[]):
|
||||
features += [29]
|
||||
if EXPERIMENTAL_SPLICING:
|
||||
features += [35] # option_quiesce
|
||||
features += [63] # option_splice
|
||||
features += [163] # option_experimental_splice
|
||||
return hex_bits(features + extra)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user