Skip to content

GetVersionV2 endpoint#16347

Open
Inspector-Butters wants to merge 3 commits intodevelopfrom
GetVersionV2
Open

GetVersionV2 endpoint#16347
Inspector-Butters wants to merge 3 commits intodevelopfrom
GetVersionV2

Conversation

@Inspector-Butters
Copy link
Contributor

What does this PR do? Why is it needed?
This PR adds the implementation for GetVersionV2 based on ethereum/beacon-APIs#568.

Q: is there anything to be done for deprecating GetVersionV1?

@Inspector-Butters Inspector-Butters force-pushed the GetVersionV2 branch 2 times, most recently from 1469307 to 393a8bc Compare February 10, 2026 13:33
@james-prysm
Copy link
Contributor

james-prysm commented Feb 10, 2026

Q: is there anything to be done for deprecating GetVersionV1?

we should mark it for deprecation in the comments

}
type VersionV2 struct {
BeaconNode *ClientVersionV1 `json:"beacon_node"`
ExecutionClient []*ClientVersionV1 `json:"execution_client"`
Copy link
Contributor

Choose a reason for hiding this comment

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

you need ,omitempty added

Copy link
Contributor

Choose a reason for hiding this comment

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

make sure there's a unit test where it's omitted instead of null, null is incorrect to spec

)

if len(result) == 0 {
return nil, errors.New("execution client returned no result")
Copy link
Contributor

Choose a reason for hiding this comment

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

this will hide the error, you need to handle the rpc error first then do the len check

Code: "PM",
Name: "Prysm",
Version: version.SemanticVersion(),
Commit: version.GitCommit()[:8],
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a potential panic I think, don't we need some len check

assert.StringContains(t, arch, resp.Data.Version)
}

func TestGetVersionV2(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have some unhappy testcases too

require.NoError(t, err)
require.DeepEqual(t, want, resp)
})
t.Run(GetClientVersionV1, func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

also needs some unhappy cases

}
type VersionV2 struct {
BeaconNode *ClientVersionV1 `json:"beacon_node"`
ExecutionClient []*ClientVersionV1 `json:"execution_client"`
Copy link

Choose a reason for hiding this comment

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

fyi, we've decided to only return the first value again and not an array


var elData *structs.ClientVersionV1
elDataList, err := s.ExecutionEngineCaller.GetClientVersionV1(ctx)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be testing len of elDatalist being at least 1 just in case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add that, but I made sure that the function being called will only return the list if the length is >0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants