Skip to content
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

Added engine_getPayloadV4 and engine_newPayloadV4 for Prague (EIP-7002) #528

Merged
merged 6 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 166 additions & 6 deletions src/engine/openrpc/methods/payload.yaml

Large diffs are not rendered by default.

79 changes: 77 additions & 2 deletions src/engine/openrpc/schemas/payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RestrictedPayloadStatusV1:
enum:
- VALID
- INVALID
- SYNCING
- SYNCING
latestValidHash:
$ref: '#/components/schemas/PayloadStatusV1/properties/latestValidHash'
validationError:
Expand All @@ -43,7 +43,7 @@ PayloadStatusNoInvalidBlockHash:
- VALID
- INVALID
- SYNCING
- ACCEPTED
- ACCEPTED
latestValidHash:
$ref: '#/components/schemas/PayloadStatusV1/properties/latestValidHash'
validationError:
Expand Down Expand Up @@ -243,6 +243,68 @@ ExecutionPayloadV3:
excessBlobGas:
title: Excess blob gas
$ref: '#/components/schemas/uint64'
ExecutionPayloadV4:
title: Execution payload object V4
type: object
required:
- parentHash
- feeRecipient
- stateRoot
- receiptsRoot
- logsBloom
- prevRandao
- blockNumber
- gasLimit
- gasUsed
- timestamp
- extraData
- baseFeePerGas
- blockHash
- transactions
- withdrawals
- blobGasUsed
- excessBlobGas
- exits
properties:
parentHash:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/parentHash'
feeRecipient:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/feeRecipient'
stateRoot:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/stateRoot'
receiptsRoot:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/receiptsRoot'
logsBloom:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/logsBloom'
prevRandao:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/prevRandao'
blockNumber:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockNumber'
gasLimit:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasLimit'
gasUsed:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/gasUsed'
timestamp:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/timestamp'
extraData:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/extraData'
baseFeePerGas:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/baseFeePerGas'
blockHash:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blockHash'
transactions:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/transactions'
withdrawals:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/withdrawals'
blobGasUsed:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed'
excessBlobGas:
$ref: '#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas'
exits:
title: Exits
type: array
items:
$ref: '#/components/schemas/ExitV1'
ExecutionPayloadBodyV1:
title: Execution payload body object V1
type: object
Expand Down Expand Up @@ -281,3 +343,16 @@ BlobsBundleV1:
type: array
items:
$ref: '#/components/schemas/bytes'
ExitV1:
title: Exit object V1
type: object
required:
- sourceAddress
- validatorPublicKey
properties:
sourceAddress:
title: Source address
$ref: '#/components/schemas/address'
validatorPublicKey:
title: Validator public key
$ref: '#/components/schemas/bytes48'
106 changes: 106 additions & 0 deletions src/engine/prague.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Engine API -- Prague

Engine API changes introduced in Prague.

This specification is based on and extends [Engine API - Cancun](./cancun.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 -->

- [Engine API -- Prague](#engine-api----prague)
- [Table of contents](#table-of-contents)
- [Structures](#structures)
- [ExitV1](#exitv1)
- [ExecutionPayloadV4](#executionpayloadv4)
- [Methods](#methods)
- [engine\_newPayloadV4](#engine_newpayloadv4)
- [Request](#request)
- [Response](#response)
- [Specification](#specification)
- [engine\_getPayloadV4](#engine_getpayloadv4)
- [Request](#request-1)
- [Response](#response-1)
- [Specification](#specification-1)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Structures

### ExitV1

This structure represents an execution layer triggered exit operation.
The fields are encoded as follows:

- `sourceAddress`: `DATA`, 20 Bytes
- `validatorPublicKey`: `DATA`, 48 Bytes

### ExecutionPayloadV4

This structure has the syntax of [`ExecutionPayloadV3`](./cancun.md#executionpayloadv3) and appends the new field: `exits`.

- `parentHash`: `DATA`, 32 Bytes
- `feeRecipient`: `DATA`, 20 Bytes
- `stateRoot`: `DATA`, 32 Bytes
- `receiptsRoot`: `DATA`, 32 Bytes
- `logsBloom`: `DATA`, 256 Bytes
- `prevRandao`: `DATA`, 32 Bytes
- `blockNumber`: `QUANTITY`, 64 Bits
- `gasLimit`: `QUANTITY`, 64 Bits
- `gasUsed`: `QUANTITY`, 64 Bits
- `timestamp`: `QUANTITY`, 64 Bits
- `extraData`: `DATA`, 0 to 32 Bytes
- `baseFeePerGas`: `QUANTITY`, 256 Bits
- `blockHash`: `DATA`, 32 Bytes
- `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)
- `withdrawals`: `Array of WithdrawalV1` - Array of withdrawals, each object is an `OBJECT` containing the fields of a `WithdrawalV1` structure.
- `blobGasUsed`: `QUANTITY`, 64 Bits
- `excessBlobGas`: `QUANTITY`, 64 Bits
- `exits`: `Array of ExitV1` - Array of exits, each object is an `OBJECT` containing the fields of a `ExitV1` structure.

## Methods

### engine_newPayloadV4

The request of this method is updated with [`ExecutionPayloadV4`](#ExecutionPayloadV4).

#### Request

* method: `engine_newPayloadV4`
* params:
1. `executionPayload`: [`ExecutionPayloadV4`](#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.

#### Response

Refer to the response for [`engine_newPayloadV3`](./cancun.md#engine_newpayloadv3).

#### Specification

This method follows the same specification as [`engine_newPayloadV3`](./cancun.md#engine_newpayloadv3).

### engine_getPayloadV4

The response of this method is updated with [`ExecutionPayloadV4`](#ExecutionPayloadV4).

#### Request

* method: `engine_getPayloadV4`
* params:
1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process
* timeout: 1s

#### Response

* result: `object`
- `executionPayload`: [`ExecutionPayloadV4`](#ExecutionPayloadV4)
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
- `blobsBundle`: [`BlobsBundleV1`](#BlobsBundleV1) - Bundle with data corresponding to blob transactions included into `executionPayload`
- `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the execution layer to use this `executionPayload` instead of an externally provided one
* error: code and message set in case an exception happens while getting the payload.

#### Specification

Refer to the specification for [`engine_getPayloadV3`](./cancun.md#engine_getpayloadv3).
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ randao
src
https
forkchoiceupdatedresponsev
exitv
Loading