Commit graph

24 commits

Author SHA1 Message Date
Carla Kirk-Cohen
7d140d57b9
process: allow outgoing channel not found for failed htlcs
Update error handling for outgoing channel not found to catch the case
where an outgoing channel was not found for a failed HTLC. Unlike
incoming HTLCs, where the HTLC arrived on the channel so we know it
exists, we have not yet performed any existence validation on the
outgoing channel (because interception happens before we check that it
exists).

Since we only need the outgoing channel for record keeping, we just
log the case where a HTLC was failed back and we don't know the channel
(since this is just a bogus channel). We don't store this HTLC in the
DB, as it will be instantly failed back.
2023-12-13 10:31:22 -05:00
Carla Kirk-Cohen
fa9ee24552
process: include closed channels in getChanInfo 2023-10-20 10:17:21 -04:00
Carla Kirk-Cohen
e43aa41121
multi: make forwarding history limit configurable 2023-10-20 10:07:16 -04:00
Carla Kirk-Cohen
66b6bcf013
process: run eventLoop in same gogroup as peerContollers it produces
Remove deadlock where:
- Eventloop errors out, but waits on peerContollers to exit to return.
- peerContollers require eventLoop to exit for their context to be
  be cancelled.

This is achieved by sharing a go error group between the peer
controllers and the event loop. By sharing a group, errors anywhere
will shut everything down.

This change introduces a change in how we wait for clean shutdown:
- Previously: eventLoop would only exit once peerControllers shut down.
- Now: eventLoop exits on error, and we wait on peerControllers at the
  call site of eventLoop.
2023-10-18 10:31:36 -04:00
Carla Kirk-Cohen
29f81fe166
process/test: demonstrate deadlock on error in eventLoop
The following deadlock will occur when:
- We are running process.eventLoop in a go group which means that
  it'll cancel context on error from any member of the group.
- Inside of process.eventLoop, we spin up a set of peerControlers in
  a secondary go group that rely on the parent context (associated
  with the top level group) for cancellation.
- There is an error in eventLoop due to an unknown channel, which
  prompts it to return.
- The defer function waits for the peerController group to exit.
- Since the top level context will only be cancelled when eventLoop
  successfully exits (because receiving the error will cancel ctx),
  we hit a deadlock:
  -> eventLoop is waiting for all peerControllers to exit on a
     canceled context to return an error.
  -> the group is waiting on eventLoop to return an error to cancel
     context.
2023-10-11 10:15:40 -04:00
Carla Kirk-Cohen
34780bee7d
multi: store completed htlcs in DB 2023-10-02 12:54:23 -04:00
Carla Kirk-Cohen
7558dd1e18
multi: add outgoing peer information to peerResolvedEvent 2023-10-02 12:54:07 -04:00
Carla Kirk-Cohen
9616f0a724
multi/refactor: rename resolved event key to incoming key 2023-09-14 16:44:12 -04:00
Joost Jager
0cd238a52d
add blocked mode 2023-02-13 14:40:07 +01:00
Joost Jager
8652813059
test: use zaptest 2023-02-03 13:15:26 +01:00
Joost Jager
ebf590f182
refresh peers list periodically 2023-02-03 13:15:26 +01:00
Joost Jager
361b6302f8
test: configurable channels in lnd mock 2023-02-03 13:15:26 +01:00
Joost Jager
359f3d2f1d
add web ui 2023-01-09 18:43:59 +01:00
Joost Jager
66264ff430
add queue mode 2022-12-02 14:43:15 +01:00
Joost Jager
d5e955ecf2
test: add MaxPendingHtlc coverage 2022-12-02 14:36:33 +01:00
Joost Jager
b5a28e3ec3
isolate per-peer logic 2022-11-30 15:59:42 +01:00
Joost Jager
271f455837
move config options to newProcess 2022-11-29 14:54:39 +01:00
Joost Jager
9a616c0882
use errgroup 2022-11-29 12:49:50 +01:00
Joost Jager
c28e865d64
test: parameterize resolution type 2022-10-13 14:18:05 +02:00
Joost Jager
e542b374ec
add resolved test hook 2022-10-13 14:18:04 +02:00
Joost Jager
e06679c6a0
remove hold fee reporting 2022-10-13 14:15:04 +02:00
Joost Jager
b5261723d9 add rate limit 2021-09-11 14:05:00 +02:00
Joost Jager
f12bc2d592 create shared config struct 2021-09-11 14:05:00 +02:00
Joost Jager
a4e3f24c93 report virtual hold fees 2020-10-17 21:07:30 +02:00