-
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
/eth/v1/beacon/blinded_blocks/{block_id}
API endpoint
#11538
Conversation
bellatrixBlk, err := blk.PbBellatrixBlock() | ||
if err == nil { | ||
if bellatrixBlk == nil { | ||
return nil, status.Errorf(codes.Internal, "Nil 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.
return nil, status.Errorf(codes.Internal, "Nil block") | |
return nil, status.Error(codes.Internal, "Nil 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.
Same in other instances
blindedBlkInterface, err := blk.ToBlinded() | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "Could not convert block to blinded block: %v", err) | ||
} | ||
blindedBellatrixBlock, err := blindedBlkInterface.PbBlindedBellatrixBlock() | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "Could not get signed beacon block: %v", err) | ||
} | ||
v2Blk, err := migration.V1Alpha1BeaconBlockBlindedBellatrixToV2Blinded(blindedBellatrixBlock.Block) | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "Could not get signed beacon block: %v", err) | ||
} |
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.
why convert to blind?
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 endpoint is requesting a blinded block, so we must convert a bellatrix block to blinded format
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.
Ah. Thanks
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 reviewed @rkapka and aside from the minor suggestions from Terence, it looks good to merge
# Conflicts: # beacon-chain/rpc/apimiddleware/endpoint_factory.go # beacon-chain/rpc/apimiddleware/structs.go
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Implements fetching blinded blocks through the Beacon API as described in ethereum/beacon-APIs#241. See also https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlindedBlock.
Other notes for review
This PR also adds missing
ExecutionOptimistic
field to the response of non-blinded SSZ version and improves a few small things in existing grpc endpoints.