Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions specs/gloas/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ conditions are not satisfied.
*Note*: `hash_tree_root`, `get_randao_mix`, and `get_current_epoch` are defined
in the [Gloas consensus specs][gloas-consensus-specs]. The predicates
[`is_active_builder`][is-active-builder],
[`can_builder_cover_bid`][can-builder-cover-bid], and
[`can_builder_cover_bid`][can-builder-cover-bid],
[`is_gas_limit_target_compatible`][is-gas-limit-target-compatible], and
[`verify_execution_payload_bid_signature`][verify-execution-payload-bid-signature]
are also defined in the consensus specs.

```python
def validate_bid(
state: BeaconState,
proposer_preferences: ProposerPreferences,
parent_gas_limit: uint64,
signed_bid: SignedExecutionPayloadBid,
fee_recipient: ExecutionAddress,
) -> bool:
Expand All @@ -207,14 +209,19 @@ def validate_bid(
)
assert bid.parent_block_root == hash_tree_root(state.latest_block_header)
assert bid.prev_randao == get_randao_mix(state, get_current_epoch(state))
assert bid.gas_limit <= proposer_preferences.gas_limit
assert is_gas_limit_target_compatible(
parent_gas_limit, bid.gas_limit, proposer_preferences.target_gas_limit
)

if bid.value > 0:
assert can_builder_cover_bid(state, bid.builder_index, bid.value)

return verify_execution_payload_bid_signature(state, signed_bid)
```

`parent_gas_limit` is the gas limit of the parent execution payload identified
by `bid.parent_block_hash`.

The validator's locally configured `max_execution_payment`, the same value it
submits via [`submitBuilderPreferences`][submit-builder-preferences-api] when it
submits preferences, is not a validity condition: it caps how much of
Expand Down Expand Up @@ -258,6 +265,7 @@ block on top of a beacon `state` must take the following actions:
[gloas-consensus-specs]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas
[gloas-validator-specs]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/validator.md#block-proposal
[is-active-builder]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#new-is_active_builder
[is-gas-limit-target-compatible]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/p2p-interface.md#new-is_gas_limit_target_compatible
[proposer-preferences]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/p2p-interface.md#new-proposerpreferences
[proposer-preferences-topic]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/p2p-interface.md#new-proposer_preferences
[signed-execution-payload-bid]: https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid
Expand Down
Loading