Open drortirosh opened 1 year ago
I can confirm this is happening. Thanks @drortirosh! We'll take a look as soon as we can.
Here's some testing/analysis that may help decide a path forward. I skipped changing the compiler version to see what would happen:
$ docker run -it --rm node:20 bash
$ git clone https://github.com/eth-infinitism/account-abstraction.git
$ cd account-abstraction
$ yarn install
$ yarn compile
yarn run v1.22.22
$ ./scripts/hh-wrapper compile
Downloading compiler 0.8.23
Downloading compiler 0.8.23
Downloading compiler 0.8.23
Downloading compiler 0.8.23
Downloading compiler 0.8.23
Generating typings for: 95 artifacts in dir: typechain for target: ethers-v5
Successfully generated 260 typings!
Compiled 92 Solidity files successfully (evm target: paris).
Done in 38.11s.
$ docker run -it --rm node:20 bash
$ git clone https://github.com/eth-infinitism/account-abstraction.git
$ cd account-abstraction
$ yarn install
$ sed -i '/const { getGlobalDispatcher, ProxyAgent, request } = await Promise.resolve().then(() => __importStar(require("undici")));/a\
console.log(`filePath: ${filePath}`);\
' node_modules/hardhat/internal/util/download.js
$ yarn compile
yarn run v1.22.22
$ ./scripts/hh-wrapper compile
Downloading compiler 0.8.23
filePath: /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/list.json
Downloading compiler 0.8.23
Downloading compiler 0.8.23
filePath: /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.8.23+commit.f704f362
filePath: /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.8.23+commit.f704f362
Downloading compiler 0.8.23
filePath: /root/.cache/hardhat-nodejs/compilers-v2/wasm/list.json
filePath: /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.23+commit.f704f362.js
filePath: /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.8.23+commit.f704f362
Downloading compiler 0.8.23
Downloading compiler 0.8.23
filePath: /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.23+commit.f704f362.js
filePath: /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.23+commit.f704f362.js
Generating typings for: 95 artifacts in dir: typechain for target: ethers-v5
Successfully generated 260 typings!
Compiled 92 Solidity files successfully (evm target: paris).
Done in 25.81s.
$ docker run -it --rm node:20 bash
$ git clone https://github.com/eth-infinitism/account-abstraction.git
$ cd account-abstraction
$ yarn install
$ sed -i '1i const fs = require("fs-extra");' node_modules/hardhat/internal/util/download.js
$ sed -i '/const { getGlobalDispatcher, ProxyAgent, request } = await Promise.resolve().then(() => __importStar(require("undici")));/a\
if (await fs.pathExists(filePath)) {\
console.log(`File already exists at ${filePath}, skipping download.`);\
return;\
}' node_modules/hardhat/internal/util/download.js
$ yarn compile
yarn run v1.22.22
$ ./scripts/hh-wrapper compile
Downloading compiler 0.8.23
Downloading compiler 0.8.23
Downloading compiler 0.8.23
File already exists at /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.8.23+commit.f704f362, skipping download.
Downloading compiler 0.8.23
File already exists at /root/.cache/hardhat-nodejs/compilers-v2/linux-amd64/solc-linux-amd64-v0.8.23+commit.f704f362, skipping download.
Downloading compiler 0.8.23
Downloading compiler 0.8.23
File already exists at /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.23+commit.f704f362.js, skipping download.
File already exists at /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.23+commit.f704f362.js, skipping download.
Generating typings for: 95 artifacts in dir: typechain for target: ethers-v5
Successfully generated 260 typings!
Compiled 92 Solidity files successfully (evm target: paris).
Done in 24.96s.
So there are separate linux-amd64
and wasm
versions being downloaded. The final example will skip extra downloads, but doesn't change the code enough to avoid the "Downloading compiler" messages.
Version of Hardhat
2.12.4
What happened?
We want to use the "viaIR" mode for several files, but it is too slow to compile the entire tests around it. So we use overrides in the compiler settings here
However, this causes hardhat to report (and probably download) the compiler multiple times. e.g. I changed the version to 0.8.21 and got:
Minimal reproduction steps
hardhat.config.ts
Search terms
No response