Switch 0FC to production feature bit
What changed, and why it matters
This commit changes the feature bit used to advertise a new Lightning protocol capability called 'zero-fee commitment anchors' from an experimental/staging number (141) to the official production number (41). Feature bits are how Lightning nodes tell each other which protocol extensions they support during connection setup. The change itself is a protocol compatibility update, not a fix for a vulnerability. However, because it swaps a staging feature for a production one, nodes running older code that only understood the staging bit may fail to recognize the capability in peers running the new code, which could cause interoperability problems or prevent opening of certain channel types.
Treat this as a routine protocol update, not a security patch. Operators and integrators should verify that any counterparties or dependent software that relied on the staging bit 141 are updated to recognize production bit 41 before deploying this commit, to avoid failed channel opens or feature negotiation. No emergency response is warranted.
Security signals we found
Protocol feature bit reassignment from staging to production
Removal of experimental/staging feature bit 141
Addition of production feature bit 41 for option_zero_fee_commitments
Potential interoperability break with nodes that only recognize the staging bit
Evidence from the diff
The patch moves AnchorZeroFeeCommitments from bit 141 (the staging/experimental offset used by LDK) to bit 41 (the BOLTs-assigned production bit) in lightning-types/src/features.rs. It updates the InitContext, NodeContext, and ChannelTypeContext feature maps, removes the AnchorZeroFeeCommitmentsStaging definition, and renames the trait used by ChannelTypeFeatures::anchors_zero_fee_commitments() to the production feature. The HtlcHold staging feature at bit 153 remains untouched. This is a protocol-versioning change rather than a memory-safety or cryptographic bug fix.
Changed components
lightning-types/src/features.rsChannelTypeFeatures::anchors_zero_fee_commitments()Lightning feature-bit negotiation (init messages and channel types)Inspect captured patch +19 / −31
diff --git a/lightning-types/src/features.rs b/lightning-types/src/features.rs
index 22493ef..3cd1568 100644
--- a/lightning-types/src/features.rs
+++ b/lightning-types/src/features.rs
@@ -162,17 +162,13 @@ mod sealed {
// Byte 4
Quiescence | OnionMessages,
// Byte 5
- ProvideStorage | ChannelType | SCIDPrivacy,
+ AnchorZeroFeeCommitments | ProvideStorage | ChannelType | SCIDPrivacy,
// Byte 6
ZeroConf,
// Byte 7
Trampoline | SimpleClose | Splice,
- // Byte 8 - 16
- ,,,,,,,,,
- // Byte 17
- AnchorZeroFeeCommitmentsStaging,
- // Byte 18
- ,
+ // Byte 8 - 18
+ ,,,,,,,,,,,
// Byte 19
HtlcHold,
]
@@ -191,17 +187,13 @@ mod sealed {
// Byte 4
Quiescence | OnionMessages,
// Byte 5
- ProvideStorage | ChannelType | SCIDPrivacy,
+ AnchorZeroFeeCommitments | ProvideStorage | ChannelType | SCIDPrivacy,
// Byte 6
ZeroConf | Keysend,
// Byte 7
Trampoline | SimpleClose | Splice,
- // Byte 8 - 16
- ,,,,,,,,,
- // Byte 17
- AnchorZeroFeeCommitmentsStaging,
- // Byte 18
- ,
+ // Byte 8 - 18
+ ,,,,,,,,,,,
// Byte 19
HtlcHold,
// Byte 20 - 31
@@ -264,13 +256,9 @@ mod sealed {
// Byte 4
,
// Byte 5
- SCIDPrivacy,
+ AnchorZeroFeeCommitments | SCIDPrivacy,
// Byte 6
ZeroConf,
- // Byte 7 - 16
- ,,,,,,,,,,
- // Byte 17
- AnchorZeroFeeCommitmentsStaging,
]);
/// Defines a feature with the given bits for the specified [`Context`]s. The generated trait is
@@ -606,6 +594,17 @@ mod sealed {
supports_onion_messages,
requires_onion_messages
);
+ define_feature!(
+ 41,
+ AnchorZeroFeeCommitments,
+ [InitContext, NodeContext, ChannelTypeContext],
+ "Feature flags for `option_zero_fee_commitments`.",
+ set_anchor_zero_fee_commitments_optional,
+ set_anchor_zero_fee_commitments_required,
+ clear_anchor_zero_fee_commitments,
+ supports_anchor_zero_fee_commitments,
+ requires_anchor_zero_fee_commitments
+ );
define_feature!(
43,
ProvideStorage,
@@ -699,17 +698,6 @@ mod sealed {
// 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.
pub(super) const MIN_FEATURES_ALLOCATION_BYTES: usize = 63_usize.div_ceil(8);
- define_feature!(
- 141, // The BOLTs PR uses feature bit 40/41, so add +100 for the experimental bit
- AnchorZeroFeeCommitmentsStaging,
- [InitContext, NodeContext, ChannelTypeContext],
- "Feature flags for `option_zero_fee_commitments`.",
- set_anchor_zero_fee_commitments_optional,
- set_anchor_zero_fee_commitments_required,
- clear_anchor_zero_fee_commitments,
- supports_anchor_zero_fee_commitments,
- requires_anchor_zero_fee_commitments
- );
define_feature!(
153, // The BOLTs PR uses feature bit 52/53, so add +100 for the experimental bit
HtlcHold,
@@ -1086,7 +1074,7 @@ impl ChannelTypeFeatures {
/// Constructs a ChannelTypeFeatures with zero fee commitment anchors support.
pub fn anchors_zero_fee_commitments() -> Self {
let mut ret = Self::empty();
- <sealed::ChannelTypeContext as sealed::AnchorZeroFeeCommitmentsStaging>::set_required_bit(
+ <sealed::ChannelTypeContext as sealed::AnchorZeroFeeCommitments>::set_required_bit(
&mut ret,
);
ret
Why this scored 27/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.