Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of accepted proposed solutions #3078

Merged
merged 3 commits into from
Oct 24, 2024
Merged

Conversation

sunce86
Copy link
Contributor

@sunce86 sunce86 commented Oct 22, 2024

Description

Fixes #3063

With full colocation, we need to have a limit on the number of solutions a solver can propose per auction.

Changes

  • Added configuration parameter for limiting the number of proposed solutions per solver
  • Filter out solutions that don't satisfy the new condition.

How to test

Existing tests.

@sunce86 sunce86 added the E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details label Oct 22, 2024
@sunce86 sunce86 self-assigned this Oct 22, 2024
@sunce86 sunce86 requested a review from a team as a code owner October 22, 2024 12:59
let mut counter = HashMap::new();
solutions.retain(|participant| {
let driver = participant.driver().name.clone();
let count = counter.entry(driver).or_insert(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you could extend it with .and_modify(|counter| *counter+=1)

@sunce86 sunce86 enabled auto-merge (squash) October 24, 2024 14:56
@sunce86 sunce86 merged commit 516a4e0 into main Oct 24, 2024
11 checks passed
@sunce86 sunce86 deleted the limit-proposed-solutions branch October 24, 2024 15:01
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add max allowed solutions per solver
3 participants