Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description The driver has a routine to prioritize orders and filter orders based on the balance the trader currently has. With the introduction of pre-interactions this check became much trickier because a user might not have any sell_tokens at the moment but unstakes the needed tokens in a pre-interaction. Because of that we introduced a way to get the actual tradable balance by simulating a balance check using a helper contract. This is very accurate but unfortunately also very slow. (~10s just for fetching the balances of all traders in an auction) Luckily most of our orders don't have pre-interactions so we can fall back to a simpler and faster way to query the current balance. # Changes Reimplement parts of the balance query of [balances.sol](https://github.com/cowprotocol/services/blob/main/crates/contracts/solidity/Balances.sol#L59-L76) using simple `eth_call`s and use that for any order group that does not contain any pre-interactions. While testing locally this reduced the time to fetch all balances to ~ 1.2 - 2 seconds. ## How to test covered by e2e tests ## Related Issues #2041
- Loading branch information