Closed fullkomnun closed 6 months ago
Hi @fullkomnun thanks for reporting this issue!
I tried a quick repro with a sample project here and I couldn't reproduce the issue unfortunately. With hardhat=2.22.2
(latest EDR release) I'm getting ~800ms median execution time for npx hardhat test
with a warm cache. With hardhat=2.20.1
(latest non-EDR release) I'm getting ~1000ms median execution time with a warm cache, so EDR is ~20% faster.
Two things changed with the EDR release that could cause the problem that you're seeing:
cache/hardhat-network-fork/rpc_cache
(relative to the repo root). Could you verify if this cache is reused between your test executions?If none of these resolve the issue, could you please share more repro steps?
Closing for lack of response.
Sorry for lack of response, the reason for longer deployment tests were related to re-deployment of contracts (and therefore longer pre-tests setup) due to targetting 'shangahi' hardfork instead of 'merge'/'paris' which due to the introduction of push0 opcode affect almost every contract and triggers re-deployment.
EDR is fine =]
Thanks for letting us know!
Version of Hardhat
2.22.1
What happened?
While unit test and deployment scripts (using 'hardhat-deploy' plugin) that run against the hardhat network with no forking appear to execute faster after updating to v2.22.1, when running tests or deployment scripts against the hardhat network with forking any remote network (with or without setting a pinned block number, public networks through Alchemy or remote internal Geth node) I see execution time is increased by about 50% compared to pre-EDR hardhat releases. Verified that even tests not using
hardhat-deploy
suffer from longer runtime when using forking. Let me know what can I do to provide additional useful details if you unaware of this issue.Minimal reproduction steps
Any test when forking is running significantly slower comapred to pre-EDR releases. Node: v20.10 OS: macOS CPU: Apple Silicon (arm64)
Can't yet verify execution times on Github ubuntu runner since I'm investigating a crash in EDR rust code when running tests
Search terms
EDR