-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Better integration with MoonNet #58
Comments
Thanks for the thoughts @marcelomorgado I think running tests directly on the MoonNet node was @kendricktan's original intention, and it is highly recommended where possible. It really depends on the tests you want to run, but for something like the If you're making a dapp, then I would probably run the tests directly on MoonNet. But for this project, I am not sure it's necessary to do that yet. And like you said, we would have the issue of losing parallelism. I wonder if we could spawn a CI that creates Ganache instances in memory that would allow that though. Definitely a lot to think about. I am not sure what the right answer is. We should keep discussing. @kendricktan any thoughts? |
@marcelomorgado Thanks for the inputs. @adrianmcli is right - the original goal I had in mind with moonnet was to minimize iteration time, and the largest bottleneck for me was the testing time. Unfortuntely, Moonnet wasn't designed to be forked from, it was designed specifically as a Ethereum-testnet-in-the-cloud service that had low latency to a pseudo archival node in order to test/integrate with existing mainnet defi protocols.
You're right. But as you mention, you can revert back to the original state using
Parallelism can be achieved, but that requires spawning up a new testnet instance for every test suite. Its a tradeoff between time/money/computing power, which is something we might tackle in the future if we have enough time/funding.
Definitely in the words, we will be migrating to builder-evm once it has the forking feature :) |
Hi!
I'm interested to keep contributing with this project because I'm studying DeFi protocols and it's a great way to get they better, but one thing is bothering me, the time needed to run the tests, it's making my code/learning slowly since running a forked
Ganache
node isn't the fastest thing out there... because of that I've also get interested in theMoonNet
project because it's trying to solve this issue, but actually, the performance of fork fromInfura
and fork fromMoonNet
are almost the same for me (sometimesInfura
is performing better).So, before back my contribution/studies with new protocols, I've spent some time trying to improve the time needed to run the tests and I think that I've found something (that can could also help
MoonNet
with their users' support):I've started making some test rounds using the
compound.test.ts
test suite:Forked from Infura: 83.418s
Forked from MoonNet: 81.527s
MoonNet (without forking): 29.596s 🥇
Based on these results, I was want to run all test suites using
MoonNet
without forking it. For make it possible some changes were needed because since the test suites run in parallel, all of them would run against the same node/state making some unexpected behaviors happen (e.g. mint dai in test suite A can make a dai balance assert to fail int test suite B).The changes that I've made were:
jest
without parallelism (--runInBand param);evm_revert
andevm_snapshot
methods. I've changedsetup
andtearDown
functions to do so.Here are the time results of running all test suites:
Forked from Infura: 462.934s
Forked from MoonNet: 499.884s
MoonNet (without forking): 89.819s 🥇
Some notes:
jest
process;buidler
fork feature is more performatic than theganache
no change would be needed (Do you have some info about it?).WDTY @adrianmcli @kendricktan?
The text was updated successfully, but these errors were encountered: