Merge pull request #2948 from arik-so/2024-03-public-node-announcement-excess
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 20 Mar 2024 00:53:38 +0000 (00:53 +0000)
committerGitHub <noreply@github.com>
Wed, 20 Mar 2024 00:53:38 +0000 (00:53 +0000)
Publicize all UnsignedNodeAnnouncement fields.

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

index d28066ec4131b429f70e7e16b8ed843f9e014265..6467af568886bd1891a7e8c52ae6b5956736f6bd 100644 (file)
@@ -120,11 +120,14 @@ impl TryFrom<CounterpartyForwardingInfo> for PaymentRelay {
 
 impl Writeable for ForwardTlvs {
        fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
+               let features_opt =
+                       if self.features == BlindedHopFeatures::empty() { None }
+                       else { Some(&self.features) };
                encode_tlv_stream!(w, {
                        (2, self.short_channel_id, required),
                        (10, self.payment_relay, required),
                        (12, self.payment_constraints, required),
-                       (14, self.features, required)
+                       (14, features_opt, option)
                });
                Ok(())
        }
@@ -169,7 +172,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.