-
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
Add metadata fields to getBlobSidecars #14677
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dB2510
reviewed
Nov 28, 2024
@@ -92,8 +115,7 @@ loop: | |||
return indices, nil | |||
} | |||
|
|||
func buildSidecarsJsonResponse(verifiedBlobs []*blocks.VerifiedROBlob) *structs.SidecarsResponse { | |||
resp := &structs.SidecarsResponse{Data: make([]*structs.Sidecar, len(verifiedBlobs))} | |||
func buildSidecarsJsonResponse(resp *structs.SidecarsResponse, verifiedBlobs []*blocks.VerifiedROBlob) *structs.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.
nit: I think a cleaner way to write this function would be to return slice of sidecars and then assign the returned slice to resp.Data
above.
Suggested change
func buildSidecarsJsonResponse(resp *structs.SidecarsResponse, verifiedBlobs []*blocks.VerifiedROBlob) *structs.SidecarsResponse { | |
func buildSidecarsJsonResponse(verifiedBlobs []*blocks.VerifiedROBlob) []*structs.Sidecar { |
rkapka
reviewed
Nov 28, 2024
} | ||
blkRoot, err := blk.Block().HashTreeRoot() | ||
if err != nil { | ||
httputil.HandleError(w, "Could not hash block: %s"+err.Error(), http.StatusInternalServerError) |
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.
Suggested change
httputil.HandleError(w, "Could not hash block: %s"+err.Error(), http.StatusInternalServerError) | |
httputil.HandleError(w, "Could not hash block: "+err.Error(), http.StatusInternalServerError) |
rkapka
approved these changes
Nov 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Other
What does this PR do? Why is it needed?
This PR updates the
GetBlobSidecarsResponse
to include additional metadata fields:version
,execution_optimistic
, andfinalized
. These changes align our API with the latest Beacon Node API specification.Which issues(s) does this PR fix?
N/A
Other notes for review
Acknowledgements