mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Adjust beacon node timeouts for validator client HTTP requests (#2352)
## Issue Addressed Resolves #2313 ## Proposed Changes Provide `BeaconNodeHttpClient` with a dedicated `Timeouts` struct. This will allow granular adjustment of the timeout duration for different calls made from the VC to the BN. These can either be a constant value, or as a ratio of the slot duration. Improve timeout performance by using these adjusted timeout duration's only whenever a fallback endpoint is available. Add a CLI flag called `use-long-timeouts` to revert to the old behavior. ## Additional Info Additionally set the default `BeaconNodeHttpClient` timeouts to the be the slot duration of the network, rather than a constant 12 seconds. This will allow it to adjust to different network specifications. Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
use beacon_node::ProductionBeaconNode;
|
||||
use environment::RuntimeContext;
|
||||
use eth2::{reqwest::ClientBuilder, BeaconNodeHttpClient};
|
||||
use eth2::{reqwest::ClientBuilder, BeaconNodeHttpClient, Timeouts};
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
@@ -77,6 +77,7 @@ impl<E: EthSpec> LocalBeaconNode<E> {
|
||||
Ok(BeaconNodeHttpClient::from_components(
|
||||
beacon_node_url,
|
||||
beacon_node_http_client,
|
||||
Timeouts::set_all(HTTP_TIMEOUT),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user