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

Make /settle call blocking and report tx_hash #1999

Merged
merged 7 commits into from
Oct 20, 2023

Conversation

MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Oct 20, 2023

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

@MartinquaXD MartinquaXD requested a review from a team as a code owner October 20, 2023 11:22
@MartinquaXD MartinquaXD marked this pull request as draft October 20, 2023 11:31
@MartinquaXD MartinquaXD marked this pull request as ready for review October 20, 2023 11:51
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.

I believe you also have to set a custom timeout on the http request as otherwise /settle will likely return after 10s like all our other http requests.

@MartinquaXD MartinquaXD enabled auto-merge (squash) October 20, 2023 12:17
@MartinquaXD MartinquaXD merged commit 1044860 into main Oct 20, 2023
7 checks passed
@MartinquaXD MartinquaXD deleted the make-settle-call-blocking branch October 20, 2023 12:21
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 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.

2 participants