8484 - [ Modified ` get_expected_withdrawals ` ] ( #modified-get_expected_withdrawals )
8585 - [ Modified ` process_withdrawals ` ] ( #modified-process_withdrawals )
8686 - [ Execution payload] ( #execution-payload )
87+ - [ New ` get_execution_requests_list ` ] ( #new-get_execution_requests_list )
8788 - [ Modified ` process_execution_payload ` ] ( #modified-process_execution_payload )
8889 - [ Operations] ( #operations )
8990 - [ Modified ` process_operations ` ] ( #modified-process_operations )
@@ -990,8 +991,8 @@ class NewPayloadRequest(object):
990991``` python
991992def notify_new_payload (self : ExecutionEngine,
992993 execution_payload : ExecutionPayload,
993- execution_requests : ExecutionRequests ,
994- parent_beacon_block_root : Root ) -> bool :
994+ parent_beacon_block_root : Root ,
995+ execution_requests_list : list[ bytes ] ) -> bool :
995996 """
996997 Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
997998 are valid with respect to ``self.execution_state``.
@@ -1011,8 +1012,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10111012 Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``.
10121013 """
10131014 execution_payload = new_payload_request.execution_payload
1014- execution_requests = new_payload_request.execution_requests # [New in Electra]
10151015 parent_beacon_block_root = new_payload_request.parent_beacon_block_root
1016+ execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra]
10161017
10171018 if not self .is_valid_block_hash(execution_payload, parent_beacon_block_root):
10181019 return False
@@ -1022,9 +1023,9 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10221023
10231024 # [Modified in Electra]
10241025 if not self .notify_new_payload(
1025- execution_payload,
1026- execution_requests,
1027- parent_beacon_block_root ):
1026+ execution_payload,
1027+ parent_beacon_block_root,
1028+ execution_requests_list ):
10281029 return False
10291030
10301031 return True
@@ -1139,6 +1140,19 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
11391140
11401141#### Execution payload
11411142
1143+ ##### New ` get_execution_requests_list `
1144+
1145+ * Note* : Encodes execution requests as defined by [ EIP-7685] ( https://eips.ethereum.org/EIPS/eip-7685 ) .
1146+
1147+ ``` python
1148+ def get_execution_requests_list (execution_requests : ExecutionRequests) -> list[bytes ]:
1149+ deposit_bytes = serialize(execution_requests.deposits)
1150+ withdrawal_bytes = serialize(execution_requests.withdrawals)
1151+ consolidation_bytes = serialize(execution_requests.consolidations)
1152+
1153+ return [deposit_bytes, withdrawal_bytes, consolidation_bytes]
1154+ ```
1155+
11421156##### Modified ` process_execution_payload `
11431157
11441158* Note* : The function ` process_execution_payload ` is modified to pass ` execution_requests ` into ` execution_engine.verify_and_notify_new_payload ` (via the updated ` NewPayloadRequest ` ).
@@ -1160,9 +1174,9 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
11601174 assert execution_engine.verify_and_notify_new_payload(
11611175 NewPayloadRequest(
11621176 execution_payload = payload,
1163- execution_requests = body.execution_requests, # [New in Electra]
11641177 versioned_hashes = versioned_hashes,
11651178 parent_beacon_block_root = state.latest_block_header.parent_root,
1179+ execution_requests = body.execution_requests, # [New in Electra]
11661180 )
11671181 )
11681182 # Cache execution payload header
0 commit comments