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 Debug Block Endpoint + Return SSZ-Encoded #5926
Conversation
beacon-chain/rpc/debug/block.go
Outdated
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "Could not retrieve block by root: %v", err) | ||
} | ||
encoded, err := ssz.Marshal(signedBlock.Block) |
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.
don't you want to Marshal the whole thing including signature?
req *pbrpc.BlockRequest, | ||
) (*pbrpc.SSZResponse, error) { | ||
root := bytesutil.ToBytes32(req.BlockRoot) | ||
signedBlock, err := ds.BeaconDB.Block(ctx, root) |
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.
what happens if it's nil
?
Codecov Report
@@ Coverage Diff @@
## master #5926 +/- ##
==========================================
+ Coverage 59.40% 59.61% +0.21%
==========================================
Files 318 319 +1
Lines 26796 26862 +66
==========================================
+ Hits 15917 16015 +98
+ Misses 8720 8686 -34
- Partials 2159 2161 +2 |
What type of PR is this?
What does this PR do? Why is it needed?
This PR adds
/eth/v1alpha1/debug/state
and/eth/v1alpha1/debug/block
to return an ssz-encoded response. It also allows the ability to get a beacon block by its root.Which issues(s) does this PR fix?
Fixes #5918