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.
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.