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

Add driver submission address to the autopilot #3065

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

m-lord-renkse
Copy link
Contributor

@m-lord-renkse m-lord-renkse commented Oct 17, 2024

Description

This PR should solve: #3045 and #2780

Changes

  • Add driver submission address to the autopilot
  • Do not request /solve to drivers which have been deny listed
  • Filter the results by the driver submission address

How to test

  1. Regression test (e2e modified to use the new config)
  2. e2e test to check the filtering works

Related Issues

Fixes #3045
Fixes #2780

@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch 5 times, most recently from faf5c2a to b52a744 Compare October 17, 2024 11:59
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from b52a744 to 42bf53a Compare October 17, 2024 12:00
@m-lord-renkse m-lord-renkse marked this pull request as ready for review October 17, 2024 12:06
@m-lord-renkse m-lord-renkse requested a review from a team as a code owner October 17, 2024 12:06
Copy link
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

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

The code to make things optional is pretty convoluted. Let's make it required from the start.
Would also be good to prepare the infra PR in the meantime.

crates/autopilot/src/run_loop.rs Outdated Show resolved Hide resolved
crates/autopilot/src/run_loop.rs Outdated Show resolved Hide resolved
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch 10 times, most recently from ef21e9d to 4910d52 Compare October 17, 2024 16:11
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from 4910d52 to df34e7e Compare October 17, 2024 16:18
Copy link
Contributor

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

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

Can we also add a manual step (to the tutorial for solver submission keys rotation in notion) to

  1. Update the infra configuration for autopilot
  2. To make sure the solver switched their submission to use new account

crates/autopilot/src/run_loop.rs Outdated Show resolved Hide resolved
crates/autopilot/src/arguments.rs Outdated Show resolved Hide resolved
crates/autopilot/src/infra/solvers/mod.rs Outdated Show resolved Hide resolved
crates/autopilot/src/infra/solvers/mod.rs Outdated Show resolved Hide resolved
.await
.with_context(|| {
let msg = format!("Unable to load KMS account {:?}", key_id);
tracing::error!(?name, msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: maybe move out tracing::error to the caller so that message formatting is cleaner

.await
.with_context(|| format!("Unable to load KMS account {:?}", key_id))?;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sunce86 I thought of that, but then we need to have the same trace in two places in the code, potentially creating inconsistencies in the future (if one log is reformatted, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this gets way better by introducing the error you suggested above 👌

crates/e2e/tests/e2e/solver_competition.rs Show resolved Hide resolved
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from f556294 to 02c199b Compare October 25, 2024 07:34
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from 17886e0 to e7dd8ab Compare October 25, 2024 07:46
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from e7dd8ab to e3a6f7a Compare October 25, 2024 08:06
Comment on lines +550 to +551
Ok(driver) => Some(Arc::new(driver)),
Err(_) => None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to introduce a new error when it is completely ignored on the caller's side? Either an Option should be returned or the error needs to be logged here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Introducing an error is good for the function itself, that we don't use it now doesn't mean it won't be used. The logging is done within the function instead of the caller, mostly to avoid code repetition since this is instantiated in multiple times.

Copy link
Contributor

Choose a reason for hiding this comment

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

that we don't use it now doesn't mean it won't be used.

IMO, then it should only be introduced then. Currently, it is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree. If we design a function that errors, then it has to emit an error. How the error is treated is responsibility of the caller.

Copy link

github-actions bot commented Nov 2, 2024

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

@github-actions github-actions bot added the stale label Nov 2, 2024
@github-actions github-actions bot closed this Nov 10, 2024
@m-lord-renkse m-lord-renkse reopened this Nov 11, 2024
@m-lord-renkse m-lord-renkse force-pushed the 3045/add-submission-address-autopilot branch from 1137f42 to bbf1691 Compare November 11, 2024 12:06
@github-actions github-actions bot removed the stale label Nov 12, 2024
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.

LGTM, just that this will cause issues with https://cowservices.slack.com/archives/C036JAGRQ04/p1732005732731009

@@ -372,6 +380,77 @@ impl std::fmt::Display for Arguments {
}
}

/// External solver driver configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: does it make sense to move this type into it's own arguments module?

@@ -372,6 +380,77 @@ impl std::fmt::Display for Arguments {
}
}

/// External solver driver configuration
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternalSolver {
Copy link
Contributor

Choose a reason for hiding this comment

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

naming nit (there is no such thing as an internal solver anymore)

Suggested change
pub struct ExternalSolver {
pub struct Solver {

.into_iter()
.filter(|participant| {
let submission_address = participant.driver().submission_address;
let is_solution_from_driver = participant.solution().solver() == submission_address;
Copy link
Contributor

Choose a reason for hiding this comment

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

this will cause issues in case copium wants to use multiple different solvers, cc @bram-vdberg

Copy link

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants