Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cc93ca1
driver: parallel unsupported order detection
metalurgical Apr 20, 2026
889f437
driver(tests): unsupported_order_uids test cases
metalurgical Apr 22, 2026
ae060d2
lint: run cargo fmt
metalurgical Apr 22, 2026
c5cf81d
refactor
metalurgical Apr 29, 2026
8ae2e9b
refactor: implement trait to cover simulation branch in test
metalurgical Apr 29, 2026
144212f
fix: lint
metalurgical Apr 30, 2026
8375c44
fix: lint
metalurgical Apr 30, 2026
13d0be9
Merge branch 'main' into fix_chore_3516
metalurgical May 1, 2026
5ad8f6b
update: use tokio::spawn to schedule filtering and liquidity fetching…
metalurgical May 1, 2026
b56b2b9
review: address comments
metalurgical May 4, 2026
6045c8b
refactor: simplify test
metalurgical May 5, 2026
ede7489
review: address additional review comments
metalurgical May 5, 2026
efc6d90
fix: comment
metalurgical May 5, 2026
e01df58
fix: comment
metalurgical May 5, 2026
9dac353
Merge branch 'main' into fix_chore_3516
metalurgical May 5, 2026
5707a99
Merge branch 'main' into fix_chore_3516
metalurgical May 6, 2026
c06963a
refactor: separate concerns in without_unsupported_orders
metalurgical May 6, 2026
60e766f
update
metalurgical May 7, 2026
f41f0d9
Merge branch 'main' into fix_chore_3516
metalurgical May 8, 2026
e954f2c
update: flashloan test for quote changes
metalurgical May 9, 2026
035b6bf
fix: flashloan quote test names
metalurgical May 9, 2026
9aa8acc
Merge branch 'main' into fix_chore_3516
metalurgical May 11, 2026
e17a6ae
Merge branch 'main' into fix_chore_3516
metalurgical May 11, 2026
405dfc9
Merge branch 'main' into fix_chore_3516
metalurgical May 12, 2026
be82231
Merge branch 'main' into fix_chore_3516
metalurgical May 16, 2026
e9ce935
Merge branch 'main' into fix_chore_3516
metalurgical May 21, 2026
b6293f1
Merge branch 'main' into fix_chore_3516
metalurgical May 22, 2026
0e22fb0
Merge branch 'main' into fix_chore_3516
metalurgical May 24, 2026
fcc1f50
Merge branch 'main' into fix_chore_3516
metalurgical May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions crates/driver/src/domain/competition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use {
time::Instant,
},
tokio::{sync::mpsc, task},
tracing::{Instrument, instrument},
tracing::Instrument,
};

pub mod auction;
Expand Down Expand Up @@ -339,11 +339,11 @@ impl Competition {
Self::sort_orders(auction, solver_address, order_sorting_strategies)
});

// We can sort the orders and fetch auction data in parallel
// We can sort the orders and fetch auction data in parallel.
let (auction, balances, app_data) =
tokio::join!(sort_orders_future, tasks.balances, tasks.app_data);

let auction = Self::run_blocking_with_timer("update_orders", move || {
let mut auction = Self::run_blocking_with_timer("update_orders", move || {
// Same as before with sort_orders, we use spawn_blocking() because a lot of CPU
// bound computations are happening and we want to avoid blocking
// the runtime.
Expand All @@ -352,14 +352,21 @@ impl Competition {
.await;

// We can run bad token filtering and liquidity fetching in parallel
let (liquidity, auction) = tokio::join!(
let (_, liquidity) = tokio::join!(
async {
self.risk_detector
.filter_unsupported_orders_in_auction(
&mut auction,
self.solver.config().flashloans_enabled,
)
.await
},
async {
match self.solver.liquidity() {
solver::Liquidity::Fetch => tasks.liquidity.await,
solver::Liquidity::Skip => Arc::new(Vec::new()),
}
},
self.without_unsupported_orders(auction)
}
);

let elapsed = start.elapsed();
Expand Down Expand Up @@ -951,16 +958,6 @@ impl Competition {
}
Ok(())
}

#[instrument(skip_all)]
async fn without_unsupported_orders(&self, mut auction: Auction) -> Auction {
if !self.solver.config().flashloans_enabled {
auction.orders.retain(|o| o.app_data.flashloan().is_none());
}
self.risk_detector
.filter_unsupported_orders_in_auction(auction)
.await
}
}

const MAX_SOLUTIONS_TO_MERGE: usize = 10;
Expand Down
Loading
Loading