Attempt to unblock blocked monitor updates on startup#4520
Attempt to unblock blocked monitor updates on startup#4520TheBlueMatt wants to merge 2 commits intolightningdevkit:mainfrom
Conversation
|
I've assigned @joostjager as a reviewer! |
|
There was a unit test already in issue linked in the description. On branch main...joostjager:2026-03-startup-mpp-unblock-with-test, it's added as a commit, and shows that your fix makes the test pass. |
|
Discussed offline and improved unit test by ignoring some ignored read outs and 'loops until settled'. |
When we make an MPP claim we push RAA blockers for each chanel to ensure we don't allow any single channel to make too much progress until all channels have the preimage durably on disk. We don't have to store those RAA blockers on disk in the ChannelManager as there's no point - if the ChannelManager gets to disk with the RAA blockers it also brought with it the pending ChannelMonitorUpdates that contain the preimages and will now be replayed, ensuring the preimage makes it to all ChannelMonitors. However, just because those RAA blockers dissapear on reload doesn't mean the implications of them does too - if a later ChannelMonitorUpdate was blocked in the channel we don't have logic to unblock it on startup. Here we add such logic, simply attempting to unblock all blocked `ChannelMonitorUpdate`s that existed on startup. Code written by Claude. Fixes lightningdevkit#4518
a38acca to
6977e25
Compare
|
Thanks! Rebased and included the test. |
|
No issues found. The implementation is correct and complete. I performed an exhaustive review of:
|
Add a characterization test for a claimed MPP payment whose preimage monitor updates are only partially persisted before restart. The test drives both channels through a held fee-update commitment dance, claims with async monitor persistence, reloads one fresh and one stale monitor, and verifies that the bug leaves a sender-side HTLC stuck after reconnect.
6977e25 to
52a0030
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4520 +/- ##
=======================================
Coverage 86.11% 86.12%
=======================================
Files 157 157
Lines 108772 108786 +14
Branches 108772 108786 +14
=======================================
+ Hits 93668 93688 +20
+ Misses 12487 12484 -3
+ Partials 2617 2614 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When we make an MPP claim we push RAA blockers for each chanel to ensure we don't allow any single channel to make too much progress until all channels have the preimage durably on disk. We don't have to store those RAA blockers on disk in the ChannelManager as there's no point - if the ChannelManager gets to disk with the RAA blockers it also brought with it the pending ChannelMonitorUpdates that contain the preimages and will now be replayed, ensuring the preimage makes it to all ChannelMonitors.
However, just because those RAA blockers dissapear on reload doesn't mean the implications of them does too - if a later ChannelMonitorUpdate was blocked in the channel we don't have logic to unblock it on startup.
Here we add such logic, simply attempting to unblock all blocked
ChannelMonitorUpdates that existed on startup.Code written by Claude.
Fixes #4518
Needs a test, I have a start on one but need to clean it up