Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions beacon_node/execution_layer/src/engine_api/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ impl HttpJsonRpc {
execution_timeout_multiplier: Option<u32>,
) -> Result<Self, Error> {
Ok(Self {
client: Client::builder().build()?,
client: Client::builder().user_agent(VERSION).build()?,
url,
execution_timeout_multiplier: execution_timeout_multiplier.unwrap_or(1),
engine_capabilities_cache: Mutex::new(None),
Expand All @@ -628,7 +628,7 @@ impl HttpJsonRpc {
execution_timeout_multiplier: Option<u32>,
) -> Result<Self, Error> {
Ok(Self {
client: Client::builder().build()?,
client: Client::builder().user_agent(VERSION).build()?,
url,
execution_timeout_multiplier: execution_timeout_multiplier.unwrap_or(1),
engine_capabilities_cache: Mutex::new(None),
Expand Down
1 change: 1 addition & 0 deletions common/eth2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ethereum_ssz_derive = { workspace = true }
futures = { workspace = true }
futures-util = "0.3.8"
libp2p-identity = { version = "0.2", features = ["peerid"] }
lighthouse_version = { workspace = true }
mediatype = "0.19.13"
multiaddr = "0.18.2"
pretty_reqwest_error = { workspace = true }
Expand Down
8 changes: 7 additions & 1 deletion common/eth2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use educe::Educe;
use futures::Stream;
use futures_util::StreamExt;
use libp2p_identity::PeerId;
use lighthouse_version::VERSION;
pub use reqwest;
use reqwest::{
Body, IntoUrl, RequestBuilder, Response,
Expand Down Expand Up @@ -154,8 +155,13 @@ impl fmt::Display for BeaconNodeHttpClient {

impl BeaconNodeHttpClient {
pub fn new(server: SensitiveUrl, timeouts: Timeouts) -> Self {
let client = reqwest::Client::builder()
.user_agent(VERSION)
.build()
.unwrap_or_else(|_| reqwest::Client::new());

Self {
client: reqwest::Client::new(),
client,
server,
timeouts,
}
Expand Down
15 changes: 13 additions & 2 deletions common/eth2/src/lighthouse_vc/http_client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::types::*;
use crate::{Error, success_or_error};
use lighthouse_version::VERSION;
use reqwest::{
IntoUrl,
header::{HeaderMap, HeaderValue},
Expand Down Expand Up @@ -45,8 +46,13 @@ impl Display for AuthorizationHeader {
impl ValidatorClientHttpClient {
/// Create a new client pre-initialised with an API token.
pub fn new(server: SensitiveUrl, secret: String) -> Result<Self, Error> {
let client = reqwest::Client::builder()
.user_agent(VERSION)
.build()
.unwrap_or_else(|_| reqwest::Client::new());

Ok(Self {
client: reqwest::Client::new(),
client,
server,
api_token: Some(secret.into()),
authorization_header: AuthorizationHeader::Bearer,
Expand All @@ -57,8 +63,13 @@ impl ValidatorClientHttpClient {
///
/// A token can be fetched by using `self.get_auth`, and then reading the token from disk.
pub fn new_unauthenticated(server: SensitiveUrl) -> Result<Self, Error> {
let client = reqwest::Client::builder()
.user_agent(VERSION)
.build()
.unwrap_or_else(|_| reqwest::Client::new());

Ok(Self {
client: reqwest::Client::new(),
client,
server,
api_token: None,
authorization_header: AuthorizationHeader::Omit,
Expand Down
7 changes: 6 additions & 1 deletion common/monitoring_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ pub struct MonitoringHttpClient {

impl MonitoringHttpClient {
pub fn new(config: &Config) -> Result<Self, String> {
let client = reqwest::Client::builder()
.user_agent(lighthouse_version::VERSION)
.build()
.unwrap_or_else(|_| reqwest::Client::new());

Ok(Self {
client: reqwest::Client::new(),
client,
db_path: config.db_path.clone(),
freezer_db_path: config.freezer_db_path.clone(),
update_period: Duration::from_secs(
Expand Down
1 change: 1 addition & 0 deletions validator_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ graffiti_file = { workspace = true }
hyper = { workspace = true }
initialized_validators = { workspace = true }
lighthouse_validator_store = { workspace = true }
lighthouse_version = { workspace = true }
metrics = { workspace = true }
monitoring_api = { workspace = true }
parking_lot = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions validator_client/initialized_validators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bincode = { workspace = true }
bls = { workspace = true }
eth2_keystore = { workspace = true }
filesystem = { workspace = true }
lighthouse_version = { workspace = true }
lockfile = { workspace = true }
metrics = { workspace = true }
parking_lot = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions validator_client/initialized_validators/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ fn build_web3_signer_client(
max_idle_connections: Option<usize>,
) -> Result<Client, Error> {
let builder = Client::builder()
.user_agent(lighthouse_version::VERSION)
.timeout(request_timeout)
.pool_idle_timeout(keep_alive_timeout)
.pool_max_idle_per_host(max_idle_connections.unwrap_or(usize::MAX));
Expand Down
3 changes: 2 additions & 1 deletion validator_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
let url = x.1;
let slot_duration = Duration::from_secs(context.eth2_config.spec.seconds_per_slot);

let mut beacon_node_http_client_builder = ClientBuilder::new();
let mut beacon_node_http_client_builder =
ClientBuilder::new().user_agent(lighthouse_version::VERSION);

// Add new custom root certificates if specified.
if let Some(certificates) = &config.beacon_nodes_tls_certs {
Expand Down