Skip to content

feat(rpc): add package version to RPC response headers#21526

Merged
spalladino merged 1 commit intomerge-train/spartanfrom
palla/add-package-version-header
Mar 13, 2026
Merged

feat(rpc): add package version to RPC response headers#21526
spalladino merged 1 commit intomerge-train/spartanfrom
palla/add-package-version-header

Conversation

@spalladino
Copy link
Contributor

@spalladino spalladino commented Mar 13, 2026

Motivation

The JSON-RPC server already returns x-aztec-* headers for protocol component versions (chain id, rollup address, etc.), but does not include the node's package version. This makes it harder to identify which software version a node is running when debugging or monitoring.

Approach

Extended getVersioningMiddleware to accept an optional packageVersion parameter and emit it as an x-aztec-packageVersion response header alongside existing versioning headers.

Example

$ curl -s -D- http://localhost:8090 -H 'content-type: application/json' -d '[{"jsonrpc":"2.0","id":1,"method":"node_getNodeVersion","params":[]}]'
HTTP/1.1 200 OK
Vary: Accept-Encoding, Origin
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
x-aztec-l2CircuitsVkTreeRoot: 0x06624799e2080c43aba671cdece34d5f4cdff2122bc6be41d80bd903ca0975cc
x-aztec-l2ProtocolContractsHash: 0x23c2022f0b69b29e354b4f7612d5db3ba0bc4259d71ac9186ed272945a644b9c
x-aztec-packageVersion: 5.0.0
Content-Length: 43
Date: Fri, 13 Mar 2026 16:04:31 GMT
Connection: keep-alive
Keep-Alive: timeout=5

[{"jsonrpc":"2.0","id":1,"result":"5.0.0"}]

Changes

  • stdlib: Updated getVersioningMiddleware to accept an optional opts bag with packageVersion, setting x-aztec-packageVersion header when provided
  • aztec: Wired getPackageVersion() into both the main and admin RPC server middleware calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (missing a test though)

@spalladino spalladino enabled auto-merge (squash) March 13, 2026 16:21
@spalladino spalladino merged commit 4f8fdf6 into merge-train/spartan Mar 13, 2026
21 of 25 checks passed
@spalladino spalladino deleted the palla/add-package-version-header branch March 13, 2026 16:24
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
## Motivation

The JSON-RPC server already returns `x-aztec-*` headers for protocol
component versions (chain id, rollup address, etc.), but does not
include the node's package version. This makes it harder to identify
which software version a node is running when debugging or monitoring.

## Approach

Extended `getVersioningMiddleware` to accept an optional
`packageVersion` parameter and emit it as an `x-aztec-packageVersion`
response header alongside existing versioning headers.

## Example

```
$ curl -s -D- http://localhost:8090 -H 'content-type: application/json' -d '[{"jsonrpc":"2.0","id":1,"method":"node_getNodeVersion","params":[]}]'
HTTP/1.1 200 OK
Vary: Accept-Encoding, Origin
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
x-aztec-l2CircuitsVkTreeRoot: 0x06624799e2080c43aba671cdece34d5f4cdff2122bc6be41d80bd903ca0975cc
x-aztec-l2ProtocolContractsHash: 0x23c2022f0b69b29e354b4f7612d5db3ba0bc4259d71ac9186ed272945a644b9c
x-aztec-packageVersion: 5.0.0
Content-Length: 43
Date: Fri, 13 Mar 2026 16:04:31 GMT
Connection: keep-alive
Keep-Alive: timeout=5

[{"jsonrpc":"2.0","id":1,"result":"5.0.0"}]
```

## Changes

- **stdlib**: Updated `getVersioningMiddleware` to accept an optional
`opts` bag with `packageVersion`, setting `x-aztec-packageVersion`
header when provided
- **aztec**: Wired `getPackageVersion()` into both the main and admin
RPC server middleware calls

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@AztecBot
Copy link
Collaborator

✅ Successfully backported to backport-to-v4-staging #21477.

AztecBot added a commit that referenced this pull request Mar 14, 2026
BEGIN_COMMIT_OVERRIDE
fix: orchestrator enqueue yield (#21286)
chore: default multiplier (#21482)
chore: update yarn.lock (#21479)
chore: backport #21231 feat!: improve L2ToL1MessageWitness API to v4
(#21463)
feat(rpc): add package version to RPC response headers (#21526)
feat(ethereum): check VK tree root and protocol contracts hash in rollup
compatibility (#21537)
feat: add public log filtering by tag (#21561)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants