From 7f33437e63cb6138edb4909b271fb3b95f82e92a Mon Sep 17 00:00:00 2001 From: Petar Ivanov <29689712+dartdart26@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:52:00 +0300 Subject: [PATCH] feature: add rand() - publish v0.1.9-alpha (#191) * ci: update Makefile to run the fhevm-solidity tests instead of python ERC20 test * ci: update fhevm-solidity version that includes the run_tests.sh script * ci: use evmos-node v0.1.9-alpha as base image for dev image * 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 * ci: add script to run test in fhevm-solidity --------- Co-authored-by: Levent Demir --- .env | 4 ++-- .github/workflows/publish_developer_image.yml | 7 +++++++ Makefile | 18 ++++++------------ docker/Dockerfile.evmos-node.developer | 2 +- docker/Dockerfile.evmos-node.local | 1 + go.mod | 2 +- scripts/run_tests.sh | 9 +++++++++ 7 files changed, 27 insertions(+), 16 deletions(-) create mode 100755 scripts/run_tests.sh 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/.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 diff --git a/Makefile b/Makefile index 26f1dce0..8e595abf 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 ?= v0.1.9 - +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 @@ -404,17 +403,12 @@ 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 +## 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 - - + change_running_node_owner: ifeq ($(GITHUB_ACTIONS),true) 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 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 diff --git a/go.mod b/go.mod index 72e6ac91..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.9 +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 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