Skip to content

Commit 7a53d67

Browse files
committed
Signal splice prototype feature bit instead
As our splice implementation is not yet complete (missing RBF support) and we still need to do cross-compatibility testing with eclair/CLN, we signal the agreed upon prototype feature bit instead.
1 parent fcb1164 commit 7a53d67

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

lightning-types/src/features.rs

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ mod sealed {
166166
// Byte 6
167167
ZeroConf,
168168
// Byte 7
169-
Trampoline | SimpleClose | Splice,
169+
Trampoline | SimpleClose | SpliceProduction,
170170
// Byte 8 - 16
171171
,,,,,,,,,
172172
// Byte 17
173173
AnchorZeroFeeCommitmentsStaging,
174174
// Byte 18
175175
,
176176
// Byte 19
177-
HtlcHold,
177+
HtlcHold | SplicePrototype,
178178
]
179179
);
180180
define_context!(
@@ -195,15 +195,15 @@ mod sealed {
195195
// Byte 6
196196
ZeroConf | Keysend,
197197
// Byte 7
198-
Trampoline | SimpleClose | Splice,
198+
Trampoline | SimpleClose | SpliceProduction,
199199
// Byte 8 - 16
200200
,,,,,,,,,
201201
// Byte 17
202202
AnchorZeroFeeCommitmentsStaging,
203203
// Byte 18
204204
,
205205
// Byte 19
206-
HtlcHold,
206+
HtlcHold | SplicePrototype,
207207
// Byte 20 - 31
208208
,,,,,,,,,,,,
209209
// Byte 32
@@ -687,14 +687,14 @@ mod sealed {
687687
);
688688
define_feature!(
689689
63,
690-
Splice,
690+
SpliceProduction,
691691
[InitContext, NodeContext],
692692
"Feature flags for channel splicing.",
693-
set_splicing_optional,
694-
set_splicing_required,
695-
clear_splicing,
696-
supports_splicing,
697-
requires_splicing
693+
set_splicing_production_optional,
694+
set_splicing_production_required,
695+
clear_splicing_production,
696+
supports_splicing_production,
697+
requires_splicing_production
698698
);
699699
// By default, allocate enough bytes to cover up to Splice. Update this as new features are
700700
// added which we expect to appear commonly across contexts.
@@ -721,6 +721,17 @@ mod sealed {
721721
supports_htlc_hold,
722722
requires_htlc_hold
723723
);
724+
define_feature!(
725+
155, // Splice prototype feature bit as listed in https://github.com/lightning/bolts/issues/605#issuecomment-877237519.
726+
SplicePrototype,
727+
[InitContext, NodeContext],
728+
"Feature flags for channel splicing.",
729+
set_splicing_optional,
730+
set_splicing_required,
731+
clear_splicing,
732+
supports_splicing,
733+
requires_splicing
734+
);
724735
define_feature!(
725736
259,
726737
DnsResolver,
@@ -1431,15 +1442,27 @@ mod tests {
14311442
// - option_channel_type | option_scid_alias
14321443
// - option_zeroconf
14331444
// - option_simple_close | option_splice
1434-
assert_eq!(node_features.flags.len(), 8);
1445+
assert_eq!(node_features.flags.len(), 20);
14351446
assert_eq!(node_features.flags[0], 0b00000001);
14361447
assert_eq!(node_features.flags[1], 0b01010001);
14371448
assert_eq!(node_features.flags[2], 0b10001010);
14381449
assert_eq!(node_features.flags[3], 0b00001010);
14391450
assert_eq!(node_features.flags[4], 0b10001000);
14401451
assert_eq!(node_features.flags[5], 0b10100000);
14411452
assert_eq!(node_features.flags[6], 0b00001000);
1442-
assert_eq!(node_features.flags[7], 0b10100000);
1453+
assert_eq!(node_features.flags[7], 0b00100000);
1454+
assert_eq!(node_features.flags[8], 0b00000000);
1455+
assert_eq!(node_features.flags[9], 0b00000000);
1456+
assert_eq!(node_features.flags[10], 0b00000000);
1457+
assert_eq!(node_features.flags[11], 0b00000000);
1458+
assert_eq!(node_features.flags[12], 0b00000000);
1459+
assert_eq!(node_features.flags[13], 0b00000000);
1460+
assert_eq!(node_features.flags[14], 0b00000000);
1461+
assert_eq!(node_features.flags[15], 0b00000000);
1462+
assert_eq!(node_features.flags[16], 0b00000000);
1463+
assert_eq!(node_features.flags[17], 0b00000000);
1464+
assert_eq!(node_features.flags[18], 0b00000000);
1465+
assert_eq!(node_features.flags[19], 0b00001000);
14431466
}
14441467

14451468
// Check that cleared flags are kept blank when converting back:

0 commit comments

Comments
 (0)