Skip to content
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 43 commits into from
May 16, 2022

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented May 11, 2022

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:

  1. SubmitBlindedBlockSSZ gRPC method + API Middleware code. This is easy to review.
  2. UnmarshalBlindedBeaconBlock method in the unmarshaler. I added this method to be able to unmarshal into SignedBlindedBeaconBlockBellatrix 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 into validateVersion, added tests and simplified existing tests by utilizing existing helper functions.

rkapka and others added 23 commits May 9, 2022 16:04
(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>
@rkapka rkapka requested a review from a team as a code owner May 11, 2022 15:01
@rkapka 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 rkapka marked this pull request as ready for review May 16, 2022 10:48
if !ok {
return &emptypb.Empty{}, status.Errorf(codes.Internal, "Could not read eth-consensus-version header")
}
ver := md.Get("eth-consensus-version")
Copy link
Contributor

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?

Copy link
Contributor

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 rauljordan added Ready For Review A pull request ready for code review OK to merge labels May 16, 2022
@prylabs-bulldozer prylabs-bulldozer bot merged commit f09b06d into develop May 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the blinded-block-production-ssz branch May 16, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants