-
Notifications
You must be signed in to change notification settings - Fork 419
Ensure partial MPP claims continue to blocks channels on restart #3928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Ensure partial MPP claims continue to blocks channels on restart #3928
Conversation
👋 Thanks for assigning @wpaulino as a reviewer! |
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
In 9cc6e08, we started using the `RAAMonitorUpdateBlockingAction` logic to block RAAs which may remove a preimage from one `ChannelMonitor` 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`'s `Channel`, doesn't mean that the `ChannelMonitorUpdate` which stored the preimage actually made it durably into the `ChannelMonitor` 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.
Rebased. |
490d6e4
to
6c34c56
Compare
Needs a rebase |
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.