diff --git a/feature/default_sets.go b/feature/default_sets.go index 9103f903..5ee98792 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -60,4 +60,8 @@ var defaultSetDesc = setDesc{ lnwire.AMPRequired: { SetInvoiceAmp: {}, // 9A }, + lnwire.ExplicitChannelTypeOptional: { + SetInit: {}, // I + SetNodeAnn: {}, // N + }, } diff --git a/feature/deps.go b/feature/deps.go index 51ee37e9..d6f57cb9 100644 --- a/feature/deps.go +++ b/feature/deps.go @@ -58,9 +58,13 @@ var deps = depDesc{ lnwire.AnchorsOptional: { lnwire.StaticRemoteKeyOptional: {}, }, + lnwire.AnchorsZeroFeeHtlcTxOptional: { + lnwire.StaticRemoteKeyOptional: {}, + }, lnwire.AMPOptional: { lnwire.PaymentAddrOptional: {}, }, + lnwire.ExplicitChannelTypeOptional: {}, } // ValidateDeps asserts that a feature vector sets all features and their diff --git a/lnwire/features.go b/lnwire/features.go index 675ba0f5..70aa2315 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -139,6 +139,26 @@ const ( // sender-generated preimages according to BOLT XX. AMPOptional FeatureBit = 31 + // ExplicitChannelTypeRequired is a required bit that denotes that a + // connection established with this node is to use explicit channel + // commitment types for negotiation instead of the existing implicit + // negotiation methods. With this bit, there is no longer a "default" + // implicit channel commitment type, allowing a connection to + // open/maintain types of several channels over its lifetime. + // + // TODO: Decide on actual feature bit value. + ExplicitChannelTypeRequired = 2020 + + // ExplicitChannelTypeOptional is an optional bit that denotes that a + // connection established with this node is to use explicit channel + // commitment types for negotiation instead of the existing implicit + // negotiation methods. With this bit, there is no longer a "default" + // implicit channel commitment type, allowing a connection to + // open/maintain types of several channels over its lifetime. + // + // TODO: Decide on actual feature bit value. + ExplicitChannelTypeOptional = 2021 + // maxAllowedSize is a maximum allowed size of feature vector. // // NOTE: Within the protocol, the maximum allowed message size is 65535 @@ -184,6 +204,8 @@ var Features = map[FeatureBit]string{ WumboChannelsOptional: "wumbo-channels", AMPRequired: "amp", AMPOptional: "amp", + ExplicitChannelTypeOptional: "explicit-commitment-type", + ExplicitChannelTypeRequired: "explicit-commitment-type", } // RawFeatureVector represents a set of feature bits as defined in BOLT-09. A