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 Validator's GetDuties #11893

Conversation

PatriceVignola
Copy link
Contributor

What type of PR is this?

Feature

What does this PR do? Why is it needed?

It adds the GetDuties REST API endpoint for the validator.

nalepae and others added 24 commits December 16, 2022 15:34
@PatriceVignola PatriceVignola requested a review from a team as a code owner January 19, 2023 06:50
validator/client/beacon-api/duties.go Outdated Show resolved Hide resolved
validator/client/beacon-api/duties.go Outdated Show resolved Hide resolved
validator/client/beacon-api/duties.go Show resolved Hide resolved
validator/client/beacon-api/duties.go Show resolved Hide resolved
@james-prysm james-prysm added the API Api related tasks label Jan 20, 2023
func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch types.Epoch) ([]*apimiddleware.CommitteeJson, error) {
committeeParams := url.Values{}
committeeParams.Add("epoch", strconv.FormatUint(uint64(epoch), 10))
committeesRequest := buildURL("/eth/v1/beacon/states/head/committees", committeeParams)
Copy link
Contributor

Choose a reason for hiding this comment

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

I want to double check if using the head in this case is correct, the grpc one read a little differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I understand it from the spec, the epoch query parameter decides which epoch to query the committees for. The head committees will only be fetches if epoch isn't specified.

epoch Fetch committees for the given epoch. If not present then the committees for the epoch of the state will be obtained.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it this makes sense.

@PatriceVignola PatriceVignola requested review from rkapka and removed request for saolyn, potuz and terencechain January 23, 2023 03:55
Copy link
Contributor

@james-prysm james-prysm left a comment

Choose a reason for hiding this comment

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

will wait for radek for a second approval.

@prylabs-bulldozer prylabs-bulldozer bot merged commit d919f80 into prysmaticlabs:develop Jan 24, 2023
@PatriceVignola PatriceVignola deleted the user/pavignol/add-get-duties branch January 25, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants