From b60546eba0092f4ff27ab1e2ba13cfe90d9fc837 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 12 Jul 2024 16:56:14 +0300 Subject: [PATCH 01/29] add slither and echidna for security scan --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9282e82..8fec5b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,11 @@ jobs: with: version: nightly + - name: Run Slither analysis on Solidity files + uses: crytic/slither-action@v0.4.0 + with: + target: packages/zksync-storage-contracts + - name: Run Forge build run: | forge --version @@ -32,3 +37,10 @@ jobs: run: | forge test -vvv id: test + + - name: Run Echidna for zksync-storage-contracts + uses: crytic/echidna-action@v2 + with: + files: . + contract: packages/zksync-storage-contracts + crytic-args: --ignore-compile \ No newline at end of file From f11098801bc5b17c021a914ddf9ad3aeeaa6cee1 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 12 Jul 2024 17:27:57 +0300 Subject: [PATCH 02/29] change to self-hosted for local testing --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fec5b8..702adb0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: fail-fast: true name: Foundry project - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 with: From 305a17677998b614fcc326452ddc5b4f4fdd9c4b Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 12 Jul 2024 17:41:29 +0300 Subject: [PATCH 03/29] change slither --- .github/workflows/test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 702adb0..e38dec1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,17 +22,18 @@ jobs: with: version: nightly - - name: Run Slither analysis on Solidity files - uses: crytic/slither-action@v0.4.0 - with: - target: packages/zksync-storage-contracts - - name: Run Forge build run: | forge --version forge build --sizes id: build + - name: Run Slither analysis on Solidity files + uses: crytic/slither-action@v0.4.0 + with: + target: packages/zksync-storage-contracts + ignore-compile: true + - name: Run Forge tests run: | forge test -vvv From d368c7405f1560573eb97d138222808931b5f238 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 12 Jul 2024 21:59:01 +0300 Subject: [PATCH 04/29] ubuntu-latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e38dec1..ba24ebf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: fail-fast: true name: Foundry project - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: From 99b10b76c61c69ab3bd20bf5aeb36396cc2b7988 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 17:21:03 +0300 Subject: [PATCH 05/29] changing the structure --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba24ebf..28a2563 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,18 +22,18 @@ jobs: with: version: nightly - - name: Run Forge build - run: | - forge --version - forge build --sizes - id: build - - name: Run Slither analysis on Solidity files uses: crytic/slither-action@v0.4.0 with: target: packages/zksync-storage-contracts ignore-compile: true + - name: Run Forge build + run: | + forge --version + forge build --sizes + id: build + - name: Run Forge tests run: | forge test -vvv From 24895b4deec0c0ba500bfd6b7654bc8dd2a6eb1b Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 17:40:01 +0300 Subject: [PATCH 06/29] testing again --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28a2563..9e49e53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,8 @@ jobs: name: Foundry project runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive From d1edc63570d5135556e03d354bdf841564abbf47 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 17:47:06 +0300 Subject: [PATCH 07/29] followed docs at slither-action --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e49e53..572cce1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,6 @@ jobs: - name: Run Slither analysis on Solidity files uses: crytic/slither-action@v0.4.0 with: - target: packages/zksync-storage-contracts ignore-compile: true - name: Run Forge build From 78c01b5486750d9af15c64bb9ad8f532aac84f7f Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 18:12:01 +0300 Subject: [PATCH 08/29] add --root to test to see how forge test work with ci --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 572cce1..e205921 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - name: Run Forge tests run: | - forge test -vvv + forge test -vvv --root packages/zksync-storage-contracts/test id: test - name: Run Echidna for zksync-storage-contracts From 7956787fee6b42f757d901a33a599a061a91a694 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 18:15:58 +0300 Subject: [PATCH 09/29] add .sol test file to improve forge test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e205921..de94a10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - name: Run Forge tests run: | - forge test -vvv --root packages/zksync-storage-contracts/test + forge test -vvv --root packages/zksync-storage-contracts/test/SparseMerkleTree.t.sol id: test - name: Run Echidna for zksync-storage-contracts From d3cf9ae3a85f3ef93161f1032a3a787d9eeb443e Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Mon, 15 Jul 2024 18:26:23 +0300 Subject: [PATCH 10/29] revert back to forge test -vvv --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de94a10..572cce1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - name: Run Forge tests run: | - forge test -vvv --root packages/zksync-storage-contracts/test/SparseMerkleTree.t.sol + forge test -vvv id: test - name: Run Echidna for zksync-storage-contracts From 52c801e028f9e0939da5aeb74867108872abd38b Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Tue, 16 Jul 2024 18:05:57 +0300 Subject: [PATCH 11/29] change in .toml file to accompany ci --- packages/zksync-storage-contracts/foundry.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/zksync-storage-contracts/foundry.toml b/packages/zksync-storage-contracts/foundry.toml index 8daacc5..79d51d3 100644 --- a/packages/zksync-storage-contracts/foundry.toml +++ b/packages/zksync-storage-contracts/foundry.toml @@ -2,6 +2,13 @@ src = "src" out = "out" libs = ["lib"] +test = "test" + +[profile.ci] +src = "src" +test = "test" +out = "out" +libs = ["lib"] # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options optimizer = true From d207dab2a51bcaea6ffe69df7d3fd074419f01a1 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Tue, 16 Jul 2024 18:14:04 +0300 Subject: [PATCH 12/29] try out targeted tests on repo --- .github/workflows/test.yml | 2 +- packages/zksync-storage-contracts/foundry.toml | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 572cce1..9c5f9e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - name: Run Forge tests run: | - forge test -vvv + forge test -vvv --root packages/zksync-storage-contracts id: test - name: Run Echidna for zksync-storage-contracts diff --git a/packages/zksync-storage-contracts/foundry.toml b/packages/zksync-storage-contracts/foundry.toml index 79d51d3..8daacc5 100644 --- a/packages/zksync-storage-contracts/foundry.toml +++ b/packages/zksync-storage-contracts/foundry.toml @@ -2,13 +2,6 @@ src = "src" out = "out" libs = ["lib"] -test = "test" - -[profile.ci] -src = "src" -test = "test" -out = "out" -libs = ["lib"] # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options optimizer = true From 90d8d681a95c1ed3ce0d1c7b8c67067e8dba7182 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Tue, 16 Jul 2024 18:24:54 +0300 Subject: [PATCH 13/29] add env for foundry --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c5f9e6..dd4abae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,4 +44,7 @@ jobs: with: files: . contract: packages/zksync-storage-contracts - crytic-args: --ignore-compile \ No newline at end of file + crytic-args: --ignore-compile + env: + FOUNDRY_PROFILE: ci + INTERNAL_GITHUB_WORKSPACE: "/home/runner/work/zksync-storage-proofs/zksync-storage-proofs" \ No newline at end of file From e4c1f60775b1332e464f28f219b0de24c56ac66d Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Tue, 16 Jul 2024 18:28:29 +0300 Subject: [PATCH 14/29] remove env --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd4abae..9c5f9e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,4 @@ jobs: with: files: . contract: packages/zksync-storage-contracts - crytic-args: --ignore-compile - env: - FOUNDRY_PROFILE: ci - INTERNAL_GITHUB_WORKSPACE: "/home/runner/work/zksync-storage-proofs/zksync-storage-proofs" \ No newline at end of file + crytic-args: --ignore-compile \ No newline at end of file From b5ce7f8a22f2f0927c52c6bab2797e1ece622deb Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 16:29:36 +0300 Subject: [PATCH 15/29] add fuzz testing to critical functions --- .github/workflows/test.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c5f9e6..c2ae28f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,9 +39,30 @@ jobs: forge test -vvv --root packages/zksync-storage-contracts id: test - - name: Run Echidna for zksync-storage-contracts + - name: Echidna scan on StorageProofVerifier uses: crytic/echidna-action@v2 with: - files: . + files: StorageProofVerifier + contract: packages/zksync-storage-contracts + crytic-args: --ignore-compile + + - name: Echidna scan on SparseMerkleTree + uses: crytic/echidna-action@v2 + with: + files: SparseMerkleTree + contract: packages/zksync-storage-contracts + crytic-args: --ignore-compile + + - name: Echidna scan on Blake2S + uses: crytic/echidna-action@v2 + with: + files: Blake2S + contract: packages/zksync-storage-contracts + crytic-args: --ignore-compile + + - name: Echidna scan on RegistryResolver + uses: crytic/echidna-action@v2 + with: + files: RegistryResolver contract: packages/zksync-storage-contracts crytic-args: --ignore-compile \ No newline at end of file From 28a8a543de9c97e1238822e57f38c1b4a6658cff Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 16:48:40 +0300 Subject: [PATCH 16/29] add relative file paths for echidna --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2ae28f..7352227 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,26 +43,26 @@ jobs: uses: crytic/echidna-action@v2 with: files: StorageProofVerifier - contract: packages/zksync-storage-contracts + contract: packages/zksync-storage-contracts/src crytic-args: --ignore-compile - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: SparseMerkleTree - contract: packages/zksync-storage-contracts + contract: packages/zksync-storage-contracts/src crytic-args: --ignore-compile - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: Blake2S - contract: packages/zksync-storage-contracts + contract: packages/zksync-storage-contracts/src crytic-args: --ignore-compile - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: RegistryResolver - contract: packages/zksync-storage-contracts + contract: packages/zksync-storage-contracts/src/demo crytic-args: --ignore-compile \ No newline at end of file From 2130828b31656835ea568ba42079d3c9413d47e2 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 17:03:12 +0300 Subject: [PATCH 17/29] adjust echidna to convention --- .github/workflows/test.yml | 12 ++++-------- packages/zksync-storage-contracts/foundry.toml | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7352227..34fb9a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,26 +43,22 @@ jobs: uses: crytic/echidna-action@v2 with: files: StorageProofVerifier - contract: packages/zksync-storage-contracts/src - crytic-args: --ignore-compile + contract: packages/zksync-storage-contracts - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: SparseMerkleTree - contract: packages/zksync-storage-contracts/src - crytic-args: --ignore-compile + contract: packages/zksync-storage-contracts - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: Blake2S - contract: packages/zksync-storage-contracts/src - crytic-args: --ignore-compile + contract: packages/zksync-storage-contracts - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: RegistryResolver - contract: packages/zksync-storage-contracts/src/demo - crytic-args: --ignore-compile \ No newline at end of file + contract: packages/zksync-storage-contracts \ No newline at end of file diff --git a/packages/zksync-storage-contracts/foundry.toml b/packages/zksync-storage-contracts/foundry.toml index 8daacc5..fd7475f 100644 --- a/packages/zksync-storage-contracts/foundry.toml +++ b/packages/zksync-storage-contracts/foundry.toml @@ -1,5 +1,4 @@ [profile.default] -src = "src" out = "out" libs = ["lib"] From ea6a352341c7bd89580a97e764093bda871da4ba Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 17:06:53 +0300 Subject: [PATCH 18/29] re-add "src" to test new changes --- packages/zksync-storage-contracts/foundry.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zksync-storage-contracts/foundry.toml b/packages/zksync-storage-contracts/foundry.toml index fd7475f..8daacc5 100644 --- a/packages/zksync-storage-contracts/foundry.toml +++ b/packages/zksync-storage-contracts/foundry.toml @@ -1,4 +1,5 @@ [profile.default] +src = "src" out = "out" libs = ["lib"] From a6f32cd2523dd54ae98524622bdae3ebe41f6027 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 17:14:02 +0300 Subject: [PATCH 19/29] remove echidna to see how it works --- .github/workflows/test.yml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34fb9a9..0bffb90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,28 +37,4 @@ jobs: - name: Run Forge tests run: | forge test -vvv --root packages/zksync-storage-contracts - id: test - - - name: Echidna scan on StorageProofVerifier - uses: crytic/echidna-action@v2 - with: - files: StorageProofVerifier - contract: packages/zksync-storage-contracts - - - name: Echidna scan on SparseMerkleTree - uses: crytic/echidna-action@v2 - with: - files: SparseMerkleTree - contract: packages/zksync-storage-contracts - - - name: Echidna scan on Blake2S - uses: crytic/echidna-action@v2 - with: - files: Blake2S - contract: packages/zksync-storage-contracts - - - name: Echidna scan on RegistryResolver - uses: crytic/echidna-action@v2 - with: - files: RegistryResolver - contract: packages/zksync-storage-contracts \ No newline at end of file + id: test \ No newline at end of file From d1deae844c9074077deaef28edd52a315f4066f8 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 21:39:17 +0300 Subject: [PATCH 20/29] fix echidna scans --- .github/workflows/test.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bffb90..8bbb04b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,4 +37,28 @@ jobs: - name: Run Forge tests run: | forge test -vvv --root packages/zksync-storage-contracts - id: test \ No newline at end of file + id: test + + - name: Echidna scan on StorageProofVerifier + uses: crytic/echidna-action@v2 + with: + files: packages/zksync-storage-contracts + contract: StorageProofVerifier + + - name: Echidna scan on RegistryResolver + uses: crytic/echidna-action@v2 + with: + files: packages/zksync-storage-contracts + contract: RegistryResolver + + - name: Echidna scan on SparseMerkleTree + uses: crytic/echidna-action@v2 + with: + files: packages/zksync-storage-contracts + contract: SparseMerkleTree + + - name: Echidna scan on Blake2S + uses: crytic/echidna-action@v2 + with: + files: packages/zksync-storage-contracts + contract: Blake2S \ No newline at end of file From ce7cd342e59dd95e140d7254b5bbaa6874acd838 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 21:55:19 +0300 Subject: [PATCH 21/29] add forge build --build-info --- .github/workflows/test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bbb04b..5bcddd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: - name: Run Forge build run: | forge --version - forge build --sizes + forge build --sizes && forge build --build-info id: build - name: Run Forge tests @@ -44,21 +44,25 @@ jobs: with: files: packages/zksync-storage-contracts contract: StorageProofVerifier + crytic-args: --ignore-compile - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: RegistryResolver + crytic-args: --ignore-compile - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: SparseMerkleTree + crytic-args: --ignore-compile - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts - contract: Blake2S \ No newline at end of file + contract: Blake2S + crytic-args: --ignore-compile \ No newline at end of file From 8cffcfbe077daee81de2e55f5dce02fb0b0ab7eb Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Fri, 19 Jul 2024 22:02:37 +0300 Subject: [PATCH 22/29] remove ignore compile in crytic args --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bcddd8..5c652e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,25 +44,25 @@ jobs: with: files: packages/zksync-storage-contracts contract: StorageProofVerifier - crytic-args: --ignore-compile + crytic-args: - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: RegistryResolver - crytic-args: --ignore-compile + crytic-args: - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: SparseMerkleTree - crytic-args: --ignore-compile + crytic-args: - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: Blake2S - crytic-args: --ignore-compile \ No newline at end of file + crytic-args: \ No newline at end of file From d0521a1558019b3cac66938bbdf1e07eccfcbee9 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 21:30:41 +0300 Subject: [PATCH 23/29] add --ignore-compile --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c652e9..5bcddd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,25 +44,25 @@ jobs: with: files: packages/zksync-storage-contracts contract: StorageProofVerifier - crytic-args: + crytic-args: --ignore-compile - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: RegistryResolver - crytic-args: + crytic-args: --ignore-compile - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: SparseMerkleTree - crytic-args: + crytic-args: --ignore-compile - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: Blake2S - crytic-args: \ No newline at end of file + crytic-args: --ignore-compile \ No newline at end of file From 39456eee70595746ccf5f063510f59d86e4f53f8 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 21:39:49 +0300 Subject: [PATCH 24/29] modify crytic-args for testing --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bcddd8..17dd6f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,25 +44,25 @@ jobs: with: files: packages/zksync-storage-contracts contract: StorageProofVerifier - crytic-args: --ignore-compile + crytic-args: "" - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: RegistryResolver - crytic-args: --ignore-compile + crytic-args: "" - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: SparseMerkleTree - crytic-args: --ignore-compile + crytic-args: "" - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: Blake2S - crytic-args: --ignore-compile \ No newline at end of file + crytic-args: "" \ No newline at end of file From 5c88ad4e608646718488f2015dc4cac376d81e63 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 21:45:06 +0300 Subject: [PATCH 25/29] add clean build with build info --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17dd6f0..ed0c349 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,11 @@ jobs: forge test -vvv --root packages/zksync-storage-contracts id: test + - name: Do a clean build with build info + run: | + cd packages/zksync-storage-contracts && forge build --build-info + + - name: Echidna scan on StorageProofVerifier uses: crytic/echidna-action@v2 with: From 882a4cd3f2fd932169e01e3e41805aa7b44eda65 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 21:48:31 +0300 Subject: [PATCH 26/29] most recent tests --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed0c349..6c820f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,25 +49,25 @@ jobs: with: files: packages/zksync-storage-contracts contract: StorageProofVerifier - crytic-args: "" + crytic-args: --ignore-compile - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: RegistryResolver - crytic-args: "" + crytic-args: --ignore-compile - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: SparseMerkleTree - crytic-args: "" + crytic-args: --ignore-compile - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: Blake2S - crytic-args: "" \ No newline at end of file + crytic-args: --ignore-compile \ No newline at end of file From 0700fc6b5641dffc86ef3986db8d6079a3e97748 Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 21:56:33 +0300 Subject: [PATCH 27/29] root cause analysis finding for echidna --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c820f1..e40ae3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,16 +34,10 @@ jobs: forge build --sizes && forge build --build-info id: build - - name: Run Forge tests - run: | - forge test -vvv --root packages/zksync-storage-contracts - id: test - - name: Do a clean build with build info run: | cd packages/zksync-storage-contracts && forge build --build-info - - name: Echidna scan on StorageProofVerifier uses: crytic/echidna-action@v2 with: From 5b457af7fe4fa74768a7d9b9cece8e725754f8af Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 22:05:18 +0300 Subject: [PATCH 28/29] add test mode: assertion --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e40ae3b..e920052 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,7 @@ jobs: files: packages/zksync-storage-contracts contract: StorageProofVerifier crytic-args: --ignore-compile + test-mode: assertion - name: Echidna scan on RegistryResolver uses: crytic/echidna-action@v2 @@ -51,6 +52,7 @@ jobs: files: packages/zksync-storage-contracts contract: RegistryResolver crytic-args: --ignore-compile + test-mode: assertion - name: Echidna scan on SparseMerkleTree uses: crytic/echidna-action@v2 @@ -58,10 +60,12 @@ jobs: files: packages/zksync-storage-contracts contract: SparseMerkleTree crytic-args: --ignore-compile + test-mode: assertion - name: Echidna scan on Blake2S uses: crytic/echidna-action@v2 with: files: packages/zksync-storage-contracts contract: Blake2S - crytic-args: --ignore-compile \ No newline at end of file + crytic-args: --ignore-compile + test-mode: assertion \ No newline at end of file From acd2ab99bd93649fce3c43a60a06e8707ad787aa Mon Sep 17 00:00:00 2001 From: Ata Tekeli Date: Sat, 20 Jul 2024 22:13:13 +0300 Subject: [PATCH 29/29] remove fuzzing step --- .github/workflows/test.yml | 39 ++++---------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e920052..a6bc513 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,41 +31,10 @@ jobs: - name: Run Forge build run: | forge --version - forge build --sizes && forge build --build-info + forge build --sizes id: build - - name: Do a clean build with build info + - name: Run Forge tests run: | - cd packages/zksync-storage-contracts && forge build --build-info - - - name: Echidna scan on StorageProofVerifier - uses: crytic/echidna-action@v2 - with: - files: packages/zksync-storage-contracts - contract: StorageProofVerifier - crytic-args: --ignore-compile - test-mode: assertion - - - name: Echidna scan on RegistryResolver - uses: crytic/echidna-action@v2 - with: - files: packages/zksync-storage-contracts - contract: RegistryResolver - crytic-args: --ignore-compile - test-mode: assertion - - - name: Echidna scan on SparseMerkleTree - uses: crytic/echidna-action@v2 - with: - files: packages/zksync-storage-contracts - contract: SparseMerkleTree - crytic-args: --ignore-compile - test-mode: assertion - - - name: Echidna scan on Blake2S - uses: crytic/echidna-action@v2 - with: - files: packages/zksync-storage-contracts - contract: Blake2S - crytic-args: --ignore-compile - test-mode: assertion \ No newline at end of file + forge test -vvv --root packages/zksync-storage-contracts + id: test \ No newline at end of file