diff --git a/.cargo/config.toml b/.cargo/config.toml index 05f3b7de87..f3f65ced71 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -41,3 +41,6 @@ rustflags = [ "-Dclippy::unwrap_used", "-Dclippy::expect_used", ] + +[net] +retry = 5 diff --git a/.github/workflows/common/reset-self-hosted-runner/action.yml b/.github/workflows/common/reset-self-hosted-runner/action.yml deleted file mode 100644 index 753861ddb5..0000000000 --- a/.github/workflows/common/reset-self-hosted-runner/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Reset Self-hosted Runner -description: Shared action that allows to reset a runner to its original state -runs: - using: "composite" - steps: - - name: Remove /home/runner - shell: bash - run: | - whoami - echo "***> BEFORE removal of /home/runner dir:" - ls -la /home - echo "Removing no longer used /home/runner dir..." - rm -fr /home/runner - echo "***> After removal of /home/runner dir:" - ls -la /home - - name: Remove Cargo Generated Artifacts - shell: bash - run: | - echo "Removing generated cargo artifacts..." - rm -fr ./target - rm -rf ./runtime/frequency/target - - name: Remove NPM node Modules - shell: bash - run: | - find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + - - name: Prune Docker Resources - shell: bash - run: | - set -x - if [ "$(which docker)" ] && [ "$(docker --version)" ]; then - echo "Docker is found. Cleaning..." - containers=$(docker ps --all --quiet) - if [ ! -z "$containers" ]; then - docker container rm -f $containers; - fi - docker container ls -a - docker system prune -a --volumes - docker image prune -a -f --filter "until=720h" - echo "Finished cleaning docker resources." - else - echo "Docker's not found. Exiting..." - exit 0 - fi diff --git a/.github/workflows/common/srtool/action.yml b/.github/workflows/common/srtool/action.yml new file mode 100644 index 0000000000..4755b56475 --- /dev/null +++ b/.github/workflows/common/srtool/action.yml @@ -0,0 +1,234 @@ +# This is a copy of the action file from https://github.com/chevdor/srtool-actions/blob/48e9baed50ca414936dfac59d34d8b9bbe581abd/action.yml +# It is pulled in and modified for the following reasons: +# 1. We needed to add an additional environment variable to the docker run (CARGO_NET_RETRY=10) +# 2. Local for direct auditing of the action building the runtime + +name: "Srtool" +description: "Build WASM Runtime with SRTOOL" +author: chevdor +branding: + icon: "package" + color: "blue" + +inputs: + chain: + description: > + Name of the chain, ie. polkadot + required: true + + package: + description: > + Runtime package to build, ie. polkadot-runtime. + If your runtime follows this pattern, you don't have and should not provide this input. + + If not provided, it will be set to -runtime + required: false + + image: + description: > + You can use an alternate image, use with caution! + default: "paritytech/srtool" + required: true + + tag: + description: > + Tag of the srtool image to use. Omit to use the latest (recommended) + required: false + + workdir: + description: > + Path of the project, this is where your main Cargo.toml is located. This is relative to $GITHUB_WORKSPACE. + default: "." + required: false + + runtime_dir: + description: > + Location of the runtime in your repo. The default is 'runtime/' + required: false + + profile: + description: > + Which profile to use with cargo build. + required: false + default: "release" + +outputs: + json: + description: > + The full json output of srtool. If you need more information than this action provides by default, + you can use this json output and extract some content using 'jq'. + value: ${{ steps.build.outputs.json }} + + proposal_hash: + description: The proposal hash as it will show on-chain + value: ${{ steps.build.outputs.proposal_hash }} + + version: + description: The version of srtool + value: ${{ steps.build.outputs.version }} + + info: + description: Some information from srtool about the current project + value: ${{ steps.build.outputs.info }} + + ipfs: + description: ipfs hash + value: ${{ steps.build.outputs.ipfs }} + + wasm: + description: Path of the produced compact runtime + value: ${{ steps.build.outputs.wasm }} + + wasm_compressed: + description: Path of the produced compressed runtime + value: ${{ steps.build.outputs.wasm_compressed }} + +runs: + using: "composite" + steps: + - id: check_latest_srtool + name: Check the version of the latest srtool + shell: bash + run: | + echo ::group::Inputs + echo "- image: ${{ inputs.image }}" + echo "- chain: ${{ inputs.chain }}" + echo ::endgroup:: + + RUSTC_VERSION_URL=https://raw.githubusercontent.com/${{ inputs.image }}/master/RUSTC_VERSION + echo Fetching RUSTC_VERSION from $RUSTC_VERSION_URL + RUSTC_VERSION=`curl -s $RUSTC_VERSION_URL` + + SRTOOL_VERSION_URL=https://raw.githubusercontent.com/${{ inputs.image }}/master/VERSION + echo Fetching SRTOOL_VERSION from $SRTOOL_VERSION_URL + SRTOOL_VERSION=`curl -s $SRTOOL_VERSION_URL` + + echo "RUSTC_VERSION=$RUSTC_VERSION" >> $GITHUB_ENV + echo "SRTOOL_VERSION=$SRTOOL_VERSION" >> $GITHUB_ENV + echo "SRTOOL_LATEST=$RUSTC_VERSION" >> $GITHUB_ENV + + - id: env_setup + name: Setting Env + shell: bash + run: | + echo ::group::Debug + echo "RUSTC_VERSION=$RUSTC_VERSION" + echo "SRTOOL_VERSION=$SRTOOL_VERSION" + echo "SRTOOL_LATEST=$RUSTC_VERSION" + echo ::endgroup:: + + echo ::group::Environment setup + SRTOOL_TAG=${{ inputs.tag || env.SRTOOL_LATEST }} + echo "SRTOOL_TAG=$SRTOOL_TAG" >> $GITHUB_ENV + echo "SRTOOL_IMAGE=${{ inputs.image }}:$SRTOOL_TAG" >> $GITHUB_ENV + echo "WORKDIR=${{ github.workspace }}/${{ inputs.workdir }}" >> $GITHUB_ENV + + RUNTIME_DIR=${{ inputs.runtime_dir }} + RUNTIME_DIR=${RUNTIME_DIR:-'runtime/'${{ inputs.chain }}} + echo "RUNTIME_DIR=$RUNTIME_DIR" >> $GITHUB_ENV + + PACKAGE=${{ inputs.package }} + PACKAGE=${PACKAGE:-${{ inputs.chain }}'-runtime'} + echo "PACKAGE=$PACKAGE" >> $GITHUB_ENV + + echo "BUILD_OPTS=${{ env.BUILD_OPTS }}" >> $GITHUB_ENV + + PROFILE=${{ inputs.profile }} + echo "PROFILE=$PROFILE" >> $GITHUB_ENV + + PARACHAIN_PALLET_ID=${{ env.PARACHAIN_PALLET_ID }} + PARACHAIN_PALLET_ID=${PARACHAIN_PALLET_ID:-0x01} + AUTHORIZE_UPGRADE_PREFIX=${{ env.AUTHORIZE_UPGRADE_PREFIX }} + AUTHORIZE_UPGRADE_PREFIX=${AUTHORIZE_UPGRADE_PREFIX:-0x02} + echo "PARACHAIN_PALLET_ID=$PARACHAIN_PALLET_ID" >> $GITHUB_ENV + echo "AUTHORIZE_UPGRADE_PREFIX=$AUTHORIZE_UPGRADE_PREFIX" >> $GITHUB_ENV + + echo ::endgroup:: + + - id: env_check + name: Checking Env + shell: bash + run: | + echo ::group::Environment check + + echo ℹ️ SRTOOL_LATEST: ${{ env.SRTOOL_LATEST }} + echo ℹ️ image: ${{ env.SRTOOL_IMAGE }} + echo ℹ️ chain: ${{ inputs.chain }} + echo ℹ️ package: ${{ env.PACKAGE }} + echo ℹ️ Github Workspace: ${{ github.workspace }} + echo ℹ️ workdir: ${{ env.WORKDIR }} + echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }} + echo ℹ️ build_opts: ${{ env.BUILD_OPTS }} + echo ℹ️ parachain_pallet_id: ${{ env.PARACHAIN_PALLET_ID }} + echo ℹ️ profile: ${{ env.PROFILE }} + echo ℹ️ authorize_upgrade_prefix: ${{ env.AUTHORIZE_UPGRADE_PREFIX }} + echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git` + echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml` + + echo ::endgroup:: + + - id: pulling_srtool + name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} + shell: bash + run: | + echo ::group::Pulling the srtool docker image: ${{ env.SRTOOL_IMAGE }} + docker pull ${{ env.SRTOOL_IMAGE }} + echo ::endgroup:: + + - id: version + shell: bash + run: | + echo ::group::Srtool version + CMD="docker run -i --rm -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} version -cM" + JSON=`$CMD` + echo $JSON | jq . + echo "version=$JSON" >> $GITHUB_OUTPUT + echo ::endgroup:: + + - id: info + shell: bash + run: | + echo ::group::srtool info + CMD="docker run -i --rm -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} info -cM" + JSON=`$CMD` + echo $JSON | jq . + echo "info=$JSON" >> $GITHUB_OUTPUT + echo ::endgroup:: + + - id: build + name: Build ${{ env.PACKAGE }} using ${{ env.SRTOOL_IMAGE }} + shell: bash + env: + # https://github.com/paritytech/polkadot-sdk/pull/2217 + WASM_BUILD_STD: "0" + run: | + echo ::group::Srtool build of chain ${{ inputs.chain }} + CMD="docker run -i --rm -e CARGO_NET_RETRY=10 -e PACKAGE=${{ env.PACKAGE }} -e RUNTIME_DIR=${{ env.RUNTIME_DIR }} -e BUILD_OPTS -e + PARACHAIN_PALLET_ID -e AUTHORIZE_UPGRADE_PREFIX -e PROFILE -e WASM_BUILD_STD -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE + }} build --app --json -cM" + + echo ::debug::build::docker_run $CMD + # here we keep streaming the progress and fetch the last line for the json result + stdbuf -oL $CMD | { + while IFS= read -r line + do + echo ║ $line + JSON="$line" + done + + echo "json=$JSON" >> $GITHUB_OUTPUT + echo $JSON | jq . + + PROP=`echo $JSON | jq -r .runtimes.compact.prop` + echo "proposal_hash=$PROP" >> $GITHUB_OUTPUT + + WASM=`echo $JSON | jq -r .runtimes.compact.wasm` + echo "wasm=$WASM" >> $GITHUB_OUTPUT + + Z_WASM=`echo $JSON | jq -r .runtimes.compressed.wasm` + echo "wasm_compressed=$Z_WASM" >> $GITHUB_OUTPUT + + IPFS=`echo $JSON | jq -r .runtimes.compact.ipfs` + echo "ipfs=$IPFS" >> $GITHUB_OUTPUT + } + echo ::endgroup:: diff --git a/.github/workflows/e2e-testnet.yml b/.github/workflows/e2e-testnet.yml index f89d0db67b..9671196449 100644 --- a/.github/workflows/e2e-testnet.yml +++ b/.github/workflows/e2e-testnet.yml @@ -17,7 +17,7 @@ env: jobs: run-e2e: name: Run E2E Tests - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubuntu-22.04 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Validate diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index 0dabebdcdb..ddc1cb0cf5 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -12,7 +12,6 @@ jobs: changes: name: Determine Changed Files runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest outputs: ci-base-image: ${{steps.filter.outputs.ci-base-image}} steps: @@ -28,7 +27,7 @@ jobs: publish-js-api-augment-rc: name: Merge - Publish JS API Augment Release Candidate - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-4 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -65,7 +64,7 @@ jobs: calc-code-coverage: name: Merge - Calculate Code Coverage - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-8 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 753dfcfa81..6725a6e72a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,9 @@ on: description: "Release version (v#.#.#[-rc#])" required: true +permissions: + contents: write + env: NEW_RELEASE_TAG_FROM_UI: ${{github.event.inputs.release-version}} NEW_RELEASE_TAG: ${{github.event.inputs.release-version || github.ref_name}} @@ -29,7 +32,6 @@ jobs: validate-release-version: name: Validate Release Version runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Validate if: env.NEW_RELEASE_TAG_FROM_UI != '' @@ -48,12 +50,10 @@ jobs: needs: validate-release-version name: Create Release Branch runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 with: - token: ${{secrets.GHA_GIT_COMMIT || github.token}} fetch-depth: 0 - name: Create Release Branch? id: create-release-branch @@ -116,7 +116,6 @@ jobs: needs: run-all-benchmarks name: Version Code runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -154,9 +153,8 @@ jobs: strategy: fail-fast: true matrix: - # os: [[self-hosted, Linux, X64, build, v2], [self-hosted, Linux, ARM64, build, v2]] - os: [[self-hosted, Linux, X64, build, v2]] network: [dev, local, testnet, mainnet] + arch: [amd64] include: - network: dev spec: frequency-no-relay @@ -174,11 +172,7 @@ jobs: spec: frequency build-profile: release release-file-name-prefix: frequency - - os: [self-hosted, Linux, X64, build, v2] - arch: amd64 - # - os: [self-hosted, Linux, ARM64] - # arch: arm64 - runs-on: ${{matrix.os}} + runs-on: ubicloud-standard-8 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest env: SIGNING_SUBKEY_FINGERPRINT: B6327D1474C6392032870E8EFA4FD1E73A0FE707 @@ -243,10 +237,6 @@ jobs: ${{env.BIN_DIR}}/${{env.RELEASE_BIN_FILENAME}}.asc if-no-files-found: error - # Could not port this job to container because this creates docker-in-docker - # situation and fails when srtool-ci container is trying to process files in - # the mapped volume which don't exist on the host. - # See https://github.com/LibertyDSNP/frequency/issues/1543 build-runtimes: needs: version-code name: Build Runtime for ${{matrix.network}} @@ -296,12 +286,8 @@ jobs: release-wasm-file-name-prefix: frequency_runtime features: frequency wasm-core-version: frequency - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-8 steps: - - name: Install Required Packages - run: | - sudo apt-get update - sudo apt install -y wget file build-essential - name: Check Out Repo uses: actions/checkout@v4 with: @@ -329,26 +315,28 @@ jobs: release_wasm_filename=${{matrix.release-wasm-file-name-prefix}}-v${{env.RUNTIME_SPEC_VERSION}}.${{env.NEW_RELEASE_TAG}}.compact.compressed.wasm echo "RELEASE_WASM_FILENAME=$release_wasm_filename" >> $GITHUB_ENV echo "runtime_filename_${{matrix.network}}=$release_wasm_filename" >> $GITHUB_OUTPUT - - name: Install srtool-cli - run: | - cargo install --locked --git https://github.com/chevdor/srtool-cli - srtool --version - name: Build Deterministic WASM - run: | - RUST_LOG=debug SRTOOL_TAG="1.75.0" srtool build \ - --build-opts="'--features on-chain-release-build,no-metadata-docs,${{matrix.features}}'" \ - --profile=${{matrix.build-profile}} \ - --package=${{matrix.package}} + id: srtool_build + uses: ./.github/workflows/common/srtool + env: + BUILD_OPTS: "--features on-chain-release-build,no-metadata-docs,${{matrix.features}}" + with: + profile: ${{matrix.build-profile}} + package: ${{matrix.package}} + chain: ${{matrix.chain}} + tag: "1.77.0" + runtime_dir: ${{ matrix.runtime-dir }} - name: Rename WASM file run: | - cp -p ./${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} \ + cp -p ${{ steps.srtool_build.outputs.wasm }} \ ./${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}} - name: Install Subwasm run: | - cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.19.1 --force + cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.20.0 --force subwasm --version - name: Test WASM file run: | + file ${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}} subwasm info ${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}} subwasm info ${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}} | grep "Core version:.*${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" || \ (echo "ERROR: WASM Core version didn't match ${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" && exit 1) @@ -362,7 +350,7 @@ jobs: build-rust-developer-docs: needs: version-code name: Build Rust Developer Docs - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-4 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -462,7 +450,6 @@ jobs: - os: ubuntu-22.04 arch: amd64 runs-on: ${{matrix.os}} - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Set Env Vars run: | @@ -843,7 +830,6 @@ jobs: DOCKER_HUB_PROFILE: frequencychain IMAGE_NAME: parachain-node runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Set Env Vars run: | @@ -939,7 +925,6 @@ jobs: env: DOCKER_HUB_PROFILE: frequencychain runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Set Env Vars run: | @@ -1017,7 +1002,6 @@ jobs: needs: wait-for-all-builds name: Release Rust Developer Docs runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest permissions: contents: read pages: write @@ -1035,7 +1019,6 @@ jobs: needs: wait-for-all-builds name: Release JS API Augment runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 diff --git a/.github/workflows/rococo.yml b/.github/workflows/rococo.yml index 707ddd0e4b..0d0f225682 100644 --- a/.github/workflows/rococo.yml +++ b/.github/workflows/rococo.yml @@ -17,7 +17,7 @@ env: jobs: run-e2e: name: Run E2E Tests - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubuntu-22.04 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Validate diff --git a/.github/workflows/verify-pr-commit.yml b/.github/workflows/verify-pr-commit.yml index af33d5306c..51c4d49ff3 100644 --- a/.github/workflows/verify-pr-commit.yml +++ b/.github/workflows/verify-pr-commit.yml @@ -17,7 +17,6 @@ jobs: changes: name: Determine Changed Files runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest outputs: rust: ${{steps.filter.outputs.rust}} build-binary: ${{steps.filter.outputs.build-binary}} @@ -59,7 +58,6 @@ jobs: clear-metadata-labels: name: Clear Metadata Labels runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Clear Metadata Changed Label if: contains(github.event.pull_request.labels.*.name, env.PR_LABEL_METADATA_CHANGED) @@ -132,7 +130,7 @@ jobs: - network: mainnet spec: frequency branch_alias: pr - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-16 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest env: NETWORK: mainnet @@ -207,7 +205,7 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' name: Lint Rust Code - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-4 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -223,7 +221,7 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' name: Verify Rust Developer Docs - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-4 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -237,7 +235,7 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' name: Verify Rust Packages and Dependencies - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-4 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -249,7 +247,7 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' name: Run Rust Tests - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-8 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -264,7 +262,7 @@ jobs: needs: changes if: needs.changes.outputs.rust == 'true' name: Calculate Code Coverage - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-8 container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo @@ -289,9 +287,6 @@ jobs: steps: - run: echo "Just a dummy matrix to satisfy GitHub required checks that were skipped" - # Could not port this job to container because this creates docker-in-docker - # situation and fails when srtool-ci container is trying to process files in - # the mapped volume which don't exist on the host verify-build-runtimes: needs: changes if: needs.changes.outputs.rust == 'true' @@ -305,6 +300,7 @@ jobs: network: [dev, rococo, paseo, mainnet] include: - network: dev + chain: dev build-profile: release package: frequency-runtime runtime-dir: runtime/frequency @@ -312,6 +308,7 @@ jobs: features: frequency-no-relay wasm-core-version: frequency-testnet - network: rococo + chain: frequency-rococo build-profile: release package: frequency-runtime runtime-dir: runtime/frequency @@ -319,6 +316,7 @@ jobs: features: frequency-testnet wasm-core-version: frequency-testnet - network: paseo + chain: frequency-paseo build-profile: release package: frequency-runtime runtime-dir: runtime/frequency @@ -326,18 +324,15 @@ jobs: features: frequency-testnet wasm-core-version: frequency-testnet - network: mainnet + chain: frequency build-profile: release package: frequency-runtime runtime-dir: runtime/frequency built-wasm-file-name-prefix: frequency_runtime features: frequency wasm-core-version: frequency - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubicloud-standard-8 steps: - - name: Install Required Packages - run: | - sudo apt-get update - sudo apt install -y wget file build-essential curl - name: Check Out Repo uses: actions/checkout@v4 - name: Install Rust Toolchain @@ -366,35 +361,30 @@ jobs: # with: # path: ${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} # key: runtimes-${{runner.os}}-${{matrix.network}}-${{github.head_ref}} - - name: Install srtool-cli - if: steps.cache-wasm.outputs.cache-hit != 'true' - run: | - rustup show - cargo install --locked --git https://github.com/chevdor/srtool-cli - echo "PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV - - name: Test srtool-cli Install - run: | - echo "PATH: $PATH" - which srtool - srtool --version - name: Build Deterministic WASM + id: srtool_build if: steps.cache-wasm.outputs.cache-hit != 'true' - run: | - RUST_LOG=debug SRTOOL_TAG="1.75.0" srtool build \ - --build-opts="'--features on-chain-release-build,no-metadata-docs,${{matrix.features}}'" \ - --profile=${{matrix.build-profile}} \ - --package=${{matrix.package}} + uses: ./.github/workflows/common/srtool + env: + BUILD_OPTS: "--features on-chain-release-build,no-metadata-docs,${{matrix.features}}" + with: + profile: ${{matrix.build-profile}} + package: ${{matrix.package}} + chain: ${{matrix.chain}} + runtime_dir: ${{ matrix.runtime-dir }} + tag: "1.77.0" - name: Check Deterministic WASM Build Exists if: steps.cache-wasm.outputs.cache-hit != 'true' - run: file ${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} + run: | + file ${{ steps.srtool_build.outputs.wasm }} - name: Install Subwasm run: | - cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.19.1 --force + cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.20.0 --force subwasm --version - name: Test WASM file run: | - subwasm info ${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} - subwasm info ${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} | grep "Core version:.*${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" || \ + subwasm info ${{ steps.srtool_build.outputs.wasm }} + subwasm info ${{ steps.srtool_build.outputs.wasm }} | grep "Core version:.*${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" || \ (echo "ERROR: WASM Core version didn't match ${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" && exit 1) verify-js-api-augment: @@ -461,7 +451,6 @@ jobs: needs: build-binaries name: Verify Node Docker Images runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -524,7 +513,6 @@ jobs: if: needs.changes.outputs.ci-docker-image == 'true' name: Verify CI Docker Image runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -548,7 +536,6 @@ jobs: needs: build-binaries name: Execute Binary Checks runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -580,7 +567,6 @@ jobs: needs: build-binaries name: Check Metadata and Spec Version runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -661,7 +647,7 @@ jobs: if: needs.changes.outputs.run-e2e == 'true' needs: [build-binaries, verify-js-api-augment] name: Run E2E Tests - runs-on: [self-hosted, Linux, X64, build, v2] + runs-on: ubuntu-22.04 steps: - name: Check Out Repo uses: actions/checkout@v4 @@ -738,7 +724,6 @@ jobs: needs: build-binaries name: Verify Genesis State runs-on: ubuntu-22.04 - container: ghcr.io/libertydsnp/frequency/ci-base-image:latest steps: - name: Set Env Vars run: | diff --git a/README.md b/README.md index 57f5dbb451..f2a47121a0 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ make start-frequency-with-offchain 1. Check out the commit at which the runtime was built. 2. Use [srtool](https://github.com/paritytech/srtool) and [srtool-cli](https://github.com/chevdor/srtool-cli) to verify the runtime: ```sh - SRTOOL_TAG="1.75.0" srtool build \ + SRTOOL_TAG="1.77.0" srtool build \ --build-opts="'--features on-chain-release-build,no-metadata-docs,frequency'" \ --profile=release \ --package=frequency-runtime \ diff --git a/pallets/schemas/src/tests/other_tests.rs b/pallets/schemas/src/tests/other_tests.rs index faa3aa9aac..43e5052767 100644 --- a/pallets/schemas/src/tests/other_tests.rs +++ b/pallets/schemas/src/tests/other_tests.rs @@ -490,7 +490,7 @@ fn create_schema_v3_requires_valid_schema_size() { expected: (Error::::LessThanMinSchemaModelBytes, 3), }, TestCase { - input: r#"{"id": "long", "title": "I am a very very very long schema", "properties": "just way too long to live a long life", "description": "Just a never ending stream of bytes that goes on for a minute too long"}"#, + input: r#"{"id": "long", "title": "I am a very very very very long schema", "properties": "just way too long to live a long life", "description": "Just a never ending stream of bytes that goes on for a minute too long"}"#, expected: (Error::::ExceedsMaxSchemaModelBytes, 2), }, ];