Skip to content

Comments

Add SubQuery indexer benchmark to ERC20 transfer events case#6

Closed
DZakh wants to merge 2 commits intodz/open-indexer-benchmarkfrom
claude/add-subquery-benchmark-N7Ue6
Closed

Add SubQuery indexer benchmark to ERC20 transfer events case#6
DZakh wants to merge 2 commits intodz/open-indexer-benchmarkfrom
claude/add-subquery-benchmark-N7Ue6

Conversation

@DZakh
Copy link
Member

@DZakh DZakh commented Feb 16, 2026

Summary

This PR adds SubQuery as a new indexer to the ERC20 transfer events benchmark suite, enabling performance comparison with existing indexers (Ponder, Rindexer, Squid, and Envio).

Key Changes

  • Benchmark Integration: Added benchmarkSubQuery() function to the benchmark runner that:

    • Manages SubQuery lifecycle via Docker Compose
    • Handles dependency installation, codegen, and build steps
    • Queries the GraphQL endpoint to collect metrics on processed events and blocks
    • Cleans up Docker resources after benchmarking
  • SubQuery Project Setup: Created a complete SubQuery Ethereum indexer configuration:

    • project.ts: Defines the indexer configuration targeting the RocketTokenRETH contract (0xae78736cd615f374d3085123a210448e74fc6393) starting at block 18,600,000
    • schema.graphql: Defines entities for Account, TransferEvent, Allowance, and ApprovalEvent
    • mappingHandlers.ts: Implements event handlers for Transfer and Approval events with account balance tracking and allowance management
    • package.json: Specifies SubQuery dependencies and build scripts
  • Docker Infrastructure: Added Docker Compose configuration for running SubQuery with:

    • PostgreSQL database service with health checks
    • SubQuery node service with configurable RPC endpoint
    • GraphQL query engine service
    • Custom PostgreSQL Dockerfile with required extensions
  • CI/CD: Added GitHub Actions workflow job to validate SubQuery build and codegen steps

  • Configuration Files: Added TypeScript config, .gitignore, and environment example file

Implementation Details

  • The benchmark uses the same GraphQL query pattern as other indexers, querying _metadata.lastProcessedHeight and event counts
  • Event IDs are generated from block number and log index to ensure uniqueness
  • The implementation tracks account balances and allowances in addition to event records
  • Docker Compose is used for consistent, reproducible benchmark execution

https://claude.ai/code/session_01FN9sUj2bn1fq1msFgiQ8B2

Adds a SubQuery Network indexer implementation alongside the existing
Envio and Ponder cases. Includes the project manifest, GraphQL schema,
mapping handlers for Transfer/Approval events, Docker Compose stack,
and benchmark runner integration.

https://claude.ai/code/session_01FN9sUj2bn1fq1msFgiQ8B2
Drop the manually maintained Implementations list from the case README.
Bump @subql/cli to ^6.4.1 and @subql/node-ethereum to ^6.2.1.

https://claude.ai/code/session_01FN9sUj2bn1fq1msFgiQ8B2
@DZakh DZakh closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants