Skip to content
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 5 commits into from
Nov 28, 2024
Merged

Conversation

saolyn
Copy link
Contributor

@saolyn saolyn commented Nov 27, 2024

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, and finalized. 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

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@saolyn saolyn requested a review from rkapka November 27, 2024 19:03
@saolyn saolyn requested a review from a team as a code owner November 27, 2024 19:03
@saolyn saolyn added the API Api related tasks label Nov 27, 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 {
Copy link
Contributor

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 {

}
blkRoot, err := blk.Block().HashTreeRoot()
if err != nil {
httputil.HandleError(w, "Could not hash block: %s"+err.Error(), http.StatusInternalServerError)
Copy link
Contributor

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)

@saolyn saolyn added this pull request to the merge queue Nov 28, 2024
Merged via the queue into develop with commit 1139c90 Nov 28, 2024
15 checks passed
@saolyn saolyn deleted the add-metadata-getBlobSidecars branch November 28, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants