lightninglabs / lightninglabs/faraday
insights: Track Forwards using HtlcEventStream
- Dominant language
- Go
- Stars
- 130
- Forks
- 35
- Avg merge
- 7h 54m
- Merged PRs (30d)
- 5
Description
The newly added `HtlcEventStream` added to lnd's `routerrpc` provides new insight into a node's forwarding activity. This data is useful for a variety of applications - rate limiting for forwards, success rate tracking of various channels, rebalancing hints which trigger when we see a drop in incoming traffic or a rise in `ErrInsufficientBandwidth` failures.
This issue proposes the addition of a rounting package that consumes forwarding events, and matches them to their settle/fails where applicable. Such a solution could also write htlcs to disk, but for now we will start in memory and let requirements take form. A rough version of this change has been started [here](https://github.com/carlaKC/faraday/tree/temp-htlcnotifier).
### Steps to Completion
1. Update `lndclient` to consume forwarding events (in loop repo)
2. Consume htlc events, classifying them into forwards, receives and link failures (where forwards contain a forwarding event and subsequent settle/fail events.
3. Add the ability to make requests to this subsystem for a set of events over a period of time, which are handled by the main event loop consuming htlc events from lnd so we don't need any locking.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the proposed temp-htlcnotifier branch and the lndclient integration around HtlcEventStream. Trace how the main event loop can classify forwarding events into forwards, receives, and link failures, then support period-based event queries without locking; completion follows the three listed steps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100