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: refine message ordering section #133

Merged
merged 4 commits into from
Nov 29, 2021
Merged
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
21 changes: 17 additions & 4 deletions src/engine/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This document specifies the Engine API methods that the Consensus Layer uses to

- [Underlying protocol](#underlying-protocol)
- [Versioning](#versioning)
- [Constants](#constants)
- [Message ordering](#message-ordering)
- [Load-balancing and advanced configurations](#load-balancing-and-advanced-configurations)
- [Errors](#errors)
Expand Down Expand Up @@ -59,13 +60,25 @@ The versioning of the Engine API is defined as follows:
* a set of structure fields
* The specification **MAY** reference a method or a structure without the version suffix e.g. `engine_executePayload`. These statements should be read as related to all versions of the referenced method or structure.

## Constants

| Name | Value |
| - | - |
| `MESSAGE_ORDER_RESET_ID` | `0` |

## Message ordering

Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly
increasing.
Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly increasing.
Request IDs assigned to `engine_forkchoiceUpdated` method calls **MUST** respect the order of
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
the corresponding fork choice update events occurring in the system.

Execution Layer client software **MUST NOT** process `engine_forkchoiceUpdated` method call
if its JSON-RPC request ID is lower than the ID assigned to the previous call of this method.
lightclient marked this conversation as resolved.
Show resolved Hide resolved

Execution Layer client software **MUST** execute calls strictly in the order of request IDs
to avoid degenerate race conditions.
Consensus Layer client software **SHOULD** use `MESSAGE_ORDER_RESET_ID` as initial value of request ID
to reset the ID cached by Execution Layer client software.
If the ID of a request equals to `MESSAGE_ORDER_RESET_ID`, Execution Layer client software **MUST** process this request
disregarding the ID of the previous one and use `MESSAGE_ORDER_RESET_ID` value as the latest previous request ID, effectively resetting the request ID event ordering.

## Load-balancing and advanced configurations

Expand Down