BOLT catchup: quiescence is included.

This means we should support it by default.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_quiesce` enabled by default.
Changelog-Deprecated: Config: --experimental-quiesce: it's now the default.
This commit is contained in:
Rusty Russell 2024-10-15 02:30:49 +10:30
parent c6be91f8ae
commit 3a9536fd37
11 changed files with 17 additions and 36 deletions

View file

@ -26,7 +26,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
DEFAULT_BOLTVERSION := 57ce4b1e05c996fa649f00dc13521f6d496a288f
DEFAULT_BOLTVERSION := 5dd9d9cd5fa9bc928c0fd47602ee84b7a15822a9
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)

View file

@ -313,7 +313,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)
status_debug("STFU initiator was remote.");
} else {
/* BOLT-quiescent #2:
/* BOLT #2:
*
* If both sides send `stfu` simultaneously, they will both
* set `initiator` to `1`, in which case the "initiator" is
@ -329,7 +329,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)
}
}
/* BOLT-quiescent #2:
/* BOLT #2:
* The receiver of `stfu`:
* - if it has sent `stfu` then:
* - MUST now consider the channel to be quiescent

View file

@ -115,6 +115,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
* | 24/25 | `option_route_blinding` |...IN9 ...
* | 26/27 | `option_shutdown_anysegwit` |... IN ...
* | 28/29 | `option_dual_fund` |... IN ...
* | 34/35 | `option_quiesce` | ... IN ...
* | 38/39 | `option_onion_messages` |... IN ...
* | 44/45 | `option_channel_type` |... IN ...
* | 46/47 | `option_scid_alias` | ... IN ...
@ -135,6 +136,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
#define OPT_ROUTE_BLINDING 24
#define OPT_SHUTDOWN_ANYSEGWIT 26
#define OPT_DUAL_FUND 28
#define OPT_QUIESCE 34
#define OPT_ONION_MESSAGES 38
#define OPT_CHANNEL_TYPE 44
#define OPT_SCID_ALIAS 46
@ -151,11 +153,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
#define OPT_SPLICE 62
#define OPT_EXPERIMENTAL_SPLICE 162
/* BOLT-quiescent #9:
* | 34/35 | `option_quiesce` | ... IN ...
*/
#define OPT_QUIESCE 34
#define OPT_SHUTDOWN_WRONG_FUNDING 104
/* BOLT-peer-storage #9:

View file

@ -919,6 +919,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_QUIESCE),
OPTIONAL_FEATURE(OPT_ONION_MESSAGES),
OPTIONAL_FEATURE(OPT_CHANNEL_TYPE),
OPTIONAL_FEATURE(OPT_ROUTE_BLINDING),

View file

@ -1260,10 +1260,6 @@ static char *opt_set_dual_fund(struct lightningd *ld)
static char *opt_set_splicing(struct lightningd *ld)
{
/* Splicing requires STFU to be enabled */
feature_set_or(ld->our_features,
take(feature_set_for_feature(NULL,
OPTIONAL_FEATURE(OPT_QUIESCE))));
feature_set_or(ld->our_features,
take(feature_set_for_feature(NULL,
OPTIONAL_FEATURE(OPT_EXPERIMENTAL_SPLICE))));
@ -1299,9 +1295,9 @@ static char *opt_set_peer_storage(struct lightningd *ld)
static char *opt_set_quiesce(struct lightningd *ld)
{
feature_set_or(ld->our_features,
take(feature_set_for_feature(NULL,
OPTIONAL_FEATURE(OPT_QUIESCE))));
if (!opt_deprecated_ok(ld, "experimental-quiesce", NULL,
"v24.11", "v25.05"))
return "--experimental-quiesce is now enabled by default";
return NULL;
}

View file

@ -3996,7 +3996,7 @@ def test_upgrade_statickey_fail(node_factory, executor, bitcoind):
def test_quiescence(node_factory, executor):
l1, l2 = node_factory.line_graph(2, opts={'experimental-quiesce': None})
l1, l2 = node_factory.line_graph(2)
# Works fine.
l1.pay(l2, 1000)

View file

@ -2373,6 +2373,7 @@ def test_list_features_only(node_factory):
'option_anchors/odd',
'option_route_blinding/odd',
'option_shutdown_anysegwit/odd',
'option_quiesce/odd',
'option_onion_messages/odd',
'option_channel_type/odd',
'option_scid_alias/odd',

View file

@ -38,12 +38,11 @@ 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, 39, 45, 47, 51]
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51]
if EXPERIMENTAL_DUAL_FUND:
# option_dual_fund
features += [29]
if EXPERIMENTAL_SPLICING:
features += [35] # option_quiesce
features += [163] # option_experimental_splice
if TEST_NETWORK != 'liquid-regtest':
# Anchors, except for elements
@ -55,12 +54,11 @@ 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, 39, 45, 47, 51, 55]
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51, 55]
if EXPERIMENTAL_DUAL_FUND:
# option_dual_fund
features += [29]
if EXPERIMENTAL_SPLICING:
features += [35] # option_quiesce
features += [163] # option_experimental_splice
if TEST_NETWORK != 'liquid-regtest':
# Anchors, except for elements

View file

@ -23,9 +23,9 @@
+subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16,
+subtypedata,lease_rates,lease_fee_base_sat,u32,
+subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
msgtype,shutdown,38
msgdata,shutdown,channel_id,channel_id,
msgdata,shutdown,len,u16,
msgtype,stfu,2
msgdata,stfu,channel_id,channel_id,
msgdata,stfu,initiator,u8,
@@ -215,6 +219,9 @@
msgtype,update_fee,134
msgdata,update_fee,channel_id,channel_id,

View file

@ -1,12 +0,0 @@
--- wire/peer_exp_wire.csv 2021-05-17 09:30:02.302260471 +0930
+++ - 2021-05-31 12:20:36.390910632 +0930
@@ -120,6 +82,9 @@
subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16,
subtypedata,lease_rates,lease_fee_base_sat,u32,
subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
+msgtype,stfu,2
+msgdata,stfu,channel_id,channel_id,
+msgdata,stfu,initiator,u8,
msgtype,shutdown,38
msgdata,shutdown,channel_id,channel_id,
msgdata,shutdown,len,u16,

View file

@ -366,7 +366,7 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id)
* * [`channel_id`:`channel_id`]
*/
case WIRE_STFU:
/* BOLT-quiescent #2:
/* BOLT #2:
* 1. type: 2 (`stfu`)
* 2. data:
* * [`channel_id`:`channel_id`]