close: Do not attempt a unilateral close when we see another close on-chain #7447
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.
In Greenlight we have an issue with channels that close, and the
signer got desynced from the Node due to a non-atomic update which
bumped the VLS signer commitment number, but the corresponding bump
got lost on CLN due to preemption. The problem here is that the signer
will not sign off on any future states, so the channel is unusable and
needs to be closed. If the peer closes the channel however, the last-
ditch attempt of publishing the last state, i.e., signing the
n-1
thcommitment TX, when VLS believes we are at the
n
th, won't work.To get past this situation we selectively skip the unilateral close
attempt on our end, by setting
passive=true
when callingdrop_to_chain
. This is safe because the way we got to this place isby seeing our counterparty's unilateral close confirmed in a block we
are processing, therefore it is already too late to publish the
unilateral close anyway (it conflicts with the counterparty's close).
Changelog-Changed: close: We no longer attempt to publish a unilateral close that'd fail anyway when we witness a close onchain.