Skip to content
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

Don't send splice_locked before tx_signatures #528

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Sep 12, 2023

When reconnecting in the middle of signing a splice, we must ensure that splice_locked is sent after tx_signatures. Otherwise when using 0-conf we may retransmit splice_locked before tx_signatures, which our peer will ignore because they don't have a corresponding fully signed commitment.

This may eventually lead to a mismatch where one side thinks that the splice has been locked and the other doesn't, so one side will send more signatures which results in a force-close.

When reconnecting in the middle of signing a splice, we must ensure that
splice_locked is sent *after* tx_signatures. Otherwise when using 0-conf
we may retransmit splice_locked before tx_signatures, which our peer will
ignore because they don't have a corresponding fully signed commitment.
@t-bast t-bast requested a review from pm47 September 12, 2023 08:27
@t-bast t-bast changed the title Don't send splice_locked before tx_signatures Don't send splice_locked before tx_signatures Sep 12, 2023
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

Just to be sure, this happens if we get disconnected right after having gone over this line:

val spliceLocked = SpliceLocked(channelId, action.fundingTx.txId.reversed())

@t-bast
Copy link
Member Author

t-bast commented Sep 13, 2023

Just to be sure, this happens if we get disconnected right after having gone over this line:

Yes, that's exactly it! In that case on reconnection we will re-send [commit_sig, tx_signatures, splice_locked]. But we were actually sending [splice_locked, commit_sig, tx_signatures] so the splice_locked was ignored by the other side, which didn't yet have a matching commitment.

@t-bast t-bast merged commit 6c6446c into master Sep 13, 2023
2 checks passed
@t-bast t-bast deleted the splice-locked-after-tx-sigs branch September 13, 2023 13:48
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 this pull request may close these issues.

2 participants