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

Add getPayloadV3 with builder override flag #395

Closed
wants to merge 1 commit into from
Closed
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
43 changes: 43 additions & 0 deletions src/engine/builder-override.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Engine API -- Builder Override

Engine API spec for builder override feature.

## 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 -->

- [Methods](#methods)
- [engine_getPayloadV3](#engine_getpayloadv3)
- [Request](#request)
- [Response](#response)
- [Specification](#specification)

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

## Methods

### engine_getPayloadV3

#### Request

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

#### Response

* result: `object`
- `executionPayload`: [`ExecutionPayloadV1`](./paris.md#ExecutionPayloadV1) | [`ExecutionPayloadV2`](#./shanghai.md#ExecutionPayloadV2) where:
- `ExecutionPayloadV1` **MUST** be returned if the payload `timestamp` is lower than the Shanghai timestamp
- `ExecutionPayloadV2` **MUST** be returned if the payload `timestamp` is greater or equal to the Shanghai timestamp
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
- `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the EL 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

This method follows the same specification as [`engine_getPayloadV2`](./shanghai.md#engine_getpayloadv2) with the addition of the following:

1. Client software **MAY** use any heuristics to decide `shouldOverrideBuilder`.
36 changes: 34 additions & 2 deletions src/engine/openrpc/methods/payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- code: -32602
message: Invalid params
- name: engine_getPayloadV1
summary: Obtains execution payload from payload build process
summary: Obtains execution payload from payload build process, V1
externalDocs:
description: Method specification
url: https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#engine_getpayloadv1
Expand All @@ -49,7 +49,7 @@
- code: -38001
message: Unknown payload
- name: engine_getPayloadV2
summary: Obtains execution payload from payload build process
summary: Obtains execution payload from payload build process, V2
externalDocs:
description: Method specification
url: https://github.com/ethereum/execution-apis/blob/main/src/engine/shanghai.md#engine_getpayloadv2
Expand Down Expand Up @@ -77,6 +77,38 @@
errors:
- code: -38001
message: Unknown payload
- name: engine_getPayloadV3
summary: Obtains execution payload from payload build process, V3
externalDocs:
description: Method specification
url: https://github.com/ethereum/execution-apis/blob/main/src/engine/builder-override.md#engine_getpayloadv3
params:
- name: Payload id
required: true
schema:
$ref: '#/components/schemas/bytes8'
result:
name: Response object
schema:
type: object
required:
- executionPayload
- blockValue
properties:
executionPayload:
title: Execution payload
oneOf:
- $ref: '#/components/schemas/ExecutionPayloadV1'
- $ref: '#/components/schemas/ExecutionPayloadV2'
blockValue:
title: Expected fee value
$ref: '#/components/schemas/uint256'
shouldOverrideBuilder:
title: Should override builder flag
type: boolean
errors:
- code: -38001
message: Unknown payload
- name: engine_getPayloadBodiesByHashV1
summary: Given block hashes returns bodies of the corresponding execution payloads
externalDocs:
Expand Down