mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Add builder header timeout flag (#5857)
* fix bitvector test random impl * add a new flag that allows for configuring the timeout for get builder header api calls * make cli * add upper limit check, changes based on feedback * update cli * capitalization * cli fix
This commit is contained in:
@@ -370,6 +370,9 @@ pub struct Config {
|
||||
pub execution_endpoint: Option<SensitiveUrl>,
|
||||
/// Endpoint urls for services providing the builder api.
|
||||
pub builder_url: Option<SensitiveUrl>,
|
||||
/// The timeout value used when making a request to fetch a block header
|
||||
/// from the builder api.
|
||||
pub builder_header_timeout: Option<Duration>,
|
||||
/// User agent to send with requests to the builder API.
|
||||
pub builder_user_agent: Option<String>,
|
||||
/// JWT secret for the above endpoint running the engine api.
|
||||
@@ -400,6 +403,7 @@ impl<E: EthSpec> ExecutionLayer<E> {
|
||||
execution_endpoint: url,
|
||||
builder_url,
|
||||
builder_user_agent,
|
||||
builder_header_timeout,
|
||||
secret_file,
|
||||
suggested_fee_recipient,
|
||||
jwt_id,
|
||||
@@ -469,7 +473,7 @@ impl<E: EthSpec> ExecutionLayer<E> {
|
||||
};
|
||||
|
||||
if let Some(builder_url) = builder_url {
|
||||
el.set_builder_url(builder_url, builder_user_agent)?;
|
||||
el.set_builder_url(builder_url, builder_user_agent, builder_header_timeout)?;
|
||||
}
|
||||
|
||||
Ok(el)
|
||||
@@ -491,9 +495,14 @@ impl<E: EthSpec> ExecutionLayer<E> {
|
||||
&self,
|
||||
builder_url: SensitiveUrl,
|
||||
builder_user_agent: Option<String>,
|
||||
builder_header_timeout: Option<Duration>,
|
||||
) -> Result<(), Error> {
|
||||
let builder_client = BuilderHttpClient::new(builder_url.clone(), builder_user_agent)
|
||||
.map_err(Error::Builder)?;
|
||||
let builder_client = BuilderHttpClient::new(
|
||||
builder_url.clone(),
|
||||
builder_user_agent,
|
||||
builder_header_timeout,
|
||||
)
|
||||
.map_err(Error::Builder)?;
|
||||
info!(
|
||||
self.log(),
|
||||
"Using external block builder";
|
||||
|
||||
Reference in New Issue
Block a user