7979 - [ Request data] ( #request-data )
8080 - [ Modified ` NewPayloadRequest ` ] ( #modified-newpayloadrequest )
8181 - [ Engine APIs] ( #engine-apis )
82+ - [ Modified ` is_valid_block_hash ` ] ( #modified-is_valid_block_hash )
8283 - [ Modified ` notify_new_payload ` ] ( #modified-notify_new_payload )
8384 - [ Modified ` verify_and_notify_new_payload ` ] ( #modified-verify_and_notify_new_payload )
8485 - [ Block processing] ( #block-processing )
@@ -1003,30 +1004,51 @@ class NewPayloadRequest(object):
10031004 versioned_hashes: Sequence[VersionedHash]
10041005 parent_beacon_block_root: Root
10051006 execution_requests: ExecutionRequests # [New in Electra]
1007+ target_blobs_per_block: uint64 # [New in Electra:EIP7742]
10061008```
10071009
10081010#### Engine APIs
10091011
1012+ ##### Modified ` is_valid_block_hash `
1013+
1014+ * Note* : The function ` is_valid_block_hash ` is modified to include the additional
1015+ ` execution_requests_list ` and ` target_blobs_per_block ` parameters in Electra.
1016+
1017+ ``` python
1018+ def is_valid_block_hash (self : ExecutionEngine,
1019+ execution_payload : ExecutionPayload,
1020+ parent_beacon_block_root : Root,
1021+ execution_requests_list : Sequence[bytes ],
1022+ target_blobs_per_block : uint64) -> bool :
1023+ """
1024+ Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly.
1025+ """
1026+ ...
1027+ ```
1028+
10101029##### Modified ` notify_new_payload `
10111030
1012- * Note* : The function ` notify_new_payload ` is modified to include the additional ` execution_requests ` parameter in Electra.
1031+ * Note* : The function ` notify_new_payload ` is modified to include the additional
1032+ ` execution_requests_list ` and ` target_blobs_per_block ` parameters in Electra.
10131033
10141034``` python
10151035def notify_new_payload (self : ExecutionEngine,
10161036 execution_payload : ExecutionPayload,
10171037 parent_beacon_block_root : Root,
1018- execution_requests_list : Sequence[bytes ]) -> bool :
1038+ execution_requests_list : Sequence[bytes ],
1039+ target_blobs_per_block : uint64) -> bool :
10191040 """
1020- Return ``True`` if and only if ``execution_payload`` and ``execution_requests ``
1041+ Return ``True`` if and only if ``execution_payload`` and ``execution_requests_list ``
10211042 are valid with respect to ``self.execution_state``.
10221043 """
10231044 ...
10241045```
10251046
10261047##### Modified ` verify_and_notify_new_payload `
10271048
1028- * Note* : The function ` verify_and_notify_new_payload ` is modified to pass the additional parameter ` execution_requests `
1029- when calling ` notify_new_payload ` in Electra.
1049+ * Note* : The function ` verify_and_notify_new_payload ` is modified to pass the additional parameters
1050+ ` execution_requests_list ` and ` target_blobs_per_block ` when calling ` is_valid_block_hash ` and
1051+ ` notify_new_payload ` in Electra.
10301052
10311053``` python
10321054def verify_and_notify_new_payload (self : ExecutionEngine,
@@ -1037,11 +1059,17 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10371059 execution_payload = new_payload_request.execution_payload
10381060 parent_beacon_block_root = new_payload_request.parent_beacon_block_root
10391061 execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra]
1062+ target_blobs_per_block = new_payload_request.target_blobs_per_block # [New in Electra:EIP7742]
10401063
10411064 if b ' ' in execution_payload.transactions:
10421065 return False
10431066
1044- if not self .is_valid_block_hash(execution_payload, parent_beacon_block_root):
1067+ # [Modified in Electra]
1068+ if not self .is_valid_block_hash(
1069+ execution_payload,
1070+ parent_beacon_block_root,
1071+ execution_requests_list,
1072+ target_blobs_per_block):
10451073 return False
10461074
10471075 if not self .is_valid_versioned_hashes(new_payload_request):
@@ -1051,7 +1079,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10511079 if not self .notify_new_payload(
10521080 execution_payload,
10531081 parent_beacon_block_root,
1054- execution_requests_list):
1082+ execution_requests_list,
1083+ target_blobs_per_block):
10551084 return False
10561085
10571086 return True
@@ -1213,6 +1242,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
12131242 versioned_hashes = versioned_hashes,
12141243 parent_beacon_block_root = state.latest_block_header.parent_root,
12151244 execution_requests = body.execution_requests, # [New in Electra]
1245+ target_blobs_per_block = MAX_BLOBS_PER_BLOCK // 2 , # [New in Electra:EIP7742]
12161246 )
12171247 )
12181248 # Cache execution payload header
0 commit comments