Make /settle call blocking and report tx_hash #1999
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently the autopilot wastes a lot of time waiting for transactions that will never appear. This happens because the driver's
/settle
endpoint operates in a fire-and-forget (get request, kick off submission in background, return immediately). That way the driver does not have any way to communicate that it will not be able to submit the solution to the autopilot and it will have to monitor the blockchain until the deadline is reached.This PR is slightly related to #1974 but does not solve the issue that solutions don't get submitted in the first place.
Changes
This PR makes it so that
/settle
actually blocks in the driver until the solution gets submitted and returns the tx_hash. If the driver is not able to submit the solution (e.g. the simulations for the solution start reverting) it will return an error to the autopilot which will immediately move to the next auction.Note that this is not really how it's supposed to work but this solution is fine as long as we are running all the drivers (and can therefore assume a reasonable behavior). We should revisit this decision before we can encourage external parties to run their own driver.
How to test
e2e tests