Goal
Add a DB-backed cache for the bridge tracker's activity and tracking state (today both live only in memory — ActivityCache in bridgetracker/activity.go and memoryRegistry in bridgetracker/registry.go), so state survives restarts and is queryable directly.
This is meant to:
- Reduce calls to external services: both caches already avoid re-asking for something already known within a run (a bridge already scanned, a claim already confirmed, a tracking snapshot already resolved), but every restart starts from zero and re-issues the full set of bridge-service/agglayer calls again. A DB-backed cache keeps that already-resolved state across restarts.
- Increase response speed: serving
GET /activity/... and GET /tracker/... from a local DB read instead of re-scanning bridge services / re-resolving tracking steps on every cold start.
- Keep timestamps:
lastAccess (idle eviction, both caches) and terminalSince (terminal-entry retention, memoryRegistry) are currently reset to zero on every restart, since they only exist in memory — losing them means every entry looks freshly seen/non-terminal again right after a restart, which throws off idle/retention pruning. Persisting them lets pruning behave correctly across restarts instead of just within a single process lifetime.
Goal
Add a DB-backed cache for the bridge tracker's activity and tracking state (today both live only in memory —
ActivityCacheinbridgetracker/activity.goandmemoryRegistryinbridgetracker/registry.go), so state survives restarts and is queryable directly.This is meant to:
GET /activity/...andGET /tracker/...from a local DB read instead of re-scanning bridge services / re-resolving tracking steps on every cold start.lastAccess(idle eviction, both caches) andterminalSince(terminal-entry retention,memoryRegistry) are currently reset to zero on every restart, since they only exist in memory — losing them means every entry looks freshly seen/non-terminal again right after a restart, which throws off idle/retention pruning. Persisting them lets pruning behave correctly across restarts instead of just within a single process lifetime.