autopilot: await specific solution of many #3960
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
When the autopilot sends a
/settlerequest it also starts monitoring the blockchain to see if the winning solution landed on chain. So far the autopilot only searched for 2 pieces of information: solver, auction_idWith the change to combinatorial auctions this is no longer sufficient since 1 solver can have multiple winning solutions. Since it only searches for SOME proposed solution to be mined instead of each one specifically all the futures waiting for the settlement to be mined will resolve at the same time when the first solution gets mined.
This in turn causes the autopilot to terminate the
/settlerequest too early. Any driver which ties solution submission to the liveness of the HTTP request will then terminate the submission too early because it thinks the autopilot is no longer "interested" in the transaction.Changes
adjusted the waiting logic to search for a tx with the tuple (auction_id, solver, solution_uid) to actually wait for one specific solution.
How to test
existing e2e tests should still pass
However adding a new test specifically for this is very involved.
eth_sendRawTransactionto the nodeI think in order to test this explicitly we have to build a mock driver and even then it's pretty hard to make the test assertions stable. Since the change is so trivial I think not adding a new test for this is acceptable. Let me know if you disagree.