matter-labs / era-test-node

In-memory node that can be used for integration testing and debugging.
https://matter-labs.github.io/era-test-node
Apache License 2.0
308 stars 76 forks source link

Error when running `make build-contracts` #237

Closed ilitteri closed 8 months ago

ilitteri commented 11 months ago

🐛 Bug Report for zkSync Era In-Memory Node

📝 Description

There's an error when running make build-contracts (it is not working on main).

🔄 Reproduction Steps

  1. Clone the repo.
  2. Run make build-contracts.

🤔 Expected Behavior

This should compile the contracts with no errors.

😯 Current Behavior

An error is thrown and the contracts are not built.

🖥️ Environment

📋 Additional Context

-

📎 Log Output

➜  era-test-node git:(main) make build-contracts
cd etc/system-contracts && yarn; yarn install; yarn build; yarn preprocess; yarn build-bootloader
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > @matterlabs/hardhat-zksync-deploy@0.6.5" has incorrect peer dependency "zksync-web3@^0.14.3".
warning " > @typechain/ethers-v5@10.2.1" has unmet peer dependency "@ethersproject/abi@^5.0.0".
warning " > @typechain/ethers-v5@10.2.1" has unmet peer dependency "@ethersproject/providers@^5.0.0".
warning " > @typechain/ethers-v6@0.4.0" has incorrect peer dependency "ethers@6.x".
warning " > @typechain/hardhat@8.0.0" has incorrect peer dependency "ethers@^6.1.0".
[4/4] 🔨  Building fresh packages...
✨  Done in 5.98s.
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.10s.
yarn run v1.22.19
$ hardhat compile
An unexpected error occurred:

/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/hardhat.config.ts:1
import '@nomiclabs/hardhat-solpp';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1124:15)
    at Module._compile (node:internal/modules/cjs/loader:1160:27)
    at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ rm -rf ./bootloader/build && yarn ts-node scripts/process.ts
$ /Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/.bin/ts-node scripts/process.ts
(node:73595) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/scripts/process.ts:2
import { existsSync, mkdirSync, writeFileSync } from 'fs';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1124:15)
    at Module._compile (node:internal/modules/cjs/loader:1160:27)
    at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at phase4 (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/bin.ts:649:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ yarn hardhat run ./scripts/compile-yul.ts
$ /Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/.bin/hardhat run ./scripts/compile-yul.ts
An unexpected error occurred:

/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/hardhat.config.ts:1
import '@nomiclabs/hardhat-solpp';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1124:15)
    at Module._compile (node:internal/modules/cjs/loader:1160:27)
    at Module.m._compile (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ivanlitteri/Lambda/zksync_learning_path/era-test-node/etc/system-contracts/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [build-contracts] Error 1
dutterbutter commented 8 months ago

This doesnt seem to be an issue since: https://github.com/matter-labs/era-test-node/releases/tag/v0.1.0-alpha.17. Closing for now please re-open if issue persists.