From 8fdd0d72250708f495329f9a95a5e73f4fe625b7 Mon Sep 17 00:00:00 2001 From: Petar Ivanov <29689712+dartdart26@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:27:18 +0300 Subject: [PATCH 1/7] Update go-ethereum and fhevm-solidity versions --- Makefile | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 26f1dce0..bf8618bc 100755 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ FHEVM_DECRYPTIONS_DB_VERSION ?= v0.2.0 FHEVM_SOLIDITY_PATH ?= $(WORKDIR)/fhevm-solidity FHEVM_SOLIDITY_PATH_EXISTS := $(shell test -d $(FHEVM_SOLIDITY_PATH)/.git && echo "true" || echo "false") -FHEVM_SOLIDITY_VERSION ?= v0.1.9 +FHEVM_SOLIDITY_VERSION ?= b0046e66b383f0880b94e36a55952144cc09d068 ETHERMINT_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/ethermint) GO_ETHEREUM_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/go-ethereum) diff --git a/go.mod b/go.mod index 72e6ac91..c339750b 100644 --- a/go.mod +++ b/go.mod @@ -173,6 +173,6 @@ replace ( replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: Remove once our forks are public. -replace github.com/ethereum/go-ethereum v1.10.19 => github.com/zama-ai/go-ethereum v0.1.9 +replace github.com/ethereum/go-ethereum v1.10.19 => github.com/zama-ai/go-ethereum v0.1.10-for-ci replace github.com/evmos/ethermint v0.19.3 => github.com/zama-ai/ethermint v0.1.2 From 377a90e67cb751fc91f03c7a006072ac230e1f95 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 09:12:00 +0200 Subject: [PATCH 2/7] ci: update Makefile to run the fhevm-solidity tests instead of python ERC20 test --- .env | 4 ++-- Makefile | 13 +++---------- docker/Dockerfile.evmos-node.local | 1 + 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.env b/.env index 1baebc73..dd9870f7 100644 --- a/.env +++ b/.env @@ -3,6 +3,6 @@ # ZBC_DEVELOPMENT_PATH=../zbc-development # ZBC_SOLIDITY_PATH=../zbc-solidity # ZBC_FHE_TOOL_PATH=../zbc-fhe-tool -LOCAL_BUILD=false -#LOCAL_BUILD=true +#LOCAL_BUILD=false +LOCAL_BUILD=true GOPRIVATE=github.com/zama-ai/* diff --git a/Makefile b/Makefile index bf8618bc..e3285237 100755 --- a/Makefile +++ b/Makefile @@ -404,17 +404,10 @@ endif run_e2e_test: @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/prepare_fhe_keys_for_e2e_test.sh $(CURDIR)/volumes/network-public-fhe-keys - @cd $(FHEVM_SOLIDITY_PATH) && npm install -ifeq ($(LOCAL_BUILD),true) - $(info LOCAL_BUILD is set) - @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/run_ERC20_e2e_test.sh mykey1 $(CURDIR) -else - $(info LOCAL_BUILD is not set) - @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/run_ERC20_ci_test.sh mykey1 $(CURDIR) -endif + @cd $(FHEVM_SOLIDITY_PATH) && npm ci + @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/run_tests.sh @sleep 5 - - + change_running_node_owner: ifeq ($(GITHUB_ACTIONS),true) diff --git a/docker/Dockerfile.evmos-node.local b/docker/Dockerfile.evmos-node.local index b96aa55e..b3337290 100644 --- a/docker/Dockerfile.evmos-node.local +++ b/docker/Dockerfile.evmos-node.local @@ -31,6 +31,7 @@ WORKDIR /config ADD setup.sh . RUN chmod +x /config/setup.sh ADD zama_config.toml . +ADD --chmod=755 faucet.py /usr/local/bin/faucet RUN mkdir -p /root/.evmosd/zama RUN touch /root/.evmosd/zama/vm.log From 609b30b62d45753ed1d1c77e2ead230222523f61 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 09:27:55 +0200 Subject: [PATCH 3/7] ci: update fhevm-solidity version that includes the run_tests.sh script --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e3285237..a6952ebf 100755 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ FHEVM_DECRYPTIONS_DB_VERSION ?= v0.2.0 FHEVM_SOLIDITY_PATH ?= $(WORKDIR)/fhevm-solidity FHEVM_SOLIDITY_PATH_EXISTS := $(shell test -d $(FHEVM_SOLIDITY_PATH)/.git && echo "true" || echo "false") -FHEVM_SOLIDITY_VERSION ?= b0046e66b383f0880b94e36a55952144cc09d068 +FHEVM_SOLIDITY_VERSION ?= petar/fhe-rand ETHERMINT_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/ethermint) GO_ETHEREUM_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/go-ethereum) From 36df1601cedb4c1089756c5707b3a6165ad87ab4 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 11:56:05 +0200 Subject: [PATCH 4/7] ci: use evmos-node v0.1.9-alpha as base image for dev image --- docker/Dockerfile.evmos-node.developer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.evmos-node.developer b/docker/Dockerfile.evmos-node.developer index 3a75b80a..f5d6faa6 100644 --- a/docker/Dockerfile.evmos-node.developer +++ b/docker/Dockerfile.evmos-node.developer @@ -3,7 +3,7 @@ FROM ghcr.io/zama-ai/fhevm-decryptions-db:v0.2.0 as oracle-env FROM ghcr.io/zama-ai/fhevm-tfhe-cli:v0.2.0 as tfhe-cli -FROM ghcr.io/zama-ai/evmos-node:v0.1.8 +FROM ghcr.io/zama-ai/evmos-node:v0.1.9-alpha WORKDIR /config From 70b25240f0a1f2288e5674cd613a3ccb979f9694 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 13:41:31 +0200 Subject: [PATCH 5/7] ci: add ability to checkout different evmos folder to take into account change in docker/Dockerfile.evmos-node.developer for instance in the github action env --- .github/workflows/publish_developer_image.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish_developer_image.yml b/.github/workflows/publish_developer_image.yml index 1d936f82..b89d4906 100644 --- a/.github/workflows/publish_developer_image.yml +++ b/.github/workflows/publish_developer_image.yml @@ -8,6 +8,11 @@ on: default: "latest" type: string required: false + ref_to_evmos: + description: 'Branch, tag or commit SHA1 to checkout Evmos' + required: true + default: "v9.1.0-zama" + type: string env: DOCKER_IMAGE: ghcr.io/zama-ai/evmos-dev-node @@ -21,6 +26,8 @@ jobs: - name: Check out evmos uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref_to_evmos }} - name: Login to GitHub Container Registry uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b From 907ca9014897fd7584dc1834368d2daa3fd17261 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 16:16:30 +0200 Subject: [PATCH 6/7] ci: use stable versions for go-eth and fhevm-solidity --- Makefile | 3 +-- go.mod | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a6952ebf..5fc18d97 100755 --- a/Makefile +++ b/Makefile @@ -49,8 +49,7 @@ FHEVM_DECRYPTIONS_DB_VERSION ?= v0.2.0 FHEVM_SOLIDITY_PATH ?= $(WORKDIR)/fhevm-solidity FHEVM_SOLIDITY_PATH_EXISTS := $(shell test -d $(FHEVM_SOLIDITY_PATH)/.git && echo "true" || echo "false") -FHEVM_SOLIDITY_VERSION ?= petar/fhe-rand - +FHEVM_SOLIDITY_VERSION ?= v0.1.11 ETHERMINT_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/ethermint) GO_ETHEREUM_VERSION := $(shell ./scripts/get_module_version.sh go.mod zama.ai/go-ethereum) UPDATE_GO_MOD = go.mod.updated diff --git a/go.mod b/go.mod index c339750b..842507eb 100644 --- a/go.mod +++ b/go.mod @@ -173,6 +173,6 @@ replace ( replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: Remove once our forks are public. -replace github.com/ethereum/go-ethereum v1.10.19 => github.com/zama-ai/go-ethereum v0.1.10-for-ci +replace github.com/ethereum/go-ethereum v1.10.19 => github.com/zama-ai/go-ethereum v0.1.10 replace github.com/evmos/ethermint v0.19.3 => github.com/zama-ai/ethermint v0.1.2 From 988d52e75194567a884c74d6c49f6b0867c199b1 Mon Sep 17 00:00:00 2001 From: Levent Demir Date: Thu, 7 Sep 2023 16:42:35 +0200 Subject: [PATCH 7/7] ci: add script to run test in fhevm-solidity --- Makefile | 2 ++ scripts/run_tests.sh | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100755 scripts/run_tests.sh diff --git a/Makefile b/Makefile index 5fc18d97..8e595abf 100755 --- a/Makefile +++ b/Makefile @@ -404,6 +404,8 @@ endif run_e2e_test: @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/prepare_fhe_keys_for_e2e_test.sh $(CURDIR)/volumes/network-public-fhe-keys @cd $(FHEVM_SOLIDITY_PATH) && npm ci +## Copy the run_tests.sh script directly in fhevm-solidity for the nxt version + @cp ./scripts/run_tests.sh $(FHEVM_SOLIDITY_PATH)/ci/scripts/ @cd $(FHEVM_SOLIDITY_PATH) && ci/scripts/run_tests.sh @sleep 5 diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh new file mode 100755 index 00000000..7dc49418 --- /dev/null +++ b/scripts/run_tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cp .env.example .env +docker exec -i evmosnodelocal0 faucet $(npx hardhat task:getEthereumAddress) +sleep 8 +docker exec -i evmosnodelocal0 faucet $(npx hardhat accounts | grep 0x | sed -n '2p') +sleep 8 +docker exec -i evmosnodelocal0 faucet $(npx hardhat accounts | grep 0x | sed -n '3p') +npm test