-
Notifications
You must be signed in to change notification settings - Fork 491
Add initial FOCIL spec #609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jihoonsong
wants to merge
8
commits into
ethereum:main
Choose a base branch
from
jihoonsong:focil
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+159
−0
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
40d5390
Add initial FOCIL spec
jihoonsong 3222f28
Move EIP-7805 spec under experimental folder
jihoonsong e78768d
Use primitive type instead of new structures to not make dependency
jihoonsong f9063f7
Specify the upper bound of a list of inclusion lists
jihoonsong c5b9412
Add rules to ignore any blob transactions in the ILs
jihoonsong e3dff40
Rebase onto Osaka
jihoonsong 627918b
Reflect changes in the queue
jihoonsong 8c56c6b
Revamp and rebase to Bogota
jihoonsong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| # Engine API -- Bogota | ||
|
|
||
| Engine API changes introduced in Bogota. | ||
|
|
||
| This specification is based on and extends [Engine API - Amsterdam](./amsterdam.md) specification. | ||
|
|
||
| ## Table of contents | ||
|
|
||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
| <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
|
||
| - [Constants](#constants) | ||
| - [Structures](#structures) | ||
| - [PayloadAttributesV5](#payloadattributesv5) | ||
| - [Routines](#routines) | ||
| - [Payload building](#payload-building) | ||
| - [Methods](#methods) | ||
| - [engine_newPayloadV6](#engine_newpayloadv6) | ||
| - [Request](#request) | ||
| - [Response](#response) | ||
| - [Specification](#specification) | ||
| - [engine_getInclusionListV1](#engine_getinclusionlistv1) | ||
| - [Request](#request-1) | ||
| - [Response](#response-1) | ||
| - [Specification](#specification-1) | ||
| - [engine_forkchoiceUpdatedV5](#engine_forkchoiceupdatedv5) | ||
| - [Request](#request-2) | ||
| - [Response](#response-2) | ||
| - [Specification](#specification-2) | ||
| - [Update the methods of previous forks](#update-the-methods-of-previous-forks) | ||
| - [Amsterdam API](#amsterdam-api) | ||
|
|
||
| <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
|
||
| ## Constants | ||
|
|
||
| | Name | Value | | ||
| | - | - | | ||
| | `MAX_BYTES_PER_INCLUSION_LIST` | `uint64(8192) = 2**13` | | ||
|
|
||
| ## Structures | ||
|
|
||
| ### PayloadAttributesV5 | ||
|
|
||
| This structure has the syntax of [`PayloadAttributesV4`](./amsterdam.md#payloadattributesv4) and appends a single field: `inclusionListTransactions`. | ||
|
|
||
| - `timestamp`: `QUANTITY`, 64 Bits - value for the `timestamp` field of the new payload | ||
| - `prevRandao`: `DATA`, 32 Bytes - value for the `prevRandao` field of the new payload | ||
| - `suggestedFeeRecipient`: `DATA`, 20 Bytes - suggested value for the `feeRecipient` field of the new payload | ||
| - `withdrawals`: `Array of WithdrawalV1` - Array of withdrawals, each object is an `OBJECT` containing the fields of a `WithdrawalV1` structure. | ||
| - `parentBeaconBlockRoot`: `DATA`, 32 Bytes - Root of the parent beacon block. | ||
| - `slotNumber`: `QUANTITY`, 64 Bits - value for the `slotNumber` field of the new payload | ||
| - `inclusionListTransactions`: `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). | ||
|
|
||
| ## Routines | ||
|
|
||
| ### Payload building | ||
|
|
||
| This routine follows the same specification as [Payload building](./paris.md#payload-building) with the following changes to the processing flow: | ||
|
|
||
| 1. Client software **SHOULD** take `inclusionListTransactions` into account during the payload build process. The built `ExecutionPayload` **MUST** satisfy the inclusion list constraints with respect to `inclusionListTransactions` as defined in [EIP-7805](https://eips.ethereum.org/EIPS/eip-7805). | ||
|
|
||
| ## Methods | ||
|
|
||
| ### engine_newPayloadV6 | ||
|
|
||
| Method parameter list is extended with `inclusionListTransactions`. | ||
|
|
||
| #### Request | ||
|
|
||
| * method: `engine_newPayloadV6` | ||
| * params: | ||
| 1. `executionPayload`: [`ExecutionPayloadV4`](./amsterdam.md#executionpayloadv4). | ||
| 2. `expectedBlobVersionedHashes`: `Array of DATA`, 32 Bytes - Array of expected blob versioned hashes to validate. | ||
| 3. `parentBeaconBlockRoot`: `DATA`, 32 Bytes - Root of the parent beacon block. | ||
| 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. | ||
| 5. `inclusionListTransactions`: `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). | ||
|
|
||
| #### Response | ||
|
|
||
| * result: [`PayloadStatusV1`](./paris.md#payloadstatusv1), values of the `status` field are modified in the following way: | ||
| - `INVALID_BLOCK_HASH` status value is supplanted by `INVALID`. | ||
| - `INCLUSION_LIST_UNSATISFIED` status value is appended. | ||
| * error: code and message set in case an exception happens while processing the payload. | ||
|
|
||
| #### Specification | ||
|
|
||
| This method follows the same specification as [`engine_newPayloadV5`](./amsterdam.md#engine_newpayloadv5) with the following changes: | ||
|
|
||
| 1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the Bogota fork. | ||
|
|
||
| 2. Client software **MUST** return `{status: INCLUSION_LIST_UNSATISFIED, latestValidHash: null, validationError: null}` if `executionPayload` fails to satisfy the inclusion list constraints with respect to `inclusionListTransactions` as defined in [EIP-7805](https://eips.ethereum.org/EIPS/eip-7805). | ||
|
|
||
| ### engine_getInclusionListV1 | ||
|
|
||
| #### Request | ||
|
|
||
| * method: `engine_getInclusionListV1` | ||
| * params: | ||
| 1. `parentHash`: `DATA`, 32 Bytes - block hash of the parent block upon which the inclusion list should be built. | ||
|
|
||
| * timeout: 1s | ||
|
|
||
| #### Response | ||
|
|
||
| * result: `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). | ||
| * error: code and message set in case an exception happens while getting the inclusion list. | ||
|
|
||
| #### Specification | ||
|
|
||
| 1. Client software **MUST** return `-38006: Unknown parent` error if a block with the given `parentHash` does not exist. | ||
|
|
||
| 2. Client software **MUST** provide a list of transactions for the inclusion list based on the local view of the mempool. The strategy for selecting which transactions to include is implementation dependent. | ||
|
|
||
|
jihoonsong marked this conversation as resolved.
|
||
| 3. Client software **MUST** ensure the byte length of the RLP encoding of the returned transaction list does not exceed `MAX_BYTES_PER_INCLUSION_LIST`. | ||
|
|
||
| 4. Client software **MUST NOT** include any [blob transaction](https://eips.ethereum.org/EIPS/eip-4844#blob-transaction) in the returned transaction list. | ||
|
|
||
| ### engine_forkchoiceUpdatedV5 | ||
|
|
||
| #### Request | ||
|
|
||
| * method: `engine_forkchoiceUpdatedV5` | ||
| * params: | ||
| 1. `forkchoiceState`: [`ForkchoiceStateV1`](./paris.md#forkchoicestatev1). | ||
| 2. `payloadAttributes`: `Object|null` - Instance of [`PayloadAttributesV5`](#payloadattributesv5) or `null`. | ||
| * timeout: 8s | ||
|
|
||
| #### Response | ||
|
|
||
| Refer to the response for [`engine_forkchoiceUpdatedV4`](./amsterdam.md#engine_forkchoiceupdatedv4). | ||
|
|
||
| #### Specification | ||
|
mkalinin marked this conversation as resolved.
|
||
|
|
||
| This method follows the same specification as [`engine_forkchoiceUpdatedV4`](./amsterdam.md#engine_forkchoiceupdatedv4) with the following changes to the processing flow: | ||
|
|
||
| 1. Extend point (7) of the `engine_forkchoiceUpdatedV1` [specification](./paris.md#specification-1) by defining the following sequence of checks that **MUST** be run over `payloadAttributes`: | ||
|
|
||
| 1. `payloadAttributes` matches the [`PayloadAttributesV5`](#payloadattributesv5) structure, return `-38003: Invalid payload attributes` on failure. | ||
|
|
||
| 2. `payloadAttributes.timestamp` does not fall within the time frame of the Bogota fork, return `-38005: Unsupported fork` on failure. | ||
|
|
||
| 3. `payloadAttributes.timestamp` is greater than `timestamp` of a block referenced by `forkchoiceState.headBlockHash`, return `-38003: Invalid payload attributes` on failure. | ||
|
|
||
| 4. If any of the above checks fails, the `forkchoiceState` update **MUST NOT** be rolled back. | ||
|
|
||
| ### Update the methods of previous forks | ||
|
|
||
| #### Amsterdam API | ||
|
|
||
| For the following methods: | ||
|
|
||
| - [`engine_newPayloadV5`](./amsterdam.md#engine_newpayloadv5) | ||
| - [`engine_forkchoiceUpdatedV4`](./amsterdam.md#engine_forkchoiceupdatedv4) | ||
|
|
||
| a validation **MUST** be added: | ||
|
|
||
| 1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload is greater than or equal to the Bogota activation timestamp. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we define
PayloadStatusV2?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We add one enum value without changing its structure and it seems the spec doesn't add another version in such cases. It's not a strong opinion though. Should we define
PayloadStatusV2?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the spec doesn’t require to bump a version in this case, see here for all cases where the version change is required — we can definitely extend this list if we find it reasonable. But I am personally leaning towards not adding a new version in this particular case as the change doesn’t affect the layout of the
PayloadStatus