Bellatrix -- Honest Validator¶
Table of contents¶
- Introduction
- Prerequisites
- Helpers
GetPayloadResponse
get_pow_block_at_terminal_total_difficulty
get_terminal_pow_block
- Protocols
ExecutionEngine
- Beacon chain responsibilities
- Block proposal
Introduction¶
This document represents the changes to be made in the code of an "honest validator" to implement executable beacon chain proposal.
Prerequisites¶
This document is an extension of the Altair -- Honest Validator guide. All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of Bellatrix are requisite for this document and used throughout. Please see related Beacon Chain doc before continuing and use them as a reference throughout.
Helpers¶
GetPayloadResponse
¶
get_pow_block_at_terminal_total_difficulty
¶
get_terminal_pow_block
¶
Note: This function does not use simple serialize hash_tree_root
as to
avoid requiring simple serialize hashing capabilities in the Execution Layer.
Protocols¶
ExecutionEngine
¶
Note: get_payload
function is added to the ExecutionEngine
protocol for use as a validator.
The body of this function is implementation dependent. The Engine API may be used to implement it with an external execution engine.
get_payload
¶
Given the payload_id
, get_payload
returns GetPayloadResponse
with the most recent version of
the execution payload that has been built since the corresponding call to notify_forkchoice_updated
method.
Beacon chain responsibilities¶
All validator responsibilities remain unchanged other than those noted below. Namely, the transition block handling and the addition of ExecutionPayload
.
Note: A validator must not propose on or attest to a block that isn't deemed valid, i.e. hasn't yet passed the beacon chain state transition and execution validations. In future upgrades, an "execution Proof-of-Custody" will be integrated to prevent outsourcing of execution payload validations.
Block proposal¶
Constructing the BeaconBlockBody
¶
ExecutionPayload¶
To obtain an execution payload, a block proposer building a block on top of a state
must take the following actions:
- Set
payload_id = prepare_execution_payload(state, pow_chain, safe_block_hash, finalized_block_hash, suggested_fee_recipient, execution_engine)
, where:state
is the state object after applyingprocess_slots(state, slot)
transition to the resulting state of the parent block processingpow_chain
is aDict[Hash32, PowBlock]
dictionary that abstractly represents all blocks in the PoW chain with block hash as the dictionary keysafe_block_hash
is the return value of theget_safe_execution_block_hash(store: Store)
function callfinalized_block_hash
is the block hash of the latest finalized execution payload (Hash32()
if none yet finalized)suggested_fee_recipient
is the value suggested to be used for thefee_recipient
field of the execution payload
- Set
block.body.execution_payload = get_execution_payload(payload_id, execution_engine)
, where:
Note: It is recommended for a validator to call prepare_execution_payload
as soon as input parameters become known,
and make subsequent calls to this function when any of these parameters gets updated.