Commit e6a0742
committed
Persistent HTLC forward claim monitor events
Currently, the resolution of HTLCs (and decisions on when HTLCs can be
forwarded) is the responsibility of Channel objects (a part of ChannelManager)
until the channel is closed, and then the ChannelMonitor thereafter. This leads
to some complexity around race conditions for HTLCs right around channel
closure. Additionally, there is lots of complexity reconstructing the state of
all HTLCs in the ChannelManager deserialization/loading logic.
Instead, we want to do all resolution in ChannelMonitors (in response to
ChannelMonitorUpdates) and pass them back to ChannelManager in the form of
MonitorEvents (similar to how HTLCs are resolved after channels are closed). In
order to have reliable resolution, we'll need to keep MonitorEvents around in
the ChannelMonitor until the ChannelManager has finished processing them. This
will simplify things - on restart instead of examining the set of HTLCs in
monitors we can simply replay all the pending MonitorEvents.
Here we add MonitorEvent resolution of forwarded HTLC claims, which allows
us to remove usage of RAA monitor update blocking actions and a significant
amount of complex startup reconstruction code.1 parent b6b4426 commit e6a0742
File tree
7 files changed
+772
-55
lines changed- lightning/src
- chain
- ln
- util
7 files changed
+772
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2289 | 2289 | | |
2290 | 2290 | | |
2291 | 2291 | | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
2292 | 2304 | | |
2293 | 2305 | | |
2294 | 2306 | | |
| |||
3888 | 3900 | | |
3889 | 3901 | | |
3890 | 3902 | | |
3891 | | - | |
3892 | | - | |
3893 | | - | |
3894 | | - | |
3895 | | - | |
3896 | | - | |
3897 | | - | |
3898 | | - | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
3899 | 3910 | | |
3900 | | - | |
3901 | | - | |
3902 | | - | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
3903 | 3914 | | |
3904 | | - | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
3905 | 3929 | | |
3906 | 3930 | | |
3907 | 3931 | | |
| |||
0 commit comments