Fix stale pre-splice announcement_signatures during reestablish#4577
Fix stale pre-splice announcement_signatures during reestablish#4577jkczyz wants to merge 2 commits intolightningdevkit:mainfrom
announcement_signatures during reestablish#4577Conversation
When a splice transaction confirms on both sides while peers are disconnected, each peer's `channel_reestablish` carries `my_current_funding_locked` with the splice txid. In the reestablish handler, `get_announcement_sigs` was called before the inferred `splice_locked` was processed and the splice was promoted, so `self.funding` still pointed to the pre-splice scope. If `announcement_sigs_state` was `NotSent`, the generated `announcement_signatures` carried the pre-splice `short_channel_id` and bitcoin key — which the peer (having already promoted via its own inferred `splice_locked`) would verify against the post-splice `UnsignedChannelAnnouncement`, failing the signature check and force-closing. Skip the pre-promotion call when `my_current_funding_locked` refers to a pending splice funding. `maybe_promote_splice_funding` emits correct post-splice signatures after the inferred `splice_locked` is processed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A peer may transmit `announcement_signatures` signed over a stale `short_channel_id` — most plausibly a retransmission or a peer implementation whose view hasn't caught up to our post-splice promotion. Verifying such sigs against the current `UnsignedChannelAnnouncement` (built from `self.funding`) always fails the hash check, which previously produced a force-close. BOLT lightningdevkit#7 does not require closing in this situation; the mismatch is expected across splice handoffs. Short-circuit with `ChannelError::Ignore` when `msg.short_channel_id` doesn't match the current funding's scid, leaving the genuine invalid-signature paths in place for sigs that actually target our current scid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
👋 Thanks for assigning @wpaulino as a reviewer! |
|
I've thoroughly reviewed the entire PR diff. The two code changes and two regression tests are logically sound and handle edge cases correctly:
No issues found. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4577 +/- ##
=======================================
Coverage 87.08% 87.09%
=======================================
Files 161 161
Lines 109255 109272 +17
Branches 109255 109272 +17
=======================================
+ Hits 95147 95169 +22
+ Misses 11627 11619 -8
- Partials 2481 2484 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Two related issues surfaced during interop testing against Eclair's splicing implementation, both around stale
announcement_signatureswhensplice_lockedis implicit — inferred frommy_current_funding_lockedinchannel_reestablish. Either could force-close an otherwise healthy channel.Send side: the reestablish handler called
get_announcement_sigsbefore processing the inferredsplice_locked, so ifannouncement_sigs_state == NotSentit emitted sigs over the pre-spliceshort_channel_id. The peer, having already promoted, would fail verification and force-close.Receive side: the
announcement_signatureshandler treated a mismatchedshort_channel_idas a signature verification failure and force-closed. BOLT7 does not require closing; a peer can legitimately retransmit pre-splice sigs around promotion.