Skip to content

fix: update getNodeVersionV2 execution_client to array per spec#8888

Merged
nflaig merged 7 commits intoChainSafe:nflaig/node-version-v2from
lodekeeper:fix/node-version-v2-array-spec
Feb 10, 2026
Merged

fix: update getNodeVersionV2 execution_client to array per spec#8888
nflaig merged 7 commits intoChainSafe:nflaig/node-version-v2from
lodekeeper:fix/node-version-v2-array-spec

Conversation

@lodekeeper
Copy link
Contributor

Description

Updates the getNodeVersionV2 endpoint to match the latest beacon-APIs spec (PR #568), which changed execution_client from a single ClientVersionV1 to an array of ClientVersionV1.

This supports multiplexed EL connections where engine_getClientVersionV1 may return multiple entries.

Changes

  • NodeVersionV2.executionClientClientVersion[] (optional array)
  • IExecutionEngine.clientVersionclientVersions (stores full array from Engine API)
  • Graffiti uses clientVersions?.[0] for the default graffiti string
  • Test data updated to match new array type

Spec Reference

From apis/node/version.v2.yaml:

execution_client:
  type: array
  items:
    $ref: '../../beacon-node-oapi.yaml#/components/schemas/ClientVersionV1'

The execution_client field is an array because the Engine API's engine_getClientVersionV1 may return multiple entries when using multiplexed connections.


This PR was authored with AI assistance (Claude/Lodekeeper 🌟)

@lodekeeper lodekeeper requested a review from a team as a code owner February 10, 2026 13:58
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lodekeeper, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the API for retrieving node version information by aligning it with an updated beacon-APIs specification. The core change involves transitioning the representation of execution client data from a single object to an array of objects, which is crucial for supporting scenarios with multiplexed execution layer connections. This ensures the system can accurately report all connected execution clients, enhancing compatibility and robustness.

Highlights

  • API Specification Alignment: The getNodeVersionV2 endpoint has been updated to conform to the latest beacon-APIs specification (PR Reintegrate bn.js support for SSZ #568), which now defines execution_client as an array of ClientVersionV1.
  • Data Model Update: The NodeVersionV2 type now represents executionClient as an optional array of ClientVersion, accommodating multiple execution client versions.
  • Execution Engine Interface Change: The IExecutionEngine interface and its HTTP implementation (ExecutionEngineHttp) have been refactored to store and expose clientVersions as an array, replacing the previous single clientVersion property.
  • Graffiti Generation Logic: The default graffiti string generation now uses the first entry (clientVersions?.[0]) from the array of execution client versions.
  • Test Data Modernization: Unit test data for the node endpoint has been updated to reflect the new array structure for executionClient.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/api/src/beacon/routes/node.ts
    • Changed the type of executionClient in NodeVersionV2 from ClientVersion to ClientVersion[].
  • packages/api/test/unit/beacon/testData/node.ts
    • Updated the executionClient field in test data to be an array containing a ClientCode.NM object.
  • packages/beacon-node/src/api/impl/node/index.ts
    • Modified the getNodeVersionV2 endpoint to fetch executionEngine.clientVersions instead of executionEngine.clientVersion.
  • packages/beacon-node/src/api/impl/validator/index.ts
    • Updated the getDefaultGraffiti function call to access the first element ([0]) of chain.executionEngine.clientVersions.
  • packages/beacon-node/src/execution/engine/http.ts
    • Renamed the clientVersion property to clientVersions and updated its type to ClientVersion[] | null.
    • Adjusted the logic for initializing clientVersions to null on first response.
    • Updated the assignment of clientVersions to store the full array instead of just the first element.
    • Modified the error handling for getClientVersion to set clientVersions to null.
  • packages/beacon-node/src/execution/engine/interface.ts
    • Updated the IExecutionEngine interface to expose clientVersions as an optional array of ClientVersion.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the getNodeVersionV2 endpoint to align with the latest beacon-APIs specification, changing execution_client to be an array of ClientVersion. The changes are consistently applied across type definitions, implementations, and tests. My review includes a suggestion to improve logging for better observability in scenarios with multiple execution clients.

The beacon-APIs spec (PR ChainSafe#568) changed execution_client from a single
ClientVersionV1 to an array of ClientVersionV1 to support multiplexed
EL connections where engine_getClientVersionV1 may return multiple entries.

Changes:
- NodeVersionV2.executionClient type is now ClientVersion[] (optional array)
- API layer wraps single clientVersion in array for the response
- Execution engine internals unchanged (still stores single clientVersion)
- Test data updated to match new array type
@lodekeeper lodekeeper force-pushed the fix/node-version-v2-array-spec branch from a5b9895 to e2c1d6c Compare February 10, 2026 14:05
Define ClientVersionType and NodeVersionV2Type SSZ containers for proper
JSON serialization with eth2 case convention (camelCase <-> snake_case).
Marked as JSON-only since string fields don't support SSZ binary encoding.
@nflaig nflaig merged commit 9e330cc into ChainSafe:nflaig/node-version-v2 Feb 10, 2026
16 checks passed
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.33%. Comparing base (ce8e080) to head (ace4c94).
⚠️ Report is 1 commits behind head on nflaig/node-version-v2.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           nflaig/node-version-v2    #8888   +/-   ##
=======================================================
  Coverage                   52.33%   52.33%           
=======================================================
  Files                         848      848           
  Lines                       63467    63467           
  Branches                     4703     4703           
=======================================================
  Hits                        33216    33216           
  Misses                      30182    30182           
  Partials                       69       69           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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