7Block Labs
Blockchain Technology

ByAUJay

Enterprise Blockchain Indexing and Indexed Blockchain Data: Why APIs Need a Query Layer

Decision-makers summary: Two 2024–2025 protocol shifts—Ethereum’s EIP‑4844 blobs (ephemeral L2 data) and EIP‑4444 partial history expiry (client pruning)—mean raw node RPCs alone can’t satisfy enterprise-grade data needs. A dedicated query layer that indexes, normalizes, and serves verifiable multi-chain data with SLAs is now essential to build reliable products, manage risk, and control cost. (eips.ethereum.org)


Why this matters now

In the last 18 months, Ethereum shipped Dencun (EIP‑4844), moving rollup batch data into “blobs” that live in consensus clients and are pruned after roughly two weeks (~18 days). If you don’t capture blob contents quickly (e.g., from a beacon node’s blob sidecar API) you lose the raw L2 data needed for settlement analytics, fraud monitoring, and reconciliation—forever. (eips.ethereum.org)

Separately, Ethereum clients added partial history expiry aligned to EIP‑4444: execution clients can prune large swaths of pre‑Merge history and increasingly shift historical serving to specialized providers. Apps that depend on “the network” for deep history will see shrinking availability over P2P and must integrate external archives or run their own. (blog.ethereum.org)

These protocol-level realities mean your API strategy must include an indexing and query layer—not just raw JSON‑RPC endpoints.


Raw node RPCs weren’t designed for business queries

Node RPCs expose low-level primitives. They’re great for submitting transactions and reading recent state, but they break down for product-grade analytics and cross-entity queries.

  • eth_getLogs is easy to misuse and is rate-limited by providers (e.g., 10,000-block windows and/or 10k log caps), forcing careful chunking logic and pagination. Even when allowed, large ranges can timeout or overload nodes. (alchemy.com)
  • “Trace” data (internal calls, state diffs) isn’t standardized across clients and requires special modules (debug/trace) and often archive hardware; methods vary by client (e.g., Nethermind debug_traceTransaction, Erigon trace_filter). (docs.nethermind.io)
  • Historical state queries (balances, storage, code at past blocks) need archive data beyond the ~128-block recent state window; full nodes must re-execute or may not serve it at all—hence archive nodes or third-party archives are required. (ethereum.org)
  • Finality considerations matter: “latest” can reorg; “safe/finalized” only advance per epoch (~6.4 minutes) with two epochs (~12–13 minutes) to finalization, requiring query policies and client tags. (alchemy.com)
  • On rollups, post‑Dencun batches are in blobs retrievable from beacon nodes, not from execution-layer JSON‑RPC. Your ingestion must speak both EL and CL APIs. (specs.optimism.io)
  • On Solana, high throughput makes direct RPC poor for analytics; the recommended pattern is Geyser plugins or provider-managed archival/streaming APIs. (docs.solanalabs.com)

Bottom line: product asks like “show me all swaps for this user across chains last quarter” or “alert if a bridge vault moved funds in a pre-finalized L2 batch” simply don’t map to vanilla RPC calls.


What a query layer is (and isn’t)

A query layer is the indexed, integrity-checked surface that sits on top of raw nodes:

  • It ingests from multiple sources (execution clients, beacon clients for blobs, L2 nodes), decodes data (ABIs, traces), normalizes schemas, and publishes consistent APIs (GraphQL/REST/SQL) with SLAs.
  • It understands chain semantics (finality windows, reorgs, blob retention, L2 challenge periods) and encodes them into queries and freshness flags.
  • It’s observable—with SLOs and error budgets—so teams can manage reliability and ship features without breaking data contracts. (sre.google)

It is not “just a faster node.” It’s a data system with its own ETL, storage layout, governance, and product-facing APIs.


2025 realities that force the upgrade

1) Ethereum’s blob world is ephemeral by design

  • Blobs live in beacon nodes, not execution clients, and are pruned after about two weeks. If you index rollup data (Optimism OP Stack, Arbitrum) you must fetch blobs promptly from beacon APIs and verify them against KZG commitments included in L1 headers. (specs.optimism.io)
  • OP Stack’s Ecotone derivation pipeline explicitly treats type‑3 (blob) transactions differently, retrieving blob contents via beacon endpoints. Your indexer must implement blob retrieval/verification or rely on specialized archivers. (specs.optimism.io)
  • Arbitrum’s Nitro supports posting batches as blobs and exposes tuning flags for blob posting strategy; parsing and retaining those batches is now an L2 indexer responsibility. (docs.arbitrum.io)

2) History pruning is here

  • EF announced client support for partial history expiry: 300–500 GB can be freed by pruning pre‑Merge history today; long-term, EIP‑4444 aims for rolling expiry on the P2P layer. Apps must plan for fading historical availability from random peers and negotiate access to history endpoints. (blog.ethereum.org)

These two shifts together mean “I can always fetch it later” is no longer safe.


Reference architecture: a modern blockchain query layer

Here’s a concrete, battle-tested design we recommend deploying (or buying) in 2025:

Ingestion (multi-protocol, reorg-safe)

  • EVM EL: Pull blocks/receipts/logs with bounded getLogs windows (e.g., ≤2k blocks or ≤10k logs per request); auto-chunk by time/number and de‑dupe by (blockHash, logIndex). (alchemy.com)
  • EVM traces: Use Erigon’s trace_filter/trace_block for call trees and state diffs (higher throughput than ad‑hoc debug on Geth); persist parent-child call relationships and error flags. (docs.erigon.tech)
  • Beacon CL (for blobs): Subscribe to finalized headers and pull blob sidecars for any L2 batch txs (type 0x03); verify against versioned hashes; fall back to secondary beacon or archiver. (specs.optimism.io)
  • Solana: Use validator Geyser plugins or managed streaming to external stores (Kafka/Postgres/ClickHouse) to offload RPC and preserve low-latency access. (docs.solanalabs.com)

Transformation (parallel, idempotent)

  • Adopt Substreams/Firehose to process chains in parallel, cache module outputs, and stream into sinks; this cuts backfill times from weeks to hours and simplifies reorg healing via cursors. (thegraph.com)
  • Normalize schemas: entity tables for accounts, contracts, tokens, NFTs; event fact tables; trace tables; L2 batch metadata tables (blob commitments, frame indices).
  • Compute invariants (e.g., balances, TVL) as materialized views updated incrementally.

Storage (cheap, queryable, durable)

  • Store raw and refined data in columnar formats (Parquet) in cloud object storage; expose analytics via BigQuery or similar. BigQuery now hosts public multi-chain datasets (BTC, ETH, Polygon, Arbitrum, Optimism, Tron, etc.), useful for joining your private lake with public reference data. (cloud.google.com)
  • Partition by chain_id/date/hour and cluster on address/topic to minimize scan cost.

Serving (APIs built for product)

  • GraphQL for transactional app needs (entity joins, filtering, pagination).
  • SQL endpoints for quant/research (warehouse-backed).
  • Webhooks/streams for real-time triggers (order fills, vault moves).

Observability and SLOs

  • Publish SLOs (e.g., 99.9% availability, P95 <250 ms on hot endpoints, freshness <1 min for finalized data), track error budgets, and freeze changes on overspend per SRE policy. (sre.google)

Practical examples with implementation details

Example 1: L2 settlement-risk monitor with blob awareness

Goal: Alert if a rollup sequencer includes outlier transfers to a bridge vault before finalization.

  • Ingest: Watch L1 blocks for type‑3 transactions from known L2 batchers; for each, retrieve blob sidecars via beacon API, decode batches, and reconstruct L2 transactions. (specs.optimism.io)
  • Verify: Check KZG commitments match versioned hashes in the L1 header (don’t trust unverified third-party mirrors). (eip4844.com)
  • Retention: Because blob data prunes in ~2 weeks, persist decoded frames and derived L2 txs in your lake immediately; don’t rely on fetching later. (eip4844.com)
  • Policy: Expose an API that returns anomalies with freshness tags: latest, safe, finalized. Document that “finalized” aligns to two epochs on Ethereum (~12–13 minutes). (alchemy.com)

Example 2: Cross-chain NFT holder snapshot (ETH + Base) without blowing RPC limits

  • Backfill logs for ERC‑721 Transfer events using bounded windows (e.g., 2k-block slices on Base and ETH) to avoid provider caps (or 10k logs per request cap). Merge with token lists and decode proxies. (alchemy.com)
  • Compute current owners incrementally from logs; reconcile against trace-based mints/burns to catch edge cases.
  • Serve via GraphQL: query holders with pagination and filters (trait, mint window), and document finality status on each response.

Example 3: Solana high-throughput indexing without hammering RPC

  • Stream accounts/transactions via a Geyser plugin into RabbitMQ/Kafka and then ClickHouse for ultra-fast analytics; or leverage managed archival from Helius, including getTransactionsForAddress (combines signatures+transactions in one call)—handy for wallet timelines and compliance backfills. (docs.solanalabs.com)
  • For real-time, use provider streaming with gRPC/WebSockets and cursor-managed reconnection; keep an index of slot -> program changes for low-latency searches. (helius.mintlify.app)

Example 4: Audit-at-scale with public data warehousing

  • Join your internal indices with Google’s public crypto datasets to compare activity across chains or validate your own ETL outputs; BigQuery now includes many chains beyond BTC/ETH (e.g., Avalanche, Optimism, Polygon, Tron). (cloud.google.com)

Emerging practices we see working best

  • Treat “finality” as a query parameter. Let clients choose freshness: latest vs safe vs finalized; default to safe for user-facing analytics. (alchemy.com)
  • Make blob retrieval a first-class ingestion path. Run at least one trusted beacon node; cache blobs to object storage as soon as seen; maintain a fallback to a secondary beacon endpoint. (specs.optimism.io)
  • Prefer Erigon for high-volume traces. Its trace_* module offers efficient filtering for call graphs and state diffs; combine with columnar storage for cheap scans. (docs.erigon.tech)
  • Parallelize backfills with Substreams/Firehose. This drastically compresses time-to-ready for historical indexes and reduces RPC costs vs naive sequential pull. (thegraph.com)
  • Expect client-side pruning. Build against the assumption that P2P historical serving declines over time (EIP‑4444 path); contract with history providers or run your own archives. (blog.ethereum.org)
  • Engineer your getLogs callers. Respect provider caps (e.g., 10k-block windows or 10k-log caps), add retry/backoff, and track topic selectivity to auto-adjust chunk sizes. (alchemy.com)
  • Separate “backfill” from “live.” Use different pipelines and compute pools; Substreams modules can feed both your historical build and a live tail with the same code. (thegraph.com)
  • Productize SLOs. Publish data-freshness and latency SLOs per endpoint; use an error-budget policy to manage release velocity vs reliability. (sre.google)

Build vs. buy in 2025: a pragmatic take

You have credible options across the stack; the right mix depends on control needs, timelines, and budget.

  • The Graph (Subgraphs + Substreams). Subgraphs give you GraphQL over indexed on-chain entities, now fully decentralized with pay‑as‑you‑go (first 100k queries free, then usage-based). Substreams add parallel backfills and real-time streams across 90+ networks. Great when you want a standardized model and don’t want to operate heavy infra. (thegraph.com)
  • Goldsky. Backwards-compatible subgraph hosting plus “Mirror” pipelines that stream blocks/logs/traces into your DB or lake with SLAs; useful for dedicated performance or multi-chain replication pipelines without standing up your own ETL. (docs.goldsky.com)
  • Solana specialists. Helius operates independent archival and exposes single-call historical endpoints like getTransactionsForAddress, plus low-latency streams; it’s a strong fit for Solana-scale throughput and enterprise backfills. (helius.dev)
  • Public data warehouses. BigQuery’s public crypto datasets continue to expand; use them to validate your indices, run cross-chain analytics, or speed up prototyping without spinning up nodes. (cloud.google.com)

Caveat: vendor roadmaps change. For instance, Flipside shifted its API/SDK offerings in 2025, emphasizing Snowflake data sharing instead of its prior programmatic API. If your product hard-depends on a third-party API, budget for migration paths or build a thin internal query layer that can swap upstream providers. (docs.flipsidecrypto.xyz)


Deep-dive: handling finality and reorgs in your API

  • Expose “commitment level” in responses (latest, safe, finalized). Default to safe for dashboards; require finalized for financial statements. (alchemy.com)
  • For Solana, make slot/confirmation depth configurable and document your chosen commitment levels in API docs.
  • Maintain a reorg queue: if a block gets reorged, upsert affected entities and emit correction webhooks. Substreams’ cursor model simplifies this; adopt it even if you build your own processors. (thegraph.com)

Deep-dive: making EVM traces usable

Traces power custody, MEV, and compliance analytics, but raw trees are expensive. Use Erigon’s trace_filter to preselect call types and addresses; store a normalized “call_edge” table (tx_hash, parent_id, call_id, type, from, to, value, error) and an optional “state_diff” table for audits. This yields 10–100x faster queries versus reparsing JSON per request. (docs.erigon.tech)


Governance and integrity: proofs and checkpoints

  • Proof of Indexing (POI) from The Graph is a great model: it computes digests of entity-store changes so indexers can prove they indexed the same data. Even if you don’t use Subgraphs, adopt a similar checkpointing scheme to detect divergence between clusters or regions. (thegraph.com)
  • For L2 blobs, persist the versioned hash, KZG commitment, and verification status with every batch frame so you (and auditors) can confirm provenance later. (specs.optimism.io)

Cost control: fewer RPCs, more parallelization

Data is cheapest when you:

  • Backfill with Substreams/Firehose (parallel, cursored) rather than RPC loops that hammer providers. (firehose.streamingfast.io)
  • Use provider-specific endpoints designed for bulk (e.g., Solana getTransactionsForAddress) instead of stitching thousands of calls client-side. (helius.dev)
  • Cache decoded events/traces in columnar storage and serve from there.

Decision checklist for leaders

  • Will your product be correct when blobs are pruned in ~2 weeks and execution clients stop serving old history by default? Do you have beacon access and archives? (eip4844.com)
  • Can your team support archive/trace infra and reorg-safe ETL, or is a managed indexer (Subgraphs/Mirror/Helius) the better path?
  • Are SLOs (availability, latency, freshness) defined, published, and enforced with error budgets? (sre.google)
  • Do your APIs expose commitment levels (latest/safe/finalized) and document semantics for Ethereum epochs and rollup challenge windows (e.g., ~1 week on Arbitrum by default)? (docs.arbitrum.io)
  • Is your schema normalized for cross-chain: chain_id, block_time, address canonicalization, topic decoding, and L2 batch metadata?

The takeaway

Indexing isn’t optional anymore. EIP‑4844 makes critical L2 data short‑lived; EIP‑4444 makes historical serving by ordinary nodes less reliable over time. To ship trusted products, you need a query layer that ingests from execution and consensus sources, parallelizes backfills, enforces finality semantics, and serves developer-friendly APIs with SLOs. Whether you build it or buy it, make sure it is blob‑aware, reorg‑safe, and ready for a world where the past isn’t always online. (specs.optimism.io)


Further reading and tooling mentioned

7Block Labs helps teams design and implement this exact stack—from blob-aware ingestion pipelines to Substreams-based backfills and GraphQL/SQL APIs with strict SLOs. If you’re planning a new product or replatforming your data layer, we’re happy to share reference architectures and migration playbooks tailored to your chains and compliance needs.

Like what you're reading? Let's build together.

Get a free 30‑minute consultation with our engineering team.

Related Posts

7BlockLabs

Full-stack blockchain product studio: DeFi, dApps, audits, integrations.

7Block Labs is a trading name of JAYANTH TECHNOLOGIES LIMITED.

Registered in England and Wales (Company No. 16589283).

Registered Office address: Office 13536, 182-184 High Street North, East Ham, London, E6 2JA.

© 2025 7BlockLabs. All rights reserved.