How selection works
Who the gateway can select for a query, and what makes an eligible indexer more likely to be chosen.
Who can be selected
For each query, the gateway considers an indexer for a deployment only if all of these hold. The versions it requires and the blocklist it applies now are on Constraints.
- Active allocation. The indexer has an active allocation on the deployment, and it is among the deployment's 100 largest active allocations by allocated tokens.
- Reachable, supported software. indexer-service answers /version with a version that meets the minimum on the Constraints page. Graph Node reports its version through /status, and it meets the minimum on the Constraints page. The gateway checks these about every 30 seconds, and a failed check means no queries until the next check passes.
- Indexing status. /status reports progress for the deployment. If /status stops answering, the last report is used for at most 90 seconds.
- Not blocked. The indexer isn't on the gateway's blocklist for the deployment, and its Proof of Indexing doesn't match one the gateway has marked bad.
- Has the blocks the query needs. Historical queries need history back to the requested block. Queries near the head need the indexer to be close to the head.
- Not too far behind. For queries that want the latest data, an indexer more than 30 minutes behind chain head is skipped whenever another indexer is within 30 minutes. If none is, far-behind indexers are a last resort.
- On the version being served. For queries by subgraph, the gateway serves the newest version that has an indexer within 30 minutes of chain head.
- A valid manifest. The deployment's manifest declares a network and a start block.
What makes an eligible indexer more likely to be chosen
The gateway picks a few indexers per query, balancing expected quality against price. It prefers:
- Success. A higher recent share of successful, valid, attested responses. Recent results count more than older ones. Repeated failures reduce selection quickly, and recovery after a fix is gradual.
- Latency. Faster successful responses. Only successful responses count. Requests time out after 20 seconds, and a timeout counts as a failure.
- Time behind chain head. Being closer to the head, for queries that want the latest data.
- Stake. More stake, with diminishing returns.
- Fee. A lower price relative to the gateway's per-query budget. Pricing above the budget makes an indexer a last resort.
These factors are combined, so strength in one can offset weakness in another, except for the eligibility rules above. If none of the chosen indexers return a valid response, the gateway tries others. Your indexer page shows how your observed success, latency and time behind chain head compare with the median indexer.