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

Ban solvers based on the settlements success rate #3263

Open
wants to merge 29 commits into
base: notify-banned-solvers
Choose a base branch
from

Conversation

squadgazzz
Copy link
Contributor

@squadgazzz squadgazzz commented Jan 31, 2025

Description

Another follow-up to #3257, which implements a suggested statistic-based approach #3257 (comment).

Changes

Introduces an additional DB-based validator, which searches for solvers with less than 10%(configurable) of successful settlements among 100 last auctions(configurable).

  • Updated config.
  • New notification details.
  • Some refactoring.

How to test

A new SQL query test.

Copy link

github-actions bot commented Jan 31, 2025

Reminder: Please consider backward compatibility when modifying the API specification.
If breaking changes are unavoidable, ensure:

  • You explicitly pointed out breaking changes.
  • You communicate the changes to affected teams (at least Frontend team and SAFE team).
  • You provide proper versioning and migration mechanisms.

Resolved

@squadgazzz squadgazzz changed the base branch from main to notify-banned-solvers January 31, 2025 18:11
@squadgazzz squadgazzz changed the title Db statistics based guard Ban solvers based on the settlements success rate Jan 31, 2025
@squadgazzz squadgazzz marked this pull request as ready for review January 31, 2025 18:12
@squadgazzz squadgazzz requested a review from a team as a code owner January 31, 2025 18:12
Copy link
Contributor

@fleupold fleupold left a comment

Choose a reason for hiding this comment

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

Has this change been discussed with @harisang ? It's quite a steep intrusion into the arbitration cycle (any bonded solver is allowed to participate) and may require a CiP if we decide to selectively exclude solvers from the competition.

pub struct LowSettlingValidatorConfig {
/// Enables search of non-settling solvers.
#[clap(
id = "low_settling_solvers_blacklisting_enabled",
Copy link
Contributor

Choose a reason for hiding this comment

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

what is id used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default, clap uses the variable name as an ID. For this particular case, since all the params are flattened, there will be 2 identical IDs for the enabled fields, so clap fails to parse the args without this annotation.

# Conflicts:
#	crates/autopilot/src/domain/competition/participation_guard/db.rs
#	crates/autopilot/src/domain/mod.rs
#	crates/autopilot/src/infra/solvers/dto/notify.rs
#	crates/driver/src/infra/api/routes/notify/dto/notify_request.rs
#	crates/driver/src/infra/solver/dto/notification.rs
# Conflicts:
#	crates/autopilot/src/infra/solvers/dto/notify.rs
#	crates/autopilot/src/infra/solvers/mod.rs
#	crates/driver/src/infra/api/routes/notify/dto/notify_request.rs
# Conflicts:
#	crates/autopilot/src/database/competition.rs
#	crates/autopilot/src/domain/competition/participation_guard/db.rs
#	crates/autopilot/src/domain/competition/participation_guard/mod.rs
# Conflicts:
#	crates/autopilot/src/arguments.rs
#	crates/autopilot/src/domain/competition/participation_guard/db.rs
#	crates/autopilot/src/domain/competition/participation_guard/mod.rs
#	crates/autopilot/src/infra/mod.rs
#	crates/autopilot/src/infra/solvers/mod.rs
# Conflicts:
#	crates/autopilot/src/domain/competition/participation_guard/db.rs
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.

4 participants