Skip to content

Commit 4140e52

Browse files
mkalininrkrasiukmarioevzlucassaldanhalightclient
authored
engine: Make execution requests a sidecar, take 2 (#591)
* engine: extract execution requests from payload * add executionrequestsv to wordlist * update engine_getPayloadV4 * Make execution requests a sidecar, take 2 * Turn executionRequests into a sequence of bytes * Simplify wording * Clean up wordlist * Applied suggestions by @marioevz Co-authored-by: Mario Vega <[email protected]> * Switch to the nested list representation * Fix typo * Apply suggestions from @lucassaldanha Co-authored-by: Lucas Saldanha <[email protected]> * Switch getPayloadV4 response to ExecutionPayloadV3 * Replace hash with full executionRequests object for newPayloadV4 * Fix the newPayloadV4 note * Mention that requestType byte isn't part of encoding * Mention SSZ encoding in the executionRequests list * Apply suggestions from @lucassaldanha Co-authored-by: Lucas Saldanha <[email protected]> * Update payload.yaml examples * Drop 32 bytes len from executionRequests definition * engine: clarification on requests --------- Co-authored-by: Roman Krasiuk <[email protected]> Co-authored-by: Mario Vega <[email protected]> Co-authored-by: Lucas Saldanha <[email protected]> Co-authored-by: lightclient <[email protected]>
1 parent ad9102b commit 4140e52

File tree

4 files changed

+36
-186
lines changed

4 files changed

+36
-186
lines changed

src/engine/openrpc/methods/payload.yaml

Lines changed: 23 additions & 45 deletions
Large diffs are not rendered by default.

src/engine/openrpc/schemas/payload.yaml

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -243,80 +243,6 @@ ExecutionPayloadV3:
243243
excessBlobGas:
244244
title: Excess blob gas
245245
$ref: '#/components/schemas/uint64'
246-
ExecutionPayloadV4:
247-
title: Execution payload object V4
248-
type: object
249-
required:
250-
- parentHash
251-
- feeRecipient
252-
- stateRoot
253-
- receiptsRoot
254-
- logsBloom
255-
- prevRandao
256-
- blockNumber
257-
- gasLimit
258-
- gasUsed
259-
- timestamp
260-
- extraData
261-
- baseFeePerGas
262-
- blockHash
263-
- transactions
264-
- withdrawals
265-
- blobGasUsed
266-
- excessBlobGas
267-
- depositRequests
268-
- withdrawalRequests
269-
- consolidationRequests
270-
properties:
271-
parentHash:
272-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/parentHash'
273-
feeRecipient:
274-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/feeRecipient'
275-
stateRoot:
276-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/stateRoot'
277-
receiptsRoot:
278-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/receiptsRoot'
279-
logsBloom:
280-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/logsBloom'
281-
prevRandao:
282-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/prevRandao'
283-
blockNumber:
284-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockNumber'
285-
gasLimit:
286-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasLimit'
287-
gasUsed:
288-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasUsed'
289-
timestamp:
290-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/timestamp'
291-
extraData:
292-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/extraData'
293-
baseFeePerGas:
294-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/baseFeePerGas'
295-
blockHash:
296-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockHash'
297-
transactions:
298-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/transactions'
299-
withdrawals:
300-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/withdrawals'
301-
blobGasUsed:
302-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed'
303-
excessBlobGas:
304-
$ref: '#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas'
305-
depositRequests:
306-
title: Deposit requests
307-
type: array
308-
items:
309-
$ref: '#/components/schemas/DepositRequestV1'
310-
withdrawalRequests:
311-
title: Withdrawals requests
312-
type: array
313-
items:
314-
$ref: '#/components/schemas/WithdrawalRequestV1'
315-
consolidationRequests:
316-
title: Consolidation requests
317-
type: array
318-
items:
319-
$ref: '#/components/schemas/ConsolidationRequestV1'
320246
ExecutionPayloadBodyV1:
321247
title: Execution payload body object V1
322248
type: object

src/engine/prague.md

Lines changed: 13 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ This specification is based on and extends [Engine API - Cancun](./cancun.md) sp
99
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1010
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1111

12-
- [Structures](#structures)
13-
- [DepositRequestV1](#depositrequestv1)
14-
- [WithdrawalRequestV1](#withdrawalrequestv1)
15-
- [ConsolidationRequestV1](#consolidationrequestv1)
16-
- [ExecutionPayloadV4](#executionpayloadv4)
1712
- [Methods](#methods)
1813
- [engine_newPayloadV4](#engine_newpayloadv4)
1914
- [Request](#request)
@@ -27,76 +22,20 @@ This specification is based on and extends [Engine API - Cancun](./cancun.md) sp
2722

2823
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2924

30-
## Structures
31-
32-
### DepositRequestV1
33-
This structure maps onto the deposit object from [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110).
34-
The fields are encoded as follows:
35-
36-
- `pubkey`: `DATA`, 48 Bytes
37-
- `withdrawalCredentials`: `DATA`, 32 Bytes
38-
- `amount`: `QUANTITY`, 64 Bits
39-
- `signature`: `DATA`, 96 Bytes
40-
- `index`: `QUANTITY`, 64 Bits
41-
42-
*Note:* The `amount` value is represented in Gwei.
43-
44-
### WithdrawalRequestV1
45-
This structure maps onto the withdrawal request from [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002).
46-
The fields are encoded as follows:
47-
48-
- `sourceAddress`: `DATA`, 20 Bytes
49-
- `validatorPubkey`: `DATA`, 48 Bytes
50-
- `amount`: `QUANTITY`, 64 Bits
51-
52-
*Note:* The `amount` value is represented in Gwei.
53-
54-
### ConsolidationRequestV1
55-
This structure maps onto the consolidation request from [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251).
56-
The fields are encoded as follows:
57-
58-
- `sourceAddress`: `DATA`, 20 Bytes
59-
- `sourcePubkey`: `DATA`, 48 Bytes
60-
- `targetPubkey`: `DATA`, 48 Bytes
61-
62-
### ExecutionPayloadV4
63-
64-
This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3) and appends the new fields: `depositRequests` and `withdrawalRequests`.
65-
66-
- `parentHash`: `DATA`, 32 Bytes
67-
- `feeRecipient`: `DATA`, 20 Bytes
68-
- `stateRoot`: `DATA`, 32 Bytes
69-
- `receiptsRoot`: `DATA`, 32 Bytes
70-
- `logsBloom`: `DATA`, 256 Bytes
71-
- `prevRandao`: `DATA`, 32 Bytes
72-
- `blockNumber`: `QUANTITY`, 64 Bits
73-
- `gasLimit`: `QUANTITY`, 64 Bits
74-
- `gasUsed`: `QUANTITY`, 64 Bits
75-
- `timestamp`: `QUANTITY`, 64 Bits
76-
- `extraData`: `DATA`, 0 to 32 Bytes
77-
- `baseFeePerGas`: `QUANTITY`, 256 Bits
78-
- `blockHash`: `DATA`, 32 Bytes
79-
- `transactions`: `Array of DATA` - Array of transaction objects, each object is a byte list (`DATA`) representing `TransactionType || TransactionPayload` or `LegacyTransaction` as defined in [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718)
80-
- `withdrawals`: `Array of WithdrawalV1` - Array of withdrawals, each object is an `OBJECT` containing the fields of a `WithdrawalV1` structure.
81-
- `blobGasUsed`: `QUANTITY`, 64 Bits
82-
- `excessBlobGas`: `QUANTITY`, 64 Bits
83-
- `depositRequests`: `Array of DepositRequestV1` - Array of deposits, each object is an `OBJECT` containing the fields of a `DepositRequestV1` structure.
84-
- `withdrawalRequests`: `Array of WithdrawalRequestV1` - Array of withdrawal requests, each object is an `OBJECT` containing the fields of a `WithdrawalRequestV1` structure.
85-
- `consolidationRequests`: `Array of ConsolidationRequestV1` - Array of consolidation requests, each object is an `OBJECT` containing the fields of a `ConsolidationRequestV1` structure.
86-
8725
## Methods
8826

8927
### engine_newPayloadV4
9028

91-
The request of this method is updated with [`ExecutionPayloadV4`](#ExecutionPayloadV4).
29+
Method parameter list is extended with `executionRequests`.
9230

9331
#### Request
9432

9533
* method: `engine_newPayloadV4`
9634
* params:
97-
1. `executionPayload`: [`ExecutionPayloadV4`](#ExecutionPayloadV4).
35+
1. `executionPayload`: [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3).
9836
2. `expectedBlobVersionedHashes`: `Array of DATA`, 32 Bytes - Array of expected blob versioned hashes to validate.
9937
3. `parentBeaconBlockRoot`: `DATA`, 32 Bytes - Root of the parent beacon block.
38+
4. `executionRequests`: `Array of DATA` - List of execution layer triggered requests. Each list element is the corresponding request type's `request_data` as defined by [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685). Elements of the list **MUST** be ordered by `request_type` in ascending order.
10039

10140
#### Response
10241

@@ -108,9 +47,14 @@ This method follows the same specification as [`engine_newPayloadV3`](./cancun.m
10847

10948
1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the Prague fork.
11049

50+
2. Given the `executionRequests`, client software **MUST** compute the execution requests commitment
51+
and incorporate it into the `blockHash` validation process.
52+
That is, if the computed commitment does not match the corresponding commitment in the execution layer block header,
53+
the call **MUST** return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}`.
54+
11155
### engine_getPayloadV4
11256

113-
The response of this method is updated with [`ExecutionPayloadV4`](#ExecutionPayloadV4).
57+
The response of this method is extended with the `executionRequests` field.
11458

11559
#### Request
11660

@@ -122,10 +66,11 @@ The response of this method is updated with [`ExecutionPayloadV4`](#ExecutionPay
12266
#### Response
12367

12468
* result: `object`
125-
- `executionPayload`: [`ExecutionPayloadV4`](#ExecutionPayloadV4)
69+
- `executionPayload`: [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3)
12670
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
12771
- `blobsBundle`: [`BlobsBundleV1`](#BlobsBundleV1) - Bundle with data corresponding to blob transactions included into `executionPayload`
12872
- `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the execution layer to use this `executionPayload` instead of an externally provided one
73+
- `executionRequests`: `Array of DATA` - Execution layer triggered requests obtained from the `executionPayload` transaction execution.
12974
* error: code and message set in case an exception happens while getting the payload.
13075

13176
#### Specification
@@ -134,6 +79,8 @@ This method follows the same specification as [`engine_getPayloadV3`](./cancun.m
13479

13580
1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the built payload does not fall within the time frame of the Prague fork.
13681

82+
2. The call **MUST** return `executionRequests` list representing execution layer triggered requests obtained from the `executionPayload` transaction execution. Each element of the list corresponds to the request type's `request_data` as defined by [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685). Elements of the list **MUST** be ordered by `request_type` in ascending order.
83+
13784
### Update the methods of previous forks
13885

13986
This document defines how Prague payload should be handled by the [`Cancun API`](./cancun.md).

wordlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ src
6868
https
6969
forkchoiceupdatedresponsev
7070
exitv
71-
depositreceiptv

0 commit comments

Comments
 (0)