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

bug: We don't /notify solvers on some errors #2140

Closed
MartinquaXD opened this issue Dec 7, 2023 · 7 comments · Fixed by #2186
Closed

bug: We don't /notify solvers on some errors #2140

MartinquaXD opened this issue Dec 7, 2023 · 7 comments · Fixed by #2186
Labels
bug Something isn't working E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details

Comments

@MartinquaXD
Copy link
Contributor

Problem

It looks like there are some errors for which we don't correctly call the /notify endpoint to give the solver debugging information.

Impact

External solver maintainers have a hard time debugging issues with their solutions.

To reproduce

Check these logs to see that we don't have a single notification for:

  • simulation errors
  • negative scores
  • encoding errors

Expected behaviour

A solver should receive a /notify request for every solution it provided. Either a reason why it was discarded or the rank it achieved in the competition.

@MartinquaXD MartinquaXD added bug Something isn't working E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details labels Dec 7, 2023
@MartinquaXD
Copy link
Contributor Author

cc @ColePBryan (user which reported that they are missing /notifys for many auctions)

@MartinquaXD MartinquaXD self-assigned this Dec 8, 2023
@squadgazzz squadgazzz assigned squadgazzz and unassigned MartinquaXD Dec 8, 2023
@sunce86
Copy link
Contributor

sunce86 commented Dec 11, 2023

I see that we have notifies for simulation errors: https://production-6de61f.kb.eu-central-1.aws.cloud.es.io/app/r/s/Gk4lS

@sunce86
Copy link
Contributor

sunce86 commented Dec 11, 2023

And for negative scores, I don't know what is the exact case here, but we usually report either ObjectiveValueNonPositive for that https://production-6de61f.kb.eu-central-1.aws.cloud.es.io/app/r/s/5kiFQ

NonPositiveScore notify is only sent if the solver reports a 0 score.

@squadgazzz
Copy link
Contributor

squadgazzz commented Dec 18, 2023

Some of the simulation errors are ignored:

fn with<E>(tx: eth::Tx, block: eth::BlockNo) -> impl FnOnce(E) -> Error
where
E: Into<SimulatorError>,
{
move |err| {
let err: SimulatorError = err.into();
let tx = match &err {
SimulatorError::Tenderly(tenderly::Error::Http(_)) => None,
SimulatorError::Tenderly(tenderly::Error::Revert(_)) => Some(tx),
SimulatorError::Blockchain(blockchain::Error::Method(error))
if matches!(error.inner, ExecutionError::Revert(_)) =>
{
Some(tx)
}
SimulatorError::Blockchain(blockchain::Error::Method(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Web3(inner)) => {
let error = ExecutionError::from(inner.clone());
if matches!(error, ExecutionError::Revert(_)) {
Some(tx)
} else {
None
}
}
SimulatorError::Blockchain(blockchain::Error::Gas(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Response(_)) => None,
SimulatorError::Enso(enso::Error::Http(_)) => None,
SimulatorError::Enso(enso::Error::Revert(_)) => Some(tx),
};
match tx {
Some(tx) => Error::Revert(RevertError { err, tx, block }),
None => Error::Basic(err),
}
}
}

But it needs to be confirmed if the following errors are properly built from responses:
pub enum Error {
Http(#[from] reqwest::Error),
Revert(SimulationId),
}

Further investigation is required on what errors are not received by solvers exactly.

@squadgazzz squadgazzz removed their assignment Dec 18, 2023
@fleupold
Copy link
Contributor

Do we have a concrete solver that didn't receive a notification for a specific auction?

Unlike stated in the issue description, I see logs for simulation failures, non-positive score (encoding errors are mostly also simulation failures).

We don't notify runner ups with their rank, but this is by design (rank can be fetched from the solver competition endpoint)

@MartinquaXD
Copy link
Contributor Author

MartinquaXD commented Dec 18, 2023

The specific example that sparked this issue is here where the odos solver provided some solution which failed to simulate with execution reverted but did not receive any /notify call about it.
The odos maintainer says there are lots and lots of auctions where they participated in the shadow competition and didn't receive a notification.

@fleupold
Copy link
Contributor

In this specific auction, the error was in estimating the access list, which currently is classified as a "Basic" Simulation error (for which we don't notify solvers). I will make a PR to address this.

fleupold added a commit that referenced this issue Dec 21, 2023
# Description
We don't always notify solvers if their solutions fails in certain cases
(e.g. if we cannot generate an access list for their solution). However
for debugging, a solver should receive a /notify request for every
solution it provided that doesn't end up ranking.

# Changes
- [ ] Make some types of simulation errors that are related to the
underlying transaction failing simulation classifying as such
- [ ] For remaining errors, still notify solvers but classify that this
was a "driver" error (ie not their fault)

## How to test
CI

## Related Issues
Fixes #2140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants