Skip to content

Optimize chain-indexer sync performance #874

@gilescope

Description

@gilescope

Summary

Optimize the chain-indexer process to reduce block sync time. Faster indexer sync directly reduces dev/QA cycle time when testing against chains with significant block history.

Context

  • The chain-indexer uses subxt to fetch blocks from the node and writes parsed data (blocks, extrinsics, events, ledger state) to PostgreSQL via sqlx.
  • Current bottleneck is most visible during catch-up/resync scenarios (thousands of blocks).

Suggested investigation areas

  • Profile current sync to identify hotspots (CPU vs I/O bound)
  • Block prefetching / pipelining from node RPC
  • Parallelizing deserialization of ledger state and zswap transaction application
  • Batched / bulk database inserts
  • Connection pool tuning

Acceptance criteria

  • Measurable improvement in blocks-per-second sync rate (establish baseline first)
  • No regression in data correctness (existing tests pass)
  • Performance baseline and improvement documented

Jira: PM-22247

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions