Skip to content

Commit 28d6168

Browse files
committed
Add EIP-7928 api specs
1 parent f91fd7b commit 28d6168

File tree

3 files changed

+258
-0
lines changed

3 files changed

+258
-0
lines changed

src/engine/eip7928.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Engine API -- EIP-7928
2+
3+
Engine API changes introduced in EIP-7928.
4+
5+
This specification is based on and extends [Engine API - Osaka](./osaka.md) specification.
6+
7+
## Table of contents
8+
9+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
10+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11+
12+
- [Structures](#structures)
13+
- [ExecutionPayloadV4](#executionpayloadv4)
14+
- [Methods](#methods)
15+
- [engine_newPayloadV5](#engine_newpayloadv5)
16+
- [Request](#request)
17+
- [Response](#response)
18+
- [Specification](#specification)
19+
- [engine_getPayloadV6](#engine_getpayloadv6)
20+
- [Request](#request-1)
21+
- [Response](#response-1)
22+
- [Specification](#specification-1)
23+
- [Update the methods of previous forks](#update-the-methods-of-previous-forks)
24+
- [Osaka API](#osaka-api)
25+
26+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
27+
28+
## Structures
29+
30+
### ExecutionPayloadV4
31+
32+
This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3) and appends the new field: `blockAccessList`.
33+
34+
- `parentHash`: `DATA`, 32 Bytes
35+
- `feeRecipient`: `DATA`, 20 Bytes
36+
- `stateRoot`: `DATA`, 32 Bytes
37+
- `receiptsRoot`: `DATA`, 32 Bytes
38+
- `logsBloom`: `DATA`, 256 Bytes
39+
- `prevRandao`: `DATA`, 32 Bytes
40+
- `blockNumber`: `QUANTITY`, 64 Bits
41+
- `gasLimit`: `QUANTITY`, 64 Bits
42+
- `gasUsed`: `QUANTITY`, 64 Bits
43+
- `timestamp`: `QUANTITY`, 64 Bits
44+
- `extraData`: `DATA`, 0 to 32 Bytes
45+
- `baseFeePerGas`: `QUANTITY`, 256 Bits
46+
- `blockHash`: `DATA`, 32 Bytes
47+
- `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)
48+
- `withdrawals`: `Array of WithdrawalV1` - Array of withdrawals, each object is an `OBJECT` containing the fields of a `WithdrawalV1` structure.
49+
- `blobGasUsed`: `QUANTITY`, 64 Bits
50+
- `excessBlobGas`: `QUANTITY`, 64 Bits
51+
- `blockAccessList`: `DATA` - RLP-encoded block access list as defined in [EIP-7928](https://eips.ethereum.org/EIPS/eip-7928)
52+
53+
## Methods
54+
55+
### engine_newPayloadV5
56+
57+
This method is updated to support the new `ExecutionPayloadV4` structure.
58+
59+
#### Request
60+
61+
* method: `engine_newPayloadV5`
62+
* params:
63+
1. `executionPayload`: [`ExecutionPayloadV4`](#executionpayloadv4).
64+
2. `expectedBlobVersionedHashes`: `Array of DATA`, 32 Bytes - Array of expected blob versioned hashes to validate.
65+
3. `parentBeaconBlockRoot`: `DATA`, 32 Bytes - Root of the parent beacon block.
66+
4. `executionRequests`: `Array of DATA` - List of execution layer triggered requests.
67+
68+
#### Response
69+
70+
Refer to the response for [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4).
71+
72+
#### Specification
73+
74+
This method follows the same specification as [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4) with the following changes:
75+
76+
1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the EIP-7928 activation.
77+
78+
2. The `blockAccessList` field **MUST** be validated and incorporated into the block hash computation.
79+
80+
3. If the `blockAccessList` field is missing or invalid, the call **MUST** return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}`.
81+
82+
### engine_getPayloadV6
83+
84+
This method is updated to return the new `ExecutionPayloadV4` structure.
85+
86+
#### Request
87+
88+
* method: `engine_getPayloadV6`
89+
* params:
90+
1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process
91+
* timeout: 1s
92+
93+
#### Response
94+
95+
* result: `object`
96+
- `executionPayload`: [`ExecutionPayloadV4`](#executionpayloadv4)
97+
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
98+
- `blobsBundle`: [`BlobsBundleV2`](./osaka.md#blobsbundlev2) - Bundle with data corresponding to blob transactions included into `executionPayload`
99+
- `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the execution layer to use this `executionPayload` instead of an externally provided one
100+
- `executionRequests`: `Array of DATA` - Execution layer triggered requests obtained from the `executionPayload` transaction execution.
101+
* error: code and message set in case an exception happens while getting the payload.
102+
103+
#### Specification
104+
105+
This method follows the same specification as [`engine_getPayloadV5`](./osaka.md#engine_getpayloadv5) with the following changes:
106+
107+
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 EIP-7928 activation.
108+
109+
2. The `executionPayload` **MUST** contain the `blockAccessList` field populated with the RLP-encoded block access list data collected during block execution.
110+
111+
### Update the methods of previous forks
112+
113+
#### Osaka API
114+
115+
For the following methods:
116+
117+
- [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4)
118+
- [`engine_getPayloadV5`](./osaka.md#engine_getpayloadv5)
119+
120+
a validation **MUST** be added:
121+
122+
1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload greater or equal to the EIP-7928 activation timestamp.
123+
124+
For the [`engine_forkchoiceUpdatedV3`](./cancun.md#engine_forkchoiceupdatedv3) the following modification **MUST** be made:
125+
1. Return `-38005: Unsupported fork` if `payloadAttributes.timestamp` doesn't fall within the time frame of the Cancun, Prague, Osaka *or EIP-7928* forks.

src/engine/openrpc/methods/payload.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,3 +886,76 @@
886886
validatorIndex: '0xf3'
887887
address: '0x00000000000000000000000000000000000010f3'
888888
amount: '0x1'
889+
- name: engine_newPayloadV5
890+
summary: Runs execution payload validation
891+
externalDocs:
892+
description: Method specification
893+
url: https://github.com/ethereum/execution-apis/blob/main/src/engine/eip7928.md#engine_newpayloadv5
894+
params:
895+
- name: Execution payload
896+
required: true
897+
schema:
898+
$ref: '#/components/schemas/ExecutionPayloadV4'
899+
- name: Expected blob versioned hashes
900+
required: true
901+
schema:
902+
type: array
903+
items:
904+
$ref: '#/components/schemas/hash32'
905+
- name: Parent beacon block root
906+
required: true
907+
schema:
908+
$ref: '#/components/schemas/hash32'
909+
- name: Execution requests
910+
required: true
911+
schema:
912+
type: array
913+
items:
914+
$ref: '#/components/schemas/bytes'
915+
result:
916+
name: Payload status
917+
schema:
918+
$ref: '#/components/schemas/PayloadStatusNoInvalidBlockHash'
919+
errors:
920+
- code: -32602
921+
message: Invalid params
922+
- code: -38005
923+
message: Unsupported fork
924+
- name: engine_getPayloadV6
925+
summary: Obtains execution payload from payload build process
926+
externalDocs:
927+
description: Method specification
928+
url: https://github.com/ethereum/execution-apis/blob/main/src/engine/eip7928.md#engine_getpayloadv6
929+
params:
930+
- name: Payload id
931+
required: true
932+
schema:
933+
$ref: '#/components/schemas/bytes8'
934+
result:
935+
name: Response object
936+
schema:
937+
type: object
938+
required:
939+
- executionPayload
940+
- blockValue
941+
- blobsBundle
942+
- shouldOverrideBuilder
943+
- executionRequests
944+
properties:
945+
executionPayload:
946+
$ref: '#/components/schemas/ExecutionPayloadV4'
947+
blockValue:
948+
$ref: '#/components/schemas/uint256'
949+
blobsBundle:
950+
$ref: '#/components/schemas/BlobsBundleV2'
951+
shouldOverrideBuilder:
952+
type: boolean
953+
executionRequests:
954+
type: array
955+
items:
956+
$ref: '#/components/schemas/bytes'
957+
errors:
958+
- code: -38001
959+
message: Unknown payload
960+
- code: -38005
961+
message: Unsupported fork

src/engine/openrpc/schemas/payload.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,66 @@ 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+
- blockAccessList
268+
properties:
269+
parentHash:
270+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/parentHash'
271+
feeRecipient:
272+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/feeRecipient'
273+
stateRoot:
274+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/stateRoot'
275+
receiptsRoot:
276+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/receiptsRoot'
277+
logsBloom:
278+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/logsBloom'
279+
prevRandao:
280+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/prevRandao'
281+
blockNumber:
282+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockNumber'
283+
gasLimit:
284+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasLimit'
285+
gasUsed:
286+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasUsed'
287+
timestamp:
288+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/timestamp'
289+
extraData:
290+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/extraData'
291+
baseFeePerGas:
292+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/baseFeePerGas'
293+
blockHash:
294+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockHash'
295+
transactions:
296+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/transactions'
297+
withdrawals:
298+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/withdrawals'
299+
blobGasUsed:
300+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed'
301+
excessBlobGas:
302+
$ref: '#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas'
303+
blockAccessList:
304+
title: Block access list
305+
$ref: '#/components/schemas/bytes'
246306
ExecutionPayloadBodyV1:
247307
title: Execution payload body object V1
248308
type: object

0 commit comments

Comments
 (0)