Skip to content

No off-chain event indexer β€” every page load re-derives state from raw RPC callsΒ #943

Description

@Ejirowebfi

πŸ”΄ Critical Β· .kiro/specs/contract-event-indexing/ (currently empty), issues #22/#23 above

Description

There is an empty spec directory literally named contract-event-indexing, confirming the team has already identified this gap but not yet scoped or built it. As demonstrated concretely by issue #22 (the 100-event hard cap silently truncating the explorer) and #23 (sequential pagination latency), the frontend's entire data layer is built on live, synchronous RPC calls to Soroban/Horizon with a thin, short-TTL, unbounded in-memory cache (#21) as the only persistence β€” there is no off-chain service that ingests factory events once and serves fast, complete, paginated, filterable queries over them. This architecture fundamentally cannot scale past a few hundred tokens without either the truncation bug (#22) or unacceptable load times (#23), and every RPC-endpoint outage or rate-limit event (#34) takes down the entire app's data-reading capability simultaneously, since there's no cached fallback layer.

Tasks

  • Scope the empty .kiro/specs/contract-event-indexing/ spec: define whether the indexer is a simple serverless cron job periodically ingesting events into a lightweight database (e.g. a Cloudflare D1/Vercel Postgres table of TokenInfo rows keyed by contract address, kept in sync via periodic getEvents polling or a Soroban RPC event subscription if available), or a more substantial dedicated service.
  • Define the indexer's API surface the frontend would consume (e.g. GET /api/tokens?creator=&offset=&limit=, GET /api/tokens/:address) mirroring but not replacing the on-chain view functions (the indexer is a read-optimization layer, not a source of truth β€” the frontend should still be able to fall back to direct RPC calls if the indexer is unavailable or the user wants to verify against the chain directly).
  • Build a minimal first version covering just the "all tokens" explorer view (directly fixing issue Add Select / Dropdown UI ComponentΒ #22's truncation) as the initial milestone, before expanding to per-creator queries, search/filter, and transaction history.
  • Add monitoring/alerting for indexer lag (time since last successfully-ingested event) so staleness is visible rather than silent.

Acceptance Criteria

  • A scoped design document fills in the currently-empty contract-event-indexing spec.
  • A first working version serves the "all tokens" explorer view completely and correctly (no 100-event truncation), verified against a testnet deployment with more than 100 tokens created.
  • The frontend has a documented, tested fallback path to direct RPC calls if the indexer is unreachable.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26bugSomething isn't workingcriticalCritical severity β€” address immediatelydocumentationImprovements or additions to documentation

Type

No type

Fields

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