Remove `is_execution_enabled` condition since Capella
This commit is contained in:
parent
1c424d76ed
commit
0f5ac1186e
|
@ -176,9 +176,8 @@ class BeaconState(Container):
|
|||
```python
|
||||
def process_block(state: BeaconState, block: BeaconBlock) -> None:
|
||||
process_block_header(state, block)
|
||||
if is_execution_enabled(state, block.body):
|
||||
process_withdrawals(state, block.body.execution_payload)
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in EIP6110]
|
||||
process_withdrawals(state, block.body.execution_payload)
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in EIP6110]
|
||||
process_randao(state, block.body)
|
||||
process_eth1_data(state, block.body)
|
||||
process_operations(state, block.body) # [Modified in EIP6110]
|
||||
|
@ -212,8 +211,7 @@ def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
|
|||
for_ops(body.bls_to_execution_changes, process_bls_to_execution_change)
|
||||
|
||||
# [New in EIP6110]
|
||||
if is_execution_enabled(state, body):
|
||||
for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt)
|
||||
for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt)
|
||||
```
|
||||
|
||||
#### New `process_deposit_receipt`
|
||||
|
|
|
@ -236,8 +236,7 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
|
|||
process_block_header(state, block)
|
||||
verify_builder_block_bid(state, block)
|
||||
process_sharded_data(state, block)
|
||||
if is_execution_enabled(state, block.body):
|
||||
process_execution_payload(state, block, EXECUTION_ENGINE)
|
||||
process_execution_payload(state, block, EXECUTION_ENGINE)
|
||||
|
||||
if not is_builder_block_slot(block.slot):
|
||||
process_randao(state, block.body)
|
||||
|
|
|
@ -331,9 +331,9 @@ def process_historical_summaries_update(state: BeaconState) -> None:
|
|||
```python
|
||||
def process_block(state: BeaconState, block: BeaconBlock) -> None:
|
||||
process_block_header(state, block)
|
||||
if is_execution_enabled(state, block.body):
|
||||
process_withdrawals(state, block.body.execution_payload) # [New in Capella]
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in Capella]
|
||||
# Removed `is_execution_enabled` check
|
||||
process_withdrawals(state, block.body.execution_payload) # [New in Capella]
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in Capella]
|
||||
process_randao(state, block.body)
|
||||
process_eth1_data(state, block.body)
|
||||
process_operations(state, block.body) # [Modified in Capella]
|
||||
|
|
|
@ -200,9 +200,8 @@ def verify_kzg_commitments_against_transactions(transactions: Sequence[Transacti
|
|||
```python
|
||||
def process_block(state: BeaconState, block: BeaconBlock) -> None:
|
||||
process_block_header(state, block)
|
||||
if is_execution_enabled(state, block.body):
|
||||
process_withdrawals(state, block.body.execution_payload)
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in Deneb]
|
||||
process_withdrawals(state, block.body.execution_payload)
|
||||
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in Deneb]
|
||||
process_randao(state, block.body)
|
||||
process_eth1_data(state, block.body)
|
||||
process_operations(state, block.body)
|
||||
|
|
|
@ -10,7 +10,10 @@ from eth2spec.test.helpers.execution_payload import (
|
|||
build_randomized_execution_payload
|
||||
)
|
||||
from eth2spec.test.context import (
|
||||
with_bellatrix_and_later, spec_state_test
|
||||
BELLATRIX,
|
||||
with_bellatrix_and_later,
|
||||
with_phases,
|
||||
spec_state_test,
|
||||
)
|
||||
|
||||
|
||||
|
@ -44,7 +47,7 @@ def test_empty_block_transition_randomized_payload(spec, state):
|
|||
yield 'post', state
|
||||
|
||||
|
||||
@with_bellatrix_and_later
|
||||
@with_phases([BELLATRIX])
|
||||
@spec_state_test
|
||||
def test_is_execution_enabled_false(spec, state):
|
||||
# Set `latest_execution_payload_header` to empty
|
||||
|
|
|
@ -31,6 +31,29 @@ from eth2spec.test.helpers.deposits import (
|
|||
from eth2spec.test.helpers.voluntary_exits import prepare_signed_exits
|
||||
|
||||
|
||||
#
|
||||
# `is_execution_enabled` has been removed from Capella
|
||||
#
|
||||
|
||||
@with_capella_and_later
|
||||
@spec_state_test
|
||||
def test_invalid_is_execution_enabled_false(spec, state):
|
||||
# Set `latest_execution_payload_header` to empty
|
||||
state.latest_execution_payload_header = spec.ExecutionPayloadHeader()
|
||||
yield 'pre', state
|
||||
|
||||
block = build_empty_block_for_next_slot(spec, state)
|
||||
|
||||
# Set `execution_payload` to empty
|
||||
block.body.execution_payload = spec.ExecutionPayload()
|
||||
assert len(block.body.execution_payload.transactions) == 0
|
||||
|
||||
signed_block = state_transition_and_sign_block(spec, state, block, expect_fail=True)
|
||||
|
||||
yield 'blocks', [signed_block]
|
||||
yield 'post', None
|
||||
|
||||
|
||||
#
|
||||
# BLSToExecutionChange
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue