-
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
Upgrade getBlindedBlock
API endpoint to Capella
#11687
Conversation
(cherry picked from commit e5c269ddf7b0c9e04f72ed28982a82de56fcac55)
(cherry picked from commit 1719ce5967b0f74786c596cc921f7256e6b224f3)
assert.Equal(t, "root", beaconBlock.ParentRoot) | ||
assert.Equal(t, "root", beaconBlock.StateRoot) | ||
assert.NotNil(t, beaconBlock.Body) | ||
assert.Equal(t, true, resp.ExecutionOptimistic) |
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.
Do we want to check the execution payload header here?
@@ -813,6 +813,77 @@ func (bs *Server) GetBlindedBlock(ctx context.Context, req *ethpbv1.BlockRequest | |||
return nil, status.Errorf(codes.Internal, "Could not get signed beacon block: %v", err) | |||
} | |||
|
|||
capellaBlk, err := blk.PbCapellaBlock() |
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 function is unreadably long, can we talk about ways of avoiding all this code duplication? or even if we are going to duplicate it, perhaps having each case as a helper?
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 refactored the code and put it into its own file. Deduplicating is hard because there are lot of differences in terms of block types and function calls.
7608e78
to
617b1c4
Compare
617b1c4
to
134b218
Compare
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Upgrades https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlindedBlock to handle Capella blocks.