Ensure partial MPP claims continue to blocks channels on restart #3928
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 9cc6e08, we started using the
RAAMonitorUpdateBlockingAction
logic to block RAAs which may remove a preimage from oneChannelMonitor
if it isn't durably stored in another that is a part of the same MPP claim.At the time, when we claimed a payment, if we saw that the HTLC was already claimed in the channel, we'd simply drop the new RAA blocker. This can happen on reload when replaying MPP claims.
However, just because an HTLC is no longer present in
ChannelManager
'sChannel
, doesn't mean that theChannelMonitorUpdate
which stored the preimage actually made it durably into theChannelMonitor
on disk.We could begin an MPP payment, have one channel get the preimage durably into its
ChannelMonitor
, then step forward another update with the peer. Then, we could reload, causing the MPP claims to be replayed across all chanels, leading to the RAA blocker(s) being dropped and all channels being unlocked. Finally, if the first channel managed to step forward a further update with its peer before the (now-replayed)ChannelMonitorUpdate
s for all MPP parts make it to disk we could theoretically lose the preimage.This is, of course, a somewhat comically unlikely scenario, but I had an old note to expand the test and it turned up the issue, so we might as well fix it.