Skip to content

Commit

Permalink
Use Sequence for serialized execution requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed Oct 10, 2024
1 parent 2a163ad commit 04a40d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,9 @@ class NewPayloadRequest(object):
def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: list[bytes]) -> bool:
execution_requests_list: Sequence[bytes]) -> bool:
"""
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
are valid with respect to ``self.execution_state``.
"""
...
Expand Down Expand Up @@ -1145,7 +1145,7 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:
*Note*: Encodes execution requests as defined by [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685).

```python
def get_execution_requests_list(execution_requests: ExecutionRequests) -> list[bytes]:
def get_execution_requests_list(execution_requests: ExecutionRequests) -> Sequence[bytes]:
deposit_bytes = serialize(execution_requests.deposits)
withdrawal_bytes = serialize(execution_requests.withdrawals)
consolidation_bytes = serialize(execution_requests.consolidations)
Expand Down
8 changes: 4 additions & 4 deletions specs/electra/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GetPayloadResponse(object):
execution_payload: ExecutionPayload
block_value: uint256
blobs_bundle: BlobsBundle
execution_requests: List[bytes] # [New in Electra]
execution_requests: Sequence[bytes] # [New in Electra]
```

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

```python
def get_execution_requests(execution_requests: List[bytes]) -> ExecutionRequests:
def get_execution_requests(execution_requests: Sequence[bytes]) -> ExecutionRequests:
deposits = deserialize(List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD], execution_requests[0])
withdrawals = deserialize(List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD], execution_requests[1])
consolidations = deserialize(List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD],
consolidations = deserialize(List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD],
execution_requests[2])

return ExecutionRequests(deposits, withdrawals, consolidations)
Expand Down

0 comments on commit 04a40d2

Please sign in to comment.