mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 18:54:00 +02:00
feature: define new feature bit for bolt11 blinded paths
We need a new feature bit for BOLT11 invoices in order to indicate that they contain the new blinded path tagged field. Tagged fields pre-date TLV and so nodes who dont understand them will simply skip them. Therefore the feature bit helps them to fail fast.
This commit is contained in:
@@ -92,4 +92,7 @@ var defaultSetDesc = setDesc{
|
|||||||
SetInit: {}, // I
|
SetInit: {}, // I
|
||||||
SetNodeAnn: {}, // N
|
SetNodeAnn: {}, // N
|
||||||
},
|
},
|
||||||
|
lnwire.Bolt11BlindedPathsOptional: {
|
||||||
|
SetInvoice: {}, // I
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@@ -82,8 +82,8 @@ var deps = depDesc{
|
|||||||
lnwire.RouteBlindingOptional: {
|
lnwire.RouteBlindingOptional: {
|
||||||
lnwire.TLVOnionPayloadOptional: {},
|
lnwire.TLVOnionPayloadOptional: {},
|
||||||
},
|
},
|
||||||
lnwire.RouteBlindingRequired: {
|
lnwire.Bolt11BlindedPathsOptional: {
|
||||||
lnwire.TLVOnionPayloadRequired: {},
|
lnwire.RouteBlindingOptional: {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -128,6 +128,8 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
|||||||
raw.Unset(lnwire.MPPRequired)
|
raw.Unset(lnwire.MPPRequired)
|
||||||
raw.Unset(lnwire.RouteBlindingOptional)
|
raw.Unset(lnwire.RouteBlindingOptional)
|
||||||
raw.Unset(lnwire.RouteBlindingRequired)
|
raw.Unset(lnwire.RouteBlindingRequired)
|
||||||
|
raw.Unset(lnwire.Bolt11BlindedPathsOptional)
|
||||||
|
raw.Unset(lnwire.Bolt11BlindedPathsRequired)
|
||||||
raw.Unset(lnwire.AMPOptional)
|
raw.Unset(lnwire.AMPOptional)
|
||||||
raw.Unset(lnwire.AMPRequired)
|
raw.Unset(lnwire.AMPRequired)
|
||||||
raw.Unset(lnwire.KeysendOptional)
|
raw.Unset(lnwire.KeysendOptional)
|
||||||
@@ -187,6 +189,8 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
|||||||
if cfg.NoRouteBlinding {
|
if cfg.NoRouteBlinding {
|
||||||
raw.Unset(lnwire.RouteBlindingOptional)
|
raw.Unset(lnwire.RouteBlindingOptional)
|
||||||
raw.Unset(lnwire.RouteBlindingRequired)
|
raw.Unset(lnwire.RouteBlindingRequired)
|
||||||
|
raw.Unset(lnwire.Bolt11BlindedPathsOptional)
|
||||||
|
raw.Unset(lnwire.Bolt11BlindedPathsRequired)
|
||||||
}
|
}
|
||||||
for _, custom := range cfg.CustomFeatures[set] {
|
for _, custom := range cfg.CustomFeatures[set] {
|
||||||
if custom > set.Maximum() {
|
if custom > set.Maximum() {
|
||||||
|
@@ -223,7 +223,7 @@ const (
|
|||||||
// able and willing to accept keysend payments.
|
// able and willing to accept keysend payments.
|
||||||
KeysendOptional = 55
|
KeysendOptional = 55
|
||||||
|
|
||||||
// ScriptEnforcedLeaseOptional is an optional feature bit that signals
|
// ScriptEnforcedLeaseRequired is a required feature bit that signals
|
||||||
// that the node requires channels having zero-fee second-level HTLC
|
// that the node requires channels having zero-fee second-level HTLC
|
||||||
// transactions, which also imply anchor commitments, along with an
|
// transactions, which also imply anchor commitments, along with an
|
||||||
// additional CLTV constraint of a channel lease's expiration height
|
// additional CLTV constraint of a channel lease's expiration height
|
||||||
@@ -241,18 +241,17 @@ const (
|
|||||||
// TODO: Decide on actual feature bit value.
|
// TODO: Decide on actual feature bit value.
|
||||||
ScriptEnforcedLeaseOptional FeatureBit = 2023
|
ScriptEnforcedLeaseOptional FeatureBit = 2023
|
||||||
|
|
||||||
// SimpleTaprootChannelsRequredFinal is a required bit that indicates
|
// SimpleTaprootChannelsRequiredFinal is a required bit that indicates
|
||||||
// the node is able to create taproot-native channels. This is the
|
// the node is able to create taproot-native channels. This is the
|
||||||
// final feature bit to be used once the channel type is finalized.
|
// final feature bit to be used once the channel type is finalized.
|
||||||
SimpleTaprootChannelsRequiredFinal = 80
|
SimpleTaprootChannelsRequiredFinal = 80
|
||||||
|
|
||||||
// SimpleTaprootChannelsOptionalFinal is an optional bit that indicates
|
// SimpleTaprootChannelsOptionalFinal is an optional bit that indicates
|
||||||
// the node is able to create taproot-native channels. This is the
|
// the node is able to create taproot-native channels. This is the
|
||||||
// final
|
// final feature bit to be used once the channel type is finalized.
|
||||||
// feature bit to be used once the channel type is finalized.
|
|
||||||
SimpleTaprootChannelsOptionalFinal = 81
|
SimpleTaprootChannelsOptionalFinal = 81
|
||||||
|
|
||||||
// SimpleTaprootChannelsRequredStaging is a required bit that indicates
|
// SimpleTaprootChannelsRequiredStaging is a required bit that indicates
|
||||||
// the node is able to create taproot-native channels. This is a
|
// the node is able to create taproot-native channels. This is a
|
||||||
// feature bit used in the wild while the channel type is still being
|
// feature bit used in the wild while the channel type is still being
|
||||||
// finalized.
|
// finalized.
|
||||||
@@ -260,11 +259,20 @@ const (
|
|||||||
|
|
||||||
// SimpleTaprootChannelsOptionalStaging is an optional bit that
|
// SimpleTaprootChannelsOptionalStaging is an optional bit that
|
||||||
// indicates the node is able to create taproot-native channels. This
|
// indicates the node is able to create taproot-native channels. This
|
||||||
// is a feature
|
// is a feature bit used in the wild while the channel type is still
|
||||||
// bit used in the wild while the channel type is still being
|
// being finalized.
|
||||||
// finalized.
|
|
||||||
SimpleTaprootChannelsOptionalStaging = 181
|
SimpleTaprootChannelsOptionalStaging = 181
|
||||||
|
|
||||||
|
// Bolt11BlindedPathsRequired is a required feature bit that indicates
|
||||||
|
// that the node is able to understand the blinded path tagged field in
|
||||||
|
// a BOLT 11 invoice.
|
||||||
|
Bolt11BlindedPathsRequired = 260
|
||||||
|
|
||||||
|
// Bolt11BlindedPathsOptional is an optional feature bit that indicates
|
||||||
|
// that the node is able to understand the blinded path tagged field in
|
||||||
|
// a BOLT 11 invoice.
|
||||||
|
Bolt11BlindedPathsOptional = 261
|
||||||
|
|
||||||
// MaxBolt11Feature is the maximum feature bit value allowed in bolt 11
|
// MaxBolt11Feature is the maximum feature bit value allowed in bolt 11
|
||||||
// invoices.
|
// invoices.
|
||||||
//
|
//
|
||||||
@@ -331,6 +339,8 @@ var Features = map[FeatureBit]string{
|
|||||||
SimpleTaprootChannelsOptionalFinal: "simple-taproot-chans",
|
SimpleTaprootChannelsOptionalFinal: "simple-taproot-chans",
|
||||||
SimpleTaprootChannelsRequiredStaging: "simple-taproot-chans-x",
|
SimpleTaprootChannelsRequiredStaging: "simple-taproot-chans-x",
|
||||||
SimpleTaprootChannelsOptionalStaging: "simple-taproot-chans-x",
|
SimpleTaprootChannelsOptionalStaging: "simple-taproot-chans-x",
|
||||||
|
Bolt11BlindedPathsOptional: "bolt-11-blinded-paths",
|
||||||
|
Bolt11BlindedPathsRequired: "bolt-11-blinded-paths",
|
||||||
}
|
}
|
||||||
|
|
||||||
// RawFeatureVector represents a set of feature bits as defined in BOLT-09. A
|
// RawFeatureVector represents a set of feature bits as defined in BOLT-09. A
|
||||||
|
Reference in New Issue
Block a user