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

simulators/eth2: Verify block signatures on blocks sent to builder #756

Merged
merged 5 commits into from
Apr 24, 2023

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Apr 13, 2023

Adds a check to verify that all blocks sent to the builder are properly signed by the clients.

Tests will now fail if any block is detected with an invalid signature.

The builder also now returns an error if the signature is invalid, which should help detect this issue in test nets that use the builder as an external command.

Correctly detects prysmaticlabs/prysm#12263

Summary of the issue:

  • On their turn to propose, the clients can request a block to be built for them from the Builder API
  • The builder API in hive is a mock builder that simply relays blocks built from execution client back to the consensus client as an intermediary
  • The mock builder can simulate payloads built incorrectly in order to test that the clients detect these issues, or circuit break the builder altogether in case of an issue
  • The client gets a "blinded" payload which is only the header but is missing the full transaction list from the builder
  • The client forms the beacon block including this blinded payload, signs it, and sends it back to the builder
  • One important step that the hive mock builder was missing from a real relayer (like mev-boost) is that the beacon block signature is validated before returning the unblinded payload
  • In reality, if the client delivers a bad signature, the builder will simply refuse to unblind the block and the slot proposal would be missed
  • Hive mock builder now checks the signature and expects that the beacon block is well formed and correctly signed

@marioevz marioevz requested a review from fjl April 18, 2023 18:40
@marioevz marioevz merged commit 51ecfda into ethereum:master Apr 24, 2023
mattsse pushed a commit to paradigmxyz/hive that referenced this pull request May 12, 2023
* simulators/ethereum/engine: send `eth_` requests to port 8545 (ethereum#752)

simulators/ethereum/engine: send `eth_` requests to 8545

* clients/ethereumjs: Update branch (ethereum#753)

* clients/ethereumjs: Change git branch

* clients/ethereumjs: Fix bash script issues

* simulators/ethereum/engine: node: unsubscribe from events

* simulators/ethereum/engine: clmock: add extra logs

* simulators/ethereum/engine: correctly stop secondary clients

* simulators/eth2/common: create client interfaces, update mock builder (ethereum#738)

* simulators/eth2/common: refactor clients

* simulators/eth2/engine: fixes due to refactor

* simulators/eth2/common: builder: invalidate payloads

* simulators/eth2/common: builder readme

* simulators/eth2/common: builder: add option to build a payload on an outdated version

* simulators/eth2/withdrawals: add invalid built payload version test

* simulators/eth2/common: builder: remove check to build invalid payload

* simulators/eth2/withdrawals: Fix check

* simulators/eth2/withdrawals: test case validation

* simulators/eth2/common: builder: fix invalidation

* simulators/eth2/withdrawals: fix verifications again

* simulators/ethereum/pyspec: Comment Dockerfile to run local fixtures (ethereum#755)

simulators/ethereum/pyspec: Add Dockerfile comment to run locally generated fixtures

* clients/besu: add --data-storage-format=BONSAI  (ethereum#758)

* simulators/ethereum/engine: Unique Payload ID Tests (ethereum#757)

* simulators/ethereum/engine: expose generic fcu, np

* simulators/ethereum/engine: Unique payload id test

* simulators/ethereum/engine: Add payload id test

* simulators/ethereum/engine: Parallel getPayloadBodies Test (ethereum#749)

* simulators/ethereum/engine: parallel getpayloadbodies

* simulators/ethereum/withdrawals: readme

* clients/erigon: --externalcl flag is not supported anymore (ethereum#760)

* graphql: consistent rule for Long outputs and args (ethereum#746)

* simulators/eth2: Verify block signatures on blocks sent to builder (ethereum#756)

* simulators/eth2/common/builder: interfaces changes

* simulators/eth2/common/builder: verify signatures

* simulators/eth2/withdrawals: Verify block signatures

* simulators/eth2/withdrawals: Update README

* simulators/eth2/withdrawals: minor nit comment

* clients/erigon: explicit --db.size.limit value (ethereum#766)

* clients/nethermind: Cancun support (ethereum#762)

* clients/nethermind: Cancun Support

* clients/nethermind: Dockerfile args

* clients/besu: Cancun Support (ethereum#769)

* clients/ethereumjs: Cancun Support (ethereum#768)

clients/ethereumjs: Cancun Support.

* clients/go-ethereum: remove deprecated PoW (ethereum#773)

Remove ethash-related flags and utils from go-ethereum, since they were
deprecated upstream.

---------

Co-authored-by: Martin Holst Swende <[email protected]>

* clients/nethermind: Add excessDataGas to genesis mapper. (ethereum#771)

* sim/pyspec: bubble error (ethereum#777)

* simulators/devp2p: fix issue causing ethereumjs to crash (ethereum#778)

sim/devp2p: fix issue causing ethereumjs to crash

It seems ethereumjs crashes if the chainid is not present in the genesis.

---------

Co-authored-by: Mario Vega <[email protected]>
Co-authored-by: Gabriel Fukushima <[email protected]>
Co-authored-by: Andrew Ashikhmin <[email protected]>
Co-authored-by: Sina Mahmoodi <[email protected]>
Co-authored-by: Spencer Taylor-Brown <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
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.

1 participant