lightninglabs / lightninglabs/faraday
chanevents: channel event monitor improvements
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 130
- Forks
- 35
- Avg merge
- 7h 54m
- Merged PRs (30d)
- 5
Description
Follow-up improvements identified during review of #237 (currently only in faraday-forwarding-ability branch).
* Reconnection:
The monitor retries on a fixed interval when the subscription breaks. We should use exponential backoff to be friendlier to lnd during extended outages. The connection may also need to be re-established (needs tests if the grpc connection can recover).
* Start subscription before initial sync:
Right now we sync first, then subscribe. Any events that happen in between get dropped. We should flip the order - subscribe first to start buffering, do the sync, then process buffered events with dedup.
* Deduplicate initial sync events
`initialSync` writes events for every channel on startup regardless of whether anything actually changed. Over time this bloats the DB. We should compare against the last recorded state and only write when something differs.
Points raised in review here https://github.com/lightninglabs/faraday/pull/244
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the channel event monitor and its `initialSync` path, then read the review discussion in #237 and pull request #244. Trace subscription setup, reconnection handling, buffering, and event writes before deciding how the three changes interact. Done means outages use backoff, events between subscription and sync are retained and deduplicated, and unchanged initial-sync state is not rewritten.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grpc
- Domain
- backend, databases, distributed-systems
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100