-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share liquidity fetch requests (#2065)
# Description Because all the traits and APIs around liquidity fetching are very weird it's pretty hard to keep track of which liquidity pools are not worth fetching. # Changes 1. This PR introduces a request sharing logic in the `RecentBlockCache`. With that it shouldn't matter how many solvers have to fetch liquidity in parallel as they should all share the underlying RPC requests. 2. Additionally I modified the logic that keeps track of recently used keys to only contain ids of pools we were able to fetch. This is important because those keys are used to update the cache in a background task and if we have too many useless keys in there we'd waste a lot of work during those background updates. 3. Moved `RequestSharing` garbage collection to background task instead of at every insert. This is mostly relevant because we now use this component for liquidity fetching which issues **MANY** requests. This improvement is actually pretty huge. Those changes (together with the previous 2 liquidity changes) brought down the liquidity fetching time from ~8s to 0.7-1.5s which should be fast enough for the gnosis solvers. Fixes: #2041
- Loading branch information
1 parent
fa8796c
commit d583ec3
Showing
9 changed files
with
209 additions
and
113 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
Oops, something went wrong.