Repository navigation
feat: serve gateway version and indexer requirements at /version - #1229
Merged
Merged
Conversation
Indexers can't tell why the gateway stops sending them queries after an
upgrade unless they know the gateway's minimum indexer-service and
graph-node versions. Those minimums live only in the gateway's config.
Add GET /version, which returns the gateway's crate version and the
configured minimums as semver requirements:
{"version": "27.7.1",
"indexer_requirements": {"indexer_service": ">=1.0.0",
"graph_node": ">=0.35.0"}}
The route is public, like /ready and /blocklist.
The served `>=minimum` requirements disagreed with VersionFilter for prereleases: the filter compares versions by semver precedence and accepts 1.3.0-rc.1 against a 1.2.3 minimum, but a `>=1.2.3` range excludes prereleases it doesn't name. Serve the minimum versions themselves, documented as compared by semver precedence, and cover prereleases in the equivalence test.
tmigone
approved these changes
Nov 19, 2026
tmigone
pushed a commit
that referenced
this pull request
Nov 19, 2026
…#1230) `VersionFilter::check` enforces `min_graph_node_version` only when an indexer's graph-node reports its version. If the `/status` `{ version { version } }` query fails or returns no version, the indexer still receives queries, so it can skip the minimum just by not reporting a version. This change treats a missing graph-node version the same way as a missing indexer-service version: the indexer is unavailable, with a `no status: failed to query graph-node version: …` reason, until it reports one. An indexer below the minimum is still `not supported: graph-node version below minimum`. This resolves the TODO that held off the check until more graph-nodes reported their version. - **Impact:** indexers whose graph-node can't answer `{ version { version } }` stop receiving queries from a gateway running this change. Failed lookups aren't cached, so an indexer comes back as soon as it reports a version. - **Docs:** the `min_graph_node_version` config comment now says so. - **Related:** #1229 documents the current behaviour, where an indexer whose graph-node doesn't report its version is not excluded. Whichever PR merges second should drop that caveat. Validation: - `cargo +nightly fmt --all -- --check` - `cargo +stable clippy --all-targets -- -Dwarnings --force-warn deprecated --force-warn dead-code` - `cargo +stable test`: 54 passed, including 4 new `VersionFilter` tests against a local indexer-service stub. They cover acceptance, a graph-node that doesn't report its version, a graph-node below the minimum, and an indexer-service below the minimum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
GET /version, which returns the gateway's version and the minimum indexer-service and graph-node versions it requires of indexers:{ "version": "27.7.1", "indexer_requirements": { "min_indexer_service_version": "1.0.0", "min_graph_node_version": "0.35.0" } }Today those minimums (
min_indexer_version,min_graph_node_version) exist only in the gateway's config. When a gateway raises them, an indexer that stops receiving queries can't see why. This endpoint lets indexers and operators check compatibility directly. It mirrors indexer-service's own/version.versionis the crate version (CARGO_PKG_VERSION).min_indexer_version,min_graph_node_version), compared by semver precedence asVersionFiltercompares them, so a prerelease of a later version meets a minimum (1.3.0-rc.1meets1.2.3). A semver range such as>=1.2.3would exclude that prerelease, so they are not served as ranges. A test checks that the served minimums admit exactly what the filter admits, prereleases included.graph_nodeis enforced only when graph-node reports its version, asVersionFilter::checkdoes today. The README says so./readyand/blocklist, and the payload is computed once at startup.Validation:
cargo +nightly fmt --all -- --checkcargo +stable clippy --all-targets -- -Dwarnings --force-warn deprecated --force-warn dead-codecargo +stable test: 53 passed, including 3 new tests for the payload shape, requirement semantics, and the route's JSON response.