-
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 for GetValidatorActiveSetChanges
#14264
Conversation
beacon-chain/rpc/endpoints.go
Outdated
template: "/prysm/v1/validators/active_set_changes", | ||
name: namespace + ".GetValidatorActiveSetChanges", | ||
middleware: []mux.MiddlewareFunc{ | ||
middleware.ContentTypeHandler([]string{api.JsonMediaType}), |
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 don't need the content type handler for a get request
beacon-chain/rpc/endpoints.go
Outdated
@@ -1087,5 +1088,14 @@ func (*Service) prysmValidatorEndpoints(coreService *core.Service) []endpoint { | |||
handler: server.GetValidatorPerformance, | |||
methods: []string{http.MethodPost}, | |||
}, | |||
{ | |||
template: "/prysm/v1/validators/active_set_changes", | |||
name: namespace + ".GetValidatorActiveSetChanges", |
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.
One small nitpick: since the namespace is prysm.validator
, there is no need to repeat the word Validator
in every handler. Can you remove it from this one and all the other existing ones?
httputil.WriteJson(w, response) | ||
} | ||
|
||
func byteArrayToString(byteArrays [][]byte) []string { |
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.
To be precise, this should be named byteSlice2dToStringSlice
because:
- arrays are fixed-length
- we have a slice of slices
- the result is not a string, but a slice of strings
return s | ||
} | ||
|
||
func uint64ArrayToString(indices []primitives.ValidatorIndex) []string { |
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.
This should technically be named uint64SliceToStringSlice
What type of PR is this?
Other
What does this PR do? Why is it needed?
Adding the HTTP endpoint for
GetValidatorActiveSetChanges
.Same changes done here as to #14261
Which issues(s) does this PR fix?
N/A
Other notes for review