Commit 0eb6190
committed
Add monitor_event_source to holding cell HTLC fails
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. We started this process
in the previous commit, and here we continue by storing the monitor event id
in the Channel's holding cell HTLC failures. 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 9b33f06 commit 0eb6190
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
| 554 | + | |
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
556 | 558 | | |
557 | 559 | | |
| 560 | + | |
558 | 561 | | |
559 | 562 | | |
560 | 563 | | |
| |||
6470 | 6473 | | |
6471 | 6474 | | |
6472 | 6475 | | |
6473 | | - | |
| 6476 | + | |
6474 | 6477 | | |
6475 | 6478 | | |
6476 | 6479 | | |
| |||
6494 | 6497 | | |
6495 | 6498 | | |
6496 | 6499 | | |
| 6500 | + | |
6497 | 6501 | | |
6498 | 6502 | | |
6499 | 6503 | | |
| |||
8292 | 8296 | | |
8293 | 8297 | | |
8294 | 8298 | | |
8295 | | - | |
| 8299 | + | |
8296 | 8300 | | |
8297 | 8301 | | |
8298 | 8302 | | |
8299 | 8303 | | |
8300 | 8304 | | |
8301 | 8305 | | |
8302 | 8306 | | |
| 8307 | + | |
8303 | 8308 | | |
8304 | 8309 | | |
8305 | 8310 | | |
| |||
14540 | 14545 | | |
14541 | 14546 | | |
14542 | 14547 | | |
14543 | | - | |
| 14548 | + | |
14544 | 14549 | | |
14545 | 14550 | | |
14546 | 14551 | | |
| |||
14552 | 14557 | | |
14553 | 14558 | | |
14554 | 14559 | | |
| 14560 | + | |
14555 | 14561 | | |
14556 | 14562 | | |
14557 | 14563 | | |
| |||
14991 | 14997 | | |
14992 | 14998 | | |
14993 | 14999 | | |
| 15000 | + | |
14994 | 15001 | | |
14995 | 15002 | | |
14996 | 15003 | | |
| |||
15445 | 15452 | | |
15446 | 15453 | | |
15447 | 15454 | | |
15448 | | - | |
| 15455 | + | |
15449 | 15456 | | |
15450 | 15457 | | |
15451 | 15458 | | |
| |||
15460 | 15467 | | |
15461 | 15468 | | |
15462 | 15469 | | |
| 15470 | + | |
15463 | 15471 | | |
15464 | 15472 | | |
15465 | 15473 | | |
| |||
16486 | 16494 | | |
16487 | 16495 | | |
16488 | 16496 | | |
| 16497 | + | |
16489 | 16498 | | |
16490 | 16499 | | |
16491 | 16500 | | |
16492 | 16501 | | |
16493 | 16502 | | |
16494 | 16503 | | |
| 16504 | + | |
16495 | 16505 | | |
16496 | 16506 | | |
16497 | 16507 | | |
| |||
0 commit comments