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 )
@@ -991,7 +992,7 @@ class NewPayloadRequest(object):
991992def notify_new_payload (self : ExecutionEngine,
992993 execution_payload : ExecutionPayload,
993994 parent_beacon_block_root : Root,
994- execution_requests : ExecutionRequests ) -> bool :
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``.
@@ -1012,7 +1013,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10121013 """
10131014 execution_payload = new_payload_request.execution_payload
10141015 parent_beacon_block_root = new_payload_request.parent_beacon_block_root
1015- execution_requests = new_payload_request.execution_requests # [New in Electra]
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
@@ -1024,7 +1025,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
10241025 if not self .notify_new_payload(
10251026 execution_payload,
10261027 parent_beacon_block_root,
1027- execution_requests ):
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 ` ).
0 commit comments