Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Jun 22, 2023
1 parent 2660af0 commit ad4f1de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions specs/deneb/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ class NewPayloadRequest(object):

##### `is_valid_block_hash`

*Note*: The function `is_valid_block_hash` is modified to include the additional `parent_beacon_block_root` parameter for EIP-4788.

```python
def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
Expand Down Expand Up @@ -275,15 +277,15 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
execution_payload = new_payload_request.execution_payload
parent_beacon_block_root = new_payload_request.parent_beacon_block_root

# [New in Deneb:EIP4788]
# [Modified in Deneb:EIP4788]
if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
return False

# [New in Deneb:EIP4844]
if not self.is_valid_versioned_hashes(new_payload_request):
return False

# [New in Deneb:EIP4788]
# [Modified in Deneb:EIP4788]
if not self.notify_new_payload(execution_payload, parent_beacon_block_root):
return False

Expand Down Expand Up @@ -354,7 +356,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi

# Verify the execution payload is valid
# [Modified in Deneb:EIP4844] Pass `versioned_hashes` to Execution Engine
# [Modified in Deneb:EIP4788] Pass parent beacon block root to Execution Engine
# [Modified in Deneb:EIP4788] Pass `parent_beacon_block_root` to Execution Engine
versioned_hashes = [kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments]
assert execution_engine.verify_and_notify_new_payload(
NewPayloadRequest(
Expand Down
2 changes: 1 addition & 1 deletion specs/deneb/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This is the modification of the fork choice accompanying the Deneb upgrade.

### Extended `PayloadAttributes`

`PayloadAttributes` is extended with the parent beacon block root.
`PayloadAttributes` is extended with the parent beacon block root for EIP-4788.

```python
@dataclass
Expand Down

0 comments on commit ad4f1de

Please sign in to comment.