Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REST implementation for MultipleValidatorStatus #11786

Merged
merged 11 commits into from
Jan 4, 2023
Merged

Add REST implementation for MultipleValidatorStatus #11786

merged 11 commits into from
Jan 4, 2023

Conversation

nalepae
Copy link
Contributor

@nalepae nalepae commented Dec 16, 2022

What type of PR is this?

Feature

Related gitHub issue:

#11580

What does this PR do? Why is it needed?

This adds an implementation for the MultipleValidatorStatus validator client method by calling the Beacon Node REST API instead of the gRPC one.

Notes for reviewers:

I tried to mimic https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/rpc/prysm/v1alpha1/validator/status.go#L55-L98.

A list of validators keys and validator indexes are given in inputs.

  • If the input validator key corresponds to an existing validator, then nothing fancy is done.
  • If the input validator key does not correspond to an existing validator, then the corresponding validator status is set as unknown and the corresponding validator index is set at the highest possible uint64 value.
  • If the input validator index does not correspond to an existing validator, then the corresponding validator is dropped.

Compared to gRPC version, I did not keep the same order in the outputs.
I checked in the codebase where MultipleValidatorStatus is used, and did not noticed any need for a specific output order.

@nalepae nalepae requested a review from a team as a code owner December 16, 2022 14:21
@nalepae nalepae marked this pull request as draft December 16, 2022 14:23
@nalepae nalepae marked this pull request as ready for review December 16, 2022 14:46
validator/client/beacon-api/state_validators.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved
validator/client/beacon-api/status.go Outdated Show resolved Hide resolved

var lastActivatedValidatorIndex uint64 = 0
// Set PositionInActivationQueue
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's extract this to a private function setPositionInActivationQueue

@nalepae nalepae requested review from rkapka and removed request for prestonvanloon, nisdas and james-prysm December 22, 2022 09:37
@nalepae
Copy link
Contributor Author

nalepae commented Jan 3, 2023

It seems some e2e tests fail because of No space left on device error:

Exemple: https://buildkite.com/prysmatic-labs/prysm/builds/69708#018577a1-b5ea-40ba-8922-2a0854c91921 - line 218

@prylabs-bulldozer prylabs-bulldozer bot merged commit e1408de into prysmaticlabs:develop Jan 4, 2023
@nalepae nalepae deleted the MultipleValidatorsStatus branch January 5, 2023 06:43
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.

3 participants