84
84
- [ Modified ` get_expected_withdrawals ` ] ( #modified-get_expected_withdrawals )
85
85
- [ Modified ` process_withdrawals ` ] ( #modified-process_withdrawals )
86
86
- [ Execution payload] ( #execution-payload )
87
+ - [ New ` get_execution_requests_list ` ] ( #new-get_execution_requests_list )
87
88
- [ Modified ` process_execution_payload ` ] ( #modified-process_execution_payload )
88
89
- [ Operations] ( #operations )
89
90
- [ Modified ` process_operations ` ] ( #modified-process_operations )
@@ -991,7 +992,7 @@ class NewPayloadRequest(object):
991
992
def notify_new_payload (self : ExecutionEngine,
992
993
execution_payload : ExecutionPayload,
993
994
parent_beacon_block_root : Root,
994
- execution_requests : ExecutionRequests ) -> bool :
995
+ execution_requests_list : list[ bytes ] ) -> bool :
995
996
"""
996
997
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
997
998
are valid with respect to ``self.execution_state``.
@@ -1012,7 +1013,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
1012
1013
"""
1013
1014
execution_payload = new_payload_request.execution_payload
1014
1015
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]
1016
1017
1017
1018
if not self .is_valid_block_hash(execution_payload, parent_beacon_block_root):
1018
1019
return False
@@ -1024,7 +1025,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
1024
1025
if not self .notify_new_payload(
1025
1026
execution_payload,
1026
1027
parent_beacon_block_root,
1027
- execution_requests ):
1028
+ execution_requests_list ):
1028
1029
return False
1029
1030
1030
1031
return True
@@ -1139,6 +1140,19 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
1139
1140
1140
1141
#### Execution payload
1141
1142
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
+
1142
1156
##### Modified ` process_execution_payload `
1143
1157
1144
1158
* 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