|
| 1 | +# Engine API -- Amsterdam |
| 2 | + |
| 3 | +Engine API changes introduced in Amsterdam. |
| 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 Amsterdam activation. |
| 77 | + |
| 78 | +2. Client software **MUST** return `-32602: Invalid params` error if the `blockAccessList` field is missing. |
| 79 | + |
| 80 | +3. Client software **MUST** validate the `blockAccessList` field by executing the payload's transactions and verifying that the computed access list matches the provided one. |
| 81 | + |
| 82 | +4. If the `blockAccessList` field is malformed or doesn't match the computed access list, the call **MUST** return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}`. |
| 83 | + |
| 84 | +### engine_getPayloadV6 |
| 85 | + |
| 86 | +This method is updated to return the new `ExecutionPayloadV4` structure. |
| 87 | + |
| 88 | +#### Request |
| 89 | + |
| 90 | +* method: `engine_getPayloadV6` |
| 91 | +* params: |
| 92 | + 1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process |
| 93 | +* timeout: 1s |
| 94 | + |
| 95 | +#### Response |
| 96 | + |
| 97 | +* result: `object` |
| 98 | + - `executionPayload`: [`ExecutionPayloadV4`](#executionpayloadv4) |
| 99 | + - `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei |
| 100 | + - `blobsBundle`: [`BlobsBundleV2`](./osaka.md#blobsbundlev2) - Bundle with data corresponding to blob transactions included into `executionPayload` |
| 101 | + - `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the execution layer to use this `executionPayload` instead of an externally provided one |
| 102 | + - `executionRequests`: `Array of DATA` - Execution layer triggered requests obtained from the `executionPayload` transaction execution. |
| 103 | +* error: code and message set in case an exception happens while getting the payload. |
| 104 | + |
| 105 | +#### Specification |
| 106 | + |
| 107 | +This method follows the same specification as [`engine_getPayloadV5`](./osaka.md#engine_getpayloadv5) with the following changes: |
| 108 | + |
| 109 | +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 Amsterdam activation. |
| 110 | + |
| 111 | +2. When building the block, client software **MUST** collect all account accesses and state changes during transaction execution and populate the `blockAccessList` field in the returned `ExecutionPayloadV4` with the RLP-encoded access list. |
| 112 | + |
| 113 | +### Update the methods of previous forks |
| 114 | + |
| 115 | +#### Osaka API |
| 116 | + |
| 117 | +For the following methods: |
| 118 | + |
| 119 | +- [`engine_newPayloadV4`](./prague.md#engine_newpayloadv4) |
| 120 | +- [`engine_getPayloadV5`](./osaka.md#engine_getpayloadv5) |
| 121 | + |
| 122 | +a validation **MUST** be added: |
| 123 | + |
| 124 | +1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload greater or equal to the Amsterdam activation timestamp. |
| 125 | + |
| 126 | +For the [`engine_forkchoiceUpdatedV3`](./cancun.md#engine_forkchoiceupdatedv3) the following modification **MUST** be made: |
| 127 | +1. Return `-38005: Unsupported fork` if `payloadAttributes.timestamp` doesn't fall within the time frame of the Cancun, Prague, Osaka *or Amsterdam* forks. |
0 commit comments