-
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 API: /eth/v1/beacon/pool/bls_to_execution_changes
#12963
Conversation
/eth/v1/beacon/pool/bls_to_execution_changes
@@ -87,13 +85,6 @@ func (_ *BeaconEndpointFactory) Create(path string) (*apimiddleware.Endpoint, er | |||
case "/eth/v1/beacon/pool/proposer_slashings": | |||
endpoint.PostRequest = &ProposerSlashingJson{} | |||
endpoint.GetResponse = &ProposerSlashingsPoolResponseJson{} | |||
case "/eth/v1/beacon/pool/bls_to_execution_changes": | |||
endpoint.PostRequest = &SubmitBLSToExecutionChangesRequest{} | |||
endpoint.GetResponse = &BLSToExecutionChangesPoolResponseJson{} |
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.
BLSToExecutionChangesPoolResponseJson
can be removed
|
||
// SubmitSignedBLSToExecutionChanges submits said object to the node's pool | ||
// if it passes validation the node must broadcast it to the network. | ||
func (s *Server) SubmitSignedBLSToExecutionChanges(w http.ResponseWriter, r *http.Request) { |
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.
I would simplify the name to SubmitBLSToExecutionChanges
because there is no unsigned counterpart
if len(failures) > 0 { | ||
failuresContainer := &helpers.IndexedVerificationFailure{Failures: failures} | ||
err := grpc.AppendCustomErrorHeader(ctx, failuresContainer) | ||
if err != nil { | ||
http2.HandleError(w, fmt.Sprintf("One or more BLSToExecutionChange failed validation. Could not prepare BLSToExecutionChange failure information: %v", | ||
err), http.StatusBadRequest) | ||
return | ||
} | ||
http2.HandleError(w, fmt.Sprintf("One or more BLSToExecutionChange failed validation: %v", | ||
err), http.StatusBadRequest) | ||
return | ||
} |
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 is not how it should be done for HTTP. It should be done the same way as when submitting atts:
if len(attFailures) > 0 {
failuresErr := &shared.IndexedVerificationFailureError{
Code: http.StatusBadRequest,
Message: "One or more attestations failed validation",
Failures: attFailures,
}
http2.WriteError(w, failuresErr)
}
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
What type of PR is this?
Feature
What does this PR do? Why is it needed?
implements
/eth/v1/beacon/pool/bls_to_execution_changes
/eth/v1/beacon/pool/bls_to_execution_changes
endpoints in full rest and removes the grpc implementation. some of the types must remain for the purposes of execution payload use, we may have a better migration path for these endpoints in the future.
Which issues(s) does this PR fix?
part of #12970