Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 46 additions & 34 deletions lightning-types/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,18 @@ 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 - 130
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Byte 131
// Byte 8 - 16
,,,,,,,,,
// Byte 17
AnchorZeroFeeCommitmentsStaging,
// Byte 18
,
// Byte 19
HtlcHold,
]
);
Expand All @@ -187,19 +191,23 @@ 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 - 31
,,,,,,,,,,,,,,,,,,,,,,,,
// Byte 8 - 16
,,,,,,,,,
// Byte 17
AnchorZeroFeeCommitmentsStaging,
// Byte 18
,
// Byte 19
HtlcHold,
// Byte 20 - 31
,,,,,,,,,,,,
// Byte 32
DnsResolver,
// Byte 33 - 130
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Byte 131
HtlcHold,
]
);
define_context!(ChannelContext, []);
Expand Down Expand Up @@ -256,9 +264,13 @@ 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
Expand Down Expand Up @@ -594,17 +606,6 @@ 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,
Expand Down Expand Up @@ -699,18 +700,18 @@ mod sealed {
// added which we expect to appear commonly across contexts.
pub(super) const MIN_FEATURES_ALLOCATION_BYTES: usize = (63 + 7) / 8;
define_feature!(
259,
DnsResolver,
[NodeContext],
"Feature flags for DNS resolving.",
set_dns_resolution_optional,
set_dns_resolution_required,
clear_dns_resolution,
supports_dns_resolution,
requires_dns_resolution
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!(
1053, // The BOLTs PR uses feature bit 52/53, so add +1000 for the experimental bit
153, // The BOLTs PR uses feature bit 52/53, so add +100 for the experimental bit
HtlcHold,
[InitContext, NodeContext],
"Feature flags for holding HTLCs and forwarding on receipt of an onion message",
Expand All @@ -720,6 +721,17 @@ mod sealed {
supports_htlc_hold,
requires_htlc_hold
);
define_feature!(
259,
DnsResolver,
[NodeContext],
"Feature flags for DNS resolving.",
set_dns_resolution_optional,
set_dns_resolution_required,
clear_dns_resolution,
supports_dns_resolution,
requires_dns_resolution
);

// Note: update the module-level docs when a new feature bit is added!

Expand Down Expand Up @@ -1074,7 +1086,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::AnchorZeroFeeCommitments>::set_required_bit(
<sealed::ChannelTypeContext as sealed::AnchorZeroFeeCommitmentsStaging>::set_required_bit(
&mut ret,
);
ret
Expand Down
Loading