Skip to content

Commit d7398c9

Browse files
authored
Merge pull request #133 from mkalinin/engine-api-msg-order
Engine API: refine message ordering section
2 parents 33fb5c7 + 3b90f9e commit d7398c9

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/engine/specification.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This document specifies the Engine API methods that the Consensus Layer uses to
99

1010
- [Underlying protocol](#underlying-protocol)
1111
- [Versioning](#versioning)
12+
- [Constants](#constants)
1213
- [Message ordering](#message-ordering)
1314
- [Load-balancing and advanced configurations](#load-balancing-and-advanced-configurations)
1415
- [Errors](#errors)
@@ -59,13 +60,25 @@ The versioning of the Engine API is defined as follows:
5960
* a set of structure fields
6061
* 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.
6162

63+
## Constants
64+
65+
| Name | Value |
66+
| - | - |
67+
| `MESSAGE_ORDER_RESET_ID` | `0` |
68+
6269
## Message ordering
6370

64-
Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly
65-
increasing.
71+
Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly increasing.
72+
Request IDs assigned to `engine_forkchoiceUpdated` method calls **MUST** respect the order of
73+
the corresponding fork choice update events occurring in the system.
74+
75+
Execution Layer client software **MUST NOT** process `engine_forkchoiceUpdated` method call
76+
if its JSON-RPC request ID is lower than the ID assigned to the previous call of this method.
6677

67-
Execution Layer client software **MUST** execute calls strictly in the order of request IDs
68-
to avoid degenerate race conditions.
78+
Consensus Layer client software **SHOULD** use `MESSAGE_ORDER_RESET_ID` as initial value of request ID
79+
to reset the ID cached by Execution Layer client software.
80+
If the ID of a request equals to `MESSAGE_ORDER_RESET_ID`, Execution Layer client software **MUST** process this request
81+
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.
6982

7083
## Load-balancing and advanced configurations
7184

0 commit comments

Comments
 (0)