Correctly set next_commitment_number during splice reconnect#736
Merged
Correctly set next_commitment_number during splice reconnect#736
next_commitment_number during splice reconnect#736Conversation
This was referenced Dec 13, 2024
pm47
previously approved these changes
Jan 13, 2025
Member
pm47
left a comment
There was a problem hiding this comment.
LGTM, integration tests with eclair would be nice.
NB: ACINQ/eclair#2965 isn't yet on mainnet
modules/core/src/commonMain/kotlin/fr/acinq/lightning/channel/states/Channel.kt
Show resolved
Hide resolved
Member
Author
I have tested that channel creation and splices are correctly resumed on reconnection. |
As pointed out in lightning/bolts#1214, when reconnecting a partially signed `interactive-tx` session, we should set `next_commitment_number` to the current commitment number if we haven't received our peer's `commit_sig`, which tells them they need to retransmit it. More importantly, if our peer behaves correctly and sends us the current commitment number, we must not think that they're late and halt, waiting for them to send `error`. This commit fixes that by allowing our peers to use the current commitment number when they set `next_funding_txid`. Note that we keep retransmitting our `commit_sig` regardless of the value our peer set in `next_commitment_number`, because we need to wait for them to have an opportunity to upgrade. In a future commit we will stop sending spurious `commit_sig`.
e882792 to
95f6261
Compare
Member
Author
|
Rebased to fix trivial import conflict. |
pm47
pushed a commit
that referenced
this pull request
Jan 20, 2025
As pointed out in lightning/bolts#1214, when reconnecting a partially signed `interactive-tx` session, we should set `next_commitment_number` to the current commitment number if we haven't received our peer's `commit_sig`, which tells them they need to retransmit it. More importantly, if our peer behaves correctly and sends us the current commitment number, we must not think that they're late and halt, waiting for them to send `error`. This commit fixes that by allowing our peers to use the current commitment number when they set `next_funding_txid`. Note that we keep retransmitting our `commit_sig` regardless of the value our peer set in `next_commitment_number`, because we need to wait for them to have an opportunity to upgrade. In a future commit we will stop sending spurious `commit_sig`.
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.
As pointed out in lightning/bolts#1214, when reconnecting a partially signed
interactive-txsession, we should setnext_commitment_numberto the current commitment number if we haven't received our peer'scommit_sig, which tells them they need to retransmit it.More importantly, if our peer behaves correctly and sends us the current commitment number, we must not think that they're late and halt, waiting for them to send
error. This commit fixes that by allowing our peers to use the current commitment number when they setnext_funding_txid.Note that we keep retransmitting our
commit_sigregardless of the value our peer set innext_commitment_number, because we need to wait for them to have an opportunity to upgrade. In a future commit we will stop sending spuriouscommit_sig.This PR must only be merged once ACINQ/eclair#2965 has been deployed on the ACINQ node.