Skip to content

Commit 54386c5

Browse files
committed
Add initial FOCIL spec
1 parent 7c9772f commit 54386c5

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed

src/engine/focil.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Engine API -- FOCIL
2+
3+
Engine API changes introduced in FOCIL.
4+
5+
This specification is based on and extends [Engine API - Prague](./prague.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+
- [Constants](#constants)
13+
- [Structures](#structures)
14+
- [InclusionListV1](#inclusionlistv1)
15+
- [UpdateInclusionListResponse](#updateinclusionlistresponse)
16+
- [Methods](#methods)
17+
- [engine_newPayloadV5](#engine_newpayloadv5)
18+
- [Request](#request)
19+
- [Response](#response)
20+
- [Specification](#specification)
21+
- [engine_getInclusionListV1](#engine_getinclusionlistv1)
22+
- [Request](#request-1)
23+
- [Response](#response-1)
24+
- [Specification](#specification-1)
25+
- [engine_updatePayloadWithInclusionListV1](#engine_updatepayloadwithinclusionlistv1)
26+
- [Request](#request-2)
27+
- [Response](#response-2)
28+
- [Specification](#specification-2)
29+
- [Update the methods of previous forks](#update-the-methods-of-previous-forks)
30+
31+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
32+
33+
## Constants
34+
35+
| Name | Value |
36+
| - | - |
37+
| `MaxBytesPerInclusionList` | `uint64(8192) = 2**13` |
38+
39+
## Structures
40+
41+
### InclusionListV1
42+
43+
This structure contains a list of transactions. The fields are encoded as follows:
44+
- `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)
45+
46+
### UpdateInclusionListResponse
47+
48+
This structure contains an identifier of the payload build process that is requested to update with the given inclusion list.
49+
- `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process
50+
51+
## Methods
52+
53+
### engine_newPayloadV5
54+
55+
The request of this method is updated with [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3).
56+
57+
#### Request
58+
59+
* method: `engine_newPayloadV5`
60+
* params:
61+
1. `executionPayload`: [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3).
62+
2. `expectedBlobVersionedHashes`: `Array of DATA`, 32 Bytes - Array of expected blob versioned hashes to validate.
63+
3. `parentBeaconBlockRoot`: `DATA`, 32 Bytes - Root of the parent beacon block.
64+
4. `inclusionList`: [`InclusionListV1`](#InclusionListV1).
65+
66+
#### Response
67+
68+
Refer to the response for [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4).
69+
70+
#### Specification
71+
72+
This method follows the same specification as [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4) with the following changes:
73+
74+
1. Client software **MUST** return `{status: INVALID_INCLUSION_LIST, latestValidHash: null, validationError: null}` if there are any transactions of `inclusionList` that are not part of the `executionPayload`, even if they can be appended at the end of the `executionPayload`.
75+
76+
### engine_getInclusionListV1
77+
78+
#### Request
79+
80+
* method: `engine_getInclusionListV1`
81+
* params:
82+
1. `parentHash`: `DATA`, 32 Bytes - parent hash which returned inclusion list should be built upon.
83+
* timeout: 1s
84+
85+
#### Response
86+
87+
* result: [`InclusionListV1`](#InclusionListV1).
88+
* error: code and message set in case an exception happens while getting the inclusion list.
89+
90+
#### Specification
91+
92+
1. Client software **MUST** provide a list of transactions for the inclusion list based on local view of the mempool and according to the config specifications.
93+
94+
### engine_updatePayloadWithInclusionListV1
95+
96+
#### Request
97+
98+
* method: `engine_updatePayloadWithInclusionListV1`
99+
* params:
100+
1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process.
101+
2. `inclusionList`: [`InclusionListV1`](#InclusionListV1).
102+
* timeout: 1s
103+
104+
#### Response
105+
106+
* result: [`UpdateInclusionListResponse`](#UpdateInclusionListResponse).
107+
* error: code and message set in case an exception happens while getting the inclusion list.
108+
109+
#### Specification
110+
111+
1. Given the `payloadId` client software **MUST** update payload build process building with `inclusionList`. The transactions must be part of the execution payload unless it fails to be included at the end of it.
112+
113+
### Update the methods of previous forks
114+
115+
This document defines how FOCIL payload should be handled by the [`Prague API`](./prague.md).
116+
117+
For the following methods:
118+
119+
- [`engine_newPayloadV4`](./prague.md#engine_newpayloadV4)
120+
121+
a validation **MUST** be added:
122+
123+
1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload or payloadAttributes greater or equal to the FOCIL activation timestamp.

0 commit comments

Comments
 (0)