From 8f49d5214642774f18ab1b761607a7b4d72b312c Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Thu, 7 Dec 2023 14:23:14 +0800 Subject: [PATCH 1/4] Update test node --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1ffa5d8d..59bce160 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,6 +6,7 @@ on: branches: - dev - main + - v1-4-1-integration jobs: build: @@ -108,7 +109,7 @@ jobs: - name: Use era-test-node for testing uses: dutterbutter/era-test-node-action@v0.1.3 with: - releaseTag: v0.0.1-alpha.boojum + releaseTag: v0.0.1-vm1.4.1 - name: Install dependencies run: yarn From 5df2b7e53d616c36002a2df90f25855978fdd6a7 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Thu, 7 Dec 2023 18:34:11 +0800 Subject: [PATCH 2/4] Fix CI, update quick setup --- .github/workflows/ci.yaml | 3 +++ scripts/quick-setup.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 59bce160..df4f3b71 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -127,6 +127,9 @@ jobs: contracts/precompiles/artifacts bootloader/build + - name: Build contracts + run: yarn build + - name: Run tests run: yarn test diff --git a/scripts/quick-setup.sh b/scripts/quick-setup.sh index efbd8e66..3419c440 100755 --- a/scripts/quick-setup.sh +++ b/scripts/quick-setup.sh @@ -6,7 +6,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup toolchain install nightly # install era-test-node -cargo +nightly install --git https://github.com/matter-labs/era-test-node.git --locked --branch boojum-integration-vm-1.4.1 +cargo +nightly install --git https://github.com/matter-labs/era-test-node.git --locked --branch vm1.4.1 yarn yarn build From 38796d740a0604c0127e32338fe3f016e0228dd5 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 8 Dec 2023 00:14:55 +0800 Subject: [PATCH 3/4] New approach to run the test node --- .github/workflows/ci.yaml | 1 - README.md | 12 ++++-- hardhat.config.ts | 1 + package.json | 2 + scripts/quick-setup.sh | 16 -------- yarn.lock | 80 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 21 deletions(-) delete mode 100755 scripts/quick-setup.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index df4f3b71..16214710 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,7 +6,6 @@ on: branches: - dev - main - - v1-4-1-integration jobs: build: diff --git a/README.md b/README.md index 99c7f5c1..22546c3c 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,17 @@ changes. ## Testing -The tests of the system contracts utilize the zkSync test node. In order to run the tests, execute the following command in the root of the repository: +The tests of the system contracts utilize the zkSync test node. In order to run the tests, execute the following commands in the root of the repository: ``` -bash ./scripts/quick-setup.sh +yarn test-node ``` - -The `quick-setup.sh` script will proceeed to install all the necessary dependencies and will run the tests. +It will run the test node, and you can see its logs in the output. +Then run tests in the separate terminal: +``` +yarn test +``` +Please note that you need to rerun the test node every time you are running the tests because, in the current version, tests will be affected by the state after the previous run. ## License diff --git a/hardhat.config.ts b/hardhat.config.ts index 73c7c0e8..f65098f3 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -3,6 +3,7 @@ import "@matterlabs/hardhat-zksync-solc"; import "@nomiclabs/hardhat-ethers"; import "@nomiclabs/hardhat-solpp"; import "@typechain/hardhat"; +import "@matterlabs/hardhat-zksync-node"; // eslint-disable-next-line @typescript-eslint/no-var-requires const systemConfig = require("./SystemConfig.json"); diff --git a/package.json b/package.json index 5ca538d2..a2888d1b 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "devDependencies": { "@matterlabs/eslint-config-typescript": "^1.1.2", "@matterlabs/hardhat-zksync-chai-matchers": "^0.1.4", + "@matterlabs/hardhat-zksync-node": "^0.0.1-beta.7", "@matterlabs/hardhat-zksync-solc": "^0.4.2", "@matterlabs/prettier-config": "^1.0.3", "@nomicfoundation/hardhat-chai-matchers": "^1.0.3", @@ -75,6 +76,7 @@ "prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yaml}\"", "prettier:fix": "prettier --write \"**/*.{js,json,md,sol,ts,yaml}\"", "test": "hardhat test --network zkSyncTestNode", + "test-node": "hardhat node-zksync --tag v0.0.1-vm1.4.1", "test:bootloader": "cd bootloader/test_infra && cargo run" } } diff --git a/scripts/quick-setup.sh b/scripts/quick-setup.sh deleted file mode 100755 index 3419c440..00000000 --- a/scripts/quick-setup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# install rust -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - -rustup toolchain install nightly - -# install era-test-node -cargo +nightly install --git https://github.com/matter-labs/era-test-node.git --locked --branch vm1.4.1 - -yarn -yarn build -yarn build-yul -era_test_node run > /dev/null 2>&1 & export TEST_NODE_PID=$! -yarn test -kill $TEST_NODE_PID diff --git a/yarn.lock b/yarn.lock index 166747de..089dbef0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -525,6 +525,17 @@ chalk "4.1.2" ts-morph "^19.0.0" +"@matterlabs/hardhat-zksync-node@^0.0.1-beta.7": + version "0.0.1-beta.7" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-node/-/hardhat-zksync-node-0.0.1-beta.7.tgz#01e0b28f844e02aa52e9474b5b5c124ed7bf7566" + integrity sha512-14yfpSDMDai5a2AOHumR69T9GTvW94MVI8GJpbJxhMZwF+XGBEpxk281JlTZATwWVzE0AZh0jYt3p8AIxtwvDg== + dependencies: + "@matterlabs/hardhat-zksync-solc" "1.0.0" + axios "^1.4.0" + chalk "4.1.2" + fs-extra "^11.1.1" + ts-morph "^19.0.0" + "@matterlabs/hardhat-zksync-solc@0.4.2", "@matterlabs/hardhat-zksync-solc@^0.4.2": version "0.4.2" resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.4.2.tgz#64121082e88c5ab22eb4e9594d120e504f6af499" @@ -537,6 +548,18 @@ proper-lockfile "^4.1.2" semver "^7.5.1" +"@matterlabs/hardhat-zksync-solc@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-1.0.0.tgz#4da54b59fb4fa9c2ba22a3bb2e6150cf1d70028c" + integrity sha512-N6uUcmbAwZtu60WooUGJ1ssUdFFCd8MU1PdOSXcCJQ3vzjej2p3Ra8t3DrbJSWf3LRJoM18mZkZD2AktlF/ONw== + dependencies: + "@nomiclabs/hardhat-docker" "^2.0.0" + chalk "4.1.2" + dockerode "^3.3.4" + fs-extra "^11.1.1" + proper-lockfile "^4.1.2" + semver "^7.5.1" + "@matterlabs/prettier-config@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@matterlabs/prettier-config/-/prettier-config-1.0.3.tgz#3e2eb559c0112bbe9671895f935700dad2a15d38" @@ -1440,6 +1463,11 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + at-least-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" @@ -1457,6 +1485,15 @@ axios@^0.21.1: dependencies: follow-redirects "^1.14.0" +axios@^1.4.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -1837,6 +1874,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + command-exists@^1.2.8: version "1.2.9" resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" @@ -2054,6 +2098,11 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -2658,6 +2707,11 @@ follow-redirects@^1.12.1, follow-redirects@^1.14.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.0: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -2665,6 +2719,15 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fp-ts@1.19.3: version "1.19.3" resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" @@ -3693,6 +3756,18 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -4190,6 +4265,11 @@ proper-lockfile@^4.1.2: retry "^0.12.0" signal-exit "^3.0.2" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pump@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" From ca1ab3299b7a987e1a440cdcf9fc31deadf9de77 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 8 Dec 2023 00:20:03 +0800 Subject: [PATCH 4/4] Fix lints --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 22546c3c..4e1aa984 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,14 @@ The tests of the system contracts utilize the zkSync test node. In order to run ``` yarn test-node ``` + It will run the test node, and you can see its logs in the output. Then run tests in the separate terminal: + ``` yarn test ``` + Please note that you need to rerun the test node every time you are running the tests because, in the current version, tests will be affected by the state after the previous run. ## License