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

Engine API: add getPayloadBodies method #146

Closed
wants to merge 4 commits 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
29 changes: 29 additions & 0 deletions src/engine/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This document specifies the Engine API methods that the Consensus Layer uses to
- [Errors](#errors)
- [Structures](#structures)
- [ExecutionPayloadV1](#executionpayloadv1)
- [ExecutionPayloadBodyV1](#executionpayloadbodyv1)
- [ForkchoiceStateV1](#forkchoicestatev1)
- [PayloadAttributesV1](#payloadattributesv1)
- [PayloadStatusV1](#payloadstatusv1)
Expand All @@ -34,6 +35,10 @@ This document specifies the Engine API methods that the Consensus Layer uses to
- [Request](#request-2)
- [Response](#response-2)
- [Specification](#specification-2)
- [engine_getPayloadBodiesV1](#engine_getpayloadbodiesv1)
- [Request](#request-3)
- [Response](#response-3)
- [Specification](#specification-3)

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

Expand Down Expand Up @@ -144,6 +149,11 @@ This structure maps on the [`ExecutionPayload`](https://github.com/ethereum/cons
- `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)

### ExecutionPayloadBodyV1

This structure contains a body of an execution payload. The fields are encoded as follows:
- `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)

### ForkchoiceStateV1

This structure encapsulates the fork choice state. The fields are encoded as follows:
Expand Down Expand Up @@ -310,3 +320,22 @@ The payload build process is specified as follows:
1. The call **MUST** return `-32001: Unknown payload` error if the build process identified by the `payloadId` does not exist.

1. Client software **MAY** stop the corresponding build process after serving this call.

### engine_getPayloadBodiesV1

#### Request

* method: `engine_getPayloadBodiesV1`
* params:
1. `Array of DATA`, 32 Bytes - Array of `block_hash` field values of the `ExecutionPayload` structure

#### Response

* result: `Array of ExecutionPayloadBodyV1` - Array of [`ExecutionPayloadBodyV1`](#ExecutionPayloadBodyV1) objects.
* error: code and message set in case an exception happens while processing the method call.

#### Specification

1. Given array of block hashes client software **MUST** respond with array of `ExecutionPayloadBodyV1` objects with the corresponding hashes respecting the order of block hashes in the input array.

1. Client software **MUST** skip the payload body in the response array if the data of this body is missing. For instance, if the request is `[A.block_hash, B.block_hash, C.block_hash]` and client software has data of payloads `A` and `C`, but doesn't have data of `B`, the response **MUST** be `[A.body, C.body]`.
2 changes: 2 additions & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apis
attributesv
bodyv
bodiesv
bytecode
eip
endian
Expand Down