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

Notify solvers if driver fails for some reason #2186

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Conversation

fleupold
Copy link
Contributor

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

@fleupold fleupold requested a review from a team as a code owner December 19, 2023 09:41
SimulatorError::Blockchain(blockchain::Error::Gas(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Response(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Gas(_)) => Some(tx),
SimulatorError::Blockchain(blockchain::Error::Response(_)) => Some(tx),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these three are now classified as revert errors?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, these seem more like they should be Other errors. Meaning it's entirely possible that the simulated transaction is fine but we just encountered an internal error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right about Gas (I thought it was gas amount estimation related, but it's purely gas price related which the transaction has no influence on).
However for blockchain::Error::Response it only happens when we fail to estimate the accessList which happens if the transaction doesn't simulate properly.

Will rename these variants to make that more clear.

crates/driver/src/infra/simulator/mod.rs Outdated Show resolved Hide resolved
SimulatorError::Blockchain(blockchain::Error::Gas(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Response(_)) => None,
SimulatorError::Blockchain(blockchain::Error::Gas(_)) => Some(tx),
SimulatorError::Blockchain(blockchain::Error::Response(_)) => Some(tx),
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, these seem more like they should be Other errors. Meaning it's entirely possible that the simulated transaction is fine but we just encountered an internal error.

@fleupold fleupold enabled auto-merge (squash) December 21, 2023 15:03
@fleupold fleupold merged commit bf6386a into main Dec 21, 2023
8 checks passed
@fleupold fleupold deleted the notify_driver_errors branch December 21, 2023 15:07
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: We don't /notify solvers on some errors
4 participants