-
Notifications
You must be signed in to change notification settings - Fork 96
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
Conversation
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs # crates/autopilot/src/domain/competition/participation_guard/mod.rs # crates/autopilot/src/run.rs
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay. I'm mostly curious if the no-settlement
mode could be merged into the low-settlement
mode.
pub struct NonSettlingSolversFinderConfig { | ||
/// Enables search of non-settling solvers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the non-settling
version if the low-settling
version could be configured to cover that as well? (e.g. ban if 0% of all solutions went through)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The low-settling version cannot quickly ban the solver if it has 3 consecutive failed settlements since the logic is focused more on a zoomed-out picture. For example, if a solver had 90% of successful settlements and suddenly shut down, the low-settling metric would require much more time to ban this solver, whereas the non-settling guard would do that right after the 3 consecutive failures.
) | ||
SELECT solver | ||
FROM solver_settlement_counts | ||
WHERE (1 - (total_settlements::decimal / NULLIF(total_wins, 0))) > $3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the NULLIF
here cause the WHERE
clause to not match if the solver didn't win any auction at all in the time frame?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to have a settlement without winning it, right?
# Conflicts: # crates/autopilot/src/infra/persistence/mod.rs
# Conflicts: # crates/autopilot/src/infra/solvers/mod.rs # crates/driver/src/infra/api/routes/mod.rs
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs # crates/autopilot/src/infra/mod.rs
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs # crates/autopilot/src/domain/competition/participation_guard/mod.rs # crates/autopilot/src/domain/competition/participation_guard/onchain.rs
# Conflicts: # crates/autopilot/src/domain/competition/participation_guard/db.rs # crates/autopilot/src/infra/mod.rs # 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 # crates/driver/src/infra/notify/notification.rs # crates/driver/src/infra/solver/dto/notification.rs # crates/solvers-dto/src/notification.rs
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).
How to test
A new SQL query test.