Skip to content

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

Open
chriswessels wants to merge 1 commit into
graphprotocol:mainfrom
graphops:feat/version-endpoint
Open

chriswessels wants to merge 1 commit into
graphprotocol:mainfrom
graphops:feat/version-endpoint

Conversation

@chriswessels

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": {
    "indexer_service": ">=1.0.0",
    "graph_node": ">=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 semver >= requirements built from the configured minimums. They admit the same versions that VersionFilter admits (version >= minimum), and a test checks this.
  • 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.
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.

1 participant