From 6423a338eb9a745315e477c0048c95eea5923593 Mon Sep 17 00:00:00 2001 From: Grant Zukel <80433392+gzukel@users.noreply.github.com> Date: Thu, 30 May 2024 10:25:57 -0600 Subject: [PATCH] ci: add nightly performance testing, update localnet Docker image to Debian Bookworm, remove unnecessary build-jet runners. (#2285) * ci: adding nightly performance testing, removed buildjet where not-needed, and changed localnet docker image to use debian-bookworm * changed ubuntu-latest to ubunt-22.04, updated go releaser version to the last published 1.20 version * update orchestrator to bookworm --- .github/actions/performance-tests/art.yaml | 303 ++++++++++++ .github/workflows/change-log-check.yml | 2 +- .../ci-nightly-performance-testing.yaml | 34 ++ .github/workflows/docker-build-and-push.yml | 2 +- .github/workflows/generate-files.yml | 2 +- .github/workflows/labeler.yml | 2 +- .github/workflows/publish-release.yml | 20 +- .github/workflows/publish-typescript.yaml | 2 +- .github/workflows/rc-release.yml | 4 +- .github/workflows/release-status-changer.yml | 2 +- .github/workflows/sast-linters.yml | 8 +- .github/workflows/semantic-pr.yml | 2 +- .github/workflows/upgrade_path_testing.yaml | 451 ------------------ Dockerfile-localnet | 6 +- Makefile | 2 +- changelog.md | 4 +- .../orchestrator/Dockerfile.fastbuild | 2 +- 17 files changed, 368 insertions(+), 480 deletions(-) create mode 100644 .github/actions/performance-tests/art.yaml create mode 100644 .github/workflows/ci-nightly-performance-testing.yaml delete mode 100644 .github/workflows/upgrade_path_testing.yaml diff --git a/.github/actions/performance-tests/art.yaml b/.github/actions/performance-tests/art.yaml new file mode 100644 index 0000000000..71c1b3a15e --- /dev/null +++ b/.github/actions/performance-tests/art.yaml @@ -0,0 +1,303 @@ +# artillery run art.yaml --output results.json +# artillery report results.json --output artillery_report.html +config: + target: "http://127.0.0.1:8545" + phases: + - duration: 60 + arrivalRate: 10 + defaults: + headers: + content-type: "application/json" + http: + timeout: 60 + plugins: + metrics-by-endpoint: + useOnlyRequestNames: true + summary: true + reports: + - type: "html" + filename: "artillery_report.html" + +scenarios: + - name: web3_clientVersion + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "web3_clientVersion" + params: [] + + - name: web3_sha3 + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "web3_sha3" + params: + - "0x68656c6c6f20776f726c64" + + - name: net_version + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "net_version" + params: [] + + - name: net_listening + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "net_listening" + params: [] + + - name: net_peerCount + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "net_peerCount" + params: [] + + - name: eth_chainId + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_chainId" + params: [] + + - name: eth_getStorageAt + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getStorageAt" + params: + - "latest" + + - name: eth_getTransactionByBlockHashAndIndex + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getTransactionByBlockHashAndIndex" + params: + - "0x0" + + - name: eth_getTransactionByBlockNumberAndIndex + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getTransactionByBlockNumberAndIndex" + params: + - "latest" + - "0x0" + + - name: eth_getUncleByBlockHashAndIndex + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getUncleByBlockHashAndIndex" + params: + - "0x0" + + - name: eth_getUncleByBlockNumberAndIndex + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getUncleByBlockNumberAndIndex" + params: + - "latest" + - "0x0" + + - name: eth_newFilter + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_newFilter" + params: + - { + fromBlock: "latest", + toBlock: "latest", + address: "0x0", + topics: [] + } + + - name: eth_getFilterChanges + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getFilterChanges" + params: + - "0x0" + + - name: eth_getFilterLogs + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getFilterLogs" + params: + - "0x0" + + - name: eth_blockNumber + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_blockNumber" + params: [] + + - name: eth_getBlockByHash + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getBlockByHash" + params: + - "0x0" + - true + + - name: eth_getBlockByNumber + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getBlockByNumber" + params: + - "latest" + - true + + - name: eth_getBlockTransactionCountByHash + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getBlockTransactionCountByHash" + params: + - "0x0" + + - name: eth_getBlockTransactionCountByNumber + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getBlockTransactionCountByNumber" + params: + - "latest" + + - name: eth_getCode + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getCode" + params: + - "0x0" + - "latest" + + - name: eth_getTransactionByHash + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getTransactionByHash" + params: + - "0x0" + + - name: eth_getTransactionReceipt + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getTransactionReceipt" + params: + - "0x0" + + - name: eth_getLogs + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getLogs" + params: + - fromBlock: "0x1" + toBlock: "latest" + address: "0x0" + topics: ["0x0"] + + - name: eth_getBalance + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_getBalance" + params: + - "0x0" + - "latest" + + - name: eth_estimateGas + flow: + - post: + url: "/" + json: + id: 1 + jsonrpc: "2.0" + method: "eth_estimateGas" + params: + - from: "0x0" diff --git a/.github/workflows/change-log-check.yml b/.github/workflows/change-log-check.yml index dd3a98d4bf..85b68b70e6 100644 --- a/.github/workflows/change-log-check.yml +++ b/.github/workflows/change-log-check.yml @@ -6,7 +6,7 @@ on: jobs: check-changelog: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/ci-nightly-performance-testing.yaml b/.github/workflows/ci-nightly-performance-testing.yaml new file mode 100644 index 0000000000..15245da280 --- /dev/null +++ b/.github/workflows/ci-nightly-performance-testing.yaml @@ -0,0 +1,34 @@ +name: "NIGHTLY:EVM:PERFORMANCE:TESTING" + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' # Runs every day at midnight UTC + +jobs: + nightly_evm_api_performance_test: + name: "NIGHTLY:EVM:API:PERFORMANCE:TEST" + runs-on: "buildjet-16vcpu-ubuntu-2204" + steps: + - uses: actions/checkout@v4 + + - name: "START:LOCAL:NET" + run: | + make start-e2e-test + + - name: "EXECUTE:LOADTESTS" + uses: artilleryio/action-cli@v1 + with: + command: run .github/actions/performance-tests/art.yaml --output ./report.json + + - name: "GENERATE:REPORT" + uses: artilleryio/action-cli@v1 + with: + command: report report.json --output artillery_report.html + + - name: "UPLOAD:REPORT" + uses: actions/upload-artifact@v3 + if: success() + with: + name: artillery-report + path: ./artillery_report.html \ No newline at end of file diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 397affe896..95ca015953 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -22,7 +22,7 @@ env: jobs: docker_build_ubuntu: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 30 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/generate-files.yml b/.github/workflows/generate-files.yml index 1a948ceb96..881ec2025f 100644 --- a/.github/workflows/generate-files.yml +++ b/.github/workflows/generate-files.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 936823a405..e0bd3f250f 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -10,6 +10,6 @@ jobs: permissions: contents: read pull-requests: write - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/labeler@v4 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 3adfa8e37b..a396f4d71d 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -25,7 +25,7 @@ concurrency: jobs: check_branch: if: ${{ (startsWith(github.ref, 'refs/heads/release/v') || startsWith(github.ref, 'refs/heads/hotfix/v')) }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Branch run: | @@ -34,7 +34,7 @@ jobs: gosec: needs: - check_branch - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: GO111MODULE: on steps: @@ -65,7 +65,7 @@ jobs: gosec-cosmos: needs: - check_branch - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: GO111MODULE: on steps: @@ -94,7 +94,7 @@ jobs: lint: needs: - check_branch - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 15 env: GO111MODULE: on @@ -128,7 +128,7 @@ jobs: check-changelog: needs: - check_branch - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code @@ -170,7 +170,7 @@ jobs: check-upgrade-handler-updated: needs: - check_branch - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: @@ -202,7 +202,7 @@ jobs: build-test: needs: - check_branch - runs-on: buildjet-4vcpu-ubuntu-2204 + runs-on: ubuntu-22.04 timeout-minutes: 15 concurrency: group: "build-test" @@ -279,7 +279,7 @@ jobs: smoke-test: needs: - check_branch - runs-on: buildjet-4vcpu-ubuntu-2204 + runs-on: ubuntu-22.04 timeout-minutes: 25 steps: - name: "Checkout Code" @@ -357,7 +357,7 @@ jobs: e2e-admin-tests: needs: - check_branch - runs-on: buildjet-4vcpu-ubuntu-2204 + runs-on: ubuntu-22.04 timeout-minutes: 120 steps: - name: "Checkout Code" @@ -411,7 +411,7 @@ jobs: - e2e-admin-tests - e2e-upgrade-test - check_branch - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 60 environment: release steps: diff --git a/.github/workflows/publish-typescript.yaml b/.github/workflows/publish-typescript.yaml index 890f867d8b..9c4358a43b 100644 --- a/.github/workflows/publish-typescript.yaml +++ b/.github/workflows/publish-typescript.yaml @@ -5,7 +5,7 @@ on: types: [created] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml index 26804e8937..94f67de95b 100644 --- a/.github/workflows/rc-release.yml +++ b/.github/workflows/rc-release.yml @@ -14,7 +14,7 @@ env: jobs: pre-release-checks: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!" publish-release: - runs-on: buildjet-4vcpu-ubuntu-2204 + runs-on: ubuntu-22.04 timeout-minutes: 60 needs: - pre-release-checks diff --git a/.github/workflows/release-status-changer.yml b/.github/workflows/release-status-changer.yml index d07aa16fce..5095a4eb3d 100644 --- a/.github/workflows/release-status-changer.yml +++ b/.github/workflows/release-status-changer.yml @@ -7,7 +7,7 @@ on: jobs: run-script: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout Repository diff --git a/.github/workflows/sast-linters.yml b/.github/workflows/sast-linters.yml index 5f754ba1ac..3b8381e19d 100644 --- a/.github/workflows/sast-linters.yml +++ b/.github/workflows/sast-linters.yml @@ -15,7 +15,7 @@ concurrency: jobs: gosec: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: GO111MODULE: on steps: @@ -35,7 +35,7 @@ jobs: args: ./... gosec-cosmos: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: GO111MODULE: on steps: @@ -53,7 +53,7 @@ jobs: run: make lint-cosmos-gosec lint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 15 env: GO111MODULE: on @@ -76,7 +76,7 @@ jobs: args: --out-format=json nosec_alert: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 10 env: GO111MODULE: on diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index 498b95bece..11af7d5710 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -9,7 +9,7 @@ on: jobs: main: name: Validate PR title - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: amannn/action-semantic-pull-request@v5 env: diff --git a/.github/workflows/upgrade_path_testing.yaml b/.github/workflows/upgrade_path_testing.yaml deleted file mode 100644 index a4a2af9204..0000000000 --- a/.github/workflows/upgrade_path_testing.yaml +++ /dev/null @@ -1,451 +0,0 @@ -name: "UPGRADE_PATH_TESTING" - -on: - workflow_dispatch: - inputs: - version: - description: 'The new version of tag you are going to download the binary from..' - required: true - default: 'v10.1.0' - upgrade_name: - description: 'The version that is set in setup_handlers.go' - required: true - default: 'v10.1.0' - current_version: - description: 'The version that the network is currently on.' - required: true - default: 'v10.0.0' - -jobs: - upgrade_path_test_state_export: - name: "UPGRADE_PATH_TEST_STATE_EXPORT" - runs-on: ["buildjet-8vcpu-ubuntu-2204"] - env: - latest_state_export: "https://zetachain-external-files.s3.amazonaws.com/state-export/athens3/latest.json" - github_binary_version_link: "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored_testnet-linux-amd64" - downloaded_binary_name: "zetacored-testnet-linux-amd64" - VERSION: "${{ github.event.inputs.version }}" - aws_region: "us-east-1" - GAS_PRICES: "1.0azeta" - DEPOSIT: "10000000000000000000azeta" - METADATA: "ipfs://QmeABfwZ2nAxDzYyqZ1LEypPgQFMjEyrx8FfnoPLkF8R3f" - LOG_LEVEL: "INFO" - CHAINID: "localnet_101-1" - DAEMON_HOME: "/home/runner/.zetacored" - UPGRADE_NAME: "${{ github.event.inputs.upgrade_name }}" - DAEMON_NAME: "zetacored" - DENOM: "azeta" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "true" - DAEMON_RESTART_AFTER_UPGRADE: "true" - MONIKER: "zeta" - BLOCK_TIME_SECONDS: "6" - PROPOSAL_TIME_SECONDS: "60" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "-enable-chains,GOERLI,-val,zeta" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - BINARY_NAME_SUFFIX: "ubuntu-22-amd64" - UPGRADES_SLEEP_TIME: "300" - KEYRING: "test" - STATUS_ENDPOINT: "http://127.0.0.1:26657/status" - ABCI_ENDPOINT: "http://127.0.0.1:26657/abci_info" - ENDPOINT: "http://127.0.0.1:26657" - SLEEP_DURATION: "5" - GOV_ADDRESS: "zeta10d07y265gmmuvt4z0w9aw880jnsr700jvxasvr" - previous_height: "-1" - stalled_count: "0" - first: "true" - MAX_TRIES: "100" - count: "0" - steps: - - uses: actions/checkout@v1 - - - id: install-aws-cli - uses: unfor19/install-aws-cli-action@v1 - with: - version: 2 - - - uses: actions/setup-go@v5 - with: - check-latest: false - go-version: '^1.20' - - - name: "CLONE:ZETAVISOR:REPOSITORY" - uses: actions/checkout@v2 - with: - repository: zeta-chain/cosmos-sdk - path: zetavisor/ - ref: zetavisor-v0.1.5 - - - name: "INSTALL_APT_PACKAGES" - working-directory: "zetavisor/cosmovisor" - run: | - echo "*********INSTALL SOME APT PACKAGES*********" - sudo apt update - sudo apt install unzip psmisc -y - - - name: "INSTALL_ZETAVISOR" - working-directory: "zetavisor/cosmovisor" - run: | - echo "*********INSTALL ZETAVISOR*********" - go get github.com/zeta-chain/cosmos-sdk/cosmovisor/cmd/zetavisor - go install github.com/zeta-chain/cosmos-sdk/cosmovisor/cmd/zetavisor - zetavisor version || echo "zetavisor failed to install." - - echo "*********SETUP ZETAVISOR DIRECTORIES*********" - rm -rf /home/runner/.zetacored - mkdir -p /home/runner/.zetacored/zetavisor - mkdir -p /home/runner/.zetacored/zetavisor/genesis/bin - mkdir -p /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin - mkdir -p /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin - - - name: "DOWNLOAD_STATE_EXPORT_AND_BINARIES" - run: | - echo "*********DOWNLOAD STATE EXPORT*********" - wget -q ${latest_state_export} - - echo "*********DOWNLOAD UPGRADE BINARY AND PUT IN ZETAVISOR UPGRADES FOLDER*********" - wget -q ${github_binary_version_link} -O /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored - ZETACORED_CHECKSUM=$(shasum -b -a 256 /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored | cut -d ' ' -f 1) - sudo chmod a+x /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored - - echo "UPGRADE_INFO=${UPGRADE_INFO}" >> ${GITHUB_ENV} - ls -lah /home/runner/.zetacored/zetavisor/upgrades/ - ls -lah /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored - - wget -q ${github_binary_version_link} -O /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored - ZETACORED_CHECKSUM=$(shasum -b -a 256 /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored | cut -d ' ' -f 1) - sudo chmod a+x /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored - - echo "UPGRADE_INFO=${UPGRADE_INFO}" >> ${GITHUB_ENV} - ls -lah /home/runner/.zetacored/zetavisor/upgrades/ - ls -lah /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored - - echo "ZETACORED_CHECKSUM=${ZETACORED_CHECKSUM}" >> ${GITHUB_ENV} - UPGRADE_INFO='{"binaries": {"zetacored-linux/amd64": "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored_testnet-linux-amd64?checksum=sha256:'${ZETACORED_CHECKSUM}'"}}' - echo ${UPGRADE_INFO} - - echo "*********DOWNLOAD CURRENT BINARY AND PUT IN ZETAVISOR GENESIS & CURRENT FOLDER*********" - current_version=$(curl https://rpc-archive.athens.zetachain.com:26657/abci_info -s | jq .result.response.version -r | tr -d '\n') - current_version=${{ github.event.inputs.current_version }} - echo "STARTING_VERSION=${current_version}" >> ${GITHUB_ENV} - echo "STARTING_VERSION=${current_version}" - if [ "${{ github.event.inputs.current_version }}" == "v10.0.0" ]; then - echo "download 10.0.0 binary" - wget -q https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.current_version }}/zetacored-ubuntu-22-amd64 -O /home/runner/.zetacored/zetavisor/genesis/bin/zetacored - else - echo "download non 10.0.0 version" - wget -q https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.current_version }}/zetacored_testnet-linux-amd64 -O /home/runner/.zetacored/zetavisor/genesis/bin/zetacored - fi - sudo chmod a+x /home/runner/.zetacored/zetavisor/genesis/bin/zetacored - echo "PATH=/home/runner/.zetacored/zetavisor/genesis/bin:$PATH" >> ${GITHUB_ENV} - - - name: "START_TESTING_NETWORK" - run: | - zetacored config keyring-backend $KEYRING --home ${DAEMON_HOME} - - zetacored config chain-id $CHAINID --home ${DAEMON_HOME} - - zetacored keys delete zetaa --keyring-backend $KEYRING -y > /dev/null 2>&1 || echo "doesn't exist" - zetacored keys delete executer_zeta --keyring-backend $KEYRING -y > /dev/null 2>&1 || echo "doesn't exist" - zetacored keys delete mario --keyring-backend $KEYRING -y > /dev/null 2>&1 || echo "doesn't exist" - zetacored keys delete executer_mario --keyring-backend $KEYRING -y > /dev/null 2>&1 || echo "doesn't exist" - - echo "race draft rival universe maid cheese steel logic crowd fork comic easy truth drift tomorrow eye buddy head time cash swing swift midnight borrow" | zetacored keys add zeta --algo=secp256k1 --recover --keyring-backend=$KEYRING - echo "hand inmate canvas head lunar naive increase recycle dog ecology inhale december wide bubble hockey dice worth gravity ketchup feed balance parent secret orchard" | zetacored keys add mario --algo secp256k1 --recover --keyring-backend=$KEYRING - echo "lounge supply patch festival retire duck foster decline theme horror decline poverty behind clever harsh layer primary syrup depart fantasy session fossil dismiss east" | zetacored keys add executer_zeta --recover --keyring-backend=$KEYRING --algo secp256k1 - echo "debris dumb among crew celery derive judge spoon road oyster dad panic adult song attack net pole merge mystery pig actual penalty neither peasant"| zetacored keys add executer_mario --algo=secp256k1 --recover --keyring-backend=$KEYRING - - echo ' - [ - { - "IsObserver": "y", - "ObserverAddress": "zeta13c7p3xrhd6q2rx3h235jpt8pjdwvacyw6twpax", - "ZetaClientGranteeAddress": "zeta10up34mvwjhjd9xkq56fwsf0k75vtg287uav69n", - "ZetaClientGranteePubKey": "zetapub1addwnpepqtlu7fykuh875xjckz4mn4x0mzc25rrqk5qne7mrwxqmatgllv3nx6lrkdp" - }, - { - "IsObserver": "y", - "ObserverAddress": "zeta1f203dypqg5jh9hqfx0gfkmmnkdfuat3jr45ep2", - "ZetaClientGranteeAddress": "zeta1unzpyll3tmutf0r8sqpxpnj46vtdr59mw8qepx", - "ZetaClientGranteePubKey": "zetapub1addwnpepqwy5pmg39regpq0gkggxehmfm8hwmxxw94sch7qzh4smava0szs07kk5045" - } - ] - ' > observers.json - - zetacored init Zetanode-Localnet --chain-id=$CHAINID - - #Set config to use azeta - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="azeta"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="azeta"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="azeta"' > ~/.zetacored/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="azeta"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["evm"]["params"]["evm_denom"]="azeta"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - cat $DAEMON_HOME/config/genesis.json | jq '.app_state["gov"]["voting_params"]["voting_period"]="60s"' > $DAEMON_HOME/config/tmp_genesis.json && mv $DAEMON_HOME/config/tmp_genesis.json $DAEMON_HOME/config/genesis.json - - sed -i '/\[api\]/,+3 s/enable = false/enable = true/' $DAEMON_HOME/config/app.toml - - zetacored add-observer-list observers.json --keygen-block=5 - - zetacored gentx zeta 1000000000000000000000azeta --chain-id=$CHAINID --keyring-backend=$KEYRING - - echo "Collecting genesis txs..." - zetacored collect-gentxs - - echo "Validating genesis file..." - zetacored validate-genesis - - cp $DAEMON_HOME/config/genesis.json ./genesis.json - - echo "Do Genesis Manipulation" - export OLD_GENESIS=./latest.json - export NEW_GENESIS=./genesis.json - - python .github/actions/upgrade-testing/scripts/create_genesis.py - - echo "Move Manipulated Genesis" - cp ./genesis-edited.json $DAEMON_HOME/config/genesis.json - - cat $DAEMON_HOME/config/genesis.json | grep -A 10 -B 10 out_tx_tracker - - echo "Zetavisor Version" - zetavisor version || echo "zetavisor not found" - zetacored version || echo "zetcored not found" - - echo "Start Network" - nohup zetavisor start --rpc.laddr tcp://0.0.0.0:26657 --minimum-gas-prices ${GAS_PRICES} "--grpc.enable=true" > cosmovisor.log 2>&1 & - - sleep ${UPGRADES_SLEEP_TIME} - cat cosmovisor.log - - - name: "DETERMINE_UPGRADE_TYPE" - shell: python - run: | - import os - - first_version=os.environ["STARTING_VERSION"] - first_major_version = first_version.split(".")[0] - first_minor_version = first_version.split(".")[1] - first_sub_version = first_version.split(".")[2] - - version="${{ github.event.inputs.version }}" - major_version = version.split(".")[0] - minor_version = version.split(".")[1] - sub_version = version.split(".")[2] - - print("${{ github.event.inputs.version }}") - git_env_file = open(os.environ["GITHUB_ENV"], "a+") - - if "${{ github.event.inputs.version }}" == "v10.1.0": - git_env_file.write("UPGRADE_TYPE=GOV") - elif major_version == first_major_version and minor_version != first_minor_version: - git_env_file.write("UPGRADE_TYPE=NONCON") - elif major_version == first_major_version and minor_version == first_minor_version and sub_version != first_sub_version: - git_env_file.write("UPGRADE_TYPE=NONCON") - else: - git_env_file.write("UPGRADE_TYPE=GOV") - git_env_file.close() - - - name: "NON_CONSENSUS_BREAKING_UPGRADE" - if: env.UPGRADE_TYPE == 'NONCON' - run: | - echo ${UPGRADE_TYPE} - echo "*********CHECK VERSION BEFORE BINARY SWITCH*********" - zetavisor version - - echo "*********KILLALL ZETAVISOR*********" - killall zetavisor - - echo "*********COPY UPGRADE BINARY TO NEW LOCATION*********" - rm -rf /home/runner/.zetacored/zetavisor/genesis/bin/zetacored - rm -rf /home/runner/.zetacored/zetavisor/current/bin/zetacored - - cp /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored /home/runner/.zetacored/zetavisor/genesis/bin/zetacored - cp /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.version }}/bin/zetacored /home/runner/.zetacored/zetavisor/current/bin/zetacored - nohup zetavisor start --rpc.laddr tcp://0.0.0.0:26657 --minimum-gas-prices ${GAS_PRICES} "--grpc.enable=true" > cosmovisor.log 2>&1 & - - sleep ${UPGRADES_SLEEP_TIME} - cat cosmovisor.log - echo "*********CHECK VERSION AFTER BINARY SWITCH*********" - check_version=$(zetavisor version | tr -d '\n') - http_version=$(curl http://127.0.0.1:26657/abci_info | jq .result.response.version -r | tr -d '\n') - - echo "END_VERSION=${{ github.event.inputs.version }}" - echo "CURRENT_VERSION_BINARY=${check_version}" - echo "CURRENT_VERSION_HTTP=${http_version}" - - if [ "${{ github.event.inputs.version }}" == "${check_version}" ]; then - if [ "${{ github.event.inputs.version }}" == "${http_version}" ]; then - echo "*********VERSION MATCHES UPGRADE SUCCESS*********" - exit 0 - else - echo "*********VERSION DOESN'T MATCH UPGRADE FAILED*********" - exit 2 - fi - else - echo "*********VERSION DOESN'T MATCH UPGRADE FAILED*********" - exit 2 - fi - - - name: "CONSENSUS_BREAKING_UPGRADE" - if: env.UPGRADE_TYPE == 'GOV' #GOV - run: | - echo "*****UPGRADE TYPE*****" - echo ${UPGRADE_TYPE} - - echo "*****BUILD GOV PROPOSAL*****" - GOV_PROPOSAL=$(python .github/actions/upgrade-testing/scripts/raise_gov_proposal.py) - - echo "${GOV_PROPOSAL}" - cat gov.json - - GOV_PROPOSAL_OUTPUT=$(eval ${GOV_PROPOSAL}) - - echo "*****GOV PROPOSAL OUTPUT*****" - echo ${GOV_PROPOSAL_OUTPUT} - - echo "*****GET TX HASH*****" - TX_HASH=$(echo ${GOV_PROPOSAL_OUTPUT} | awk -F'txhash: ' '{print $2}' | tr -d '\n' | tr -d ' ') - echo "****TXHASH: ${TX_HASH}****" - - echo "*****SLEEP FOR 1 MIN TO ALLOW TX TO MAKE IT ON NETWORK*****" - sleep 15 - - zetacored query tx --type=hash ${TX_HASH} - - proposal_id=$(python .github/actions/upgrade-testing/scripts/get_proposal_id.py) - echo "****PROPOSAL_ID: ${proposal_id}****" - - source ${GITHUB_ENV} - - zetacored tx gov vote "${proposal_id}" yes \ - --from ${MONIKER} \ - --keyring-backend test \ - --chain-id ${CHAINID} \ - --node http://127.0.0.1:26657 \ - --gas=auto \ - --gas-adjustment=2 \ - --gas-prices=${{ env.GAS_PRICES }} \ - -y - - sleep 5 - zetacored query gov proposal ${proposal_id} --node http://127.0.0.1:26657 - - TARGET_HEIGHT=$(echo ${UPGRADE_HEIGHT} | cut -d '.' -f 1) - - echo "**** CHECK FOR HEIGHT ${TARGET_HEIGHT} ****" - while [[ $count -lt $MAX_TRIES ]] - do - echo "CURL FOR CURRENT HEIGHT" - response=$(curl -s "$ENDPOINT/status" || echo "failed curl") - if [ $? -ne 0 ]; then - echo "CURL failed with exit code $?" - else - echo "curl success" - fi - echo "curl success" - echo "${response}" - current_height=$(echo $response | jq '.result.sync_info.latest_block_height' | tr -d '"') - echo "Current Height: $current_height" - echo "Target Height: $TARGET_HEIGHT" - - if [[ $current_height -ge $TARGET_HEIGHT ]]; then - echo "Reached target height: $current_height. Sleep and wait for upgrade to take place." - sleep 120 - break - fi - - echo "attempt number ${count} of ${MAX_TRIES}" - ((count=count+1)) - echo "sleep and ty again." - sleep 10 - done - - if [[ $count -eq $MAX_TRIES ]]; then - cat cosmovisor.log - echo "Max tries reached without achieving target height." - exit 2 - fi - - for (( i=1; i<=MAX_TRIES; i++ )) - do - pgrep zetavisor > /dev/null - if [[ $? -ne 0 ]]; then - cat cosmovisor.log - echo "zetavisor process not found." - exit 2 - fi - - response=$(curl -s "$STATUS_ENDPOINT") - - # If curl fails - if [[ $? -ne 0 ]]; then - cat cosmovisor.log - echo "Failed to get a response from the status endpoint on try $i." - exit 2 - fi - - # Extracting the current height from the response - current_height=$(echo $response | jq '.result.sync_info.latest_block_height' | tr -d '"') - - # If jq fails or height is empty - if [[ $? -ne 0 || -z "$current_height" ]]; then - cat cosmovisor.log - echo "Failed to extract block height from the response on try $i." - exit 2 - fi - - # If the block height has changed since last check - if [[ $current_height -ne $previous_height ]]; then - if [ "${first}" == "true" ]; then - stalled_count=0 - first="false" - else - echo "Network appears to be processing blocks" - stalled_count=0 - - # Query the ABCI endpoint for version info - abci_response=$(curl -s "$ABCI_ENDPOINT") - - # Extracting the version from the response - app_version=$(echo $abci_response | jq '.result.response.version' | tr -d '"') - - # If jq fails or version is empty - if [[ $? -ne 0 || -z "$app_version" ]]; then - cat cosmovisor.log - echo "Failed to extract version from the ABCI response on try $i." - exit 2 - fi - - # Compare the extracted version with the expected version - if [[ "$app_version" == "$VERSION" ]]; then - echo "Version matches the expected version. Exiting..." - echo "ABCI RESPONSE \n ${abci_response}" - echo "Versions: $VERSION, Found: $app_version" - exit 0 - else - cat cosmovisor.log - echo "Version mismatch. Expected: $VERSION, Found: $app_version" - echo "ABCI RESPONSE \n ${abci_response}" - exit 2 - fi - fi - else - ((stalled_count=stalled_count+1)) - fi - - # Update the previous height - previous_height=$current_height - - # If we're on the last iteration and the block height hasn't changed for all tries - if [[ $i -eq $MAX_TRIES && $stalled_count -eq $MAX_TRIES ]]; then - cat cosmovisor.log - echo "Block height hasn't changed for $MAX_TRIES consecutive checks. Network might be stalled." - exit 2 - fi - - # Sleep for the specified duration - sleep $SLEEP_DURATION - done \ No newline at end of file diff --git a/Dockerfile-localnet b/Dockerfile-localnet index c6e4efdd94..ee16e6282b 100644 --- a/Dockerfile-localnet +++ b/Dockerfile-localnet @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.7-labs -FROM golang:1.20.14-bullseye AS base-build +FROM golang:1.20.14-bookworm AS base-build ENV GOPATH /go ENV GOOS=linux @@ -22,10 +22,10 @@ COPY --exclude=*.sh --exclude=*.md --exclude=*.yml . . RUN --mount=type=cache,target="/root/.cache/go-build" make install RUN --mount=type=cache,target="/root/.cache/go-build" make install-zetae2e -FROM golang:1.20.14-bullseye AS cosmovisor-build +FROM golang:1.20.14-bookworm AS cosmovisor-build RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 -FROM debian:bullseye-slim AS base-runtime +FROM golang:1.20.14-bookworm AS base-runtime RUN apt update && \ apt install -yq jq curl tmux python3 openssh-server iputils-ping iproute2 && \ diff --git a/Makefile b/Makefile index 6508b07b50..480c956c9a 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,7 @@ stop-monitoring: ############################################################################### PACKAGE_NAME := github.com/zeta-chain/node -GOLANG_CROSS_VERSION ?= v1.20 +GOLANG_CROSS_VERSION ?= v1.20.7 GOPATH ?= '$(HOME)/go' release-dry-run: docker run \ diff --git a/changelog.md b/changelog.md index 4c371f2c87..442fcb68f8 100644 --- a/changelog.md +++ b/changelog.md @@ -56,7 +56,9 @@ * [2256](https://github.com/zeta-chain/node/pull/2256) - fix rate limiter falsely included reverted non-withdraw cctxs ### CI -* [2268](https://github.com/zeta-chain/node/pull/2268) - CI: updated the publish-release pipeline to utilize the Github Actions Ubuntu 20.04 Runners. + +* [2285](https://github.com/zeta-chain/node/pull/2285) - added nightly EVM performance testing pipeline, modified localnet testing docker image to utilitze debian:bookworm, removed build-jet runners where applicable, removed deprecated/removed upgrade path testing pipeline. +* [2268](https://github.com/zeta-chain/node/pull/2268) - updated the publish-release pipeline to utilize the Github Actions Ubuntu 20.04 Runners. * [2070](https://github.com/zeta-chain/node/pull/2070) - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. * [2119](https://github.com/zeta-chain/node/pull/2119) - Updated the release pipeline to only run on hotfix/ and release/ branches. Added option to only run pre-checks and not cut release as well. Switched approval steps to use environments. * [2189](https://github.com/zeta-chain/node/pull/2189) - Updated the docker tag when a release trigger runs to be the github event for the release name which should be the version. Removed mac specific build as the arm build should handle that. diff --git a/contrib/localnet/orchestrator/Dockerfile.fastbuild b/contrib/localnet/orchestrator/Dockerfile.fastbuild index 332ed3330e..2ef5520c64 100644 --- a/contrib/localnet/orchestrator/Dockerfile.fastbuild +++ b/contrib/localnet/orchestrator/Dockerfile.fastbuild @@ -1,6 +1,6 @@ FROM zetanode:latest as zeta FROM ethereum/client-go:v1.10.26 as geth -FROM debian:bullseye-slim as orchestrator +FROM golang:1.20.14-bookworm as orchestrator RUN apt update && \ apt install -yq jq curl tmux python3 openssh-server iputils-ping iproute2 && \