-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid double balance caching race condition (#2067)
# Description While working on dockerizing the e2e tests I noticed that we can run into an annoying race condition caused by caching balances in 2 places (balancer fetcher and solvable orders). Given this scenario: 1. start solvable orders block 2. it notices a new block appeared so it asks the balance fetcher for the new balances 3. balancer fetcher did not yet see the new block so it returns the old unchanged balances 4. solvable orders caches old balances This case is not a big deal in production but I'm fairly confident this causes our flaky e2e tests. Because those e2e tests only produce blocks when a tx needs to get mined we can encounter the scenario where that test waits for an order to be settled which will never happen because the `autopilot` never noticed that the user has the required balances by now. # Changes Removes caching in the `SolvableOrdersCache` because we already have a cache in the balance fetcher. Also we wouldn't really want to build new auction on the same block anyway so we shouldn't even be able to use balances cached by the `SolvableOrderCache`. ## How to test e2e tests still pass
- Loading branch information
1 parent
148a922
commit def4f38
Showing
2 changed files
with
12 additions
and
44 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