-
Notifications
You must be signed in to change notification settings - Fork 1k
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
HTTP endpoint GetIndividualVotes
#14198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I just remove GetIndividualVotes
endpoint from v1alpha1
since the proto object is deprecated?
No, we only ever remove stuff in major releases |
* Electra: EIP-7251 Update `process_voluntary_exit` * Add unit test for VerifyExitAndSignature EIP-7251 * @potuz peer feedback
* Add Current Changes * add back check * Avoid a Panic
* Implement Initial Logic * Include check in main.go * Add tests for multiple flags * remove usage of append * remove config/features dependency * Move ValidateNetworkFlags to config/features * Nit * removed NetworkFlags from cmd * remove usage of empty string literal * add comment * add flag validation to prysctl validator-exit --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
defer span.End() | ||
|
||
var req structs.GetIndividualVotesRequest | ||
if r.Body != http.NoBody { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You made the endpoint a GET, which doesn't have a body in the request. We can either put the epoch, public keys and indices in query params or make the endpoint a POST. Given that the length of a query string can be limited by some servers, the latter is a much better option.
- What if there is no body? The function will panic when reading
req.Epoch
. I see we have the same pattern inGetValidatorPerformance
, but this is a bug. We should return a BadRequest error in this case. What we usually do:
err = json.NewDecoder(r.Body).Decode(&req)
switch {
case errors.Is(err, io.EOF):
httputil.HandleError(w, "No data submitted", http.StatusBadRequest)
return
case err != nil:
httputil.HandleError(w, "Could not decode request body: "+err.Error(), http.StatusBadRequest)
return
}
b893d07
to
25e517a
Compare
What type of PR is this?
Other
What does this PR do? Why is it needed?
This PR adds the HTTP endpoint for
GetIndividualVotes
Other notes for review