Remove uniform clearing prices from winner selection#4313
Remove uniform clearing prices from winner selection#4313jmg-duarte wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the prices field and its associated logic from the Solution struct across the winner-selection and autopilot crates. Key changes include updating the Solution constructor, removing the prices() getter, and simplifying the compute_order_score function by removing unused uniform clearing price lookups. Additionally, the clearing_prices field in the solver competition API is now defaulted to an empty map to maintain backward compatibility. I have no feedback to provide as the existing review comment was informational and did not meet the required severity or actionability thresholds defined in the style guide.
Uniform clearing prices (UCP) are no longer used in winner selection scoring since CIP-67. The variables were already prefixed with `_` (unused). This removes the dead `prices` field from the winner-selection `Solution` struct, the unused UCP lookups in `compute_order_score()`, and stops passing/populating clearing prices from the autopilot.
MartinquaXD
left a comment
There was a problem hiding this comment.
Makes sense as the lowest risk first step. 👍
Description
Uniform clearing prices (UCP) are no longer part of the core CoW Protocol scoring mechanism since CIP-67. In winner selection, the UCP variables were already dead code (
_uniform_sell_price/_uniform_buy_price). All scoring usescalculate_custom_prices_from_executed()from per-trade executed amounts instead.This is the first PR in a series to remove UCP from the entire backend. It targets only the winner-selection crate and its integration points in the autopilot, which is low-risk since the code was already unused.
Changes
prices: HashMap<Address, U256>field andprices()accessor fromwinner_selection::Solution_uniform_sell_price/_uniform_buy_pricelookups incompute_order_score()winsel::Solutionin the autopilotclearing_pricestoDefault::default()in the run loop (kept to avoid breaking the solver competition API)settlement/mod.rsto match newSolution::new()signatureHow to test
cargo nextest run -p winner-selectioncargo nextest run -p autopilotcargo clippy --locked -p winner-selection -p autopilot --all-features --all-targets -- -D warningsStaging test