diff --git a/docs/cli-reference.md b/docs/cli-reference.md index bfba2ec..b29cdb3 100644 --- a/docs/cli-reference.md +++ b/docs/cli-reference.md @@ -6,17 +6,17 @@ Usage: eleel [OPTIONS] --ee-jwt-secret --controller-jwt-secret --c Options: --listen-address Listening address for the HTTP server - + [default: 127.0.0.1] --listen-port Listening port for the HTTP server - + [default: 8552] --ee-url Primary execution engine to be shared by connected consensus nodes - + [default: http://localhost:8551] --ee-jwt-secret @@ -27,42 +27,42 @@ Options: --client-jwt-secrets Path to TOML file of JWT secrets for the non-controlling consensus clients. - + See docs for TOML file format. --new-payload-cache-size Number of recent newPayload messages to cache in memory - + [default: 64] --fcu-cache-size Number of recent forkchoiceUpdated messages to cache in memory - + [default: 64] --payload-builder-cache-size Number of payload attributes and past payloads to cache in memory - + [default: 8] --payload-builder-extra-data Extra data to include in produced blocks - + [default: Eleel] --justified-block-cache-size Number of justified block hashes to cache in memory - + [default: 4] --finalized-block-cache-size Number of finalized block hashes to cache in memory - + [default: 4] --fcu-matching Choose the type of matching to use before returning a VALID fcU message to a client - + [default: loose] Possible values: @@ -72,35 +72,40 @@ Options: --network Network that the consensus and execution nodes are operating on - + [default: mainnet] --new-payload-wait-millis Maximum time that a consensus node should wait for a newPayload response from the cache. - + We expect that the controlling consensus node and primary execution node will take some time to process requests, and that requests from consensus nodes could arrive while this processing is on-going. Using a timeout of 0 will often result in a SYNCING response, which will put the consensus node into optimistic sync. Using a longer timeout will allow the definitive (VALID) response from the execution engine to be returned, more closely matching the behaviour of a full execution engine. - + [default: 2000] --new-payload-wait-cutoff Maximum age of a payload that will trigger a wait on `newPayload` - + Payloads older than this age receive an instant SYNCING response. See docs for `--new-payload-wait-millis` for the purpose of this wait. - + [default: 64] --fcu-wait-millis Maximum time that a consensus node should wait for a forkchoiceUpdated response from the cache. - + See the docs for `--new-payload-wait-millis` for the purpose of this timeout. - + [default: 1000] --body-limit-mb Maximum size of JSON-RPC message to accept from any connected consensus node - + [default: 128] + --ee-timeout-millis + Maximum timeout that need to wait for a response from the execution + + [default: 15000] + -h, --help Print help (see a summary with '-h') ``` diff --git a/src/config.rs b/src/config.rs index 8c33863..b886a45 100644 --- a/src/config.rs +++ b/src/config.rs @@ -79,6 +79,9 @@ pub struct Config { /// Maximum size of JSON-RPC message to accept from any connected consensus node. #[arg(long, value_name = "MEGABYTES", default_value = "128")] pub body_limit_mb: usize, + /// Maximum timeout that need to wait for a response from the execution + #[arg(long, value_name = "MILLIS", default_value = "15000")] + pub ee_timeout_millis: u64, } #[derive(Deserialize, Serialize)] diff --git a/src/meta.rs b/src/meta.rs index d773762..1f9d264 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -16,8 +16,7 @@ impl Multiplexer { pub async fn handle_chain_id(&self, request: Request) -> Result { let (id, _) = request.parse_as::>()?; - // TODO: dynamic timeout - let timeout = Duration::from_secs(1); + let timeout = Duration::from_millis(self.config.ee_timeout_millis); let chain_id = self .engine .api @@ -47,9 +46,7 @@ impl Multiplexer { pub async fn proxy_directly(&self, request: Request) -> Result { let id = request.id; - - // TODO: adjust timeout - let timeout = Duration::from_secs(12); + let timeout = Duration::from_millis(self.config.ee_timeout_millis); let result: JsonValue = self .engine