From af50afb597bf162dafdb3e8e38834006476ab27e Mon Sep 17 00:00:00 2001 From: Ana <134174965+anaye1997@users.noreply.github.com> Date: Tue, 22 Aug 2023 22:34:50 +1000 Subject: [PATCH] :rocket: arc runner migration patch 2.1 (#1242) * :rocket: update `check_tests` pipeline to use org `runtime` runner Signed-off-by: Anathan (Ana) Ye * :bug: update `Run tests` pipeline with required changes for org arc runner migration Signed-off-by: Anathan (Ana) Ye * :bug: handle `polkadot` Signed-off-by: Anathan (Ana) Ye * :bug: use `bash` for `launch testnet` step Signed-off-by: Anathan (Ana) Ye * :bug: try docker Signed-off-by: Anathan (Ana) Ye * :bug: try docker Signed-off-by: Anathan (Ana) Ye * :bug: try docker Signed-off-by: Anathan (Ana) Ye * :bug: dasel don't need cargo Signed-off-by: Anathan (Ana) Ye * :bug: missing jq Signed-off-by: Anathan (Ana) Ye * :bug: address dasel Signed-off-by: Anathan (Ana) Ye * :bug: address dasel Signed-off-by: Anathan (Ana) Ye * :bug: address dasel Signed-off-by: Anathan (Ana) Ye * :bug: address dasel Signed-off-by: Anathan (Ana) Ye * :bug: address dasel Signed-off-by: Anathan (Ana) Ye * :bug: fix `calamari integration test` Signed-off-by: Anathan (Ana) Ye * Fix calamari integration tests Signed-off-by: Dengjianping * Fix storage insertion Signed-off-by: Dengjianping * Remove unused cmd Signed-off-by: Dengjianping * Do not skip compilation Signed-off-by: Dengjianping --------- Signed-off-by: Anathan (Ana) Ye Signed-off-by: Dengjianping Co-authored-by: Dengjianping --- .github/CODEOWNERS | 1 + .github/PULL_REQUEST_TEMPLATE.md | 4 + .github/workflows/check_tests.yml | 314 +++++---------- .github/workflows/docker.yml | 1 - .../workflows/integration_test_calamari.yml | 311 +++++---------- .github/workflows/integration_test_manta.yml | 359 ++++++------------ .github/workflows/label_checker.yml | 8 + .github/workflows/metadata_diff.yml | 76 ++-- .github/workflows/publish_draft_releases.yml | 41 +- .github/workflows/run_all_benchmarks.yml | 66 +--- .github/workflows/run_linters.yml | 26 +- .github/workflows/runtime_upgrade_test.yml | 65 +--- .github/workflows/try-runtime-mainnet.yml | 55 +-- tests/stress_benchmark_test.ts | 116 +++++- zombienet/tests/0001-block-production.toml | 4 + zombienet/tests/0001-block-production.zndsl | 4 +- 16 files changed, 486 insertions(+), 965 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..3ce580efb --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +.github/ @Manta-Network/devops diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9ee090a90..bc54016d2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,10 @@ Before we can approve this PR for merge, please make sure that **all** the follo - [ ] Added **one or more** labels from the `A-` and `C-` groups to this PR - [ ] Explicitly labelled `A-calamari` and/or `A-manta` if your changes are meant for/impact either of these (CI depends on it) - [ ] Re-reviewed `Files changed` in the Github PR explorer. +- [ ] Add `A-integration-test-checks` to run **start-integration-test-checks** (Required) +- [ ] Add `A-benchmark-checks` to run **start-benchmark-check** (Required) +- [ ] Add `A-unit-test-checks` to run **start-unit-test-checks** (Required) +- [ ] Add `A-congestion-test-checks` to run **start-integration-test-checks** (Optional) Situational Notes: diff --git a/.github/workflows/check_tests.yml b/.github/workflows/check_tests.yml index ab2a8e4b3..b8fbd8a29 100644 --- a/.github/workflows/check_tests.yml +++ b/.github/workflows/check_tests.yml @@ -2,44 +2,30 @@ name: Run Tests on: pull_request: branches: [manta] + types: [opened, reopened, synchronize, labeled] push: branches: [manta] concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: - AWS_REGION: us-east-1 - AWS_INSTANCE_TYPE: c5.2xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 1024 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive jobs: start-integration-test-checks: + if: contains(github.event.pull_request.labels.*.name, 'A-integration-test-checks') timeout-minutes: 480 runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} + container: + image: ubuntu:20.04 steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - uses: actions/checkout@v2 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | + apt update + apt install -y curl SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -47,29 +33,21 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false with: - path: /home/runner/.cache/sccache + path: ~/.cache/sccache key: sccache-${{ hashFiles('**/Cargo.lock') }} restore-keys: | sccache- - name: start sccache server run: sccache --start-server - name: init + shell: bash run: | - sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + apt update + apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env @@ -77,62 +55,41 @@ jobs: rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Run Integration Tests + shell: bash env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache - SCCACHE_CACHE_SIZE: 120G - SCCACHE_DIR: /home/runner/.cache/sccache + # SCCACHE_CACHE_SIZE: 120G + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ~/.cache/sccache run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo test -p integration-tests --release --features=calamari --no-default-features - RUSTC_BOOTSTRAP=1 cargo test -p integration-tests --release --features=manta --no-default-features + RUSTC_BOOTSTRAP=1 cargo test -p integration-tests --release --features=calamari --no-default-features --timings + RUSTC_BOOTSTRAP=1 cargo test -p integration-tests --release --features=manta --no-default-features --timings - name: stop sccache server run: sccache --stop-server || true - stop-integration-test-checks: - timeout-minutes: 15 - needs: start-integration-test-checks - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-integration-test-checks.outputs.aws-region }} - runner-label: ${{ needs.start-integration-test-checks.outputs.runner-label }} - aws-instance-id: ${{ needs.start-integration-test-checks.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true start-benchmark-checks: timeout-minutes: 180 - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} + runs-on: runtime + if: contains(github.event.pull_request.labels.*.name, 'A-benchmark-checks') + container: + image: ubuntu:20.04 steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | + apt update + apt install -y curl wget + npm install -g yarn && node --version && node --version && npm --version && yarn --version SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -140,62 +97,46 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false with: - path: /home/runner/.cache/sccache + path: ~/.cache/sccache key: sccache-${{ hashFiles('**/Cargo.lock') }} restore-keys: | sccache- - name: start sccache server run: sccache --start-server - - name: build benchmarking binary + - name: rust setup + shell: bash env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache - SCCACHE_CACHE_SIZE: 120G - SCCACHE_DIR: /home/runner/.cache/sccache + # SCCACHE_CACHE_SIZE: 120G + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ~/.cache/sccache CARGO_TERM_COLOR: always run: | - sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + apt update + apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown - df -h - sudo apt remove -y '^dotnet-.*' - sudo apt remove -y '^mongodb-.*' - sudo apt remove -y '^mysql-.*' - sudo apt remove -y '^postgresql-*' - sudo apt remove -y google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt autoremove -y - sudo apt clean - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - df -h + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: build benchmarking binary run: | - RUSTC_BOOTSTRAP=1 cargo build --release --features runtime-benchmarks + RUSTC_BOOTSTRAP=1 cargo build --release --features runtime-benchmarks --timings - name: create-calamari-chainspec run: | - ${{ github.workspace }}/target/release/manta build-spec --chain calamari-dev --disable-default-bootnode --raw > ${{ github.workspace }}/tests/data/fork.json + $GITHUB_WORKSPACE/target/release/manta build-spec --chain calamari-dev --disable-default-bootnode --raw > $GITHUB_WORKSPACE/tests/data/fork.json - name: append manta-pay storage for Calamari run: | - wget -P ${{ github.workspace }}/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json - cd ${{ github.workspace }}/tests + wget -P $GITHUB_WORKSPACE/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json + cd $GITHUB_WORKSPACE/tests yarn install yarn node append_storage.js @@ -203,24 +144,25 @@ jobs: env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache - SCCACHE_CACHE_SIZE: 120G - SCCACHE_DIR: /home/runner/.cache/sccache + # SCCACHE_CACHE_SIZE: 120G + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ~/.cache/sccache run: | - ${{ github.workspace }}/target/release/manta \ + $GITHUB_WORKSPACE/target/release/manta \ benchmark \ pallet \ - --chain=${{ github.workspace }}/tests/data/fork.json \ + --chain=$GITHUB_WORKSPACE/tests/data/fork.json \ --pallet=* \ --extrinsic=* \ --repeat=1 \ --steps=2 - name: create-manta-dev-chainspec run: | - ${{ github.workspace }}/target/release/manta build-spec --chain manta-dev --disable-default-bootnode --raw > ${{ github.workspace }}/tests/data/fork.json + $GITHUB_WORKSPACE/target/release/manta build-spec --chain manta-dev --disable-default-bootnode --raw > $GITHUB_WORKSPACE/tests/data/fork.json - name: append manta-pay storage for Manta run: | - wget -P ${{ github.workspace }}/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json - cd ${{ github.workspace }}/tests + wget -P $GITHUB_WORKSPACE/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json + cd $GITHUB_WORKSPACE/tests yarn install yarn node append_storage.js @@ -228,62 +170,35 @@ jobs: env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache - SCCACHE_CACHE_SIZE: 120G - SCCACHE_DIR: /home/runner/.cache/sccache + # SCCACHE_CACHE_SIZE: 120G + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ~/.cache/sccache run: | - ${{ github.workspace }}/target/release/manta \ + $GITHUB_WORKSPACE/target/release/manta \ benchmark \ pallet \ - --chain=${{ github.workspace }}/tests/data/fork.json \ + --chain=$GITHUB_WORKSPACE/tests/data/fork.json \ --pallet=* \ --extrinsic=* \ --repeat=1 \ --steps=2 - name: stop sccache server run: sccache --stop-server || true - stop-benchmark-checks: - needs: start-benchmark-checks - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-benchmark-checks.outputs.aws-region }} - runner-label: ${{ needs.start-benchmark-checks.outputs.runner-label }} - aws-instance-id: ${{ needs.start-benchmark-checks.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true start-unit-test-checks: + if: contains(github.event.pull_request.labels.*.name, 'A-unit-test-checks') timeout-minutes: 480 - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} + runs-on: runtime + container: + image: ubuntu:20.04 steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - uses: actions/checkout@v2 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | + apt update + apt install -y curl SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -291,29 +206,21 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false with: - path: /home/runner/.cache/sccache + path: ~/.cache/sccache key: sccache-${{ hashFiles('**/Cargo.lock') }} restore-keys: | sccache- - name: start sccache server run: sccache --start-server - name: init + shell: bash run: | - sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + apt update + apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env @@ -321,46 +228,23 @@ jobs: rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown - df -h - sudo apt remove -y '^dotnet-.*' - sudo apt remove -y '^mongodb-.*' - sudo apt remove -y '^mysql-.*' - sudo apt remove -y '^postgresql-*' - sudo apt remove -y google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - sudo apt autoremove -y - sudo apt clean - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - df -h + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Run Unit Tests + shell: bash env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache - SCCACHE_CACHE_SIZE: 240 - SCCACHE_DIR: /home/runner/.cache/sccache + # SCCACHE_CACHE_SIZE: 240 + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ~/.cache/sccache run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo test --release --features=runtime-benchmarks,try-runtime --workspace --exclude integration-tests + RUSTC_BOOTSTRAP=1 cargo test --release --features=runtime-benchmarks,try-runtime --workspace --exclude integration-tests --timings - name: stop sccache server run: sccache --stop-server || true - stop-unit-test-checks: - needs: start-unit-test-checks - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-unit-test-checks.outputs.aws-region }} - runner-label: ${{ needs.start-unit-test-checks.outputs.runner-label }} - aws-instance-id: ${{ needs.start-unit-test-checks.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true start-congestion-test-checks: + if: contains(github.event.pull_request.labels.*.name, 'A-congestion-test-checks') timeout-minutes: 480 strategy: matrix: @@ -368,28 +252,15 @@ jobs: - name: manta-runtime - name: calamari-runtime runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} + container: + image: ubuntu:20.04 steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - uses: actions/checkout@v2 - name: init + shell: bash run: | - sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + apt update + apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env @@ -397,11 +268,16 @@ jobs: rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + echo "$HOME/.local/bin" >> $GITHUB_PATH + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Run congestion test (allowed to fail) id: congestion_test + shell: bash run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo test --package ${{ matrix.runtime.name }} --lib -- fee::multiplier_tests::multiplier_growth_simulator_and_congestion_budget_test --exact --nocapture --ignored + RUSTC_BOOTSTRAP=1 cargo test --package ${{ matrix.runtime.name }} --lib -- fee::multiplier_tests::multiplier_growth_simulator_and_congestion_budget_test --exact --nocapture --ignored --timings continue-on-error: true - name: Print res id: congestion_test_res @@ -434,21 +310,3 @@ jobs: const above = status === 'success' ? 'is above' : 'is NOT above'; const updatedComment = `${statusIcon} ${comment_text} ${above} the target daily congestion cost`; await octokit.rest.issues.updateComment({ owner, repo, comment_id: existingComment.id, body: updatedComment }); - stop-congestion-test-checks: - timeout-minutes: 15 - needs: start-congestion-test-checks - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-congestion-test-checks.outputs.aws-region }} - runner-label: ${{ needs.start-congestion-test-checks.outputs.runner-label }} - aws-instance-id: ${{ needs.start-congestion-test-checks.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a0da51a65..fb36eb251 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,7 +46,6 @@ jobs: image_id=`cat docker_id.log` echo $image_id echo "Adjusting permissions so we can access docker logs..." - sudo chmod -R +x /var/lib/docker/ sudo cat /var/lib/docker/containers/${image_id}/${image_id}-json.log - uses: actions/checkout@v2 with: diff --git a/.github/workflows/integration_test_calamari.yml b/.github/workflows/integration_test_calamari.yml index 554d97898..d6edec0df 100644 --- a/.github/workflows/integration_test_calamari.yml +++ b/.github/workflows/integration_test_calamari.yml @@ -6,21 +6,14 @@ on: branches: [manta] types: [opened, reopened, synchronize, labeled] concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: - AWS_INSTANCE_SSH_PUBLIC_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb24HEQ++aNFWaqVyMtIs6GotUB8R+q61XOoI2z6uMj - AWS_REGION: us-east-1 - AWS_SUBNET_ID: subnet-08c26caf0a52b7c19 - AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b - AWS_INSTANCE_TYPE: c5.2xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 32 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive POLKADOT_BINARY: https://github.com/paritytech/polkadot/releases/download/v1.0.0/polkadot jobs: print-rust-versions: - if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') + if: contains(github.event.pull_request.labels.*.name, 'A-calamari') runs-on: ubuntu-20.04 container: image: paritytech/ci-linux:production @@ -36,18 +29,21 @@ jobs: echo "::set-output name=nightly::$(rustc +nightly --version)" build-node-current: timeout-minutes: 120 - if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - needs: start-node-builder-current - runs-on: ${{ needs.start-node-builder-current.outputs.runner-label }} + if: contains(github.event.pull_request.labels.*.name, 'A-calamari') + runs-on: ubuntu-20.04 env: CARGO_TERM_COLOR: always steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | + sudo apt update && sudo apt install -y curl SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -55,15 +51,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -75,15 +62,18 @@ jobs: - name: start sccache server run: sccache --start-server - name: init + shell: bash run: | sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + sudo apt install -y pkg-config libssl-dev protobuf-compiler git clang curl protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: build env: RUST_BACKTRACE: full @@ -92,9 +82,7 @@ jobs: SCCACHE_DIR: /home/runner/.cache/sccache run: | source ${HOME}/.cargo/env - mkdir -p target/production - curl -L -o target/production/manta https://github.com/Manta-Network/Manta/releases/download/v4.4.0/manta - chmod +x target/production/manta + RUSTC_BOOTSTRAP=1 cargo build --profile production --verbose - name: stop sccache server run: sccache --stop-server || true - if: always() @@ -105,14 +93,16 @@ jobs: path: target/production/manta calamari-integration-test: if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - needs: [build-node-current, start-calamari-integration-tester] - runs-on: ${{ needs.start-calamari-integration-tester.outputs.runner-label }} + needs: [build-node-current] + runs-on: runtime-integration-test timeout-minutes: 240 + container: + image: ubuntu:20.04 strategy: fail-fast: false matrix: chain-spec: - - id: calamari-local + - id: calamari-dev expected: block-count: relay: 25 @@ -135,17 +125,27 @@ jobs: name: manta - name: mv and chmod manta run: | - mv ${{ github.workspace }}/manta $HOME/.local/bin/ + mv $GITHUB_WORKSPACE/manta $HOME/.local/bin/ chmod +x $HOME/.local/bin/manta - ls -ahl ${{ github.workspace }}/ + ls -ahl $GITHUB_WORKSPACE/ ls -ahl $HOME/.local/bin/ - name: fetch and chmod polkadot + shell: bash run: | - curl -L -o $HOME/.local/bin/polkadot ${{ env.POLKADOT_BINARY }} - chmod +x $HOME/.local/bin/polkadot + apt update && apt install -y curl jq wget + if [[ ! -f "$HOME/.local/bin/polkadot" ]]; then + curl -L -o $HOME/.local/bin/polkadot ${{ env.POLKADOT_BINARY }} + chmod +x $HOME/.local/bin/polkadot + fi ls -ahl $HOME/.local/bin/ + - name: Install dasel cli + run: | + curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o $HOME/dasel && chmod +x $HOME/dasel + $HOME/dasel --version - id: create-chainspec + shell: bash run: | + jq --version manta build-spec --chain ${{ matrix.chain-spec.id }} --disable-default-bootnode --raw > $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-spec.json jq \ --sort-keys \ @@ -181,24 +181,17 @@ jobs: with: name: ${{ matrix.chain-spec.id }}-${{ steps.create-chainspec.outputs.short-sha }}-spec.json path: /home/runner/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${{ steps.create-chainspec.outputs.short-sha }}-spec.json - - name: Install dasel cli - run: | - source ${HOME}/.cargo/env - curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o dasel && chmod +x dasel - mv ./dasel $HOME/.cargo/bin/dasel - dasel --version - name: create launch config run: | - source ${HOME}/.cargo/env - ls -ahl ${{ github.workspace }}/Manta - cd ${{ github.workspace }} - dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + ls -ahl $GITHUB_WORKSPACE/Manta + cd $GITHUB_WORKSPACE + $HOME/dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.relaychain.default_command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[0].command' - cat ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + cat $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - if: always() uses: actions/upload-artifact@v2 with: @@ -221,33 +214,34 @@ jobs: - name: Install pm2 run: npm install -g pm2 - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: init measure-block-time rococo run: | - cd ${{ github.workspace }}/dev-tools-rococo/measure-block-time + cd $GITHUB_WORKSPACE/dev-tools-rococo/measure-block-time yarn install pm2 start index.js \ --name measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }} \ - --output ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log \ + --output $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log \ --no-autorestart \ -- \ --address=ws://127.0.0.1:9911 - name: init measure-block-time calamari run: | - cd ${{ github.workspace }}/dev-tools-calamari/measure-block-time + cd $GITHUB_WORKSPACE/dev-tools-calamari/measure-block-time yarn install pm2 start index.js \ --name measure-block-time-${{ matrix.chain-spec.id }} \ - --output ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log \ + --output $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log \ --no-autorestart \ -- \ --address=ws://127.0.0.1:9921 @@ -258,21 +252,21 @@ jobs: - name: run test suites run: | sleep 120 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn correctness_test --address=ws://127.0.0.1:9921 --exit yarn performance_test --address=ws://127.0.0.1:9921 --exit - name: check if target block is finalized run: | - cd ${{ github.workspace }}/dev-tools-calamari/check-finalized-block + cd $GITHUB_WORKSPACE/dev-tools-calamari/check-finalized-block yarn install yarn node index.js --para_address=ws://127.0.0.1:9921 --relay_address=ws://127.0.0.1:9911 --target_block=${{ matrix.chain-spec.expected.block-count.para }} if [ $? == 1 ]; then echo "Failed to finalize the target block - ${{ matrix.chain-spec.expected.block-count.para }}"; exit 1; fi - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }} pm2 stop measure-block-time-${{ matrix.chain-spec.id }} pm2 stop zombienet @@ -280,118 +274,115 @@ jobs: uses: actions/upload-artifact@v2 with: name: zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: zombienet-for-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log + path: $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log - - name: parse rococo block times - run: | - grep '#.*' ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log | while read -r line; do words=($line); echo ${words[6]},${words[10]} | tee ${{ github.workspace }}/block-time-rococo.csv; done - if [ ! -f ${{ github.workspace }}/block-time-rococo.csv ]; then echo "block times not detected"; exit 1; fi - jq -s -R '[split("\n") | .[] | select(length > 0) | split(",") | {block:.[0]|tonumber, time:.[1]|tonumber} ]' ${{ github.workspace }}/block-time-rococo.csv > ${{ github.workspace }}/block-time-rococo.json + path: $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log - if: always() uses: actions/upload-artifact@v2 with: name: block-time-rococo-relay-for-${{ matrix.chain-spec.id }}.json - path: ${{ github.workspace }}/block-time-rococo.json + path: $GITHUB_WORKSPACE/block-time-rococo.json - if: always() name: test - calamari alice peered successfully run: | - cd ${{ github.workspace }}/zombienet-tool/javascript - node packages/cli/dist/cli.js -f -p native test ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.zndsl + cd $GITHUB_WORKSPACE/zombienet-tool/javascript + node packages/cli/dist/cli.js -f -p native test $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.zndsl - name: append manta-pay storage + shell: bash run: | - source ${HOME}/.cargo/env - wget -P ${{ github.workspace }}/Manta/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json - mv $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json ${{ github.workspace }}/Manta/tests/data/fork.json - cd ${{ github.workspace }}/Manta/tests + wget -P $GITHUB_WORKSPACE/Manta/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json + mv $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json $GITHUB_WORKSPACE/Manta/tests/data/fork.json + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn node append_storage.js cd ../../ - mv ${{ github.workspace }}/Manta/tests/data/fork.json $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json - dasel put -t string -v $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + mv $GITHUB_WORKSPACE/Manta/tests/data/fork.json $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json + $HOME/dasel put -t string -v $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain_spec_path' - dasel delete -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel delete -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain' - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: run stress test run: | sleep 720 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn stress_benchmark_test --address=ws://127.0.0.1:9921 --exit - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop zombienet - if: always() uses: actions/upload-artifact@v2 with: name: ${{ matrix.chain-spec.id }}-alice-stress.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: run farming test run: | sleep 120 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn test_farming --address=ws://127.0.0.1:9921 --exit - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop zombienet - if: always() uses: actions/upload-artifact@v2 with: name: ${{ matrix.chain-spec.id }}-alice-stress.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log docker-image-test: timeout-minutes: 120 if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - needs: [build-node-current, start-docker-image-tester] + needs: [build-node-current] runs-on: ubuntu-20.04 strategy: matrix: @@ -399,6 +390,7 @@ jobs: - name: calamari steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 - name: fetch manta uses: actions/download-artifact@v2 with: @@ -425,7 +417,6 @@ jobs: image_id=`cat docker_id.log` echo $image_id echo "Adjusting permissions so we can access docker logs..." - sudo chmod -R +x /var/lib/docker/ sudo cat /var/lib/docker/containers/${image_id}/${image_id}-json.log - uses: actions/checkout@v2 with: @@ -434,128 +425,8 @@ jobs: - name: check if target block is finalized run: | cd dev-tools/check-finalized-block + npm install -g yarn yarn install yarn node index.js --para_address=ws://127.0.0.1:9944 --relay_address=ws://127.0.0.1:9945 --target_block=6 if [ $? == 1 ]; then echo "Failed to finalize the target block - 6"; exit 1; fi - # HELPER JOBS BELOW - start-node-builder-current: - if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 32 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-node-builder-current: - if: ${{ always() }} - needs: [start-node-builder-current, build-node-current] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-node-builder-current.outputs.aws-region }} - runner-label: ${{ needs.start-node-builder-current.outputs.runner-label }} - aws-instance-id: ${{ needs.start-node-builder-current.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true - start-calamari-integration-tester: - if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 64 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-calamari-integration-tester: - if: ${{ always() }} - needs: [start-calamari-integration-tester, calamari-integration-test] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-calamari-integration-tester.outputs.aws-region }} - runner-label: ${{ needs.start-calamari-integration-tester.outputs.runner-label }} - aws-instance-id: ${{ needs.start-calamari-integration-tester.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true - start-docker-image-tester: - if: contains(github.event.pull_request.labels.*.name, 'A-calamari' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 64 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-docker-image-tester: - if: ${{ always() }} - needs: [start-docker-image-tester, docker-image-test] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-docker-image-tester.outputs.aws-region }} - runner-label: ${{ needs.start-docker-image-tester.outputs.runner-label }} - aws-instance-id: ${{ needs.start-docker-image-tester.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/.github/workflows/integration_test_manta.yml b/.github/workflows/integration_test_manta.yml index 70124f630..643521a14 100644 --- a/.github/workflows/integration_test_manta.yml +++ b/.github/workflows/integration_test_manta.yml @@ -9,14 +9,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: - AWS_INSTANCE_SSH_PUBLIC_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb24HEQ++aNFWaqVyMtIs6GotUB8R+q61XOoI2z6uMj - AWS_REGION: us-east-1 - AWS_SUBNET_ID: subnet-08c26caf0a52b7c19 - AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b - AWS_INSTANCE_TYPE: c5.2xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 32 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive POLKADOT_BINARY: https://github.com/paritytech/polkadot/releases/download/v1.0.0/polkadot jobs: print-rust-versions: @@ -37,12 +30,12 @@ jobs: build-node-current: timeout-minutes: 120 if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - needs: start-node-builder-current - runs-on: ${{ needs.start-node-builder-current.outputs.runner-label }} + runs-on: ubuntu-20.04 env: CARGO_TERM_COLOR: always steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download @@ -55,15 +48,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -77,13 +61,15 @@ jobs: - name: init run: | sudo apt update - sudo apt install -y pkg-config libssl-dev protobuf-compiler + sudo apt install -y pkg-config libssl-dev protobuf-compiler curl clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: build env: RUST_BACKTRACE: full @@ -92,9 +78,7 @@ jobs: SCCACHE_DIR: /home/runner/.cache/sccache run: | source ${HOME}/.cargo/env - mkdir -p target/production - curl -L -o target/production/manta https://github.com/Manta-Network/Manta/releases/download/v4.4.0/manta - chmod +x target/production/manta + RUSTC_BOOTSTRAP=1 cargo build --profile production --verbose - name: stop sccache server run: sccache --stop-server || true - if: always() @@ -105,14 +89,16 @@ jobs: path: target/production/manta manta-integration-test: if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - needs: [build-node-current, start-manta-integration-tester] - runs-on: ${{ needs.start-manta-integration-tester.outputs.runner-label }} + needs: [build-node-current] + runs-on: runtime-integration-test timeout-minutes: 240 + container: + image: ubuntu:20.04 strategy: fail-fast: false matrix: chain-spec: - - id: manta-local + - id: manta-dev expected: block-count: relay: 15 @@ -135,22 +121,26 @@ jobs: name: manta - name: mv and chmod manta run: | - mv ${{ github.workspace }}/manta $HOME/.local/bin/ + mv $GITHUB_WORKSPACE/manta $HOME/.local/bin/ chmod +x $HOME/.local/bin/manta - ls -ahl ${{ github.workspace }}/ + ls -ahl $GITHUB_WORKSPACE/ ls -ahl $HOME/.local/bin/ - name: fetch and chmod polkadot + shell: bash run: | - curl -L -o $HOME/.local/bin/polkadot ${{ env.POLKADOT_BINARY }} - chmod +x $HOME/.local/bin/polkadot + apt update && apt install -y curl jq wget + if [[ ! -f "$HOME/.local/bin/polkadot" ]]; then + curl -L -o $HOME/.local/bin/polkadot ${{ env.POLKADOT_BINARY }} + chmod +x $HOME/.local/bin/polkadot + fi ls -ahl $HOME/.local/bin/ - name: Install dasel cli + shell: bash run: | - source ${HOME}/.cargo/env - curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o dasel && chmod +x dasel - mv ./dasel $HOME/.cargo/bin/dasel - dasel --version + curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o $HOME/dasel && chmod +x $HOME/dasel + $HOME/dasel --version - id: create-chainspec + shell: bash run: | manta build-spec --chain ${{ matrix.chain-spec.id }} --disable-default-bootnode --raw > $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-spec.json jq \ @@ -188,35 +178,35 @@ jobs: name: ${{ matrix.chain-spec.id }}-${{ steps.create-chainspec.outputs.short-sha }}-spec.json path: /home/runner/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${{ steps.create-chainspec.outputs.short-sha }}-spec.json - name: create launch config + shell: bash run: | - source ${HOME}/.cargo/env - ls -ahl ${{ github.workspace }} - cd ${{ github.workspace }} - dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + ls -ahl $GITHUB_WORKSPACE + cd $GITHUB_WORKSPACE + $HOME/dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.relaychain.default_command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[0].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[1].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[2].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[3].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[4].command' - dasel put -t string -v "manta-local" -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v "manta-dev" -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain' - dasel put -t int -v 2104 -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t int -v 2104 -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].id' - cat ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + cat $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - if: always() uses: actions/upload-artifact@v2 with: @@ -239,33 +229,34 @@ jobs: - name: Install pm2 run: npm install -g pm2 - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: init measure-block-time rococo run: | - cd ${{ github.workspace }}/dev-tools-rococo/measure-block-time + cd $GITHUB_WORKSPACE/dev-tools-rococo/measure-block-time yarn install pm2 start index.js \ --name measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }} \ - --output ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log \ + --output $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log \ --no-autorestart \ -- \ --address=ws://127.0.0.1:9911 - name: init measure-block-time manta run: | - cd ${{ github.workspace }}/dev-tools-manta/measure-block-time + cd $GITHUB_WORKSPACE/dev-tools-manta/measure-block-time yarn install pm2 start index.js \ --name measure-block-time-${{ matrix.chain-spec.id }} \ - --output ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log \ + --output $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log \ --no-autorestart \ -- \ --address=ws://127.0.0.1:9921 @@ -276,166 +267,168 @@ jobs: - name: run test suites run: | sleep 120 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn correctness_test --address=ws://127.0.0.1:9921 --exit yarn performance_test --address=ws://127.0.0.1:9921 --exit - name: check if target block is finalized run: | - cd ${{ github.workspace }}/dev-tools-manta/check-finalized-block + cd $GITHUB_WORKSPACE/dev-tools-manta/check-finalized-block yarn install yarn node index.js --para_address=ws://127.0.0.1:9921 --relay_address=ws://127.0.0.1:9911 --target_block=${{ matrix.chain-spec.expected.block-count.para }} if [ $? == 1 ]; then echo "Failed to finalize the target block - ${{ matrix.chain-spec.expected.block-count.para }}"; exit 1; fi - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }} pm2 stop measure-block-time-${{ matrix.chain-spec.id }} pm2 stop zombienet - name: test - manta alice peered successfully + shell: bash run: | - source ${HOME}/.cargo/env - cd ${{ github.workspace }}/zombienet-tool/javascript - sed -i 's/2084/2104/g' ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.zndsl - dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + cd $GITHUB_WORKSPACE/zombienet-tool/javascript + sed -i 's/2084/2104/g' $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.zndsl + $HOME/dasel put -t string -v $HOME/.local/bin/polkadot -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.relaychain.default_command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[0].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[1].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[2].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[3].command' - dasel put -t string -v $HOME/.local/bin/manta -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v $HOME/.local/bin/manta -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].collators.[4].command' - dasel put -t string -v "manta-local" -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t string -v "manta-dev" -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain' - dasel put -t int -v 2104 -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel put -t int -v 2104 -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].id' - cat ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml - cat ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.zndsl - node packages/cli/dist/cli.js -f -p native test ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.zndsl + cat $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml + cat $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.zndsl + node packages/cli/dist/cli.js -f -p native test $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.zndsl - if: always() uses: actions/upload-artifact@v2 with: name: zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: zombienet-for-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log + path: $GITHUB_WORKSPACE/measure-block-time-rococo-relay-for-${{ matrix.chain-spec.id }}-stderr.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-${{ matrix.chain-spec.id }}-stdout.log - path: ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stdout.log - if: always() uses: actions/upload-artifact@v2 with: name: measure-block-time-${{ matrix.chain-spec.id }}-stderr.log - path: ${{ github.workspace }}/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log + path: $GITHUB_WORKSPACE/measure-block-time-${{ matrix.chain-spec.id }}-stderr.log - name: append manta-pay storage + shell: bash run: | - source ${HOME}/.cargo/env - wget -P ${{ github.workspace }}/Manta/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json - mv $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json ${{ github.workspace }}/Manta/tests/data/fork.json - cd ${{ github.workspace }}/Manta/tests + wget -P $GITHUB_WORKSPACE/Manta/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json + mv $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json $GITHUB_WORKSPACE/Manta/tests/data/fork.json + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn node append_storage.js cd ../../ - mv ${{ github.workspace }}/Manta/tests/data/fork.json $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json - dasel put -t string -v $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + mv $GITHUB_WORKSPACE/Manta/tests/data/fork.json $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json + $HOME/dasel put -t string -v $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain_spec_path' - dasel delete -r toml \ - -f ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml \ + $HOME/dasel delete -r toml \ + -f $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml \ '.parachains.[0].chain' - cat ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + cat $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml head -20 $HOME/.local/share/calamari-pc/${{ matrix.chain-spec.id }}-${GITHUB_SHA:0:7}-spec.json - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: run stress test run: | sleep 720 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn stress_benchmark_test --address=ws://127.0.0.1:9921 --exit - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop zombienet - if: always() uses: actions/upload-artifact@v2 with: name: ${{ matrix.chain-spec.id }}-alice-stress.log - path: ${{ github.workspace }}/zombienet/9921.log + path: $GITHUB_WORKSPACE/zombienet/9921.log - name: launch testnet + shell: bash run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ - --error ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ - -- spawn --provider native ${{ github.workspace }}/Manta/zombienet/tests/0001-block-production.toml + --output $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log \ + --error $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/Manta/zombienet/tests/0001-block-production.toml - name: run farming test run: | sleep 720 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn test_farming --address=ws://127.0.0.1:9921 --exit - name: stop testnet run: | - cd ${{ github.workspace }}/zombienet-tool + cd $GITHUB_WORKSPACE/zombienet-tool pm2 stop zombienet - if: always() uses: actions/upload-artifact@v2 with: name: ${{ matrix.chain-spec.id }}-alice-stress.log - path: ${{ github.workspace }}/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log + path: $GITHUB_WORKSPACE/zombienet-for-${{ matrix.chain-spec.id }}-stdout.log - name: run tests run: | sleep 120 - cd ${{ github.workspace }}/Manta/tests + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn MANTA_BINARY=$HOME/.local/bin/manta yarn tests docker-image-test: timeout-minutes: 120 if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - needs: [build-node-current, start-docker-image-tester] + needs: [build-node-current] runs-on: ubuntu-20.04 strategy: matrix: @@ -443,6 +436,7 @@ jobs: - name: manta steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 - name: fetch manta uses: actions/download-artifact@v2 with: @@ -469,7 +463,6 @@ jobs: image_id=`cat docker_id.log` echo $image_id echo "Adjusting permissions so we can access docker logs..." - sudo chmod -R +x /var/lib/docker/ sudo cat /var/lib/docker/containers/${image_id}/${image_id}-json.log - uses: actions/checkout@v2 with: @@ -478,128 +471,8 @@ jobs: - name: check if target block is finalized run: | cd dev-tools/check-finalized-block + npm install -g yarn yarn install yarn node index.js --para_address=ws://127.0.0.1:9944 --relay_address=ws://127.0.0.1:9945 --target_block=6 if [ $? == 1 ]; then echo "Failed to finalize the target block - 6"; exit 1; fi - # HELPER JOBS BELOW - start-node-builder-current: - if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 32 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-node-builder-current: - if: ${{ always() }} - needs: [start-node-builder-current, build-node-current] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-node-builder-current.outputs.aws-region }} - runner-label: ${{ needs.start-node-builder-current.outputs.runner-label }} - aws-instance-id: ${{ needs.start-node-builder-current.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true - start-manta-integration-tester: - if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 64 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-manta-integration-tester: - if: ${{ always() }} - needs: [start-manta-integration-tester, manta-integration-test] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-manta-integration-tester.outputs.aws-region }} - runner-label: ${{ needs.start-manta-integration-tester.outputs.runner-label }} - aws-instance-id: ${{ needs.start-manta-integration-tester.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true - start-docker-image-tester: - if: contains(github.event.pull_request.labels.*.name, 'A-manta' || github.ref == 'refs/heads/manta') - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-subnet-id: ${{ env.AWS_SUBNET_ID }} - aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: 64 - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-docker-image-tester: - if: ${{ always() }} - needs: [start-docker-image-tester, docker-image-test] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-docker-image-tester.outputs.aws-region }} - runner-label: ${{ needs.start-docker-image-tester.outputs.runner-label }} - aws-instance-id: ${{ needs.start-docker-image-tester.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/.github/workflows/label_checker.yml b/.github/workflows/label_checker.yml index 904716dd1..8758cb648 100644 --- a/.github/workflows/label_checker.yml +++ b/.github/workflows/label_checker.yml @@ -12,3 +12,11 @@ jobs: with: one_of: L-added,L-changed,L-fixed,L-deprecated,L-removed,L-skip repo_token: ${{ secrets.GITHUB_TOKEN }} + check_a_labels: + name: A- Labels Check + runs-on: ubuntu-20.04 + steps: + - uses: docker://agilepathway/pull-request-label-checker:latest + with: + all_of: A-unit-test-checks,A-integration-test-checks,A-benchmark-checks + repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/metadata_diff.yml b/.github/workflows/metadata_diff.yml index 0a7cafa76..fce2d7183 100644 --- a/.github/workflows/metadata_diff.yml +++ b/.github/workflows/metadata_diff.yml @@ -10,16 +10,17 @@ on: description: The name of the chain under test. Usually, you would pass a dev chain default: manta-dev required: true +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: CHAIN: ${{github.event.inputs.chain}} ENDPOINT: ${{github.event.inputs.endpoint}} DEBIAN_FRONTEND: noninteractive jobs: - start-checks: + update-checks: timeout-minutes: 120 - runs-on: runtime - container: - image: ubuntu:20.04 + runs-on: ubuntu-20.04 strategy: matrix: node-version: [16.x] @@ -31,8 +32,8 @@ jobs: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | - apt update - apt install -y curl + sudo apt update + sudo apt install -y curl SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -40,15 +41,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo-registry- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -62,32 +54,16 @@ jobs: - name: init shell: bash run: | - apt update - apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git + sudo apt update + sudo apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version - apt remove -y '^dotnet-.*' - apt remove -y '^mongodb-.*' - apt remove -y '^mysql-.*' - apt remove -y '^postgresql-*' - apt remove -y google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri - apt autoremove -y - apt clean - rm -rf /usr/local/lib/android - rm -rf /usr/share/dotnet curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown - - name: cache cargo build - uses: actions/cache@v2 - with: - path: | - ./target - key: cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} - cargo-build- + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Build New Binary env: RUST_BACKTRACE: full @@ -97,7 +73,7 @@ jobs: shell: bash run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo build --release + RUSTC_BOOTSTRAP=1 cargo build --release --timings cp target/release/manta $HOME/manta chmod +x $HOME/manta - name: Fetch and chmod old release binary @@ -120,32 +96,32 @@ jobs: path: zombienet-tool - name: create launch config run: | - ls -ahl ${{ github.workspace }}/zombienet/tests - cd ${{ github.workspace }} + ls -ahl $GITHUB_WORKSPACE/zombienet/tests + cd $GITHUB_WORKSPACE dasel put -t string -v $HOME/polkadot -r toml \ - -f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \ + -f $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml \ '.relaychain.default_command' dasel put -t string -v $HOME/manta -r toml \ - -f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \ + -f $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml \ '.parachains.[0].collators.[0].command' if [[ "$CHAIN" == *"manta"* ]]; then dasel put -t int -v 2104 -r toml \ - -f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \ + -f $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml \ '.parachains.[0].id' dasel put -t string -v $CHAIN -r toml \ - -f ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml \ + -f $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml \ '.parachains.[0].chain' fi; - cat ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml + cat $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml - name: launch testnet run: | - cd ${{ github.workspace }}/zombienet-tool/javascript + cd $GITHUB_WORKSPACE/zombienet-tool/javascript yarn npm run build pm2 start packages/cli/dist/cli.js --name zombienet \ - --output ${{ github.workspace }}/stdout.log \ - --error ${{ github.workspace }}/stderr.log \ - -- spawn --provider native ${{ github.workspace }}/zombienet/tests/0003-metadata-diff.toml + --output $GITHUB_WORKSPACE/stdout.log \ + --error $GITHUB_WORKSPACE/stderr.log \ + -- spawn --provider native $GITHUB_WORKSPACE/zombienet/tests/0003-metadata-diff.toml - name: Prepare output run: | VERSION=$($HOME/manta --version) @@ -161,15 +137,15 @@ jobs: - name: Compare the metadata run: | echo $ENDPOINT - cd ${{ github.workspace }}/tools + cd $GITHUB_WORKSPACE/tools yarn CMD="yarn run:metadata $ENDPOINT ws://127.0.0.1:9921" echo -e "Running:\n$CMD" $CMD >> output.txt sed -z -i 's/\n\n/\n/g' output.txt cat output.txt | egrep -n -i '' - chmod +x ${{ github.workspace }}/scripts/github/extrinsic-ordering-filter.sh - SUMMARY=$(${{ github.workspace }}/scripts/github/extrinsic-ordering-filter.sh output.txt) + chmod +x $GITHUB_WORKSPACE/scripts/github/extrinsic-ordering-filter.sh + SUMMARY=$($GITHUB_WORKSPACE/scripts/github/extrinsic-ordering-filter.sh output.txt) echo -e $SUMMARY echo -e $SUMMARY >> output.txt - name: Show result diff --git a/.github/workflows/publish_draft_releases.yml b/.github/workflows/publish_draft_releases.yml index df3c5f086..4529ca254 100644 --- a/.github/workflows/publish_draft_releases.yml +++ b/.github/workflows/publish_draft_releases.yml @@ -5,14 +5,14 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: DEBIAN_FRONTEND: noninteractive jobs: get-rust-versions: if: ${{ startsWith(github.ref, 'refs/tags/v') }} - runs-on: runtime + runs-on: ubuntu-20.04 container: image: paritytech/ci-linux:production outputs: @@ -28,11 +28,9 @@ jobs: build-runtimes: timeout-minutes: 180 if: ${{ startsWith(github.ref, 'refs/tags/v') }} - runs-on: runtime + runs-on: ubuntu-20.04 env: CARGO_TERM_COLOR: always - container: - image: ubuntu:20.04 strategy: matrix: runtime: @@ -43,7 +41,7 @@ jobs: - name: cache target dir uses: actions/cache@v2 with: - path: "${{ github.workspace }}/runtime/${{ matrix.runtime.name }}/target" + path: "$GITHUB_WORKSPACE/runtime/${{ matrix.runtime.name }}/target" key: srtool-target-${{ matrix.runtime.name }}-${{ github.sha }} restore-keys: | srtool-target-${{ matrix.runtime.name }} @@ -75,9 +73,7 @@ jobs: build-node-current: timeout-minutes: 180 if: ${{ startsWith(github.ref, 'refs/tags/v') }} - runs-on: runtime - container: - image: ubuntu:20.04 + runs-on: ubuntu-20.04 env: CARGO_TERM_COLOR: always steps: @@ -87,8 +83,8 @@ jobs: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: v0.5.3 run: | - apt update - apt install -y curl + sudo apt update + sudo apt install -y curl SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl mkdir -p $HOME/.local/bin curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz @@ -96,15 +92,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -118,8 +105,8 @@ jobs: - name: init shell: bash run: | - apt update - apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git + sudo apt update + sudo apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git protoc --version curl -s https://sh.rustup.rs -sSf | sh -s -- -y source ${HOME}/.cargo/env @@ -129,6 +116,8 @@ jobs: rustup target add wasm32-unknown-unknown rustup install 1.69.0 rustup target add wasm32-unknown-unknown --toolchain 1.69.0 + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: build shell: bash env: @@ -161,7 +150,7 @@ jobs: path: .github/resources/config-for-runtime-upgrade-test.json # THE FOLLOWING HAPPENS ONLY WHEN TAGGED WITH A vX.Y.Z TAG create-draft-release: - runs-on: runtime + runs-on: ubuntu-20.04 needs: [build-runtimes] outputs: release_url: ${{ steps.create-release.outputs.html_url }} @@ -178,7 +167,7 @@ jobs: release_name: ${{ github.ref }} draft: true publish-runtimes: - runs-on: runtime + runs-on: ubuntu-20.04 needs: create-draft-release strategy: matrix: @@ -243,7 +232,7 @@ jobs: asset_name: ${{ matrix.runtime.name }}-srtool-output-v${{ steps.get-runtime-version.outputs.runtime_ver }}.json asset_content_type: application/json publish-node: - runs-on: runtime + runs-on: ubuntu-20.04 needs: [build-node-current, create-draft-release] outputs: download_url: ${{ steps.upload-manta.outputs.browser_download_url }} @@ -263,7 +252,7 @@ jobs: asset_name: manta asset_content_type: application/octet-stream brag: - runs-on: runtime + runs-on: ubuntu-20.04 needs: [publish-runtimes, publish-node] if: startsWith(github.ref, 'refs/tags') steps: diff --git a/.github/workflows/run_all_benchmarks.yml b/.github/workflows/run_all_benchmarks.yml index 4fecb58b8..6a4bd0bfb 100644 --- a/.github/workflows/run_all_benchmarks.yml +++ b/.github/workflows/run_all_benchmarks.yml @@ -9,23 +9,23 @@ on: snapshot_url: description: The chain snapshot to use for storage benchmarks. Leaving it blank will skip the storage benchmark. default: "" - required: false +concurrency: + group: ${{ github.workflow }}-manta env: - AWS_REGION: us-east-1 - AWS_INSTANCE_TYPE: c6i.4xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 128 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive CHAIN_SPEC: ${{github.event.inputs.chain_spec}} SNAPSHOT_URL: ${{github.event.inputs.snapshot_url}} FULL_DB_FOLDER: full-db jobs: run-benchmarks: timeout-minutes: 720 - needs: start-node-builder-current - runs-on: ${{ needs.start-node-builder-current.outputs.runner-label }} + runs-on: runtime-integration-test + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 - name: install sccache env: SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download @@ -38,15 +38,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -67,6 +58,8 @@ jobs: rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: init nodejs && yarn run: | curl -s https://deb.nodesource.com/setup_16.x | sudo bash @@ -83,7 +76,7 @@ jobs: CARGO_TERM_COLOR: always run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo build --profile production --features runtime-benchmarks --verbose + RUSTC_BOOTSTRAP=1 cargo build --profile production --features runtime-benchmarks --verbose --timings - name: create-chainspec run: | ${{ github.workspace }}/target/production/manta build-spec --chain $CHAIN_SPEC --disable-default-bootnode --raw > ${{ github.workspace }}/tests/data/fork.json @@ -145,40 +138,3 @@ jobs: with: name: rocksdb-weights path: ./scripts/benchmarking/rocksdb_weights.rs - start-node-builder-current: - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-node-builder-current: - needs: [run-benchmarks, start-node-builder-current] - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-node-builder-current.outputs.aws-region }} - runner-label: ${{ needs.start-node-builder-current.outputs.runner-label }} - aws-instance-id: ${{ needs.start-node-builder-current.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/.github/workflows/run_linters.yml b/.github/workflows/run_linters.yml index 7cb94f805..f31a36fd3 100644 --- a/.github/workflows/run_linters.yml +++ b/.github/workflows/run_linters.yml @@ -5,14 +5,14 @@ on: push: branches: [manta] concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: DEBIAN_FRONTEND: noninteractive jobs: - start-checks: + lint-checks: timeout-minutes: 120 - runs-on: runtime + runs-on: ubuntu-20.04 container: image: ubuntu:20.04 steps: @@ -33,15 +33,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo-registry- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -65,6 +56,8 @@ jobs: rustup toolchain install nightly-2023-03-13 rustup default nightly-2023-03-13 cargo install taplo-cli + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Check Formatting env: RUST_BACKTRACE: full @@ -77,15 +70,6 @@ jobs: cargo fmt --all -- --check $HOME/.cargo/bin/taplo fmt --check $HOME/.cargo/bin/taplo lint - - name: cache cargo build - uses: actions/cache@v2 - with: - path: | - ./target - key: cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} - cargo-build- - name: Cargo Check & Clippy env: RUST_BACKTRACE: full diff --git a/.github/workflows/runtime_upgrade_test.yml b/.github/workflows/runtime_upgrade_test.yml index fac5459f5..ea2dc8a2c 100644 --- a/.github/workflows/runtime_upgrade_test.yml +++ b/.github/workflows/runtime_upgrade_test.yml @@ -16,14 +16,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: - AWS_INSTANCE_SSH_PUBLIC_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb24HEQ++aNFWaqVyMtIs6GotUB8R+q61XOoI2z6uMj - AWS_REGION: us-east-1 - AWS_SUBNET_ID: subnet-08c26caf0a52b7c19 - AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b - AWS_INSTANCE_TYPE: c5.2xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 128 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive RUNTIME: ${{github.event.inputs.runtime}} RUNTIME_SPEC: ${{github.event.inputs.runtime}}-local POLKADOT_BINARY: ${{github.event.inputs.polkadot_url}} @@ -39,7 +32,7 @@ jobs: - name: cache target dir uses: actions/cache@v2 with: - path: "${{ github.workspace }}/runtime/${{ env.RUNTIME }}/target" + path: "$GITHUB_WORKSPACE/runtime/${{ env.RUNTIME }}/target" key: srtool-target-${{ env.RUNTIME }}-${{ github.sha }} restore-keys: | srtool-target-${{ env.RUNTIME }} @@ -75,12 +68,12 @@ jobs: name: config-for-runtime-upgrade-test path: .github/resources/config-for-runtime-upgrade-test.json runtime-upgrade-test: - needs: [build-runtimes, start-runtime-upgrade-tester] - runs-on: ${{ needs.start-runtime-upgrade-tester.outputs.runner-label }} + needs: [build-runtimes] + runs-on: ubuntu-20.04 timeout-minutes: 90 steps: - run: | - ls -ahl ${{ github.workspace }}/ + ls -ahl $GITHUB_WORKSPACE/ mkdir -p $HOME/.local/share/${{ env.RUNTIME }}-pc mkdir -p $HOME/.local/bin echo "${HOME}/.nvm/versions/node/v16.3.0/bin" >> $GITHUB_PATH @@ -88,10 +81,10 @@ jobs: - name: fetch, mv and chmod manta-base run: | wget ${{ env.MANTA_BINARY }} - ls -ahl ${{ github.workspace }}/ - mv ${{ github.workspace }}/manta $HOME/.local/bin/manta-base + ls -ahl $GITHUB_WORKSPACE/ + mv $GITHUB_WORKSPACE/manta $HOME/.local/bin/manta-base chmod +x $HOME/.local/bin/manta-base - ls -ahl ${{ github.workspace }}/ + ls -ahl $GITHUB_WORKSPACE/ ls -ahl $HOME/.local/bin/ - name: fetch and chmod polkadot run: | @@ -170,8 +163,8 @@ jobs: - name: run test suites run: | sleep 120 - cp ${{ github.workspace }}/${{ env.RUNTIME }}_runtime.compact.compressed.wasm ${{ github.workspace }}/Manta/tests/calamari.wasm - cd ${{ github.workspace }}/Manta/tests + cp $GITHUB_WORKSPACE/${{ env.RUNTIME }}_runtime.compact.compressed.wasm $GITHUB_WORKSPACE/Manta/tests/calamari.wasm + cd $GITHUB_WORKSPACE/Manta/tests yarn install yarn yarn runtime_upgrade_test --address=ws://127.0.0.1:9921 --exit @@ -180,41 +173,3 @@ jobs: with: name: ${{ env.RUNTIME_SPEC }}-alice.log path: ${{ github.workspace }}/zombienet-for-${{ env.RUNTIME_SPEC }}-stdout.log - # HELPER JOBS BELOW - start-runtime-upgrade-tester: - runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} - steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - stop-runtime-upgrade-tester: - if: ${{ always() }} - needs: [runtime-upgrade-test, start-runtime-upgrade-tester] - runs-on: ubuntu-20.04 - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-runtime-upgrade-tester.outputs.aws-region }} - runner-label: ${{ needs.start-runtime-upgrade-tester.outputs.runner-label }} - aws-instance-id: ${{ needs.start-runtime-upgrade-tester.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/.github/workflows/try-runtime-mainnet.yml b/.github/workflows/try-runtime-mainnet.yml index 47003307e..c8e4a8503 100644 --- a/.github/workflows/try-runtime-mainnet.yml +++ b/.github/workflows/try-runtime-mainnet.yml @@ -13,37 +13,14 @@ on: default: manta required: true env: - AWS_INSTANCE_SSH_PUBLIC_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb24HEQ++aNFWaqVyMtIs6GotUB8R+q61XOoI2z6uMj - AWS_REGION: us-east-1 - AWS_SUBNET_ID: subnet-08c26caf0a52b7c19 - AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b - AWS_INSTANCE_TYPE: c5.2xlarge - AWS_INSTANCE_ROOT_VOLUME_SIZE: 128 - AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* - AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' + DEBIAN_FRONTEND: noninteractive PROD_URL: ${{github.event.inputs.prod_url}} RUNTIME: ${{github.event.inputs.runtime}} jobs: start-checks: timeout-minutes: 120 runs-on: ubuntu-20.04 - outputs: - runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} - aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} - aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} steps: - - id: start-self-hosted-runner - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: start - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} - aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} - aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} - aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} - uses: actions/checkout@v2 - name: install sccache env: @@ -57,15 +34,6 @@ jobs: chmod +x $HOME/.local/bin/sccache echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - cargo- - name: cache sccache uses: actions/cache@v2 continue-on-error: false @@ -86,6 +54,8 @@ jobs: rustup toolchain install nightly-2023-03-03 rustup default nightly-2023-03-03 rustup target add wasm32-unknown-unknown + - name: cache cargo + uses: Swatinem/rust-cache@v2 - name: Build Binary env: RUST_BACKTRACE: full @@ -94,7 +64,7 @@ jobs: SCCACHE_DIR: /home/runner/.cache/sccache run: | source ${HOME}/.cargo/env - RUSTC_BOOTSTRAP=1 cargo build --release --features=try-runtime + RUSTC_BOOTSTRAP=1 cargo build --release --features=try-runtime --timings chmod a+x target/release/manta - name: move bin run: | @@ -116,20 +86,3 @@ jobs: $HOME/.local/bin/manta try-runtime --runtime $HOME/.local/bin/runtime.wasm --chain ${{ env.RUNTIME }}-dev on-runtime-upgrade --checks=all live --at $latest_hash --uri $PROD_URL - name: stop sccache server run: sccache --stop-server || true - stop-checks: - needs: start-checks - runs-on: ubuntu-20.04 - if: ${{ always() }} - steps: - - continue-on-error: true - uses: audacious-network/aws-github-runner@v1.0.33 - with: - mode: stop - github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ needs.start-checks.outputs.aws-region }} - runner-label: ${{ needs.start-checks.outputs.runner-label }} - aws-instance-id: ${{ needs.start-checks.outputs.aws-instance-id }} - - name: discard stopper success/failure - run: true diff --git a/tests/stress_benchmark_test.ts b/tests/stress_benchmark_test.ts index 147870935..373529367 100644 --- a/tests/stress_benchmark_test.ts +++ b/tests/stress_benchmark_test.ts @@ -26,7 +26,9 @@ const test_config = { }; describe("Node RPC Test", () => { - it("Check RPC result", async () => { + let api: ApiPromise; + + before(async function () { let nodeAddress = ""; const args: ParsedArgs = minimist(process.argv.slice(2)); if (args["address"] == null) { @@ -37,11 +39,14 @@ describe("Node RPC Test", () => { console.log("using address %s", nodeAddress); const wsProvider = new WsProvider(nodeAddress); - const api = await ApiPromise.create({ + api = await ApiPromise.create({ provider: wsProvider, types: manta_pay_types, rpc: rpc_api, }); +}); + + it("Check RPC result", async () => { const keyring = new Keyring({ type: "sr25519" }); const sender = keyring.addFromMnemonic(test_config.mnemonic); @@ -78,6 +83,8 @@ describe("Node RPC Test", () => { i < test_config.start_iteration + test_config.tests_iterations; ++i ) { + const nonce = await api.rpc.system.accountNextIndex(sender.address); + await api.tx.mantaPay .toPrivate( mintsBuffer.subarray( @@ -85,7 +92,7 @@ describe("Node RPC Test", () => { test_config.mint_size * (i + 1) ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -96,6 +103,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); @@ -108,7 +125,7 @@ describe("Node RPC Test", () => { transfersStart + test_config.mint_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(1) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -119,6 +136,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); await api.tx.mantaPay @@ -128,7 +155,7 @@ describe("Node RPC Test", () => { transfersStart + 2 * test_config.mint_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(2) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -139,6 +166,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); await api.tx.mantaPay @@ -150,7 +187,7 @@ describe("Node RPC Test", () => { test_config.transfer_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(3) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -161,6 +198,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); let reclaimsStart = @@ -172,7 +219,7 @@ describe("Node RPC Test", () => { reclaimsStart + test_config.mint_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(4) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -183,6 +230,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); await api.tx.mantaPay @@ -192,7 +249,7 @@ describe("Node RPC Test", () => { reclaimsStart + 2 * test_config.mint_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(5) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -203,6 +260,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); if (i == test_config.start_iteration + test_config.tests_iterations - 1) { @@ -215,7 +282,7 @@ describe("Node RPC Test", () => { test_config.reclaim_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(6) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -226,6 +293,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } else if (status.isFinalized) { lastFinalized = true; let endTime = performance.now(); @@ -244,7 +321,7 @@ describe("Node RPC Test", () => { test_config.reclaim_size ) ) - .signAndSend(sender, { nonce: -1 }, ({ events = [], status }) => { + .signAndSend(sender, { nonce: nonce.addn(6) }, ({ events = [], status }) => { if (status.isInBlock) { console.log("Included at block hash", status.asInBlock.toHex()); console.log("Events:"); @@ -255,6 +332,16 @@ describe("Node RPC Test", () => { allSuccesses++; } }); + events + // find/filter for failed events + .filter(({ event }) => + api.events.system.ExtrinsicFailed.is(event) + ) + .forEach(({ event: { data: [error, info] } }) => { + if (error) { + console.log(error.toString()); + } + }); } }); } @@ -263,6 +350,8 @@ describe("Node RPC Test", () => { txsCount += 7; console.log("\n Transactions sent: ", txsCount); } + const lastHeader = await api.rpc.chain.getHeader(); + lastBlock = lastHeader.number.toNumber(); // wait all txs finalized for (let i = 0; i < test_config.max_wait_time_sec; i++) { @@ -272,8 +361,6 @@ describe("Node RPC Test", () => { console.log("Tps is: ", tps); assert(tps >= test_config.expected_tps); - const lastHeader = await api.rpc.chain.getHeader(); - lastBlock = lastHeader.number.toNumber(); const averageBlockTime = totalTime / (lastBlock - firstBlock); console.log("Total time: ", totalTime); console.log("Number of blocks: ", (lastBlock - firstBlock)); @@ -291,6 +378,9 @@ describe("Node RPC Test", () => { assert(false); } - api.disconnect(); }).timeout(test_config.timeout); + + after(async function () { + await api.disconnect() + }) }); diff --git a/zombienet/tests/0001-block-production.toml b/zombienet/tests/0001-block-production.toml index b733929eb..97d528f90 100644 --- a/zombienet/tests/0001-block-production.toml +++ b/zombienet/tests/0001-block-production.toml @@ -29,15 +29,19 @@ ws_port = 9921 [[parachains.collators]] command = "manta" name = "Bob" +validator = true [[parachains.collators]] command = "manta" name = "Charlie" +validator = true [[parachains.collators]] command = "manta" name = "Dave" +validator = true [[parachains.collators]] command = "manta" name = "Eve" +validator = true diff --git a/zombienet/tests/0001-block-production.zndsl b/zombienet/tests/0001-block-production.zndsl index fe4bd52b0..c7555e7d1 100644 --- a/zombienet/tests/0001-block-production.zndsl +++ b/zombienet/tests/0001-block-production.zndsl @@ -3,8 +3,8 @@ Network: ./0001-block-production.toml Creds: config # metrics -alice: reports node_roles is 4 +Alice: reports node_roles is 4 # logs alice: parachain 2084 is registered within 225 seconds -alice: parachain 2084 block height is at least 10 within 200 seconds \ No newline at end of file +Alice: reports block height is at least 5 within 250 seconds \ No newline at end of file