Skip to content

Commit

Permalink
Revert "Auxiliary commit to revert individual files from bb3d953"
Browse files Browse the repository at this point in the history
This reverts commit 0a61d099c825239aa24b2342bbbb7832f1b81dd0.
  • Loading branch information
vladimir-trifonov committed Aug 9, 2024
1 parent bb3d953 commit 6fa972b
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 252 deletions.
2 changes: 0 additions & 2 deletions crates/common/src/pbs/constants.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
pub const BULDER_API_PATH: &str = "/eth/v1/builder";
pub const VALIDATOR_API_PATH: &str = "/eth/v1/validator";

pub const GET_HEADER_PATH: &str = "/header/:slot/:parent_hash/:pubkey";
pub const GET_STATUS_PATH: &str = "/status";
pub const REGISTER_VALIDATOR_PATH: &str = "/validators";
pub const SUBMIT_BLOCK_PATH: &str = "/blinded_blocks";
pub const GET_PROPOSER_DUTIES_PATH: &str = "/duties/proposer/:epoch";

// https://ethereum.github.io/builder-specs/#/Builder

Expand Down
2 changes: 0 additions & 2 deletions crates/common/src/pbs/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ pub enum BuilderEvent {
MissedPayload { block_hash: B256, relays: String },
RegisterValidatorRequest(Vec<ValidatorRegistration>),
RegisterValidatorResponse,
CheckProposersSlot,
CheckProposersSlotResponse,
}

#[derive(Debug, Clone)]
Expand Down
9 changes: 1 addition & 8 deletions crates/common/src/pbs/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use serde::{Deserialize, Serialize};
use url::Url;

use super::{
constants::{
BULDER_API_PATH, GET_PROPOSER_DUTIES_PATH, GET_STATUS_PATH, REGISTER_VALIDATOR_PATH,
SUBMIT_BLOCK_PATH, VALIDATOR_API_PATH,
},
constants::{BULDER_API_PATH, GET_STATUS_PATH, REGISTER_VALIDATOR_PATH, SUBMIT_BLOCK_PATH},
HEADER_VERSION_KEY, HEAVER_VERSION_VALUE,
};
use crate::{config::RelayConfig, DEFAULT_REQUEST_TIMEOUT};
Expand Down Expand Up @@ -117,10 +114,6 @@ impl RelayClient {
pub fn submit_block_url(&self) -> String {
self.get_url(&format!("{BULDER_API_PATH}{SUBMIT_BLOCK_PATH}"))
}

pub fn get_proposer_duties_url(&self, epoch: u64) -> String {
self.get_url(&format!("{VALIDATOR_API_PATH}{GET_PROPOSER_DUTIES_PATH}/{epoch}"))
}
}

#[cfg(test)]
Expand Down
2 changes: 0 additions & 2 deletions crates/common/src/pbs/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ mod blobs_bundle;
mod execution_payload;
mod get_header;
mod kzg;
mod proposer;
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 proposer::GetProposerEpochResponse;
53 changes: 0 additions & 53 deletions crates/common/src/pbs/types/proposer.rs

This file was deleted.

10 changes: 1 addition & 9 deletions crates/pbs/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy::rpc::types::beacon::{relay::ValidatorRegistration, BlsPublicKey};
use alloy::rpc::types::beacon::relay::ValidatorRegistration;
use async_trait::async_trait;
use axum::{http::HeaderMap, Router};
use cb_common::pbs::{
Expand Down Expand Up @@ -48,14 +48,6 @@ pub trait BuilderApi<S: BuilderApiState>: 'static {
) -> eyre::Result<()> {
mev_boost::register_validator(registrations, req_headers, state).await
}

async fn check_proposers_slot(
pubkeys: Vec<BlsPublicKey>,
req_headers: HeaderMap,
state: PbsState<S>,
) -> eyre::Result<()> {
mev_boost::check_proposers_slot(pubkeys, req_headers, state).await
}
}

pub struct DefaultBuilderApi;
Expand Down
1 change: 0 additions & 1 deletion crates/pbs/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pub(crate) const STATUS_ENDPOINT_TAG: &str = "status";
pub(crate) const REGISTER_VALIDATOR_ENDPOINT_TAG: &str = "register_validator";
pub(crate) const SUBMIT_BLINDED_BLOCK_ENDPOINT_TAG: &str = "submit_blinded_block";
pub(crate) const GET_HEADER_ENDPOINT_TAG: &str = "get_header";
pub(crate) const GET_PROPOSER_DUTIES_ENDPOINT_TAG: &str = "get_proposer_duties";

/// For metrics recorded when a request times out
pub(crate) const TIMEOUT_ERROR_CODE: u16 = 555;
Expand Down
2 changes: 0 additions & 2 deletions crates/pbs/src/mev_boost/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
mod get_header;
mod proposer;
mod register_validator;
mod status;
mod submit_block;

pub use get_header::get_header;
pub use proposer::check_proposers_slot;
pub use register_validator::register_validator;
pub use status::get_status;
pub use submit_block::submit_block;
116 changes: 0 additions & 116 deletions crates/pbs/src/mev_boost/proposer.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/pbs/src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
mod get_header;
mod proposer;
mod register_validator;
mod router;
mod status;
mod submit_block;

use get_header::handle_get_header;
use proposer::handle_check_proposers_slot;
use register_validator::handle_register_validator;
pub use router::create_app_router;
use status::handle_get_status;
Expand Down
47 changes: 0 additions & 47 deletions crates/pbs/src/routes/proposer.rs

This file was deleted.

11 changes: 3 additions & 8 deletions crates/pbs/src/routes/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ use axum::{
Router,
};
use cb_common::pbs::{
BULDER_API_PATH, GET_HEADER_PATH, GET_PROPOSER_DUTIES_PATH, GET_STATUS_PATH,
REGISTER_VALIDATOR_PATH, SUBMIT_BLOCK_PATH,
BULDER_API_PATH, GET_HEADER_PATH, GET_STATUS_PATH, REGISTER_VALIDATOR_PATH, SUBMIT_BLOCK_PATH,
};

use super::{
handle_check_proposers_slot, handle_get_header, handle_get_status, handle_register_validator,
handle_submit_block,
};
use super::{handle_get_header, handle_get_status, handle_register_validator, handle_submit_block};
use crate::{
api::BuilderApi,
state::{BuilderApiState, PbsState},
Expand All @@ -21,8 +17,7 @@ pub fn create_app_router<S: BuilderApiState, T: BuilderApi<S>>(state: PbsState<S
.route(GET_HEADER_PATH, get(handle_get_header::<S, T>))
.route(GET_STATUS_PATH, get(handle_get_status::<S, T>))
.route(REGISTER_VALIDATOR_PATH, post(handle_register_validator::<S, T>))
.route(SUBMIT_BLOCK_PATH, post(handle_submit_block::<S, T>))
.route(GET_PROPOSER_DUTIES_PATH, get(handle_check_proposers_slot::<S, T>));
.route(SUBMIT_BLOCK_PATH, post(handle_submit_block::<S, T>));

let builder_api = Router::new().nest(BULDER_API_PATH, builder_routes);

Expand Down

0 comments on commit 6fa972b

Please sign in to comment.