Commit fac7774
committed
Pipe monitor event source HTLCForwardInfo -> holding cell htlcs
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.
To ensure we can resolve HTLC monitor events for forward failures, we need to
pipe the event id through the HTLC failure pipeline. Here we pipe the monitor
event source from the manager to the channel, so it can be put in the channel's
holding cell.
In upcoming commits we will eventually get to the point of acking the monitor
event when the HTLC is irrevocably removed from the inbound edge via monitor
update.1 parent 0eb6190 commit fac7774
2 files changed
Lines changed: 47 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6457 | 6457 | | |
6458 | 6458 | | |
6459 | 6459 | | |
6460 | | - | |
| 6460 | + | |
| 6461 | + | |
| 6462 | + | |
6461 | 6463 | | |
6462 | 6464 | | |
6463 | 6465 | | |
| |||
6472 | 6474 | | |
6473 | 6475 | | |
6474 | 6476 | | |
6475 | | - | |
6476 | | - | |
| 6477 | + | |
| 6478 | + | |
| 6479 | + | |
| 6480 | + | |
6477 | 6481 | | |
6478 | 6482 | | |
6479 | 6483 | | |
| |||
6492 | 6496 | | |
6493 | 6497 | | |
6494 | 6498 | | |
6495 | | - | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
6496 | 6502 | | |
6497 | 6503 | | |
6498 | 6504 | | |
6499 | 6505 | | |
6500 | | - | |
| 6506 | + | |
6501 | 6507 | | |
6502 | 6508 | | |
6503 | 6509 | | |
| |||
7190 | 7196 | | |
7191 | 7197 | | |
7192 | 7198 | | |
7193 | | - | |
| 7199 | + | |
| 7200 | + | |
7194 | 7201 | | |
7195 | | - | |
| 7202 | + | |
7196 | 7203 | | |
7197 | 7204 | | |
7198 | 7205 | | |
| |||
7201 | 7208 | | |
7202 | 7209 | | |
7203 | 7210 | | |
7204 | | - | |
| 7211 | + | |
| 7212 | + | |
7205 | 7213 | | |
7206 | | - | |
7207 | | - | |
| 7214 | + | |
| 7215 | + | |
| 7216 | + | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
| 7221 | + | |
7208 | 7222 | | |
7209 | 7223 | | |
7210 | 7224 | | |
7211 | 7225 | | |
7212 | 7226 | | |
7213 | 7227 | | |
7214 | 7228 | | |
7215 | | - | |
| 7229 | + | |
7216 | 7230 | | |
7217 | 7231 | | |
7218 | 7232 | | |
| |||
7267 | 7281 | | |
7268 | 7282 | | |
7269 | 7283 | | |
7270 | | - | |
| 7284 | + | |
7271 | 7285 | | |
7272 | 7286 | | |
7273 | 7287 | | |
| |||
8297 | 8311 | | |
8298 | 8312 | | |
8299 | 8313 | | |
8300 | | - | |
| 8314 | + | |
8301 | 8315 | | |
8302 | 8316 | | |
8303 | 8317 | | |
| |||
8306 | 8320 | | |
8307 | 8321 | | |
8308 | 8322 | | |
8309 | | - | |
8310 | | - | |
| 8323 | + | |
| 8324 | + | |
| 8325 | + | |
| 8326 | + | |
| 8327 | + | |
| 8328 | + | |
| 8329 | + | |
| 8330 | + | |
8311 | 8331 | | |
8312 | 8332 | | |
8313 | 8333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8079 | 8079 | | |
8080 | 8080 | | |
8081 | 8081 | | |
8082 | | - | |
| 8082 | + | |
8083 | 8083 | | |
8084 | 8084 | | |
8085 | 8085 | | |
8086 | 8086 | | |
8087 | 8087 | | |
8088 | 8088 | | |
8089 | 8089 | | |
8090 | | - | |
| 8090 | + | |
| 8091 | + | |
| 8092 | + | |
| 8093 | + | |
| 8094 | + | |
| 8095 | + | |
| 8096 | + | |
| 8097 | + | |
| 8098 | + | |
8091 | 8099 | | |
8092 | 8100 | | |
8093 | 8101 | | |
| |||
8103 | 8111 | | |
8104 | 8112 | | |
8105 | 8113 | | |
8106 | | - | |
| 8114 | + | |
8107 | 8115 | | |
8108 | 8116 | | |
8109 | 8117 | | |
| |||
8116 | 8124 | | |
8117 | 8125 | | |
8118 | 8126 | | |
| 8127 | + | |
8119 | 8128 | | |
8120 | 8129 | | |
8121 | 8130 | | |
| |||
0 commit comments