diff --git a/crates/autopilot/src/domain/competition/mod.rs b/crates/autopilot/src/domain/competition/mod.rs index e7bd8e0166..e87f19efa2 100644 --- a/crates/autopilot/src/domain/competition/mod.rs +++ b/crates/autopilot/src/domain/competition/mod.rs @@ -80,14 +80,6 @@ pub struct TradedOrder { pub struct Score(eth::Ether); impl Score { - pub fn try_new(score: eth::Ether) -> Result { - if score.0.is_zero() { - Err(ZeroScore) - } else { - Ok(Self(score)) - } - } - pub fn get(&self) -> ð::Ether { &self.0 } @@ -112,15 +104,3 @@ impl num::CheckedSub for Score { self.0.checked_sub(&v.0).map(Score) } } - -#[derive(Debug, thiserror::Error)] -#[error("the solver proposed a 0-score solution")] -pub struct ZeroScore; - -#[derive(Debug, thiserror::Error)] -pub enum SolutionError { - #[error(transparent)] - ZeroScore(#[from] ZeroScore), - #[error("the solver got deny listed")] - SolverDenyListed, -} diff --git a/crates/autopilot/src/infra/solvers/dto/solve.rs b/crates/autopilot/src/infra/solvers/dto/solve.rs index c086a5c596..a1bdfc36f8 100644 --- a/crates/autopilot/src/infra/solvers/dto/solve.rs +++ b/crates/autopilot/src/infra/solvers/dto/solve.rs @@ -163,9 +163,7 @@ impl InjectIntoHttpRequest for Request { } impl Response { - pub fn into_domain( - self, - ) -> Vec> { + pub fn into_domain(self) -> Vec { if self .solutions .iter() @@ -203,17 +201,15 @@ pub struct Token { } impl Solution { - pub fn into_domain( - self, - ) -> Result { - Ok(domain::competition::Solution::new( + pub fn into_domain(self) -> domain::competition::Solution { + domain::competition::Solution::new( self.solution_id, self.submission_address, self.orders .into_iter() .map(|(o, amounts)| (o.into(), amounts.into_domain())) .collect(), - )) + ) } } diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index c3415993f5..4603e999ab 100644 --- a/crates/autopilot/src/run_loop.rs +++ b/crates/autopilot/src/run_loop.rs @@ -7,7 +7,6 @@ use { competition::{ self, Solution, - SolutionError, Unscored, winner_selection::{self, Ranking}, }, @@ -670,16 +669,9 @@ impl RunLoop { solutions .into_iter() - .filter_map(|solution| match solution { - Ok(solution) => { - Metrics::solution_ok(&driver); - Some(competition::Bid::new(solution, driver.clone())) - } - Err(err) => { - Metrics::solution_err(&driver, &err); - tracing::debug!(?err, driver = %driver.name, "invalid proposed solution"); - None - } + .map(|solution| { + Metrics::solution_ok(&driver); + competition::Bid::new(solution, driver.clone()) }) .collect() } @@ -689,8 +681,7 @@ impl RunLoop { &self, driver: Arc, request: solve::Request, - ) -> Result>, SolveError> - { + ) -> Result, SolveError> { let (can_participate, response) = { let driver = driver.clone(); let eth = self.eth.clone(); @@ -1097,17 +1088,6 @@ impl Metrics { .inc(); } - fn solution_err(driver: &infra::Driver, err: &SolutionError) { - let label = match err { - SolutionError::ZeroScore(_) => "zero_score", - SolutionError::SolverDenyListed => "solver_deny_listed", - }; - Self::get() - .solutions - .with_label_values(&[driver.name.as_str(), label]) - .inc(); - } - fn settle_ok(driver: &infra::Driver, settled_order_count: usize, elapsed: Duration) { Self::get() .settle diff --git a/crates/autopilot/src/shadow.rs b/crates/autopilot/src/shadow.rs index 0c7666307d..aed38bdd27 100644 --- a/crates/autopilot/src/shadow.rs +++ b/crates/autopilot/src/shadow.rs @@ -26,7 +26,6 @@ use { chrono::Utc, eth_domain_types::WrappedNativeToken, ethrpc::block_stream::CurrentBlockWatcher, - itertools::Itertools, num::{CheckedSub, Saturating}, shared::token_list::AutoUpdatingTokenList, std::{num::NonZeroUsize, sync::Arc, time::Duration}, @@ -228,11 +227,6 @@ impl RunLoop { } }; - let (solutions, errs): (Vec<_>, Vec<_>) = solutions.into_iter().partition_result(); - if !errs.is_empty() { - tracing::debug!(len = errs.len(), ?errs, "dropping solutions with errors"); - } - futures::future::join_all(solutions.iter().map(|s| async { let response = driver.reveal(reveal::Request { solution_id: s.id(),