Skip to content

Cache chain state in local database for faster query responses #147

@crtahlin

Description

@crtahlin

Sub-issue of #146 (Chain features on gateway)

Problem

Chain queries (provenance lookups, verification, lineage traversal) require on-chain calls which are slow and subject to RPC rate limits and timeouts. The MCP server already encountered issues with large block range queries (413 errors, timeouts).

Proposed Solution

Cache blockchain-anchored data in a local database (e.g., SQLite) so chain-related queries can be served from local storage with faster response times.

This would include:

  • Provenance records (anchored hashes, timestamps, signers)
  • Lineage chain relationships
  • Verification results

Implementation

Details to be planned by the gateway developer. Considerations:

  • Cache invalidation / freshness strategy
  • What to index and store vs. what to always fetch live
  • Database schema design
  • Sync mechanism to keep local state up to date with on-chain state

Context

Part of the chain features epic (#146). This optimization is important for a seamless user experience when serving chain data through the gateway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions