types: fix zero conf feature missing `clear_zero_conf`
What changed, and why it matters
This commit fixes a missing 'clear' function for the zero-confirmation channel feature flag in the Lightning Dev Kit. Feature flags are used to negotiate capabilities between Lightning nodes. Without a way to clear this flag, code that needs to remove or reset the zero-confirmation feature could fail to compile or behave unexpectedly, potentially causing misnegotiation of channel types. The fix is small and only adds the missing function.
Review whether any existing code attempted to call `clear_zero_conf` and was broken or worked around the absence. Confirm the macro-generated code now exposes the expected clearer. No immediate emergency action is indicated, but include in normal release testing.
Security signals we found
Missing feature-flag clearer could prevent safe downgrade/reset of zero-conf capability
API inconsistency in feature negotiation may lead to runtime or compile-time failures
Zero-conf channels are a sensitive capability with trust/security implications
Evidence from the diff
The define_feature! macro invocation for feature bit 51 (ZeroConf) in lightning-types/src/features.rs was missing the clear_zero_conf argument. The macro expects a consistent set of setter/clearer/getter functions. This patch reformats the macro call and adds clear_zero_conf, restoring the expected API surface. The change is syntactic/declarative and does not alter feature-bit semantics.
Changed components
lightning-types/src/features.rsZeroConf feature flag (bit 51)InitContext / NodeContext / ChannelTypeContext feature negotiationInspect captured patch +10 / −2
diff --git a/lightning-types/src/features.rs b/lightning-types/src/features.rs
index 22493ef..8ce14a8 100644
--- a/lightning-types/src/features.rs
+++ b/lightning-types/src/features.rs
@@ -649,9 +649,17 @@ mod sealed {
supports_payment_metadata,
requires_payment_metadata
);
- define_feature!(51, ZeroConf, [InitContext, NodeContext, ChannelTypeContext],
+ define_feature!(
+ 51,
+ ZeroConf,
+ [InitContext, NodeContext, ChannelTypeContext],
"Feature flags for accepting channels with zero confirmations. Called `option_zeroconf` in the BOLTs",
- set_zero_conf_optional, set_zero_conf_required, supports_zero_conf, requires_zero_conf);
+ set_zero_conf_optional,
+ set_zero_conf_required,
+ clear_zero_conf,
+ supports_zero_conf,
+ requires_zero_conf
+ );
define_feature!(
55,
Keysend,
Why this scored 35/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.