lightningd updates the channel's scid when a splice is confirmed on chain. This creates a subtle issue however where lightningd and channeld disagree on the scid for a short period of time.
After the splice is confirmed, channeld sends splice_locked and waits to hear it back. Once it is both sent and received it is considered mutual_splice_locked and will update the scid to its new post-splice value at that point.
If a disconnection and / or restart occurs after confirmation but before mutual_splice_locked, lightningd's new scid value will prevail incorrectly.
The primary fix is to move lightningd's scid update to occur after mutual_splice_lock instead, but this introduces new state complexity:
reference for discovery of the issue here: https://github.com/ElementsProject/lightning/pull/6628/files#issuecomment-1729967338
lightningdupdates the channel'sscidwhen a splice is confirmed on chain. This creates a subtle issue however wherelightningdandchannelddisagree on thescidfor a short period of time.After the splice is confirmed,
channeldsendssplice_lockedand waits to hear it back. Once it is both sent and received it is consideredmutual_splice_lockedand will update thescidto its new post-splice value at that point.If a disconnection and / or restart occurs after confirmation but before
mutual_splice_locked,lightningd's newscidvalue will prevail incorrectly.The primary fix is to move
lightningd's scid update to occur after mutual_splice_lock instead, but this introduces new state complexity:mutual_splice_locked,channeld_initshould pass in values forsplice_state->short_channel_idandsplice_state->locked_txid.channeldsees these values present inchanneld_init, it should know the splice is confirmed but not locked. Afterreestablishis completed, it should begin thesplice_lockedprocedure.scid, we should be okay with it but expectsplice_lockedwithin some kind of grace period.splice_lockedbut from our perspective we are alreadymutual_splice_locked, we should mirror the message back but not reemit any local mutal lock eventsreference for discovery of the issue here: https://github.com/ElementsProject/lightning/pull/6628/files#issuecomment-1729967338