Skip to content

Commit

Permalink
Merge pull request #280 from chainbound/lore/fix/current-slot-bolt-boost
Browse files Browse the repository at this point in the history
fix(bolt-boost): current slot logic
  • Loading branch information
thedevbirb authored Oct 7, 2024
2 parents 913d8b8 + b62e859 commit 0e967f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bolt-boost/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ use cb_common::{
config::PbsConfig,
constants::APPLICATION_BUILDER_DOMAIN,
pbs::{
error::{PbsError, ValidationError},
GetHeaderResponse, RelayClient, SignedExecutionPayloadHeader, EMPTY_TX_ROOT_HASH,
HEADER_SLOT_UUID_KEY, HEADER_START_TIME_UNIX_MS,
error::{PbsError, ValidationError}, GetHeaderResponse, RelayClient, SignedExecutionPayloadHeader, EMPTY_TX_ROOT_HASH, HEADER_SLOT_UUID_KEY, HEADER_START_TIME_UNIX_MS
},
signature::verify_signed_message,
types::Chain,
utils::{get_user_agent_with_version, ms_into_slot, utcnow_ms},
utils::{get_user_agent, get_user_agent_with_version, ms_into_slot, utcnow_ms},
};
use cb_pbs::{register_validator, BuilderApi, BuilderApiState, PbsState};

Expand Down Expand Up @@ -172,7 +170,13 @@ async fn get_header_with_proofs(
Path(params): Path<GetHeaderParams>,
req_headers: HeaderMap,
) -> Result<impl IntoResponse, PbsClientError> {
let slot_uuid = state.get_or_update_slot_uuid(params.slot);

let ua = get_user_agent(&req_headers);
let ms_into_slot = ms_into_slot(params.slot, state.config.chain);

info!(ua, parent_hash=%params.parent_hash, validator_pubkey=%params.pubkey, ms_into_slot);

let max_timeout_ms = state
.pbs_config()
.timeout_get_header_ms
Expand All @@ -188,8 +192,6 @@ async fn get_header_with_proofs(
return Ok(StatusCode::NO_CONTENT.into_response());
}

let (_, slot_uuid) = state.get_slot_and_uuid();

// prepare headers, except for start time which is set in `send_one_get_header`
let mut send_headers = HeaderMap::new();
// TODO: error handling
Expand Down

0 comments on commit 0e967f0

Please sign in to comment.