From 55dbe82162cab9d53d9de57a155cb56ef4386c5a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 8 Oct 2021 10:01:04 +1030 Subject: [PATCH] features: EXPERIMENTAL_FEATURES: advertize option_quiesce The latest draft has a feature bit here. Signed-off-by: Rusty Russell --- common/features.c | 6 +++++- common/features.h | 5 +++++ lightningd/lightningd.c | 1 + tests/test_misc.py | 1 + tests/utils.py | 4 ++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/features.c b/common/features.c index 1f3ef3ae9..c91ab9503 100644 --- a/common/features.c +++ b/common/features.c @@ -88,6 +88,10 @@ static const struct feature_style feature_styles[] = { .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, [CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } }, + { OPT_QUIESCE, + .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, + [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, + [CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } }, }; struct dependency { @@ -393,7 +397,7 @@ const char *feature_name(const tal_t *ctx, size_t f) "option_dual_fund", "option_amp", /* 30/31 */ /* https://github.com/lightningnetwork/lightning-rfc/pull/658 */ NULL, - "option_upgrade_channel", /* https://github.com/lightningnetwork/lightning-rfc/pull/868 */ + "option_quiesce", /* https://github.com/lightningnetwork/lightning-rfc/pull/869 */ NULL, "option_onion_messages", /* https://github.com/lightningnetwork/lightning-rfc/pull/759 */ "option_want_peer_backup", /* 40/41 */ /* https://github.com/lightningnetwork/lightning-rfc/pull/881 */ diff --git a/common/features.h b/common/features.h index 828685cc9..4bb2a78ec 100644 --- a/common/features.h +++ b/common/features.h @@ -130,6 +130,11 @@ const char *fmt_featurebits(const tal_t *ctx, const u8 *featurebits); */ #define OPT_DUAL_FUND 28 +/* BOLT-quiescent #9: + * | 34/35 | `option_quiesce` | ... IN ... + */ +#define OPT_QUIESCE 34 + /* BOLT-1ede04a1a3225581e265b3ce96984ba88253a4a4 #9: * * | 38/39 | `option_onion_messages` |... INC+ ... diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 1bc644c78..84f9c9cd5 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -806,6 +806,7 @@ static struct feature_set *default_features(const tal_t *ctx) OPTIONAL_FEATURE(OPT_SHUTDOWN_ANYSEGWIT), #if EXPERIMENTAL_FEATURES OPTIONAL_FEATURE(OPT_ANCHOR_OUTPUTS), + OPTIONAL_FEATURE(OPT_QUIESCE), OPTIONAL_FEATURE(OPT_ONION_MESSAGES), #endif }; diff --git a/tests/test_misc.py b/tests/test_misc.py index 246798d14..4b99e67f1 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1923,6 +1923,7 @@ def test_list_features_only(node_factory): if EXPERIMENTAL_FEATURES: expected += ['option_anchor_outputs/odd'] expected += ['option_shutdown_anysegwit/odd'] + expected += ['option_quiesce/odd'] expected += ['option_onion_messages/odd'] expected += ['supports_open_accept_channel_type'] else: diff --git a/tests/utils.py b/tests/utils.py index a21851b20..2e1436987 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -26,6 +26,8 @@ def expected_peer_features(wumbo_channels=False, extra=[]): features += [39] # option_anchor_outputs features += [21] + # option_quiesce + features += [35] if wumbo_channels: features += [19] if EXPERIMENTAL_DUAL_FUND: @@ -46,6 +48,8 @@ def expected_node_features(wumbo_channels=False, extra=[]): features += [39] # option_anchor_outputs features += [21] + # option_quiesce + features += [35] if wumbo_channels: features += [19] if EXPERIMENTAL_DUAL_FUND: