Skip to content

Commit 8f0ff20

Browse files
committed
BOLT catchup: quiescence is included.
This means we should support it by default. Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: Protocol: `option_quiesce` enabled by default. Changelog-Deprecated: Config: --experimental-quiesce: it's now the default.
1 parent 6f78abe commit 8f0ff20

File tree

10 files changed

+16
-36
lines changed

10 files changed

+16
-36
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CCANDIR := ccan
2626

2727
# Where we keep the BOLT RFCs
2828
BOLTDIR := ../bolts/
29-
DEFAULT_BOLTVERSION := 57ce4b1e05c996fa649f00dc13521f6d496a288f
29+
DEFAULT_BOLTVERSION := 5dd9d9cd5fa9bc928c0fd47602ee84b7a15822a9
3030
# Can be overridden on cmdline.
3131
BOLTVERSION := $(DEFAULT_BOLTVERSION)
3232

channeld/channeld.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)
313313

314314
status_debug("STFU initiator was remote.");
315315
} else {
316-
/* BOLT-quiescent #2:
316+
/* BOLT #2:
317317
*
318318
* If both sides send `stfu` simultaneously, they will both
319319
* set `initiator` to `1`, in which case the "initiator" is
@@ -329,7 +329,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)
329329
}
330330
}
331331

332-
/* BOLT-quiescent #2:
332+
/* BOLT #2:
333333
* The receiver of `stfu`:
334334
* - if it has sent `stfu` then:
335335
* - MUST now consider the channel to be quiescent

common/features.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
115115
* | 24/25 | `option_route_blinding` |...IN9 ...
116116
* | 26/27 | `option_shutdown_anysegwit` |... IN ...
117117
* | 28/29 | `option_dual_fund` |... IN ...
118+
* | 34/35 | `option_quiesce` | ... IN ...
118119
* | 38/39 | `option_onion_messages` |... IN ...
119120
* | 44/45 | `option_channel_type` |... IN ...
120121
* | 46/47 | `option_scid_alias` | ... IN ...
@@ -135,6 +136,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
135136
#define OPT_ROUTE_BLINDING 24
136137
#define OPT_SHUTDOWN_ANYSEGWIT 26
137138
#define OPT_DUAL_FUND 28
139+
#define OPT_QUIESCE 34
138140
#define OPT_ONION_MESSAGES 38
139141
#define OPT_CHANNEL_TYPE 44
140142
#define OPT_SCID_ALIAS 46
@@ -151,11 +153,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
151153
#define OPT_SPLICE 62
152154
#define OPT_EXPERIMENTAL_SPLICE 162
153155

154-
/* BOLT-quiescent #9:
155-
* | 34/35 | `option_quiesce` | ... IN ...
156-
*/
157-
#define OPT_QUIESCE 34
158-
159156
#define OPT_SHUTDOWN_WRONG_FUNDING 104
160157

161158
/* BOLT-peer-storage #9:

lightningd/lightningd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,7 @@ static struct feature_set *default_features(const tal_t *ctx)
919919
OPTIONAL_FEATURE(OPT_PAYMENT_METADATA),
920920
OPTIONAL_FEATURE(OPT_SCID_ALIAS),
921921
OPTIONAL_FEATURE(OPT_ZEROCONF),
922+
OPTIONAL_FEATURE(OPT_QUIESCE),
922923
OPTIONAL_FEATURE(OPT_ONION_MESSAGES),
923924
OPTIONAL_FEATURE(OPT_CHANNEL_TYPE),
924925
OPTIONAL_FEATURE(OPT_ROUTE_BLINDING),

lightningd/options.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,6 @@ static char *opt_set_dual_fund(struct lightningd *ld)
12601260

12611261
static char *opt_set_splicing(struct lightningd *ld)
12621262
{
1263-
/* Splicing requires STFU to be enabled */
1264-
feature_set_or(ld->our_features,
1265-
take(feature_set_for_feature(NULL,
1266-
OPTIONAL_FEATURE(OPT_QUIESCE))));
12671263
feature_set_or(ld->our_features,
12681264
take(feature_set_for_feature(NULL,
12691265
OPTIONAL_FEATURE(OPT_EXPERIMENTAL_SPLICE))));
@@ -1299,9 +1295,9 @@ static char *opt_set_peer_storage(struct lightningd *ld)
12991295

13001296
static char *opt_set_quiesce(struct lightningd *ld)
13011297
{
1302-
feature_set_or(ld->our_features,
1303-
take(feature_set_for_feature(NULL,
1304-
OPTIONAL_FEATURE(OPT_QUIESCE))));
1298+
if (!opt_deprecated_ok(ld, "experimental-quiesce", NULL,
1299+
"v24.11", "v25.05"))
1300+
return "--experimental-quiesce is now enabled by default";
13051301
return NULL;
13061302
}
13071303

tests/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3996,7 +3996,7 @@ def test_upgrade_statickey_fail(node_factory, executor, bitcoind):
39963996

39973997

39983998
def test_quiescence(node_factory, executor):
3999-
l1, l2 = node_factory.line_graph(2, opts={'experimental-quiesce': None})
3999+
l1, l2 = node_factory.line_graph(2)
40004000

40014001
# Works fine.
40024002
l1.pay(l2, 1000)

tests/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ def hex_bits(features):
3838

3939
def expected_peer_features(extra=[]):
4040
"""Return the expected peer features hexstring for this configuration"""
41-
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 39, 45, 47, 51]
41+
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51]
4242
if EXPERIMENTAL_DUAL_FUND:
4343
# option_dual_fund
4444
features += [29]
4545
if EXPERIMENTAL_SPLICING:
46-
features += [35] # option_quiesce
4746
features += [163] # option_experimental_splice
4847
if TEST_NETWORK != 'liquid-regtest':
4948
# Anchors, except for elements
@@ -55,12 +54,11 @@ def expected_peer_features(extra=[]):
5554
# features for the 'node' and the 'peer' feature sets
5655
def expected_node_features(extra=[]):
5756
"""Return the expected node features hexstring for this configuration"""
58-
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 39, 45, 47, 51, 55]
57+
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51, 55]
5958
if EXPERIMENTAL_DUAL_FUND:
6059
# option_dual_fund
6160
features += [29]
6261
if EXPERIMENTAL_SPLICING:
63-
features += [35] # option_quiesce
6462
features += [163] # option_experimental_splice
6563
if TEST_NETWORK != 'liquid-regtest':
6664
# Anchors, except for elements

wire/extracted_peer_04_opt_will_fund.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
+subtypedata,lease_rates,channel_fee_max_proportional_thousandths,u16,
2424
+subtypedata,lease_rates,lease_fee_base_sat,u32,
2525
+subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
26-
msgtype,shutdown,38
27-
msgdata,shutdown,channel_id,channel_id,
28-
msgdata,shutdown,len,u16,
26+
msgtype,stfu,2
27+
msgdata,stfu,channel_id,channel_id,
28+
msgdata,stfu,initiator,u8,
2929
@@ -215,6 +219,9 @@
3030
msgtype,update_fee,134
3131
msgdata,update_fee,channel_id,channel_id,

wire/extracted_peer_09_quiescence-protocol.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

wire/peer_wire.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id)
366366
* * [`channel_id`:`channel_id`]
367367
*/
368368
case WIRE_STFU:
369-
/* BOLT-quiescent #2:
369+
/* BOLT #2:
370370
* 1. type: 2 (`stfu`)
371371
* 2. data:
372372
* * [`channel_id`:`channel_id`]

0 commit comments

Comments
 (0)