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: Can't find a mined transaction when running in colocated mode #1974

Closed
MartinquaXD opened this issue Oct 16, 2023 · 2 comments
Closed
Assignees
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

MartinquaXD commented Oct 16, 2023

Problem

In the colocated mode the autopilot is orchestrating the auction. It informs solvers about the auction, picks a winner, tells the winner to /settle the solution and afterwards monitors the blockchain for some time to detect the requested tx.
But it turns out that we often are not able to find the expected auction which can indicate a bug. (logs)

Impact

It makes it unnecessarily difficult to debug the run loop for a given tx_hash because we don't issue a log linking the hash to an auction id.

Expected behaviour

If a driver submits a solution the autopilot should be able to detect it in a timely manner.

Screenshots/logs

1

services version/commit hash and environment

v2.227.1-26-g44bf11c4

@MartinquaXD MartinquaXD added the bug Something isn't working label Oct 16, 2023
@MartinquaXD MartinquaXD self-assigned this Oct 16, 2023
@sunce86 sunce86 added the E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details label Oct 16, 2023
MartinquaXD added a commit that referenced this issue 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
Copy link
Contributor Author

After investigating a bit more I see 2 options for submission issues so far:

  1. some solvers report a solutions very quickly and then have to wait a lot before being declared the winner. In the meantime the solution might become unviable
  2. it even happened a few times that right after simulating a solution and being declared the submission loop stopped because the simulations started to revert. This seems very suspicious and might indicate some node or simulation issues. Has to be investigated further.

@fleupold
Copy link
Contributor

fleupold commented Nov 20, 2023

Can this issue be closed?

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

No branches or pull requests

3 participants