diff --git a/setup.py b/setup.py index 1d647c2a1..6d75caeb1 100644 --- a/setup.py +++ b/setup.py @@ -522,10 +522,10 @@ def get_pow_chain_head() -> PowBlock: class NoopExecutionEngine(ExecutionEngine): - def execute_payload(self, execution_payload: ExecutionPayload) -> bool: + def execute_payload(self: ExecutionEngine, execution_payload: ExecutionPayload) -> bool: return True - def consensus_validated(self: ExecutionEngine, execution_payload: ExecutionPayload) -> None: + def consensus_validated(self: ExecutionEngine, block_hash: Hash32, valid: bool) -> None: pass def forkchoice_updated(self: ExecutionEngine, head_block_hash: Hash32, finalized_block_hash: Hash32) -> None: diff --git a/specs/merge/beacon-chain.md b/specs/merge/beacon-chain.md index a1ab61848..eccb7f047 100644 --- a/specs/merge/beacon-chain.md +++ b/specs/merge/beacon-chain.md @@ -263,10 +263,15 @@ def execute_payload(self: ExecutionEngine, execution_payload: ExecutionPayload) #### `consensus_validated` ```python -def consensus_validated(self: ExecutionEngine, execution_payload: ExecutionPayload) -> None: +def consensus_validated(self: ExecutionEngine, block_hash: Hash32, valid: bool) -> None: ... ``` +The call of this function depends on the result of the state transition and must be done when call to the [`state_transition`](../phase0/beacon-chain.md#beacon-chain-state-transition-function) function finishes. The value of the `valid` parameter must be set as follows: + +* `True` if `state_transition` function call succeedes +* `False` if `state_transition` function call fails + ### Block processing *Note*: The call to the `process_execution_payload` must happen before the call to the `process_randao` as the former depends on the `randao_mix` computed with the reveal of the previous block. @@ -280,9 +285,6 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None: process_eth1_data(state, block.body) process_operations(state, block.body) process_sync_aggregate(state, block.body.sync_aggregate) - if is_execution_enabled(state, block.body): - # Notify the block is valid with respect to the consensus state transition function - EXECUTION_ENGINE.consensus_validated(block.body.execution_payload) # [New in Merge] ``` ### Execution payload processing