Skip to content

Commit e405d9d

Browse files
committed
fmt
1 parent 2433b2c commit e405d9d

2 files changed

Lines changed: 54 additions & 58 deletions

File tree

crates/cli/src/docker_init.rs

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,19 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
122122
module_envs.insert(key, val);
123123
}
124124

125-
if let Some(metrics_config) = &cb_config.metrics
126-
&& metrics_config.enabled {
127-
let host_endpoint =
128-
SocketAddr::from((metrics_config.host, metrics_port));
129-
ports.push(format!("{host_endpoint}:{metrics_port}"));
130-
warnings.push(format!(
131-
"{module_cid} has an exported port on {metrics_port}"
132-
));
133-
targets.push(format!("{host_endpoint}"));
134-
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
135-
module_envs.insert(key, val);
136-
137-
metrics_port += 1;
138-
}
125+
if let Some(metrics_config) = &cb_config.metrics &&
126+
metrics_config.enabled
127+
{
128+
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
129+
ports.push(format!("{host_endpoint}:{metrics_port}"));
130+
warnings
131+
.push(format!("{module_cid} has an exported port on {metrics_port}"));
132+
targets.push(format!("{host_endpoint}"));
133+
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
134+
module_envs.insert(key, val);
135+
136+
metrics_port += 1;
137+
}
139138

140139
if log_to_file {
141140
let (key, val) = get_env_val(LOGS_DIR_ENV, LOGS_DIR_DEFAULT);
@@ -209,17 +208,18 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
209208
if let Some((key, val)) = chain_spec_env.clone() {
210209
pbs_envs.insert(key, val);
211210
}
212-
if let Some(metrics_config) = &cb_config.metrics
213-
&& metrics_config.enabled {
214-
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
215-
ports.push(format!("{host_endpoint}:{metrics_port}"));
216-
warnings.push(format!("cb_pbs has an exported port on {metrics_port}"));
217-
targets.push(format!("{host_endpoint}"));
218-
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
219-
pbs_envs.insert(key, val);
220-
221-
metrics_port += 1;
222-
}
211+
if let Some(metrics_config) = &cb_config.metrics &&
212+
metrics_config.enabled
213+
{
214+
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
215+
ports.push(format!("{host_endpoint}:{metrics_port}"));
216+
warnings.push(format!("cb_pbs has an exported port on {metrics_port}"));
217+
targets.push(format!("{host_endpoint}"));
218+
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
219+
pbs_envs.insert(key, val);
220+
221+
metrics_port += 1;
222+
}
223223
if log_to_file {
224224
let (key, val) = get_env_val(LOGS_DIR_ENV, LOGS_DIR_DEFAULT);
225225
pbs_envs.insert(key, val);
@@ -284,16 +284,16 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
284284
if let Some((key, val)) = chain_spec_env.clone() {
285285
signer_envs.insert(key, val);
286286
}
287-
if let Some(metrics_config) = &cb_config.metrics
288-
&& metrics_config.enabled {
289-
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
290-
ports.push(format!("{host_endpoint}:{metrics_port}"));
291-
warnings
292-
.push(format!("cb_signer has an exported port on {metrics_port}"));
293-
targets.push(format!("{host_endpoint}"));
294-
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
295-
signer_envs.insert(key, val);
296-
}
287+
if let Some(metrics_config) = &cb_config.metrics &&
288+
metrics_config.enabled
289+
{
290+
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
291+
ports.push(format!("{host_endpoint}:{metrics_port}"));
292+
warnings.push(format!("cb_signer has an exported port on {metrics_port}"));
293+
targets.push(format!("{host_endpoint}"));
294+
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
295+
signer_envs.insert(key, val);
296+
}
297297
if log_to_file {
298298
let (key, val) = get_env_val(LOGS_DIR_ENV, LOGS_DIR_DEFAULT);
299299
signer_envs.insert(key, val);
@@ -418,16 +418,16 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
418418
if let Some((key, val)) = chain_spec_env.clone() {
419419
signer_envs.insert(key, val);
420420
}
421-
if let Some(metrics_config) = &cb_config.metrics
422-
&& metrics_config.enabled {
423-
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
424-
ports.push(format!("{host_endpoint}:{metrics_port}"));
425-
warnings
426-
.push(format!("cb_signer has an exported port on {metrics_port}"));
427-
targets.push(format!("{host_endpoint}"));
428-
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
429-
signer_envs.insert(key, val);
430-
}
421+
if let Some(metrics_config) = &cb_config.metrics &&
422+
metrics_config.enabled
423+
{
424+
let host_endpoint = SocketAddr::from((metrics_config.host, metrics_port));
425+
ports.push(format!("{host_endpoint}:{metrics_port}"));
426+
warnings.push(format!("cb_signer has an exported port on {metrics_port}"));
427+
targets.push(format!("{host_endpoint}"));
428+
let (key, val) = get_env_uval(METRICS_PORT_ENV, metrics_port as u64);
429+
signer_envs.insert(key, val);
430+
}
431431
if log_to_file {
432432
let (key, val) = get_env_val(LOGS_DIR_ENV, LOGS_DIR_DEFAULT);
433433
signer_envs.insert(key, val);
@@ -570,12 +570,8 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
570570
println!("Env file written to: {env_path:?}");
571571

572572
println!();
573-
println!(
574-
"Run with:\n\tdocker compose --env-file {env_path:?} -f {compose_path:?} up -d"
575-
);
576-
println!(
577-
"Stop with:\n\tdocker compose --env-file {env_path:?} -f {compose_path:?} down"
578-
);
573+
println!("Run with:\n\tdocker compose --env-file {env_path:?} -f {compose_path:?} up -d");
574+
println!("Stop with:\n\tdocker compose --env-file {env_path:?} -f {compose_path:?} down");
579575
}
580576

581577
Ok(())

crates/pbs/src/mev_boost/get_header.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ pub async fn get_header<S: BuilderApiState>(
4949
state: PbsState<S>,
5050
) -> eyre::Result<Option<GetHeaderResponse>> {
5151
let parent_block = Arc::new(RwLock::new(None));
52-
if state.extra_validation_enabled()
53-
&& let Some(rpc_url) = state.pbs_config().rpc_url.clone() {
54-
tokio::spawn(
55-
fetch_parent_block(rpc_url, params.parent_hash, parent_block.clone())
56-
.in_current_span(),
57-
);
58-
}
52+
if state.extra_validation_enabled() &&
53+
let Some(rpc_url) = state.pbs_config().rpc_url.clone()
54+
{
55+
tokio::spawn(
56+
fetch_parent_block(rpc_url, params.parent_hash, parent_block.clone()).in_current_span(),
57+
);
58+
}
5959

6060
let ms_into_slot = ms_into_slot(params.slot, state.config.chain);
6161
let (pbs_config, relays, maybe_mux_id) = state.mux_config_and_relays(&params.pubkey);

0 commit comments

Comments
 (0)