diff --git a/api/signer-api.yml b/api/signer-api.yml index d5a196c1..757b9d6c 100644 --- a/api/signer-api.yml +++ b/api/signer-api.yml @@ -186,7 +186,7 @@ paths: scheme: "ecdsa" responses: "200": - description: Successs + description: Success content: application/json: schema: diff --git a/crates/common/src/config/constants.rs b/crates/common/src/config/constants.rs index e559b569..d94b0f5d 100644 --- a/crates/common/src/config/constants.rs +++ b/crates/common/src/config/constants.rs @@ -1,4 +1,4 @@ -///////////////////////// COMMMON ///////////////////////// +///////////////////////// COMMON ///////////////////////// /// Path to the main toml config file pub const CONFIG_ENV: &str = "CB_CONFIG"; diff --git a/crates/common/src/signer/loader.rs b/crates/common/src/signer/loader.rs index 47fac883..9f589b82 100644 --- a/crates/common/src/signer/loader.rs +++ b/crates/common/src/signer/loader.rs @@ -65,7 +65,7 @@ impl<'de> Deserialize<'de> for FileKey { let s = String::deserialize(deserializer)?; let s = alloy::primitives::hex::decode(s.trim_start_matches("0x")) .map_err(de::Error::custom)?; - let bytes: [u8; 32] = s.try_into().map_err(|_| de::Error::custom("wrong lenght"))?; + let bytes: [u8; 32] = s.try_into().map_err(|_| de::Error::custom("wrong length"))?; Ok(FileKey { secret_key: bytes }) } diff --git a/crates/common/src/utils.rs b/crates/common/src/utils.rs index 74e7951f..c123f217 100644 --- a/crates/common/src/utils.rs +++ b/crates/common/src/utils.rs @@ -23,8 +23,8 @@ use crate::{ const MILLIS_PER_SECOND: u64 = 1_000; pub fn timestamp_of_slot_start_millis(slot: u64, chain: Chain) -> u64 { - let seconds_since_genesis = chain.genesis_time_sec() + slot * chain.slot_time_sec(); - seconds_since_genesis * MILLIS_PER_SECOND + let slot_start_seconds = chain.genesis_time_sec() + slot * chain.slot_time_sec(); + slot_start_seconds * MILLIS_PER_SECOND } pub fn ms_into_slot(slot: u64, chain: Chain) -> u64 { let slot_start_ms = timestamp_of_slot_start_millis(slot, chain); diff --git a/crates/pbs/src/error.rs b/crates/pbs/src/error.rs index b085114d..74fc7004 100644 --- a/crates/pbs/src/error.rs +++ b/crates/pbs/src/error.rs @@ -10,7 +10,7 @@ pub enum PbsClientError { impl PbsClientError { pub fn status_code(&self) -> StatusCode { match self { - PbsClientError::NoResponse => StatusCode::SERVICE_UNAVAILABLE, + PbsClientError::NoResponse => StatusCode::BAD_GATEWAY, PbsClientError::NoPayload => StatusCode::BAD_GATEWAY, } } diff --git a/crates/pbs/src/mev_boost/get_header.rs b/crates/pbs/src/mev_boost/get_header.rs index c83e77e4..97a328ed 100644 --- a/crates/pbs/src/mev_boost/get_header.rs +++ b/crates/pbs/src/mev_boost/get_header.rs @@ -324,7 +324,7 @@ fn validate_header( return Err(ValidationError::EmptyTxRoot); } - if value <= minimum_bid_wei { + if value < minimum_bid_wei { return Err(ValidationError::BidTooLow { min: minimum_bid_wei, got: value }); } @@ -370,7 +370,7 @@ mod tests { let parent_hash = B256::from_slice(&[1; 32]); let chain = Chain::Holesky; - let min_bid = U256::ZERO; + let min_bid = U256::from(10); let secret_key = min_pk::SecretKey::from_bytes(&[ 0, 136, 227, 100, 165, 57, 106, 129, 181, 15, 235, 189, 200, 120, 70, 99, 251, 144, @@ -438,7 +438,7 @@ mod tests { Err(ValidationError::BidTooLow { min: min_bid, got: U256::ZERO }) ); - mock_header.message.value = U256::from(1); + mock_header.message.value = U256::from(11); mock_header.message.pubkey = pubkey; diff --git a/crates/pbs/src/mev_boost/register_validator.rs b/crates/pbs/src/mev_boost/register_validator.rs index 6c124693..fa6ef3a1 100644 --- a/crates/pbs/src/mev_boost/register_validator.rs +++ b/crates/pbs/src/mev_boost/register_validator.rs @@ -111,7 +111,7 @@ async fn send_register_validator( code: code.as_u16(), }; - // error here since we check if any success aboves + // error here since we check if any success above error!(%err, "failed registration"); return Err(err); }; diff --git a/crates/signer/src/service.rs b/crates/signer/src/service.rs index 153e75b7..6e27e590 100644 --- a/crates/signer/src/service.rs +++ b/crates/signer/src/service.rs @@ -35,7 +35,7 @@ pub struct SigningService; #[derive(Clone)] struct SigningState { - /// Mananger handling different signing methods + /// Manager handling different signing methods manager: Arc>, /// Map of JWTs to module ids. This also acts as registry of all modules /// running