Request announcement_signatures retransmission
What changed, and why it matters
This commit changes how Lightning nodes request missing announcement signatures after a channel reconnects. It adds a flag to the FundingLocked message so a node can explicitly ask its peer to resend announcement_signatures when needed, rather than relying on the older splice_locked retransmission path. This is a protocol-correctness improvement for splicing; it does not appear to be a direct exploit fix.
Review the peer-side handling of FundingLocked::retransmit_flags to ensure the announcement_signatures bit triggers actual retransmission. Also verify that the condition self.funding.get_funding_txid() != Some(txid) correctly identifies the splicing case and does not over-request signatures.
Security signals we found
Protocol state synchronization fix for splicing reestablishment
Explicit request for announcement_signatures retransmission to avoid missing gossip proofs
Partial patch: sender-side request only; receiver-side handling not shown in diff
Evidence from the diff
The patch implements the splicing-spec rule that, during channel reestablishment, a node may include my_current_funding_locked and set the announcement_signatures bit in FundingLocked::retransmit_flags if it has not yet received announcement_signatures for the current funding transaction. It adds a FundingLockedFlags enum and a retransmit() helper, and updates channel reestablishment logic to set the bit when announce_for_forwarding is enabled and announcement_sigs is missing or the funding txid does not match. The change is additive and partial: it requests retransmission but does not show the handling of received retransmit_flags.
Changed components
lightning/src/ln/channel.rslightning/src/ln/msgs.rsFundingLocked message constructionChannel reestablishment flowInspect captured patch +34 / −4
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 2174980..8b26a88 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -11067,7 +11067,25 @@ where
.or_else(|| {
self.is_our_channel_ready().then(|| self.funding.get_funding_txid()).flatten()
})
- .map(|txid| msgs::FundingLocked { txid, retransmit_flags: 0 })
+ .map(|txid| {
+ let mut funding_locked = msgs::FundingLocked { txid, retransmit_flags: 0 };
+
+ // - if `my_current_funding_locked` is included:
+ // - if `announce_channel` is set for this channel:
+ // - if it has not received `announcement_signatures` for that transaction:
+ // - MUST set the `announcement_signatures` bit to `1` in `retransmit_flags`.
+ // - otherwise:
+ // - MUST set the `announcement_signatures` bit to `0` in `retransmit_flags`.
+ if self.context.config.announce_for_forwarding {
+ if self.funding.get_funding_txid() != Some(txid)
+ || self.context.announcement_sigs.is_none()
+ {
+ funding_locked.retransmit(msgs::FundingLockedFlags::AnnouncementSignatures);
+ }
+ }
+
+ funding_locked
+ })
}
#[cfg(not(splicing))]
diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs
index b3a8c44..fc99ea5 100644
--- a/lightning/src/ln/msgs.rs
+++ b/lightning/src/ln/msgs.rs
@@ -976,12 +976,24 @@ pub struct FundingLocked {
/// A bitfield indicating which messages should be retransmitted by the receiving node.
///
- /// | Bit Position | Name |
- /// | ------------- | --------------------------|
- /// | 0 | `announcement_signatures` |
+ /// See [`FundingLockedFlags`] for details.
pub retransmit_flags: u8,
}
+impl FundingLocked {
+ /// Sets the bit in `retransmit_flags` for retransmitting the message corresponding to `flag`.
+ pub fn retransmit(&mut self, flag: FundingLockedFlags) {
+ self.retransmit_flags |= 1 << flag as u8;
+ }
+}
+
+/// Bit positions used in [`FundingLocked::retransmit_flags`] for requesting message retransmission.
+#[repr(u8)]
+pub enum FundingLockedFlags {
+ /// Retransmit `announcement_signatures`.
+ AnnouncementSignatures = 0,
+}
+
/// An [`announcement_signatures`] message to be sent to or received from a peer.
///
/// [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
Why this scored 34/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.