balancer / b-sdk

MIT License
23 stars 9 forks source link

V3 Init test improvement #288

Open johngrantuk opened 8 months ago

johngrantuk commented 8 months ago

Sometimes the test is timing out. Init tests are likely the heaviest ones, they have on-chain calls to:

I’d say it makes sense that they are slow. It would be nice to evaluate if some sort of multicall could improve the performance. Specially within the init pool data provider.

brunoguerios commented 8 months ago

I spent a few hours on this and found out that the issue is actually within createPool transaction. It takes ~1min to complete locally on a cold start (i.e. running from a blockNumber that was not used by other tests before) and I was able to replicate the same issue within both init and create pool integration tests. Since the issue relies on a single transaction (instead of being caused by aggregating multiple ones) it feels like we would be able to improve this only by some viem/anvil configuration. As it impacts only dev experience while running tests and our tests are quite quick at the moment, I'd say it's not worth to spend more time improving this. In other words, I'd leave this issue opened with low priority and get back to it only if it ever becomes a real issue. Hopefully it will already be fixed on future dependency versions. For now, I bumped the timeout to 2min so tests have enough time to complete.