Reestablish partially signed splice with current remote_commitment_number
#2965
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-tx
session, we should setnext_commitment_number
to the current commitment number if we haven't received our peer'scommit_sig
, which tells them they need to retransmit it.That's not what we're currently doing: we're currently setting this value to the next commitment number, regardless of whether or not we have received our peer's
commit_sig
. And we always retransmit ourcommit_sig
if our peer is settingnext_funding_txid
, even if they have already received it.More importantly, if our peer behaves correctly and sends us the current commitment number, we will think that they're late and will 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 this doesn't yet make us spec-compliant, but in order to guarantee backwards-compatibility, we must first deploy that change before we can start removing spurious
commit_sig
retransmissions.