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

Fix tx_signatures retransmission #2748

Merged
merged 3 commits into from Sep 22, 2023
Merged

Conversation

t-bast
Copy link
Member

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

If we disconnect before receiving our peer's tx_signatures, we expect them to re-send it on reconnection (by filling the next_funding_txid field in channel_reestablish). In that case, our peer may also retransmit their corresponding commit_sig first (if they cannot be sure that we've received it). If we've already received that commit_sig, we should ignore it. But we must make sure we don't end up ignoring other commit_sig messages!

Eclair wasn't spec-compliant and wouldn't retransmit their tx_signatures if the transaction was already confirmed. We now store our tx_signatures even after confirmation or publication (if using 0-conf) to make sure we can retransmit them when requested.

If our peer asks us to retransmit our `tx_signatures`, we should do it even
if the transaction is already confirmed. That means we need to store our
`tx_signatures` because they're annoying to recompute.
When expecting a retransmission of `tx_signatures`, we should ignore the
`commit_sig` they send just before if we've already received it. The right
way to check that we've already received it is to compare its signature
to our latest commitment transaction.
@t-bast t-bast requested a review from pm47 September 22, 2023 09:54
@t-bast t-bast merged commit 55f9698 into master Sep 22, 2023
1 check passed
@t-bast t-bast deleted the fix-tx-signatures-retransmit branch September 22, 2023 15: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.

None yet

2 participants