-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Fixes #2007. The preferred solution described in that issue was not straight forward to implement. It expected the `autopilot` to call `/reveal` from the highest scoring solution to the lowest scoring one to simulate it in order to avoid cases where a solver wins the auction with a solution that would revert by now. The issue was that this requires the `autopilot` to know the address of every solver which would be a significant change. Instead this PR implements a strategy on the `driver` side that a rational actor would be expected to follow as well. All solvers know when they have to return a solution at the latest. Because a solution can be more accurate the closer it was computed to the time it is supposed to be executed it makes sense for all solvers to delay their response as much as possible (something might change in the mean time which might enable an even better solution). This deadline gets propagated to the `solver` engine so ideally it would take as much time computing the optimal solution as possible. If the solver returns earlier (like some currently do) it still makes sense to assume that other solvers will submit their solution at a later point in time. In that case the only reasonable action for the `driver` is to wait until the deadline approaches and continuously re-simulate the computed solution whenever a new block gets detected. If in the meantime the solution would start to revert the `driver` would then withhold the computed solution to not accidentally win the auction and get slashed for not submitting it on-chain. # Changes `driver` waits until deadline before returning the solution on `/solve` and checks whether it's still viable on every new block. It also updates the score in case the solution still simulates but becomes better or worse (gas usage might change). Also slightly adjusted to `Ethereum::new()` to panic on any init error since we can't handle those errors anyway because the type is essential to the program. ## How to test This can be tested by a new e2e test which I would like to implement in a follow up PR when existing e2e tests don't break.
- Loading branch information
1 parent
e1df668
commit 217306a
Showing
10 changed files
with
114 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters