chanevents: channel event monitor improvements
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
initialSyncwrites 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
Hello. I would like to pick this up if that's ok?
@murraystewart96, the channel events feature (forwarding ability) is still under development, and this work should only start once the side branch (faraday-forwarding-ability) is merged into master.
@bitromortac thanks for the heads up. I have an implementation ready so I will wait to see if it's still required once the feature has been merged.