Skip to content

Commit 978a7ab

Browse files
committed
removed redundant param
1 parent d22b1ab commit 978a7ab

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

config.example.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ skip_sigverify = true
1010
min_bid_eth = 0.0
1111

1212
late_in_slot_time_ms = 2000
13-
skip_header_late_in_slot = true
1413

1514
[[relays]]
1615
id = "example-relay"

crates/common/src/pbs/config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,4 @@ pub struct PbsConfig {
5252
/// How late in the slot we consider to be "late"
5353
#[serde(default = "default_u64::<LATE_IN_SLOT_TIME_MS>")]
5454
pub late_in_slot_time_ms: u64,
55-
/// If it's too late in the slot, skip get header and force local build
56-
#[serde(default = "default_bool::<false>")]
57-
pub skip_header_late_in_slot: bool,
5855
}

crates/pbs/src/mev_boost/get_header.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,24 @@ pub async fn get_header<S: BuilderApiState>(
3232
req_headers: HeaderMap,
3333
state: PbsState<S>,
3434
) -> eyre::Result<Option<GetHeaderReponse>> {
35-
let (_, slot_uuid) = state.get_slot_and_uuid();
36-
3735
let ms_into_slot = ms_into_slot(params.slot, state.config.chain);
3836
let max_timeout_ms = state
3937
.pbs_config()
4038
.timeout_get_header_ms
4139
.min(state.pbs_config().late_in_slot_time_ms.saturating_sub(ms_into_slot));
4240

41+
if max_timeout_ms == 0 {
42+
warn!(
43+
ms_into_slot,
44+
threshold = state.pbs_config().late_in_slot_time_ms,
45+
"late in slot, skipping relay requests"
46+
);
47+
48+
return Ok(None)
49+
}
50+
51+
let (_, slot_uuid) = state.get_slot_and_uuid();
52+
4353
// prepare headers, except for start time which is set in `send_one_get_header`
4454
let mut send_headers = HeaderMap::new();
4555
send_headers.insert(HEADER_SLOT_UUID_KEY, HeaderValue::from_str(&slot_uuid.to_string())?);

crates/pbs/src/routes/get_header.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use axum::{
66
};
77
use cb_common::utils::{get_user_agent, ms_into_slot};
88
use reqwest::StatusCode;
9-
use tracing::{error, info, warn};
9+
use tracing::{error, info};
1010
use uuid::Uuid;
1111

1212
use crate::{
@@ -31,16 +31,6 @@ pub async fn handle_get_header<S: BuilderApiState, T: BuilderApi<S>>(
3131
let ms_into_slot = ms_into_slot(params.slot, state.config.chain);
3232

3333
info!(?ua, parent_hash=%params.parent_hash, validator_pubkey=%params.pubkey, ms_into_slot);
34-
if state.is_late_in_slot(ms_into_slot) && state.pbs_config().skip_header_late_in_slot {
35-
// too late into slot, force local build
36-
warn!(
37-
ms_into_slot,
38-
threshold = state.pbs_config().late_in_slot_time_ms,
39-
"late in slot, skipping relay requests"
40-
);
41-
BEACON_NODE_STATUS.with_label_values(&["204", GET_HEADER_ENDPOINT_TAG]).inc();
42-
return Ok(StatusCode::NO_CONTENT.into_response());
43-
}
4434

4535
match T::get_header(params, req_headers, state.clone()).await {
4636
Ok(res) => {

crates/pbs/src/state.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ where
8282
*guard
8383
}
8484

85-
pub fn is_late_in_slot(&self, ms_into_slot: u64) -> bool {
86-
ms_into_slot > self.config.pbs_config.late_in_slot_time_ms
87-
}
88-
8985
// Getters
9086
pub fn pbs_config(&self) -> &PbsConfig {
9187
&self.config.pbs_config

0 commit comments

Comments
 (0)