Skip to content

Commit 03f9949

Browse files
small changes
1 parent bed7616 commit 03f9949

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

specs/_features/eip7732/beacon-chain.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- [`get_payload_attesting_indices`](#get_payload_attesting_indices)
4141
- [`get_indexed_payload_attestation`](#get_indexed_payload_attestation)
4242
- [Beacon chain state transition function](#beacon-chain-state-transition-function)
43+
- [Modified `state_transition`](#modified-state_transition)
4344
- [Block processing](#block-processing)
4445
- [Withdrawals](#withdrawals)
4546
- [Modified `process_withdrawals`](#modified-process_withdrawals)
@@ -416,7 +417,7 @@ def get_indexed_payload_attestation(state: BeaconState, slot: Slot,
416417

417418
### Modified `state_transition`
418419

419-
**Note:** This is modified to accept `signed_envelope` as an additional parameter. The state transition has been broken in two parts, first importing a signed block and then importing an execution payload. Even though the order must be followed, importing of the signed block and the execution payload can be done indepedently.
420+
**Note:** This is modified to accept `signed_envelope` as an additional parameter. The state transition has been broken in two parts, first importing a signed block and then importing an execution payload. Even though the order must be followed, importing of the signed block and the execution payload can be done independently.
420421

421422
```python
422423
def state_transition(state: BeaconState, signed_block: SignedBeaconBlock, signed_envelope: SignedExecutionPayloadEnvelope, validate_result: bool=True) -> None:
@@ -430,15 +431,16 @@ def state_transition(state: BeaconState, signed_block: SignedBeaconBlock, signed
430431
process_block(state, block)
431432
# Verify state root
432433
if validate_result:
433-
assert block.state_root == hash_tree_root(state)
434+
assert block.state_root == hash_tree_root(state)
434435
# Verify execution payload signature
435436
if validate_result:
436437
assert verify_execution_payload_envelope_signature(state, signed_envelope) # [New in EIP-7732]
438+
envelope = signed_envelope.envelope
437439
# Process execution payload
438-
process_execution_payload(state, signed_envelope, EXECUTION_ENGINE) # [New in EIP-7732]
440+
process_execution_payload(state, envelope, EXECUTION_ENGINE) # [New in EIP-7732]
439441
# Verify state root
440442
if validate_result:
441-
assert signed_envelope.message.state_root == hash_tree_root(state) # [New in EIP-7732]
443+
assert envelope.state_root == hash_tree_root(state) # [New in EIP-7732]
442444
```
443445

444446
```python
@@ -667,9 +669,8 @@ def validate_merge_block(block: BeaconBlock) -> None:
667669

668670
```python
669671
def process_execution_payload(state: BeaconState,
670-
signed_envelope: SignedExecutionPayloadEnvelope,
672+
envelope: ExecutionPayloadEnvelope,
671673
execution_engine: ExecutionEngine) -> None:
672-
envelope = signed_envelope.message
673674
payload = envelope.payload
674675
# Cache latest block header state root
675676
previous_state_root = hash_tree_root(state)

0 commit comments

Comments
 (0)