-
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
Allow SSZ-serialized blocks in publishBlindedBlock
#10679
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
(cherry picked from commit 7388eeb)
* Add fuzz tests for sparse merkle trie and change HTR signature to return an error * fix capitalization of error message
* Add timeout values * Update engine_client.go * Update engine_client.go * Update beacon-chain/powchain/engine_client.go Co-authored-by: Preston Van Loon <[email protected]> * Update beacon-chain/powchain/engine_client.go Co-authored-by: Preston Van Loon <[email protected]> * Update beacon-chain/powchain/engine_client.go Co-authored-by: Preston Van Loon <[email protected]> * Update engine_client.go Co-authored-by: Preston Van Loon <[email protected]>
* powchain and stategen * revert powchain changes * rename field to blockRootsOfSavedStates * rename params to blockRoot * review feedback * fix loop Co-authored-by: Raul Jordan <[email protected]> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Process atts and updeate head * Fix ctx * New test and old tests * Update validator_test.go * Update validator_test.go * Update service.go * Rename to UpdateHead * Update receive_attestation.go * Update receive_attestation.go Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Starting * remove finalized root * Just call fcu * Review feedbacks * fix one test * Fix conflicts * Update execution_engine_test.go * Add a test for invalid recursive call * Add comprehensive recursive test * dissallow override empty hash Co-authored-by: Potuz <[email protected]> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Cache and use justified and finalized payload block hash * Fix tests * Use real byte * Fix conflicts Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
# Conflicts: # beacon-chain/rpc/apimiddleware/custom_handlers.go # beacon-chain/rpc/eth/beacon/blocks.go # beacon-chain/rpc/eth/beacon/blocks_test.go # proto/eth/service/beacon_chain_service.pb.go
# Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go # proto/eth/service/beacon_chain_service.pb.go
# Conflicts: # proto/eth/service/beacon_chain_service.pb.go # proto/eth/service/beacon_debug_service.pb.go # proto/eth/v2/beacon_block.pb.go # proto/eth/v2/ssz.pb.go # proto/eth/v2/ssz.proto
rauljordan
reviewed
May 16, 2022
if !ok { | ||
return &emptypb.Empty{}, status.Errorf(codes.Internal, "Could not read eth-consensus-version header") | ||
} | ||
ver := md.Get("eth-consensus-version") |
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.
can we use the package var for this?
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.
minor change, no big deal and can be done in another pr
rauljordan
approved these changes
May 16, 2022
rauljordan
added
Ready For Review
A pull request ready for code review
OK to merge
labels
May 16, 2022
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?
Feature
What does this PR do? Why is it needed?
Adds the ability to submit SSZ-serialized blocks to https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/publishBlindedBlock, as outlined in ethereum/beacon-APIs#205
There are two main aspects of this PR:
SubmitBlindedBlockSSZ
gRPC method + API Middleware code. This is easy to review.UnmarshalBlindedBeaconBlock
method in the unmarshaler. I added this method to be able to unmarshal intoSignedBlindedBeaconBlockBellatrix
for Bellatrix fork version. Theoretically we could dig into raw bytes and check if we're dealing with a blinded block or not, and unmarshal to the correct type in the existing method, but I found this design simpler. I also extracted common code intovalidateVersion
, added tests and simplified existing tests by utilizing existing helper functions.