Skip to content

Commit 9301c06

Browse files
authored
Engine API: introduce exchangeCapabilities (#364)
* Spec out getCapabilities * Do exchange capabilities instead of get * Update capabilities.md * State that exchangeCapabilities is optional * Move exchangeCapabilities to common.md
1 parent b7c5d34 commit 9301c06

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/engine/common.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ This document specifies common definitions and requirements affecting Engine API
1515
- [Errors](#errors)
1616
- [Timeouts](#timeouts)
1717
- [Encoding](#encoding)
18+
- [Capabilities](#capabilities)
19+
- [engine_exchangeCapabilities](#engine_exchangecapabilities)
20+
- [Request](#request)
21+
- [Response](#response)
22+
- [Specification](#specification)
1823

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

@@ -131,3 +136,41 @@ Values of a field of `QUANTITY` type **MUST** be encoded as a hexadecimal string
131136
*Note:* Byte order of encoded value having `QUANTITY` type is big-endian.
132137

133138
[json-rpc-spec]: https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/execution-apis/assembled-spec/openrpc.json&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:examplesDropdown]=false
139+
140+
## Capabilities
141+
142+
Execution and consensus layer client software may exchange with a list of supported Engine API methods by calling `engine_exchangeCapabilities` method.
143+
144+
Execution layer clients **MUST** support `engine_exchangeCapabilities` method, while consensus layer clients are free to choose whether to call it or not.
145+
146+
*Note:* The method itself doesn't have a version suffix.
147+
148+
### engine_exchangeCapabilities
149+
150+
#### Request
151+
152+
* method: `engine_exchangeCapabilities`
153+
* params:
154+
1. `Array of string` -- Array of strings, each string is a name of a method supported by consensus layer client software.
155+
* timeout: 1s
156+
157+
#### Response
158+
159+
`Array of string` -- Array of strings, each string is a name of a method supported by execution layer client software.
160+
161+
#### Specification
162+
163+
1. Consensus and execution layer client software **MAY** exchange with a list of currently supported Engine API methods. Execution layer client software **MUST NOT** log any error messages if this method has either never been called or haven't been called for a significant amount of time.
164+
165+
2. Request and response lists **MUST** contain Engine API methods that are currently supported by consensus and execution client software respectively. Name of each method in both lists **MUST** include suffixed version. Consider the following examples:
166+
* Client software of both layers currently supports `V1` and `V2` versions of `engine_newPayload` method:
167+
* params: `["engine_newPayloadV1", "engine_newPayloadV2", ...]`,
168+
* response: `["engine_newPayloadV1", "engine_newPayloadV2", ...]`.
169+
* `V1` method has been deprecated and `V3` method has been introduced on execution layer side since the last call:
170+
* params: `["engine_newPayloadV1", "engine_newPayloadV2", ...]`,
171+
* response: `["engine_newPayloadV2", "engine_newPayloadV3", ...]`.
172+
* The same capabilities modification has happened in consensus layer client, so, both clients have the same capability set again:
173+
* params: `["engine_newPayloadV2", "engine_newPayloadV3", ...]`,
174+
* response: `["engine_newPayloadV2", "engine_newPayloadV3", ...]`.
175+
176+
3. The `engine_exchangeCapabilities` method **MUST NOT** be returned in the response list.

0 commit comments

Comments
 (0)