Skip to content

Commit 04a40d2

Browse files
committed
Use Sequence for serialized execution requests
1 parent 2a163ad commit 04a40d2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

specs/electra/beacon-chain.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,9 @@ class NewPayloadRequest(object):
992992
def notify_new_payload(self: ExecutionEngine,
993993
execution_payload: ExecutionPayload,
994994
parent_beacon_block_root: Root,
995-
execution_requests_list: list[bytes]) -> bool:
995+
execution_requests_list: Sequence[bytes]) -> bool:
996996
"""
997-
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
997+
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
998998
are valid with respect to ``self.execution_state``.
999999
"""
10001000
...
@@ -1145,7 +1145,7 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
11451145
*Note*: Encodes execution requests as defined by [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685).
11461146

11471147
```python
1148-
def get_execution_requests_list(execution_requests: ExecutionRequests) -> list[bytes]:
1148+
def get_execution_requests_list(execution_requests: ExecutionRequests) -> Sequence[bytes]:
11491149
deposit_bytes = serialize(execution_requests.deposits)
11501150
withdrawal_bytes = serialize(execution_requests.withdrawals)
11511151
consolidation_bytes = serialize(execution_requests.consolidations)

specs/electra/validator.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GetPayloadResponse(object):
5454
execution_payload: ExecutionPayload
5555
block_value: uint256
5656
blobs_bundle: BlobsBundle
57-
execution_requests: List[bytes] # [New in Electra]
57+
execution_requests: Sequence[bytes] # [New in Electra]
5858
```
5959

6060
## Containers
@@ -90,7 +90,7 @@ has been built since the corresponding call to `notify_forkchoice_updated` metho
9090
```python
9191
def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadResponse:
9292
"""
93-
Return ExecutionPayload, uint256, BlobsBundle and List[bytes] objects.
93+
Return ExecutionPayload, uint256, BlobsBundle and Sequence[bytes] objects.
9494
"""
9595
# pylint: disable=unused-argument
9696
...
@@ -194,10 +194,10 @@ in [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685). The index of each elemen
194194
2. Set `block.body.execution_requests = get_execution_requests(execution_requests)`, where:
195195

196196
```python
197-
def get_execution_requests(execution_requests: List[bytes]) -> ExecutionRequests:
197+
def get_execution_requests(execution_requests: Sequence[bytes]) -> ExecutionRequests:
198198
deposits = deserialize(List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD], execution_requests[0])
199199
withdrawals = deserialize(List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD], execution_requests[1])
200-
consolidations = deserialize(List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD],
200+
consolidations = deserialize(List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD],
201201
execution_requests[2])
202202

203203
return ExecutionRequests(deposits, withdrawals, consolidations)

0 commit comments

Comments
 (0)