Skip to content

Commit 3011727

Browse files
committed
Updated validator spec with rules for including execution requests in the beacon block body
1 parent 9752a1c commit 3011727

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

specs/electra/validator.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ All behaviors and definitions defined in this document, and documents it extends
3838
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [Electra](./beacon-chain.md) are requisite for this document and used throughout.
3939
Please see related Beacon Chain doc before continuing and use them as a reference throughout.
4040

41+
## Helpers
42+
43+
### Modified `GetPayloadResponse`
44+
45+
```python
46+
@dataclass
47+
class GetPayloadResponse(object):
48+
execution_payload: ExecutionPayload
49+
block_value: uint256
50+
blobs_bundle: BlobsBundle
51+
execution_requests: list[bytes] # [New in Electra]
52+
```
53+
4154
## Containers
4255

4356
### Modified Containers
@@ -59,6 +72,24 @@ class SignedAggregateAndProof(Container):
5972
signature: BLSSignature
6073
```
6174

75+
## Protocol
76+
77+
### `ExecutionEngine`
78+
79+
#### Modified `get_payload`
80+
81+
Given the `payload_id`, `get_payload` returns the most recent version of the execution payload that
82+
has been built since the corresponding call to `notify_forkchoice_updated` method.
83+
84+
```python
85+
def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadResponse:
86+
"""
87+
Return ExecutionPayload, uint256, BlobsBundle and list[bytes] objects.
88+
"""
89+
# pylint: disable=unused-argument
90+
...
91+
```
92+
6293
## Block proposal
6394

6495
### Constructing the `BeaconBlockBody`
@@ -148,6 +179,25 @@ def prepare_execution_payload(state: BeaconState,
148179
)
149180
```
150181

182+
#### Execution Requests
183+
184+
*[New in Electra]*
185+
186+
1. The execution payload is obtained from the execution engine as defined above using `payload_id`. The response also includes a `execution_requests` entry containing a list of bytes. Each element on the list corresponds to one ssz list of requests as defined
187+
in [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685). The index of each element in the array determines the type of request.
188+
2. Set `block.body.execution_requests = get_execution_requests(execution_requests)`, where:
189+
190+
```python
191+
def get_execution_requests(execution_requests: list[bytes]) -> ExecutionRequests:
192+
requests = ExecutionRequests()
193+
194+
requests.deposits = deserialize(execution_requests[0], DepositRequest)
195+
requests.withdrawals = deserialize(execution_requests[0], WithdrawalRequest)
196+
requests.consolidations = deserialize(execution_requests[0], ConsolidationRequest)
197+
198+
return requests
199+
```
200+
151201
## Attesting
152202

153203
### Construct attestation

0 commit comments

Comments
 (0)