-
Notifications
You must be signed in to change notification settings - Fork 1.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
Deneb: get-blobs-ssz #12611
Deneb: get-blobs-ssz #12611
Conversation
@@ -213,7 +213,8 @@ func handlePostSSZ(m *apimiddleware.ApiProxyMiddleware, endpoint apimiddleware.E | |||
return true | |||
} | |||
|
|||
func sszRequested(req *http.Request) (bool, error) { | |||
// SszRequested returns a bool value if the ssz type is requested. | |||
func SszRequested(req *http.Request) (bool, error) { |
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.
Let's maybe move this function to /network
(how about a reader.go
file?) because it doesn't make sense to import the middleware package in the HTTP handler. We shouldn't need the middleware at all when writing HTTP handlers.
network.WriteError(w, errJson) | ||
return | ||
} | ||
network.WriteSsz(w, sszResp, "sidecar_response.ssz") |
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.
The spec defines the return object as "blob sidecars", so blob_sidecars.ssz
could be more appropriate
network.WriteError(w, errJson) | ||
return | ||
} | ||
sidecarResp := ðpb.SidecarsResponse{ |
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 to define SidecarsResponse
. You can use BlobSidecars
because SSZ does not preserve field names. It only stores offsets and binary data.
1115fee
to
460833e
Compare
460833e
to
d46ed74
Compare
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Adds ssz to the get blob sidecars beacon API endpoint
https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlobSidecars
Which issues(s) does this PR fix?
part of #12248
Other notes for review