Skip to content

Allow SSZ-serialized blocks in publishBlindedBlock - #10679

Merged
prylabs-bulldozer[bot] merged 43 commits into
developfrom
blinded-block-production-ssz
May 16, 2022
Merged

prylabs-bulldozer[bot] merged 43 commits into
developfrom
blinded-block-production-ssz

Conversation

@rkapka

@rkapka rkapka commented May 11, 2022

Copy link
Copy Markdown
Contributor

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 <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>
@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
Copy Markdown
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
Copy Markdown
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

@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants