Skip to content

Commit b191861

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

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

src/engine/focil.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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. `executionRequests`: `Array of DATA` - List of execution layer triggered requests. Each list element is a `requests` byte array as defined by [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685). The first byte of each element is the `request_type` and the remaining bytes are the `request_data`. Elements of the list **MUST** be ordered by `request_type` in ascending order. Elements with empty `request_data` **MUST** be excluded from the list.
65+
5. `inclusionList`: `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).
66+
67+
#### Response
68+
69+
Refer to the response for [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4).
70+
71+
#### Specification
72+
73+
This method follows the same specification as [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4) with the following changes:
74+
75+
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`.
76+
77+
### engine_getInclusionListV1
78+
79+
#### Request
80+
81+
* method: `engine_getInclusionListV1`
82+
* params:
83+
1. `parentHash`: `DATA`, 32 Bytes - parent hash which returned inclusion list should be built upon.
84+
* timeout: 1s
85+
86+
#### Response
87+
88+
* result: [`InclusionListV1`](#InclusionListV1).
89+
* error: code and message set in case an exception happens while getting the inclusion list.
90+
91+
#### Specification
92+
93+
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.
94+
95+
### engine_updatePayloadWithInclusionListV1
96+
97+
#### Request
98+
99+
* method: `engine_updatePayloadWithInclusionListV1`
100+
* params:
101+
1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process.
102+
2. `inclusionList`: [`InclusionListV1`](#InclusionListV1).
103+
* timeout: 1s
104+
105+
#### Response
106+
107+
* result: [`UpdateInclusionListResponse`](#UpdateInclusionListResponse).
108+
* error: code and message set in case an exception happens while getting the inclusion list.
109+
110+
#### Specification
111+
112+
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.
113+
114+
### Update the methods of previous forks
115+
116+
This document defines how FOCIL payload should be handled by the [`Prague API`](./prague.md).
117+
118+
For the following methods:
119+
120+
- [`engine_newPayloadV4`](./prague.md#engine_newpayloadV4)
121+
122+
a validation **MUST** be added:
123+
124+
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)