mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-22 07:18:10 +00:00
Update consensus_validated description
This commit is contained in:
parent
06107ce7d8
commit
24bacafeee
4
setup.py
4
setup.py
@ -522,10 +522,10 @@ def get_pow_chain_head() -> PowBlock:
|
|||||||
|
|
||||||
class NoopExecutionEngine(ExecutionEngine):
|
class NoopExecutionEngine(ExecutionEngine):
|
||||||
|
|
||||||
def execute_payload(self, execution_payload: ExecutionPayload) -> bool:
|
def execute_payload(self: ExecutionEngine, execution_payload: ExecutionPayload) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def consensus_validated(self: ExecutionEngine, execution_payload: ExecutionPayload) -> None:
|
def consensus_validated(self: ExecutionEngine, block_hash: Hash32, valid: bool) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def forkchoice_updated(self: ExecutionEngine, head_block_hash: Hash32, finalized_block_hash: Hash32) -> None:
|
def forkchoice_updated(self: ExecutionEngine, head_block_hash: Hash32, finalized_block_hash: Hash32) -> None:
|
||||||
|
@ -263,10 +263,15 @@ def execute_payload(self: ExecutionEngine, execution_payload: ExecutionPayload)
|
|||||||
#### `consensus_validated`
|
#### `consensus_validated`
|
||||||
|
|
||||||
```python
|
```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
|
### 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.
|
*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_eth1_data(state, block.body)
|
||||||
process_operations(state, block.body)
|
process_operations(state, block.body)
|
||||||
process_sync_aggregate(state, block.body.sync_aggregate)
|
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
|
### Execution payload processing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user