Skip to content

Commit f3891e2

Browse files
committed
pass execution_requests to block hash validation
1 parent 57483cb commit f3891e2

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

specs/electra/beacon-chain.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
- [Request data](#request-data)
7878
- [Modified `NewPayloadRequest`](#modified-newpayloadrequest)
7979
- [Engine APIs](#engine-apis)
80+
- [Modified `is_valid_block_hash`](#modified-is_valid_block_hash)
8081
- [Modified `notify_new_payload`](#modified-notify_new_payload)
8182
- [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload)
8283
- [Block processing](#block-processing)
@@ -983,6 +984,21 @@ class NewPayloadRequest(object):
983984

984985
#### Engine APIs
985986

987+
##### Modified `is_valid_block_hash`
988+
989+
*Note*: The function `is_valid_block_hash` is modified to include the additional `execution_requests` parameter in Electra.
990+
991+
```python
992+
def is_valid_block_hash(self: ExecutionEngine,
993+
execution_payload: ExecutionPayload,
994+
parent_beacon_block_root: Root,
995+
execution_requests: ExecutionRequests) -> bool:
996+
"""
997+
Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly.
998+
"""
999+
...
1000+
```
1001+
9861002
##### Modified `notify_new_payload`
9871003

9881004
*Note*: The function `notify_new_payload` is modified to include the additional `execution_requests` parameter in Electra.
@@ -993,7 +1009,7 @@ def notify_new_payload(self: ExecutionEngine,
9931009
parent_beacon_block_root: Root,
9941010
execution_requests: ExecutionRequests) -> bool:
9951011
"""
996-
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
1012+
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
9971013
are valid with respect to ``self.execution_state``.
9981014
"""
9991015
...
@@ -1014,7 +1030,10 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10141030
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
10151031
execution_requests = new_payload_request.execution_requests # [New in Electra]
10161032

1017-
if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
1033+
if not self.is_valid_block_hash(
1034+
execution_payload,
1035+
parent_beacon_block_root,
1036+
execution_requests):
10181037
return False
10191038

10201039
if not self.is_valid_versioned_hashes(new_payload_request):

0 commit comments

Comments
 (0)