Cut 0.0.125 with a few bugfixes #3361
Closed
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.
Several important bugfixes and an 0.0.125 release. The most important bugfix follows, but see individual commits for more info.
When we upgrade from LDK 0.0.123 or prior, we need to intialize
holder_commitment_pointwith commitment point(s). In1f7f3a3 we changed the point(s)
which we fetch from both the current and next per-commitment-point
(setting the value to
HolderCommitmentPoint::Availableonupgrade) to only fetching the current per-commitment-point (setting
the value to
HolderCommitmentPoint::PendingNexton upgrade).In
commitment_signedhandling, we expect the nextper-commitment-point to be available (allowing us to
advance()the
holder_commitment_point), as it was included in therevoke_and_ackwe most recently sent to our peer, so must've beenavailable at that time.
Sadly, these two interact negatively with each other - on upgrade,
assuming the channel is at a steady state and there are no pending
updates, we'll not make the next per-commitment-point available but
if we receive a
commitment_signedfrom our peer we'll assume itis. As a result, in debug mode, we'll hit an assertion failure, and
in production mode we'll force-close the channel.
Instead, here, we fix the upgrade logic to always upgrade directly
to
HolderCommitmentPoint::Available, making the nextper-commitment-point available immediately.
We also attempt to resolve the next per-commitment-point in
get_channel_reestablish, allowing any channels which wereupgraded to LDK 0.0.124 and are in this broken state to avoid the
force-closure, as long as they don't receive a
commitment_signedin the interim.