Skip to content

feat: proxy: add DB cache #1822

Description

@joanestebanr

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions