Signal splice prototype feature bit instead
What changed, and why it matters
This commit changes which experimental 'feature bit' the Lightning Dev Kit software advertises to peers for an unfinished channel-splicing capability. It stops advertising the older production-like bit and starts advertising a prototype bit that was agreed upon with other Lightning implementations. This is a protocol-compatibility and testing change, not a security fix or vulnerability.
No security action required. Treat as a normal protocol-compatibility change. Reviewers may want to confirm that the prototype bit number (155) matches the agreed BOLTS discussion and that the renamed production methods are not accidentally exposed as the default splicing API.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch renames feature bit 63 from Splice to SpliceProduction and adds feature bit 155 as SplicePrototype in lightning-types/src/features.rs. The InitContext and NodeContext feature maps are updated so that the prototype bit is advertised instead of the production bit. Public API method names are remapped to the prototype bit, while the production bit gets new method names. Test expectations are updated to reflect the new feature byte length and bit positions. The commit message states this is because splicing is incomplete and cross-implementation testing is still needed.
Changed components
lightning-types/src/features.rsLDK feature-bit advertisement for channel splicingInspect captured patch +35 / −12
diff --git a/lightning-types/src/features.rs b/lightning-types/src/features.rs
index 835c8d2..54f1d9e 100644
--- a/lightning-types/src/features.rs
+++ b/lightning-types/src/features.rs
@@ -166,7 +166,7 @@ mod sealed {
// Byte 6
ZeroConf,
// Byte 7
- Trampoline | SimpleClose | Splice,
+ Trampoline | SimpleClose | SpliceProduction,
// Byte 8 - 16
,,,,,,,,,
// Byte 17
@@ -174,7 +174,7 @@ mod sealed {
// Byte 18
,
// Byte 19
- HtlcHold,
+ HtlcHold | SplicePrototype,
]
);
define_context!(
@@ -195,7 +195,7 @@ mod sealed {
// Byte 6
ZeroConf | Keysend,
// Byte 7
- Trampoline | SimpleClose | Splice,
+ Trampoline | SimpleClose | SpliceProduction,
// Byte 8 - 16
,,,,,,,,,
// Byte 17
@@ -203,7 +203,7 @@ mod sealed {
// Byte 18
,
// Byte 19
- HtlcHold,
+ HtlcHold | SplicePrototype,
// Byte 20 - 31
,,,,,,,,,,,,
// Byte 32
@@ -687,14 +687,14 @@ mod sealed {
);
define_feature!(
63,
- Splice,
+ SpliceProduction,
[InitContext, NodeContext],
"Feature flags for channel splicing.",
- set_splicing_optional,
- set_splicing_required,
- clear_splicing,
- supports_splicing,
- requires_splicing
+ set_splicing_production_optional,
+ set_splicing_production_required,
+ clear_splicing_production,
+ supports_splicing_production,
+ requires_splicing_production
);
// By default, allocate enough bytes to cover up to Splice. Update this as new features are
// added which we expect to appear commonly across contexts.
@@ -721,6 +721,17 @@ mod sealed {
supports_htlc_hold,
requires_htlc_hold
);
+ define_feature!(
+ 155, // Splice prototype feature bit as listed in https://github.com/lightning/bolts/issues/605#issuecomment-877237519.
+ SplicePrototype,
+ [InitContext, NodeContext],
+ "Feature flags for channel splicing.",
+ set_splicing_optional,
+ set_splicing_required,
+ clear_splicing,
+ supports_splicing,
+ requires_splicing
+ );
define_feature!(
259,
DnsResolver,
@@ -1431,7 +1442,7 @@ mod tests {
// - option_channel_type | option_scid_alias
// - option_zeroconf
// - option_simple_close | option_splice
- assert_eq!(node_features.flags.len(), 8);
+ assert_eq!(node_features.flags.len(), 20);
assert_eq!(node_features.flags[0], 0b00000001);
assert_eq!(node_features.flags[1], 0b01010001);
assert_eq!(node_features.flags[2], 0b10001010);
@@ -1439,7 +1450,19 @@ mod tests {
assert_eq!(node_features.flags[4], 0b10001000);
assert_eq!(node_features.flags[5], 0b10100000);
assert_eq!(node_features.flags[6], 0b00001000);
- assert_eq!(node_features.flags[7], 0b10100000);
+ assert_eq!(node_features.flags[7], 0b00100000);
+ assert_eq!(node_features.flags[8], 0b00000000);
+ assert_eq!(node_features.flags[9], 0b00000000);
+ assert_eq!(node_features.flags[10], 0b00000000);
+ assert_eq!(node_features.flags[11], 0b00000000);
+ assert_eq!(node_features.flags[12], 0b00000000);
+ assert_eq!(node_features.flags[13], 0b00000000);
+ assert_eq!(node_features.flags[14], 0b00000000);
+ assert_eq!(node_features.flags[15], 0b00000000);
+ assert_eq!(node_features.flags[16], 0b00000000);
+ assert_eq!(node_features.flags[17], 0b00000000);
+ assert_eq!(node_features.flags[18], 0b00000000);
+ assert_eq!(node_features.flags[19], 0b00001000);
}
// Check that cleared flags are kept blank when converting back:
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.