Skip to content

Comments

Add Squid indexer to ERC20 transfer events benchmark#5

Merged
DZakh merged 6 commits intodz/open-indexer-benchmarkfrom
claude/add-squid-docs-benchmark-ECuG5
Feb 13, 2026
Merged

Add Squid indexer to ERC20 transfer events benchmark#5
DZakh merged 6 commits intodz/open-indexer-benchmarkfrom
claude/add-squid-docs-benchmark-ECuG5

Conversation

@DZakh
Copy link
Member

@DZakh DZakh commented Feb 13, 2026

Summary

This PR adds a complete Squid (Subsquid) implementation to the ERC20 transfer events benchmark suite, enabling performance comparison with existing indexers (Ponder, Envio, and Rindexer).

Key Changes

  • Benchmark Integration: Added benchmarkSquid() function to run.ts that:

    • Manages Squid processor and GraphQL server as separate processes
    • Handles PostgreSQL database lifecycle via Docker Compose
    • Queries indexed transfer and approval events with block height tracking
    • Measures indexing performance over a configurable duration
  • Process Management: Refactored active process tracking from single activeProc to activeProcs array to support Squid's dual-process architecture (processor + GraphQL server)

  • Squid Project Structure: Created complete Squid implementation including:

    • processor.ts: EVM batch processor configured for Ethereum mainnet, monitoring ERC20 contract events from block 18,600,000
    • main.ts: Event handler that processes Transfer and Approval events, maintains Account balances and Allowance state
    • schema.graphql: GraphQL schema defining Account, TransferEvent, Allowance, and ApprovalEvent entities
    • TypeORM entity models with proper indexing and bigint transformers
    • ERC20 ABI definitions and type-safe event decoders
    • Docker Compose configuration for PostgreSQL database
    • TypeScript configuration and build setup
  • CI/CD: Added GitHub Actions workflow job for Squid project validation (dependency installation and typecheck)

Implementation Details

  • Event IDs use format {blockHeight}-{logIndex} for consistent identification across indexers
  • Account balance tracking uses delta accumulation pattern for efficient state management
  • Allowance state is upserted on each Approval event
  • GraphQL server timeout increased to 60 seconds to accommodate initial indexing
  • Processor and GraphQL server are started concurrently and cleaned up independently

https://claude.ai/code/session_01BrQJTpQMVQLbH3Sr5k2BDz

claude and others added 6 commits February 12, 2026 12:16
Add a complete Subsquid SDK implementation for the ERC20 transfer events
benchmark case, following the patterns from docs.sqd.ai. Includes:
- EvmBatchProcessor configured for RocketTokenRETH on Ethereum Mainnet
- TypeORM entities for Account, TransferEvent, Allowance, ApprovalEvent
- Batch event handler with upsert logic matching the benchmark spec
- GraphQL server via @subsquid/graphql-server on port 4350
- Benchmark runner integration with Docker Postgres lifecycle
- CI validation job for typecheck

https://claude.ai/code/session_01BrQJTpQMVQLbH3Sr5k2BDz
The generated model files and migrations are no longer tracked in git.
The benchmark now runs `pnpm codegen` to regenerate models from
schema.graphql and `squid-typeorm-migration generate` before applying.

https://claude.ai/code/session_01BrQJTpQMVQLbH3Sr5k2BDz
@DZakh DZakh merged commit 6d17268 into dz/open-indexer-benchmark Feb 13, 2026
2 of 3 checks passed
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