Retransmit splice_locked to peers resuming signing - #30
Open
amackillop wants to merge 1 commit into
Open
Conversation
A peer that lost our tx_signatures (crashed before processing or persisting them) reestablishes with next_funding set for the splice. Its splice funding is still in funding_negotiation at that point, so it cannot apply the my_current_funding_locked TLV from our channel_reestablish: the inference only matches negotiated funding, and the TLV is processed exactly once. If we had already locked the splice, nothing ever conveys our lock again. The peer completes signing via the retransmitted signatures, locks, and then waits forever for our splice_locked while we consider the exchange done and eventually promote. Our next commitment_signed is not a batch, and the peer force-closes with "Got a single commitment_signed message when expecting a batch". A staging client channel died this way on 2026-08-11 (MDK-1423): the LSP restarted between tx_signatures and the completed splice_locked exchange, and an MDK 0.18.0 wallet, whose persisted state apparently predated the LSP's tx_signatures, force-closed on the first payment forwarded after reconnect. Retransmit splice_locked explicitly when the peer's next_funding names a splice we have locked, ordered after the retransmitted tx_signatures so the peer finishes its signing session before it processes the lock. This is deliberately scoped: a peer whose signing session is complete can already infer the lock from my_current_funding_locked (covered by test_splice_reestablish), and retransmitting unconditionally would send redundant messages on every reconnect. Upstream fixed the same bug on main in 5434015 ("Retransmit splice_locked for 0-conf channels missing tx_signatures"), unreleased as of 0.3.0-beta1, whose retransmission only covers locks that were absent from our reestablish TLV. This is a minimal backport of its semantics for the lsp-0.2.5 branch, keyed off the peer's next_funding rather than our tx_signatures retransmission so it also fires when we cannot retransmit signatures but the peer can still complete the splice from on-chain confirmations. It interops with already deployed 0.2.0-era clients, which handle an explicit splice_locked fine but have no recovery path if it never arrives.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A peer that lost our tx_signatures (crashed before processing or persisting them) reestablishes with next_funding set for the splice. Its splice funding is still in funding_negotiation at that point, so it cannot apply the my_current_funding_locked TLV from our channel_reestablish: the inference only matches negotiated funding, and the TLV is processed exactly once. If we had already locked the splice, nothing ever conveys our lock again. The peer completes signing via the retransmitted signatures, locks, and then waits forever for our splice_locked while we consider the exchange done and eventually promote. Our next commitment_signed is not a batch, and the peer force-closes with "Got a single commitment_signed message when expecting a batch".
A staging client channel died this way on 2026-08-11 (MDK-1423): the LSP restarted between tx_signatures and the completed splice_locked exchange, and an MDK 0.18.0 wallet, whose persisted state apparently predated the LSP's tx_signatures, force-closed on the first payment forwarded after reconnect.
Retransmit splice_locked explicitly when the peer's next_funding names a splice we have locked, ordered after the retransmitted tx_signatures so the peer finishes its signing session before it processes the lock. This is deliberately scoped: a peer whose signing session is complete can already infer the lock from my_current_funding_locked (covered by test_splice_reestablish), and retransmitting unconditionally would send redundant messages on every reconnect.
Upstream fixed the same bug on main in 5434015 ("Retransmit splice_locked for 0-conf channels missing tx_signatures"), unreleased as of 0.3.0-beta1, whose retransmission only covers locks that were absent from our reestablish TLV. This is a minimal backport of its semantics for the lsp-0.2.5 branch, keyed off the peer's next_funding rather than our tx_signatures retransmission so it also fires when we cannot retransmit signatures but the peer can still complete the splice from on-chain confirmations. It interops with already deployed 0.2.0-era clients, which handle an explicit splice_locked fine but have no recovery path if it never arrives.