Skip to content

splice: lightningd updates scid too early #6703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks
ddustin opened this issue Sep 21, 2023 · 0 comments · Fixed by #6840
Closed
4 tasks

splice: lightningd updates scid too early #6703

ddustin opened this issue Sep 21, 2023 · 0 comments · Fixed by #6840
Assignees
Milestone

Comments

@ddustin
Copy link
Collaborator

ddustin commented Sep 21, 2023

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:

  • On boot if splice is confirmed but not mutual_splice_locked, channeld_init should pass in values for splice_state->short_channel_id and splice_state->locked_txid.
  • If channeld sees these values present in channeld_init, it should know the splice is confirmed but not locked. After reestablish is completed, it should begin the splice_locked procedure.
  • Upon reestablish if the peer is using the stale scid, we should be okay with it but expect splice_locked within some kind of grace period.
  • If we receive splice_locked but from our perspective we are already mutual_splice_locked, we should mirror the message back but not reemit any local mutal lock events

reference for discovery of the issue here: https://github.com/ElementsProject/lightning/pull/6628/files#issuecomment-1729967338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant