Skip to content
4 changes: 2 additions & 2 deletions crates/common/src/pbs/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tokio::net::TcpListener;
use tracing::{error, info, trace};

use super::{
GetHeaderParams, GetHeaderReponse, SignedBlindedBeaconBlock, SubmitBlindedBlockResponse,
GetHeaderParams, GetHeaderResponse, SignedBlindedBeaconBlock, SubmitBlindedBlockResponse,
};
use crate::{
config::{load_env_var, BUILDER_SERVER_ENV},
Expand All @@ -25,7 +25,7 @@ use crate::{
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum BuilderEvent {
GetHeaderRequest(GetHeaderParams),
GetHeaderResponse(Box<Option<GetHeaderReponse>>),
GetHeaderResponse(Box<Option<GetHeaderResponse>>),
GetStatusEvent,
GetStatusResponse,
SubmitBlockRequest(Box<SignedBlindedBeaconBlock>),
Expand Down
8 changes: 4 additions & 4 deletions crates/common/src/pbs/types/get_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub struct GetHeaderParams {
}

/// Returned by relay in get_header
pub type GetHeaderReponse = VersionedResponse<SignedExecutionPayloadHeader>;
pub type GetHeaderResponse = VersionedResponse<SignedExecutionPayloadHeader>;

impl GetHeaderReponse {
impl GetHeaderResponse {
pub fn block_hash(&self) -> B256 {
self.data.message.header.block_hash
}
Expand Down Expand Up @@ -68,7 +68,7 @@ impl ExecutionPayloadHeaderMessage {
mod tests {
use alloy::primitives::U256;

use super::GetHeaderReponse;
use super::GetHeaderResponse;
use crate::{signature::verify_signed_builder_message, types::Chain};

#[test]
Expand Down Expand Up @@ -111,7 +111,7 @@ mod tests {
}
}"#;

let parsed = serde_json::from_str::<GetHeaderReponse>(&data).unwrap().data;
let parsed = serde_json::from_str::<GetHeaderResponse>(&data).unwrap().data;

assert_eq!(parsed.message.value(), U256::from(4293912964927787u64));

Expand Down
6 changes: 4 additions & 2 deletions crates/common/src/pbs/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ mod spec;
mod utils;

pub use beacon_block::{SignedBlindedBeaconBlock, SubmitBlindedBlockResponse};
pub use execution_payload::EMPTY_TX_ROOT_HASH;
pub use get_header::{GetHeaderParams, GetHeaderReponse, SignedExecutionPayloadHeader};
pub use execution_payload::{Transaction, EMPTY_TX_ROOT_HASH};
pub use get_header::{GetHeaderParams, GetHeaderResponse, SignedExecutionPayloadHeader};
pub use spec::{DenebSpec, EthSpec};
pub use utils::{Version, VersionedResponse};
4 changes: 2 additions & 2 deletions crates/pbs/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloy::rpc::types::beacon::relay::ValidatorRegistration;
use async_trait::async_trait;
use axum::{http::HeaderMap, Router};
use cb_common::pbs::{
GetHeaderParams, GetHeaderReponse, SignedBlindedBeaconBlock, SubmitBlindedBlockResponse,
GetHeaderParams, GetHeaderResponse, SignedBlindedBeaconBlock, SubmitBlindedBlockResponse,
};

use crate::{
Expand All @@ -22,7 +22,7 @@ pub trait BuilderApi<S: BuilderApiState>: 'static {
params: GetHeaderParams,
req_headers: HeaderMap,
state: PbsState<S>,
) -> eyre::Result<Option<GetHeaderReponse>> {
) -> eyre::Result<Option<GetHeaderResponse>> {
mev_boost::get_header(params, req_headers, state).await
}

Expand Down
10 changes: 5 additions & 5 deletions crates/pbs/src/mev_boost/get_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use cb_common::{
config::PbsConfig,
pbs::{
error::{PbsError, ValidationError},
GetHeaderParams, GetHeaderReponse, RelayClient, SignedExecutionPayloadHeader,
GetHeaderParams, GetHeaderResponse, RelayClient, SignedExecutionPayloadHeader,
EMPTY_TX_ROOT_HASH, HEADER_SLOT_UUID_KEY, HEADER_START_TIME_UNIX_MS,
},
signature::verify_signed_builder_message,
Expand All @@ -34,7 +34,7 @@ pub async fn get_header<S: BuilderApiState>(
params: GetHeaderParams,
req_headers: HeaderMap,
state: PbsState<S>,
) -> eyre::Result<Option<GetHeaderReponse>> {
) -> eyre::Result<Option<GetHeaderResponse>> {
let ms_into_slot = ms_into_slot(params.slot, state.config.chain);
let max_timeout_ms = state
.pbs_config()
Expand Down Expand Up @@ -97,7 +97,7 @@ async fn send_timed_get_header(
headers: HeaderMap,
ms_into_slot: u64,
mut timeout_left_ms: u64,
) -> Result<Option<GetHeaderReponse>, PbsError> {
) -> Result<Option<GetHeaderResponse>, PbsError> {
let url = relay.get_header_url(params.slot, params.parent_hash, params.pubkey)?;

if relay.config.enable_timing_games {
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn send_one_get_header(
skip_sigverify: bool,
min_bid_wei: U256,
mut req_config: RequestConfig,
) -> Result<(u64, Option<GetHeaderReponse>), PbsError> {
) -> Result<(u64, Option<GetHeaderResponse>), PbsError> {
// the timestamp in the header is the consensus block time which is fixed,
// use the beginning of the request as proxy to make sure we use only the
// last one received
Expand Down Expand Up @@ -257,7 +257,7 @@ async fn send_one_get_header(
return Ok((start_request_time, None));
}

let get_header_response: GetHeaderReponse = serde_json::from_slice(&response_bytes)?;
let get_header_response: GetHeaderResponse = serde_json::from_slice(&response_bytes)?;

debug!(
latency = ?request_latency,
Expand Down
6 changes: 3 additions & 3 deletions crates/pbs/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
use alloy::{primitives::B256, rpc::types::beacon::BlsPublicKey};
use cb_common::{
config::{PbsConfig, PbsModuleConfig},
pbs::{BuilderEvent, GetHeaderReponse, RelayClient},
pbs::{BuilderEvent, GetHeaderResponse, RelayClient},
};
use dashmap::DashMap;
use uuid::Uuid;
Expand All @@ -25,7 +25,7 @@ pub struct PbsState<S: BuilderApiState = ()> {
/// Info about the latest slot and its uuid
current_slot_info: Arc<Mutex<(u64, Uuid)>>,
/// Keeps track of which relays delivered which block for which slot
bid_cache: Arc<DashMap<u64, Vec<GetHeaderReponse>>>,
bid_cache: Arc<DashMap<u64, Vec<GetHeaderResponse>>>,
}

impl PbsState<()> {
Expand Down Expand Up @@ -88,7 +88,7 @@ where

/// Add some bids to the cache, the bids are all assumed to be for the
/// provided slot Returns the bid with the max value
pub fn add_bids(&self, slot: u64, bids: Vec<GetHeaderReponse>) -> Option<GetHeaderReponse> {
pub fn add_bids(&self, slot: u64, bids: Vec<GetHeaderResponse>) -> Option<GetHeaderResponse> {
let mut slot_entry = self.bid_cache.entry(slot).or_default();
slot_entry.extend(bids);
slot_entry.iter().max_by_key(|bid| bid.value()).cloned()
Expand Down
4 changes: 2 additions & 2 deletions tests/src/mock_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use axum::{
};
use cb_common::{
pbs::{
GetHeaderParams, GetHeaderReponse, SubmitBlindedBlockResponse, BUILDER_API_PATH,
GetHeaderParams, GetHeaderResponse, SubmitBlindedBlockResponse, BUILDER_API_PATH,
GET_HEADER_PATH, GET_STATUS_PATH, REGISTER_VALIDATOR_PATH, SUBMIT_BLOCK_PATH,
},
signer::ConsensusSigner,
Expand Down Expand Up @@ -78,7 +78,7 @@ async fn handle_get_header(
) -> Response {
state.received_get_header.fetch_add(1, Ordering::Relaxed);

let mut response = GetHeaderReponse::default();
let mut response = GetHeaderResponse::default();
response.data.message.header.parent_hash = parent_hash;
response.data.message.header.block_hash.0[0] = 1;
response.data.message.set_value(U256::from(10));
Expand Down
4 changes: 2 additions & 2 deletions tests/src/mock_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloy::{
primitives::B256,
rpc::types::beacon::{relay::ValidatorRegistration, BlsPublicKey},
};
use cb_common::pbs::{GetHeaderReponse, RelayClient, SignedBlindedBeaconBlock};
use cb_common::pbs::{GetHeaderResponse, RelayClient, SignedBlindedBeaconBlock};
use reqwest::Error;

use crate::utils::generate_mock_relay;
Expand All @@ -19,7 +19,7 @@ impl MockValidator {
pub async fn do_get_header(&self) -> Result<(), Error> {
let url = self.comm_boost.get_header_url(0, B256::ZERO, BlsPublicKey::ZERO).unwrap();
let res = self.comm_boost.client.get(url).send().await?.bytes().await?;
assert!(serde_json::from_slice::<GetHeaderReponse>(&res).is_ok());
assert!(serde_json::from_slice::<GetHeaderResponse>(&res).is_ok());

Ok(())
}
Expand Down