Run mainnet fork test in CI
Multiple of our tests for smart contracts require the RUN_FORK to be set.
I suspect these do not run in CI... but I think it is important that we also run them there...
What do you think @clemsos ?
It will be good to have some tests running on mainnet forks but there are limitations to it
- not very good to test against an unknown state
- having tests relying on a remote host to get the initial state can lead to failures on CI (if archive node is down etc)
- the state of the chain is changing constantly so the tests have to be written to support this changes (e.g. contract balances, uniswap pools liquidity, etc). To mitigate this, the fork has to be on specific block height - which kind of defeats the purpose of having "real life" tests
Overall maybe a better approach will be to have a small "mainnet test suites" with a defined scope. It could also run against other forks (Polygon, etc), not only mainnet
We added support for tenderly forks in #13220 for governance scripts that could be used as well. Most of the require test on mainnet forks are in the governance folder, except some Uniswap development that lives in smart-contracts folder.
Tenderly has a new feature for running dedicated testnets that could be used to run tests
https://docs.tenderly.co/virtual-testnets