Skip to content

Commit

Permalink
refactor auctioneer into service and submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Apr 29, 2024
1 parent 3311892 commit 13303b7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions mev-build-rs/src/auctioneer/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mod auction_schedule;
mod service;

pub use service::{AuctionContext, Config, Service};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
auction_schedule::{AuctionSchedule, Proposals, Proposer, RelaySet},
auctioneer::auction_schedule::{AuctionSchedule, Proposals, Proposer, RelaySet},
bidder::{BidStatus, Message as BidderMessage},
payload::builder_attributes::{BuilderPayloadBuilderAttributes, ProposalAttributes},
service::ClockMessage,
Expand Down Expand Up @@ -86,7 +86,7 @@ pub struct Config {
pub relays: Vec<String>,
}

pub struct Auctioneer<
pub struct Service<
Engine: EngineTypes<
PayloadBuilderAttributes = BuilderPayloadBuilderAttributes,
BuiltPayload = EthBuiltPayload,
Expand All @@ -112,7 +112,7 @@ impl<
PayloadBuilderAttributes = BuilderPayloadBuilderAttributes,
BuiltPayload = EthBuiltPayload,
> + 'static,
> Auctioneer<Engine>
> Service<Engine>
{
pub fn new(
clock: broadcast::Receiver<ClockMessage>,
Expand Down
1 change: 0 additions & 1 deletion mev-build-rs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod auction_schedule;
mod auctioneer;
mod bidder;
mod error;
Expand Down
6 changes: 3 additions & 3 deletions mev-build-rs/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
auctioneer::{Auctioneer, Config as AuctioneerConfig},
auctioneer::{Config as AuctioneerConfig, Service as Auctioneer},
bidder::{Config as BidderConfig, Service as Bidder},
node::BuilderNode,
payload::{
Expand Down Expand Up @@ -64,7 +64,7 @@ pub struct Services<
pub context: Arc<Context>,
}

pub async fn construct<
pub async fn construct_services<
Engine: EngineTypes<
PayloadBuilderAttributes = BuilderPayloadBuilderAttributes,
BuiltPayload = EthBuiltPayload,
Expand Down Expand Up @@ -140,7 +140,7 @@ pub async fn launch(
let task_executor = handle.node.task_executor.clone();
let payload_builder = handle.node.payload_builder.clone();
let Services { auctioneer, bidder, clock, clock_tx, context } =
construct(network, config, task_executor, payload_builder).await?;
construct_services(network, config, task_executor, payload_builder).await?;

handle.node.task_executor.spawn_critical_blocking("mev-builder/auctioneer", auctioneer.spawn());
handle.node.task_executor.spawn_critical_blocking("mev-builder/bidder", bidder.spawn());
Expand Down

0 comments on commit 13303b7

Please sign in to comment.