From 5ba0f15cf4c8ed2de0cb5fb50d63f550f7c5c440 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 28 Oct 2021 11:25:21 -0600 Subject: [PATCH 1/4] add directive about using rpc id to resolve fork choice ordering --- src/engine/specification.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/specification.md b/src/engine/specification.md index 55bab6309..c98965a33 100644 --- a/src/engine/specification.md +++ b/src/engine/specification.md @@ -145,6 +145,8 @@ This structure contains the attributes required to initiate a payload build proc 4. If any of the above fails due to errors unrelated to the client software's normal `SYNCING` status, the client software **MUST** return an error. +5. In the event of multiple calls to this method in an asynchronous context, client software **MUST** ultimately resolve the chain-head and/or payload build process to the `engine_forkchoiceUpdated` call with the highest JSON-RPC request ID. + ### engine_getPayload #### Request From 98cadfdc5624f577f3498c03366914d9b1bc7200 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Fri, 29 Oct 2021 09:54:34 -0600 Subject: [PATCH 2/4] rquire JSON RPC message ID ordering for all messages --- src/engine/specification.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/specification.md b/src/engine/specification.md index c98965a33..9285df9cb 100644 --- a/src/engine/specification.md +++ b/src/engine/specification.md @@ -11,6 +11,14 @@ This specification is based on [Ethereum JSON-RPC API](https://eth.wiki/json-rpc Client software **MUST** expose Engine API at a port independent from JSON-RPC API. The default port for the Engine API is 8550 for HTTP and 8551 for WebSocket. +## Message ordering + +Calling software *MUST* utilize JSON-RPC request IDs that are strictly +increasing. + +Responding software *MUST* execute calls strictly in the order of request IDs +to avoid degenerate race conditions. + ## Load-balancing and advanced configurations The Engine API supports a one-to-many Consensus Layer to Execution Layer configuration. @@ -145,8 +153,6 @@ This structure contains the attributes required to initiate a payload build proc 4. If any of the above fails due to errors unrelated to the client software's normal `SYNCING` status, the client software **MUST** return an error. -5. In the event of multiple calls to this method in an asynchronous context, client software **MUST** ultimately resolve the chain-head and/or payload build process to the `engine_forkchoiceUpdated` call with the highest JSON-RPC request ID. - ### engine_getPayload #### Request From 307634abf19fff2033e45d755fa890fcfac788bb Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Fri, 29 Oct 2021 22:03:52 +0600 Subject: [PATCH 3/4] Use CL and EL terms for clarity --- src/engine/specification.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/specification.md b/src/engine/specification.md index 9285df9cb..e5cdf5293 100644 --- a/src/engine/specification.md +++ b/src/engine/specification.md @@ -13,10 +13,10 @@ Client software **MUST** expose Engine API at a port independent from JSON-RPC A ## Message ordering -Calling software *MUST* utilize JSON-RPC request IDs that are strictly +Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly increasing. -Responding software *MUST* execute calls strictly in the order of request IDs +Execution Layer client software **MUST** execute calls strictly in the order of request IDs to avoid degenerate race conditions. ## Load-balancing and advanced configurations From e98cd1b031807ac196fcf44a723c0c98be305a01 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Fri, 29 Oct 2021 11:10:07 -0600 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Mikhail Kalinin --- src/engine/specification.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/specification.md b/src/engine/specification.md index 9285df9cb..e5cdf5293 100644 --- a/src/engine/specification.md +++ b/src/engine/specification.md @@ -13,10 +13,10 @@ Client software **MUST** expose Engine API at a port independent from JSON-RPC A ## Message ordering -Calling software *MUST* utilize JSON-RPC request IDs that are strictly +Consensus Layer client software **MUST** utilize JSON-RPC request IDs that are strictly increasing. -Responding software *MUST* execute calls strictly in the order of request IDs +Execution Layer client software **MUST** execute calls strictly in the order of request IDs to avoid degenerate race conditions. ## Load-balancing and advanced configurations