Skip to content

driver: parallel unsupported order detection#4347

Open
metalurgical wants to merge 8 commits intocowprotocol:mainfrom
metalurgical:fix_chore_3516
Open

driver: parallel unsupported order detection#4347
metalurgical wants to merge 8 commits intocowprotocol:mainfrom
metalurgical:fix_chore_3516

Conversation

@metalurgical
Copy link
Copy Markdown

@metalurgical metalurgical commented Apr 20, 2026

Description

Make unsupported order detection read-only and execute it in parallel with sorting and data fetching. Apply filtering after update_orders to preserve existing ordering.

Changes

  • Replace filter_unsupported_orders_in_auction with unsupported_order_uids(&[Order]) -> HashSet<Uid>
  • Remove filter_unsupported_orders_in_auction
  • Remove without_unsupported_orders
  • Run unsupported detection in parallel in solve()
  • Apply unsupported filtering after updating orders
  • Update quote.rs to use unsupported_order_uids and retain
  • Includes test cases for unsupported_order_uids

How to test

cargo test -p driver

Related Issues

Fixes #3516, follow up PR to #4309 and taking into account #4329

@metalurgical metalurgical requested a review from a team as a code owner April 20, 2026 21:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the competition logic to parallelize unsupported order detection by updating the risk detector API to return a set of UIDs instead of modifying the auction in place. A critical logic error was identified in the new unsupported_order_uids method where orders flagged as unsupported by metrics are filtered out of the processing loop but never added to the removal set, effectively bypassing the intended filtering logic.

Comment thread crates/driver/src/domain/competition/risk_detector/mod.rs Outdated
@metalurgical
Copy link
Copy Markdown
Author

@jmg-duarte This is minimal, easily reviewable and I think in line with what is expected for resolving the linked issue. Just finishing off what I started.

Make unsupported order detection read-only and execute it in parallel with sorting and data fetching. Apply filtering after update_orders to preserve existing ordering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(driver): parallelize without_unsupported_orders execution

2 participants