Make blinded hop features optional per spec.
authorValentine Wallace <vwallace@protonmail.com>
Mon, 18 Mar 2024 21:01:07 +0000 (17:01 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Mon, 18 Mar 2024 21:07:27 +0000 (17:07 -0400)
The spec states that if these features are missing, we MUST process the message
as if it were present and contained an empty array.

lightning/src/blinded_path/payment.rs
pending_changelog/blinded-hop-features-optional.txt [new file with mode: 0644]

index d28066ec4131b429f70e7e16b8ed843f9e014265..0ed09a366d8be7075415b92abad585a51fad6c9b 100644 (file)
@@ -169,7 +169,7 @@ impl Readable for BlindedPaymentTlvs {
                                short_channel_id,
                                payment_relay: payment_relay.ok_or(DecodeError::InvalidValue)?,
                                payment_constraints: payment_constraints.0.unwrap(),
-                               features: features.ok_or(DecodeError::InvalidValue)?,
+                               features: features.unwrap_or_else(BlindedHopFeatures::empty),
                        }))
                } else {
                        if payment_relay.is_some() || features.is_some() { return Err(DecodeError::InvalidValue) }
diff --git a/pending_changelog/blinded-hop-features-optional.txt b/pending_changelog/blinded-hop-features-optional.txt
new file mode 100644 (file)
index 0000000..f8967f1
--- /dev/null
@@ -0,0 +1,5 @@
+## Bug Fixes
+
+* LDK previously would fail to forward an intermediate blinded payment
+       if the blinded hop features were absent, potentially breaking
+       interoperability.