Allow SSZ-serialized blocks in publishBlindedBlock - #10679
Merged
Merged
Conversation
(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 <preston@prysmaticlabs.com> * Update beacon-chain/powchain/engine_client.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Update beacon-chain/powchain/engine_client.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Update engine_client.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* powchain and stategen * revert powchain changes * rename field to blockRootsOfSavedStates * rename params to blockRoot * review feedback * fix loop Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> 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 <potuz@prysmaticlabs.com> 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
rkapka
marked this pull request as draft
May 13, 2022 12:44
# 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
rkapka
marked this pull request as ready for review
May 16, 2022 10:48
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") |
Contributor
There was a problem hiding this comment.
can we use the package var for this?
Contributor
There was a problem hiding this comment.
minor change, no big deal and can be done in another pr
rauljordan
approved these changes
May 16, 2022
This file contains hidden or 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
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:
SubmitBlindedBlockSSZgRPC method + API Middleware code. This is easy to review.UnmarshalBlindedBeaconBlockmethod in the unmarshaler. I added this method to be able to unmarshal intoSignedBlindedBeaconBlockBellatrixfor 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.