Skip to content

Commit 447d4d9

Browse files
Fernando Ledesmaclaude
andcommitted
Redefine SplicePrototype to use bit 63 instead of 155
Cherry-picked from lightningdevkit#4387 (98c3cff) This fixes Eclair compatibility issues where Eclair uses bit 155 for an incompatible previous splice design, causing deserialization failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 070b31d commit 447d4d9

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

lightning-types/src/features.rs

Lines changed: 8 additions & 20 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 | SpliceProduction,
169+
Trampoline | SimpleClose | SpliceProduction | SplicePrototype,
170170
// Byte 8 - 16
171171
,,,,,,,,,
172172
// Byte 17
173173
AnchorZeroFeeCommitmentsStaging,
174174
// Byte 18
175175
,
176176
// Byte 19
177-
HtlcHold | SplicePrototype,
177+
HtlcHold,
178178
]
179179
);
180180
define_context!(
@@ -195,15 +195,15 @@ mod sealed {
195195
// Byte 6
196196
ZeroConf | Keysend,
197197
// Byte 7
198-
Trampoline | SimpleClose | SpliceProduction,
198+
Trampoline | SimpleClose | SpliceProduction | SplicePrototype,
199199
// Byte 8 - 16
200200
,,,,,,,,,
201201
// Byte 17
202202
AnchorZeroFeeCommitmentsStaging,
203203
// Byte 18
204204
,
205205
// Byte 19
206-
HtlcHold | SplicePrototype,
206+
HtlcHold,
207207
// Byte 20 - 31
208208
,,,,,,,,,,,,
209209
// Byte 32
@@ -722,7 +722,7 @@ mod sealed {
722722
requires_htlc_hold
723723
);
724724
define_feature!(
725-
155, // Splice prototype feature bit as listed in https://github.com/lightning/bolts/issues/605#issuecomment-877237519.
725+
63, // Actually the SpliceProduction feature
726726
SplicePrototype,
727727
[InitContext, NodeContext],
728728
"Feature flags for channel splicing.",
@@ -1441,28 +1441,16 @@ mod tests {
14411441
// - onion_messages
14421442
// - option_channel_type | option_scid_alias
14431443
// - option_zeroconf
1444-
// - option_simple_close | option_splice
1445-
assert_eq!(node_features.flags.len(), 20);
1444+
// - option_simple_close
1445+
assert_eq!(node_features.flags.len(), 8);
14461446
assert_eq!(node_features.flags[0], 0b00000001);
14471447
assert_eq!(node_features.flags[1], 0b01010001);
14481448
assert_eq!(node_features.flags[2], 0b10001010);
14491449
assert_eq!(node_features.flags[3], 0b00001010);
14501450
assert_eq!(node_features.flags[4], 0b10001000);
14511451
assert_eq!(node_features.flags[5], 0b10100000);
14521452
assert_eq!(node_features.flags[6], 0b00001000);
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);
1453+
assert_eq!(node_features.flags[7], 0b10100000);
14661454
}
14671455

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

0 commit comments

Comments
 (0)