From b1a4ebd78101c9b0554dc2d49f11b98302e037fc Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Fri, 10 Dec 2021 15:47:18 +0600 Subject: [PATCH 1/3] Engine API: add getPayloadBodies method --- src/engine/specification.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/engine/specification.md b/src/engine/specification.md index 58f6f8eb..2cc50b6b 100644 --- a/src/engine/specification.md +++ b/src/engine/specification.md @@ -17,6 +17,7 @@ This document specifies the Engine API methods that the Consensus Layer uses to - [ExecutionPayloadV1](#executionpayloadv1) - [ForkchoiceStateV1](#forkchoicestatev1) - [PayloadAttributesV1](#payloadattributesv1) + - [ExecutionPayloadBodyV1](#executionpayloadbodyv1) - [Core](#core) - [engine_executePayloadV1](#engine_executepayloadv1) - [Request](#request) @@ -31,6 +32,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) @@ -165,6 +170,12 @@ This structure contains the attributes required to initiate a payload build proc - `random`: `DATA`, 32 Bytes - value for the `random` field of the new payload - `suggestedFeeRecipient`: `DATA`, 20 Bytes - suggested value for the `feeRecipient` field of the new payload +### 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) + + ## Core ### engine_executePayloadV1 @@ -256,3 +267,22 @@ The payload build process is specified as follows: 2. The call **MUST** return `-32001: Unknown payload` error if the build process identified by the `payloadId` does not exist. 3. 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. + +2. 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]`. From 6be10880ca2847f403862c2ae8af3d00225c3766 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Fri, 10 Dec 2021 19:52:12 +0600 Subject: [PATCH 2/3] Engine API: fix spellchecker --- wordlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist.txt b/wordlist.txt index d372d313..aa7a1e5d 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -1,5 +1,6 @@ apis attributesv +bodyv bytecode eip endian From f500c4831d284305e4e4df3704cf0b960a7e33db Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Fri, 10 Dec 2021 19:53:33 +0600 Subject: [PATCH 3/3] Engine API: fix spellchecker. Take 2 --- wordlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist.txt b/wordlist.txt index aa7a1e5d..ff90fabf 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -1,6 +1,7 @@ apis attributesv bodyv +bodiesv bytecode eip endian