Skip to content

feat: serve gateway version and indexer requirements at /version - #1229

Merged
tmigone merged 2 commits into
graphprotocol:mainfrom
graphops:feat/version-endpoint
Nov 19, 2026
Merged

tmigone merged 2 commits into
graphprotocol:mainfrom
graphops:feat/version-endpoint

Conversation

@chriswessels

@chriswessels chriswessels commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • version is the crate version (CARGO_PKG_VERSION).
  • The requirements are the configured minimum versions (min_indexer_version, min_graph_node_version), compared by semver precedence as VersionFilter compares them, so a prerelease of a later version meets a minimum (1.3.0-rc.1 meets 1.2.3). A semver range such as >=1.2.3 would 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_node is enforced only when graph-node reports its version, as VersionFilter::check does today. The README says so.
  • The route is public and unauthenticated, like /ready and /blocklist, and the payload is computed once at startup.

Validation:

  • cargo +nightly fmt --all -- --check
  • cargo +stable clippy --all-targets -- -Dwarnings --force-warn deprecated --force-warn dead-code
  • cargo +stable test: 53 passed, including 3 new tests for the payload shape, requirement semantics, and the route's JSON response.

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
tmigone merged commit 5e102cd into graphprotocol:main Nov 19, 2026
2 checks passed
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.
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