From 724fceb01bc35b08bb32be119701beec4767bd79 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 20 Jan 2023 12:45:26 +0700 Subject: [PATCH 01/74] ref v2 --- .docker/Dockerfile-try-runtime.j2 | 40 ++++++++++ .docker/docker-compose.tmp-try-runtime.j2 | 12 +-- .docker/docker-compose.tmp-xcm-tests.j2 | 4 +- .github/actions/prepare/action.yml | 16 ++++ .github/workflows/ci-develop.yml | 8 +- .github/workflows/codestyle.yml | 20 ++--- .github/workflows/execution-matrix.yml | 4 +- .github/workflows/forkless-update-data.yml | 10 +-- .github/workflows/forkless-update-nodata.yml | 20 ++--- .../workflows/generate-execution-matrix.yml | 4 +- .github/workflows/market-test.yml | 8 +- .github/workflows/node-only-update.yml | 20 ++--- .github/workflows/polkadot-types.yml | 4 +- .github/workflows/testnet-build.yml | 8 +- .github/workflows/try-runtime.yml | 10 +-- .github/workflows/unit-test.yml | 5 +- .github/workflows/xcm.yml | 74 ++++++++++++------- .github/workflows/yarn-dev.yml | 27 +++++-- 18 files changed, 189 insertions(+), 105 deletions(-) create mode 100644 .docker/Dockerfile-try-runtime.j2 create mode 100644 .github/actions/prepare/action.yml diff --git a/.docker/Dockerfile-try-runtime.j2 b/.docker/Dockerfile-try-runtime.j2 new file mode 100644 index 0000000000..95bbe2ca1a --- /dev/null +++ b/.docker/Dockerfile-try-runtime.j2 @@ -0,0 +1,40 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release + +COPY . /unique_parachain +WORKDIR /unique_parachain + +RUN echo "Requested features: {{ NETWORK }}-runtime\n" && \ + echo "Fork from: {{ REPLICA_FROM }}\n" && \ + cargo build --features=try-runtime,{{ NETWORK }}-runtime --release + +CMD cargo run --release --features {{ NETWORK }}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri {{ REPLICA_FROM }} diff --git a/.docker/docker-compose.tmp-try-runtime.j2 b/.docker/docker-compose.tmp-try-runtime.j2 index 71e673dccd..d185dac220 100644 --- a/.docker/docker-compose.tmp-try-runtime.j2 +++ b/.docker/docker-compose.tmp-try-runtime.j2 @@ -2,16 +2,8 @@ version: "3.5" services: try-runtime: - build: - context: ../ - dockerfile: .docker/Dockerfile-try-runtime - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "NETWORK={{ NETWORK }}" - - "REPLICA_FROM={{ REPLICA_FROM }}" - - "WASM_NAME={{ WASM_NAME }}" - image: try-runtime - container_name: try-runtime + image: uniquenetwork/tryruntime-{{ NETWORK }}-testnet-local:latest + container_name: tryruntime-{{ NETWORK }}-testnet-local expose: - 9944 - 9933 diff --git a/.docker/docker-compose.tmp-xcm-tests.j2 b/.docker/docker-compose.tmp-xcm-tests.j2 index 141f5a9f91..da6befcfe8 100644 --- a/.docker/docker-compose.tmp-xcm-tests.j2 +++ b/.docker/docker-compose.tmp-xcm-tests.j2 @@ -2,8 +2,8 @@ version: "3.5" services: xcm_nodes: - image: uniquenetwork/xcm-{{ NETWORK }}-testnet-local:latest - container_name: xcm-{{ NETWORK }}-testnet-local + image: uniquenetwork/ci-xcm-local:{{ NETWORK }}-{{ BUILD_TAG }} + container_name: xcm-{{ NETWORK }}-local expose: - 9844 - 9933 diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml new file mode 100644 index 0000000000..e3b711592b --- /dev/null +++ b/.github/actions/prepare/action.yml @@ -0,0 +1,16 @@ +# .github/actions/prepare/action.yml +name: 'Preparation' +description: '' +runs: + using: "composite" + steps: + - name: Setup Environment (PR) + if: ${{ github.event_name == 'pull_request' }} + shell: bash + run: | + echo "LAST_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> ${GITHUB_ENV} + - name: Setup Environment (Push) + if: ${{ github.event_name == 'push' }} + shell: bash + run: | + echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV} \ No newline at end of file diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index f04e78046a..702891619e 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -25,12 +25,12 @@ jobs: uses: ./.github/workflows/unit-test.yml canary: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} # Conditional check for draft & labels per job. + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-canary')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets from initial workflow to nested xcm: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} # Conditional check for draft & labels per job. + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-xcm')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets from initial workflow to nested @@ -39,11 +39,11 @@ jobs: uses: ./.github/workflows/collator-selection.yml forkless: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job. + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/forkless.yml node-only-update: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'node-only-update')) }} # Conditional check for draft & labels per job. + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-node-only-update')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update.yml # integration: diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index d0cc0d0f49..51dc0ac1ec 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -13,15 +13,13 @@ jobs: steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} - name: Install latest nightly - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown + targets: wasm32-unknown-unknown components: rustfmt, clippy - name: Run cargo fmt run: cargo fmt -- --check # In that mode it returns only exit code. @@ -34,10 +32,10 @@ jobs: steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 - name: Install modules @@ -49,15 +47,13 @@ jobs: if: ${{ false }} runs-on: [ self-hosted-ci ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 - name: Install substrate dependencies run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler - name: Install latest nightly - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown + targets: wasm32-unknown-unknown components: rustfmt, clippy - name: Run cargo check run: cargo clippy -- -Dwarnings diff --git a/.github/workflows/execution-matrix.yml b/.github/workflows/execution-matrix.yml index ae3511be8c..1a55b4b172 100644 --- a/.github/workflows/execution-matrix.yml +++ b/.github/workflows/execution-matrix.yml @@ -24,7 +24,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -32,7 +32,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 53c5abefc5..8bd3b4fb27 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -23,7 +23,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -31,7 +31,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -51,14 +51,14 @@ jobs: matrix: include: ${{fromJson(needs.execution-marix.outputs.matrix)}} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -152,7 +152,7 @@ jobs: - name: Collect Docker Logs if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 + uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}' images: 'node-parachain' diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 34c10a7e69..da005daef8 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -22,7 +22,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -30,7 +30,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -49,7 +49,7 @@ jobs: name: ${{ matrix.network }}-nodata - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -60,7 +60,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -100,7 +100,7 @@ jobs: - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless-nodata.json - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 @@ -156,7 +156,7 @@ jobs: - name: Collect Docker Logs if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 + uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' images: 'node-parachain' @@ -170,7 +170,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} @@ -178,7 +178,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ - name: Test Report Parallel - uses: phoenix-actions/test-reporting@v8 + uses: phoenix-actions/test-reporting@v10 id: test-report-parallel if: success() || failure() # run this step even if previous step failed with: @@ -193,7 +193,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} @@ -201,7 +201,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ - name: Test Report Sequential - uses: phoenix-actions/test-reporting@v8 + uses: phoenix-actions/test-reporting@v10 id: test-report-sequential if: success() || failure() # run this step even if previous step failed with: diff --git a/.github/workflows/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml index 91127783a3..4881399e53 100644 --- a/.github/workflows/generate-execution-matrix.yml +++ b/.github/workflows/generate-execution-matrix.yml @@ -28,7 +28,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -36,7 +36,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml index c1a2ab558f..873e7b7bdc 100644 --- a/.github/workflows/market-test.yml +++ b/.github/workflows/market-test.yml @@ -18,7 +18,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -36,7 +36,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Checkout Market e2e tests - uses: actions/checkout@v3 + uses: actions/checkout@v3.1.0 with: repository: 'UniqueNetwork/market-e2e-tests' ssh-key: ${{ secrets.GH_PAT }} @@ -72,7 +72,7 @@ jobs: working-directory: qa-tests run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16.17 @@ -93,7 +93,7 @@ jobs: # working-directory: tests # run: | # yarn install -# node scripts/readyness.js +# ./scripts/wait_for_first_block.sh # echo "Ready to start tests" # env: # RPC_URL: http://127.0.0.1:9933/ diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index 91b50212ed..0d945b8554 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -25,7 +25,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -33,7 +33,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -52,7 +52,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -64,7 +64,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -104,7 +104,7 @@ jobs: - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless-nodata.json - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 @@ -169,7 +169,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} @@ -194,7 +194,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ # - name: Upload Sequential Test Report Before Node upgrade - # uses: phoenix-actions/test-reporting@v8 + # uses: phoenix-actions/test-reporting@v10 # id: test-sequential-report-before # if: success() || failure() # run this step even if previous step failed # with: @@ -292,7 +292,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} @@ -300,7 +300,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ #- name: Test Report Parallel After Node upgrade - # uses: phoenix-actions/test-reporting@v8 + # uses: phoenix-actions/test-reporting@v10 # id: test-report-parallel-after # if: success() || failure() # run this step even if previous step failed # with: @@ -317,7 +317,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ #- name: Upload Sequential Test Report After Node upgrade - # uses: phoenix-actions/test-reporting@v8 + # uses: phoenix-actions/test-reporting@v10 # id: test-sequential-report-after # if: success() || failure() # run this step even if previous step failed # with: diff --git a/.github/workflows/polkadot-types.yml b/.github/workflows/polkadot-types.yml index f0027b4e6e..6b62cd232d 100644 --- a/.github/workflows/polkadot-types.yml +++ b/.github/workflows/polkadot-types.yml @@ -24,7 +24,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -66,7 +66,7 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index f5481e97f5..ac838268ef 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -28,7 +28,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -36,7 +36,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -53,7 +53,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -68,7 +68,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 30efd71d13..ea72ec38ee 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -21,7 +21,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -29,7 +29,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: CertainLach/create-matrix-action@v3 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -43,7 +43,7 @@ jobs: # The type of runner that the job will run on runs-on: [self-hosted-ci] - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. name: ${{ matrix.network }}-try-runtime strategy: @@ -56,7 +56,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -82,7 +82,7 @@ jobs: - name: Collect Docker Logs if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 + uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './try-runtime-logs.${{ matrix.network }}' images: 'try-runtime' diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 0d2d022a8f..82465350d5 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,8 +17,7 @@ jobs: name: ${{ github.base_ref }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: @@ -26,7 +25,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 9874ce5f33..044007945b 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -28,7 +28,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -36,7 +36,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 + uses: CertainLach/create-matrix-action@v4 id: create_matrix with: matrix: | @@ -54,7 +54,7 @@ jobs: name: ${{ matrix.network }}-build - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -69,10 +69,14 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit + # Prepare SHA + - name: Prepare SHA + uses: ./.github/actions/prepare + - name: Read .env file uses: xom9ikk/dotenv@v2 @@ -82,9 +86,6 @@ jobs: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Install jq - run: sudo apt install jq -y - # Check POLKADOT version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for POLKADOT uses: cuchi/jinja2-action@v1.2.0 @@ -217,7 +218,6 @@ jobs: fi shell: bash - # Check ASTAR version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for ASTAR uses: cuchi/jinja2-action@v1.2.0 @@ -251,6 +251,8 @@ jobs: fi shell: bash + - name: Pull chainql docker image + run: docker pull uniquenetwork/builder-chainql:latest - name: Generate ENV related extend launch-config file uses: cuchi/jinja2-action@v1.2.0 @@ -284,24 +286,23 @@ jobs: run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@3 id: branchname with: source: ${{ github.head_ref }} find: '/' replace: '-' - - name: Pull chainql docker image - run: docker pull uniquenetwork/builder-chainql:latest + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Build the stack - run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . - name: Push docker image version - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - - - name: Push docker image latest - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest + run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA - name: Remove builder cache if: always() # run this step always @@ -318,7 +319,7 @@ jobs: name: ${{ matrix.network }}-tests - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -333,10 +334,26 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit + - name: Prepare + uses: ./.github/actions/prepare + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + - name: Read .env file uses: xom9ikk/dotenv@v2 @@ -347,14 +364,21 @@ jobs: output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml variables: | NETWORK=${{ matrix.network }} + BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA - name: Show build configuration run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + - name: Build the stack run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 @@ -364,14 +388,14 @@ jobs: run: | counter=160 function check_container_status { - docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local + docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-local } function do_docker_logs { - docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1 + docker logs --details xcm-${{ matrix.network }}-local 2>&1 } function is_started { if [ "$(check_container_status)" == "true" ]; then - echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING"; + echo "Container: xcm-${{ matrix.network }}-local RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then @@ -382,7 +406,7 @@ jobs: return 1 fi else - echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING" + echo "Container xcm-${{ matrix.network }}-local NOT RUNNING" echo "Halting all future checks" exit 1 fi @@ -409,7 +433,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} @@ -417,7 +441,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ - name: XCM Test Report - uses: phoenix-actions/test-reporting@v8 + uses: phoenix-actions/test-reporting@v10 id: test-report if: success() || failure() # run this step even if previous step failed with: diff --git a/.github/workflows/yarn-dev.yml b/.github/workflows/yarn-dev.yml index 046adf680a..8f9053c3fb 100644 --- a/.github/workflows/yarn-dev.yml +++ b/.github/workflows/yarn-dev.yml @@ -18,7 +18,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -34,7 +34,7 @@ jobs: uses: AutoModality/action-clean@v1.1.0 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.1.0 with: ref: ${{ github.head_ref }} #Checking out head commit @@ -57,7 +57,7 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3.5.1 with: node-version: 16 @@ -66,7 +66,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + ./scripts/wait_for_first_block.sh echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} @@ -74,7 +74,7 @@ jobs: RPC_URL: http://127.0.0.1:9933/ - name: Test Report - uses: phoenix-actions/test-reporting@v8 + uses: phoenix-actions/test-reporting@v10 id: test-report if: success() || failure() # run this step even if previous step failed with: @@ -97,3 +97,20 @@ jobs: docker builder prune -f -a docker system prune -f docker image prune -f -a + + # check: + # if: always() + # runs-on: [self-hosted-ci] + # needs: + # - dev_build_int_tests + + # steps: + # - name: Install python3 + # uses: actions/setup-python@v4 + # with: + # python-version: '3.10' + + # - name: Decide whether the needed jobs succeeded or failed + # uses: re-actors/alls-green@v1.2.2 + # with: + # jobs: ${{ toJSON(needs) }} \ No newline at end of file From d6423e6cf39d2e6ff5bb40511099ac60c8c9303e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 20:59:37 +0700 Subject: [PATCH 02/74] separate forkless build and tests --- .docker/Dockerfile-parachain-upgrade-data | 2 - .docker/Dockerfile-parachain-upgrade-data.j2 | 78 ++++++++++ .docker/Dockerfile-parachain-upgrade.j2 | 72 +++++++++ .docker/Dockerfile-try-runtime.j2 | 12 +- .docker/docker-compose.forkless-data.j2 | 13 ++ .docker/docker-compose.forkless-nodata.j2 | 13 ++ .docker/docker-compose.tmp-try-runtime.j2 | 16 -- .docker/docker-compose.try-runtime.j2 | 14 ++ .github/workflows/forkless-update-data.yml | 148 +++++++++++++++--- .github/workflows/forkless-update-nodata.yml | 151 +++++++++++++++---- .github/workflows/try-runtime.yml | 118 ++++++++++++++- .github/workflows/xcm.yml | 10 +- 12 files changed, 557 insertions(+), 90 deletions(-) create mode 100644 .docker/Dockerfile-parachain-upgrade-data.j2 create mode 100644 .docker/Dockerfile-parachain-upgrade.j2 create mode 100644 .docker/docker-compose.forkless-data.j2 create mode 100644 .docker/docker-compose.forkless-nodata.j2 delete mode 100644 .docker/docker-compose.tmp-try-runtime.j2 create mode 100644 .docker/docker-compose.try-runtime.j2 diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index 4718f11d43..d81215b5ec 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -38,8 +38,6 @@ FROM rust-builder as builder-unique-target ARG PROFILE=release ARG NETWORK -ARG BRANCH -ARG REPO_URL COPY . /unique_parachain WORKDIR /unique_parachain diff --git a/.docker/Dockerfile-parachain-upgrade-data.j2 b/.docker/Dockerfile-parachain-upgrade-data.j2 new file mode 100644 index 0000000000..9b41a80a91 --- /dev/null +++ b/.docker/Dockerfile-parachain-upgrade-data.j2 @@ -0,0 +1,78 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot + +# ===== Rust builder ===== +FROM uniquenetwork/services:latest as rust-builder + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release + +WORKDIR /unique_parachain + +RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ MAINNET_BRANCH }} . && \ + cargo build --features={{ NETWORK }}-runtime --$PROFILE + +# ===== BUILD target version ====== +FROM rust-builder as builder-unique-target + +ARG PROFILE=release + +COPY . /unique_parachain +WORKDIR /unique_parachain + +RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +ENV REPLICA_FROM={{ REPLICA_FROM }} + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm + +COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/launch-config-forkless-data.json /polkadot-launch/launch-config.json +COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/fork.jsonnet /polkadot-launch/fork.jsonnet +COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/typeNames.jsonnet /polkadot-launch/typeNames.jsonnet + +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/Dockerfile-parachain-upgrade.j2 b/.docker/Dockerfile-parachain-upgrade.j2 new file mode 100644 index 0000000000..6b13eab18c --- /dev/null +++ b/.docker/Dockerfile-parachain-upgrade.j2 @@ -0,0 +1,72 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot + +# ===== Rust builder ===== +FROM uniquenetwork/services:latest as rust-builder + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release + +WORKDIR /unique_parachain + +RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ MAINNET_BRANCH }} . && \ + cargo build --features={{ NETWORK }}-runtime --$PROFILE + +# ===== BUILD target version ====== +FROM rust-builder as builder-unique-target + +ARG PROFILE=release + +COPY . /unique_parachain +WORKDIR /unique_parachain + +RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm + +COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/launch-config-forkless-nodata.json /polkadot-launch/launch-config.json + +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/Dockerfile-try-runtime.j2 b/.docker/Dockerfile-try-runtime.j2 index 95bbe2ca1a..9d6c24307f 100644 --- a/.docker/Dockerfile-try-runtime.j2 +++ b/.docker/Dockerfile-try-runtime.j2 @@ -1,18 +1,10 @@ # ===== Rust builder ===== -FROM ubuntu:20.04 as rust-builder -LABEL maintainer="Unique.Network" +FROM uniquenetwork/services:latest as rust-builder +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install {{ RUST_TOOLCHAIN }} && \ diff --git a/.docker/docker-compose.forkless-data.j2 b/.docker/docker-compose.forkless-data.j2 new file mode 100644 index 0000000000..05d1cfd6b0 --- /dev/null +++ b/.docker/docker-compose.forkless-data.j2 @@ -0,0 +1,13 @@ +version: "3.5" + +services: + forkless-data: + image: uniquenetwork/ci-forkless-data-local:{{ NETWORK }}-{{ BUILD_TAG }} + container_name: forkless-data + image: forkless-data + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 diff --git a/.docker/docker-compose.forkless-nodata.j2 b/.docker/docker-compose.forkless-nodata.j2 new file mode 100644 index 0000000000..93aed4078c --- /dev/null +++ b/.docker/docker-compose.forkless-nodata.j2 @@ -0,0 +1,13 @@ +version: "3.5" + +services: + forkless-nodata: + image: uniquenetwork/ci-forkless-nodata-local:{{ NETWORK }}-{{ BUILD_TAG }} + container_name: forkless-nodata + image: forkless-nodata + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 \ No newline at end of file diff --git a/.docker/docker-compose.tmp-try-runtime.j2 b/.docker/docker-compose.tmp-try-runtime.j2 deleted file mode 100644 index d185dac220..0000000000 --- a/.docker/docker-compose.tmp-try-runtime.j2 +++ /dev/null @@ -1,16 +0,0 @@ -version: "3.5" - -services: - try-runtime: - image: uniquenetwork/tryruntime-{{ NETWORK }}-testnet-local:latest - container_name: tryruntime-{{ NETWORK }}-testnet-local - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 new file mode 100644 index 0000000000..1bae986797 --- /dev/null +++ b/.docker/docker-compose.try-runtime.j2 @@ -0,0 +1,14 @@ +version: "3.5" + +services: + try-runtime: + image: uniquenetwork/ci-tryruntime-local:{{ NETWORK }}-{{ BUILD_TAG }} + container_name: try-runtime + image: try-runtime + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 8bd3b4fb27..838a8a7468 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -40,7 +40,7 @@ jobs: network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}} - forkless-update-data: + forkless-update-data-build: needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -65,57 +65,157 @@ jobs: - name: Read .env file uses: xom9ikk/dotenv@v2 - - name: Generate ENV related extend file for docker-compose + # Prepare SHA + - name: Prepare SHA + uses: ./.github/actions/prepare + + # Build main image for FORKLESS-UPDATE-NODATA + - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-forkless-data.j2 - output_file: .docker/docker-compose-forkless-data.${{ matrix.network }}.yml + template: .docker/Dockerfile-parachain-upgrade-data.j2 + output_file: .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + WASM_NAME=${{ matrix.wasm_name }} POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - # POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} - # MAINNET_TAG=${{ matrix.mainnet_tag }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} - NETWORK=${{ matrix.network }} - # BRANCH=${{ github.head_ref }} REPLICA_FROM=${{ matrix.replica_from_address }} - WASM_NAME=${{ matrix.wasm_name }} - name: Show build configuration - run: cat .docker/docker-compose-forkless-data.${{ matrix.network }}.yml + run: cat .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml - name: Generate launch-config-forkless-data.json uses: cuchi/jinja2-action@v1.2.0 with: template: .docker/forkless-config/launch-config-forkless-data.j2 - output_file: .docker/launch-config-forkless-data.json + output_file: .docker/forkless-config/launch-config-forkless-data.json variables: | - NETWORK=${{ matrix.network }} - REPLICA_FROM=${{ matrix.replica_from_address }} - WASM_NAME=${{ matrix.wasm_name}} + WASM_NAME=${{ matrix.wasm_name }} RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }} + REPLICA_FROM=${{ matrix.replica_from_address }} - name: Show launch-config-forkless configuration - run: cat .docker/launch-config-forkless-data.json + run: cat .docker/forkless-config/launch-config-forkless-data.json + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@3 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Push docker image version + run: docker push uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + forkless-data-tests: + needs: [prepare-execution-marix, forkless-nodata-build] + # The type of runner that the job will run on + runs-on: [self-hosted-ci, large] + + timeout-minutes: 600 + + name: ${{ matrix.network }}-data-tests + + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3.1.0 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Read .env file + uses: xom9ikk/dotenv@v2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.forkless-data.j2 + output_file: .docker/docker-compose.forkless-data.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA + + - name: Show build configuration + run: cat .docker/docker-compose.forkless-data.${{ matrix.network }}.yml + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless-data.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose.forkless-data.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + + - uses: actions/setup-node@v3.5.1 + with: + node-version: 16 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | counter=160 function check_container_status { - docker inspect -f {{.State.Running}} node-parachain + docker inspect -f {{.State.Running}} forkless-data } function do_docker_logs { - docker logs --details node-parachain 2>&1 + docker logs --details forkless-data 2>&1 } function is_started { if [ "$(check_container_status)" == "true" ]; then - echo "Container: node-parachain RUNNING"; + echo "Container: forkless-data RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then @@ -129,7 +229,7 @@ jobs: return 1 fi else - echo "Container node-parachain not RUNNING" + echo "Container forkless-data not RUNNING" echo "Halting all future checks" exit 1 fi @@ -155,11 +255,11 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}' - images: 'node-parachain' + images: 'forkless-data' - name: Show Docker logs if: success() || failure() - run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log' + run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/forkless-data.log' - name: Stop running containers if: always() # run this step always diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index da005daef8..2270bfae61 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -40,7 +40,7 @@ jobs: network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}} - forkless-update-nodata: + forkless-nodata-build: needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -67,59 +67,156 @@ jobs: - name: Read .env file uses: xom9ikk/dotenv@v2 - - name: Generate ENV related extend file for docker-compose + # Prepare SHA + - name: Prepare SHA + uses: ./.github/actions/prepare + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + # Build main image for FORKLESS-UPDATE-NODATA + - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-forkless-nodata.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml + template: .docker/Dockerfile-parachain-upgrade.j2 + output_file: .docker/Dockerfile-parachain-upgrade.${{ matrix.network }}.yml variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - # POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} - # MAINNET_TAG=${{ matrix.mainnet_tag }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} NETWORK=${{ matrix.network }} - # BRANCH=${{ github.head_ref }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} WASM_NAME=${{ matrix.wasm_name }} + POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - - name: Show build configuration - run: cat .docker/docker-compose.${{ matrix.network }}.yml + - name: Show build Dockerfile + run: cat .docker/Dockerfile-parachain-upgrade.${{ matrix.network }}.yml - name: Generate launch-config-forkless-nodata.json uses: cuchi/jinja2-action@v1.2.0 with: template: .docker/forkless-config/launch-config-forkless-nodata.j2 - output_file: .docker/launch-config-forkless-nodata.json + output_file: .docker/forkless-config/launch-config-forkless-nodata.json variables: | - NETWORK=${{ matrix.network }} WASM_NAME=${{ matrix.wasm_name }} RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }} - name: Show launch-config-forkless configuration - run: cat .docker/launch-config-forkless-nodata.json + run: cat .docker/forkless-config/launch-config-forkless-nodata.json - - uses: actions/setup-node@v3.5.1 + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@3 + id: branchname with: - node-version: 16 + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + + - name: Push docker image version + run: docker push uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + + forkless-nodata-tests: + needs: [prepare-execution-marix, forkless-nodata-build] + # The type of runner that the job will run on + runs-on: [self-hosted-ci, large] + + timeout-minutes: 600 + + name: ${{ matrix.network }}-nodata-tests + + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3.1.0 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Read .env file + uses: xom9ikk/dotenv@v2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.forkless-nodata.j2 + output_file: .docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA + + - name: Show build configuration + run: cat .docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Build the stack - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + + - uses: actions/setup-node@v3.5.1 + with: + node-version: 16 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | counter=160 function check_container_status { - docker inspect -f {{.State.Running}} node-parachain + docker inspect -f {{.State.Running}} forkless-nodata } function do_docker_logs { - docker logs --details node-parachain 2>&1 + docker logs --details forkless-nodata 2>&1 } function is_started { if [ "$(check_container_status)" == "true" ]; then - echo "Container: node-parachain RUNNING"; + echo "Container: forkless-nodata RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then @@ -133,7 +230,7 @@ jobs: return 1 fi else - echo "Container node-parachain not RUNNING" + echo "Container forkless-nodata not RUNNING" echo "Halting all future checks" exit 1 fi @@ -158,12 +255,12 @@ jobs: if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.1 with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' - images: 'node-parachain' + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.network }}' + images: 'forkless-nodata' - name: Show docker logs if: success() || failure() - run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' + run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.network }}/forkless-nodata.log' - name: Run Parallel tests working-directory: tests @@ -212,7 +309,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index ea72ec38ee..30541f63e3 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -38,14 +38,14 @@ jobs: network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} - try-runtime: + try-runtime-build: needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci] continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - name: ${{ matrix.network }}-try-runtime + name: ${{ matrix.network }}-try-runtime-build strategy: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} @@ -60,25 +60,131 @@ jobs: with: ref: ${{ github.head_ref }} #Checking out head commit + # Prepare SHA + - name: Prepare SHA + uses: ./.github/actions/prepare + - name: Read .env file uses: xom9ikk/dotenv@v2 - - name: Generate ENV related extend file for docker-compose + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + # Build main image for TRY-RUNTIME + - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-try-runtime.j2 - output_file: .docker/docker-compose.try-runtime.${{ matrix.network }}.yml + template: .docker/Dockerfile-try-runtime.j2 + output_file: .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml variables: | RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} WASM_NAME=${{ matrix.wasm_name }} REPLICA_FROM=${{ matrix.replica_from_address }} + - name: Show build Dockerfile + run: cat .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@3 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-try-runtime.${{ matrix.network }}.yml --tag uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + + - name: Push docker image version + run: docker push uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + + try-runtime-tests: + needs: [prepare-execution-marix, try-runtime-build] + # The type of runner that the job will run on + runs-on: [self-hosted-ci] + + timeout-minutes: 600 + + name: ${{ matrix.network }}-try-runtime-tests + + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3.1.0 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Set build SHA + shell: bash + run: | + echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Read .env file + uses: xom9ikk/dotenv@v2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.try-runtime.j2 + output_file: .docker/docker-compose.try-runtime.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA + - name: Show build configuration run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml + - uses: actions/setup-node@v3.5.1 + with: + node-version: 16 + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + - name: Build the stack - run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from try-runtime + run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 - name: Collect Docker Logs if: success() || failure() diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 044007945b..95f8b307ca 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -360,14 +360,14 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-xcm-tests.j2 - output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + template: .docker/docker-compose.xcm.j2 + output_file: .docker/docker-compose.xcm.${{ matrix.network }}.yml variables: | NETWORK=${{ matrix.network }} BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA - name: Show build configuration - run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + run: cat .docker/docker-compose.xcm.${{ matrix.network }}.yml - uses: actions/setup-node@v3.5.1 with: @@ -380,7 +380,7 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Build the stack - run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 # 🚀 POLKADOT LAUNCH COMPLETE 🚀 - name: Check if docker logs consist messages related to testing of xcm tests @@ -456,7 +456,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" down - name: Clean Workspace if: always() From e3879d3a92871eee8f5bcc1371b7f21226dfce44 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:03:08 +0700 Subject: [PATCH 03/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 838a8a7468..db1de9e47c 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -9,7 +9,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - execution-marix: + prepare-execution-marix: name: Prepare execution matrix @@ -132,7 +132,7 @@ jobs: docker system prune -f forkless-data-tests: - needs: [prepare-execution-marix, forkless-nodata-build] + needs: [prepare-execution-marix, forkless-data-build] # The type of runner that the job will run on runs-on: [self-hosted-ci, large] From 7e798e96a17dab7e412304f4d77e204dc5eaa8a2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:04:29 +0700 Subject: [PATCH 04/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index db1de9e47c..cc72bac6c1 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -41,7 +41,7 @@ jobs: network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}} forkless-update-data-build: - needs: execution-marix + needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] timeout-minutes: 1380 From 317d9acefe6dec2822d93ccc1867373344443995 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:05:51 +0700 Subject: [PATCH 05/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index cc72bac6c1..91ee2d7571 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -40,7 +40,7 @@ jobs: network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}} - forkless-update-data-build: + forkless-data-build: needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] From 869cab07664a61e1813eac34f01e499ac7a598f2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:07:14 +0700 Subject: [PATCH 06/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-nodata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2270bfae61..65b132dba1 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -8,7 +8,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - execution-marix: + prepare-execution-marix: name: Prepare execution matrix @@ -41,7 +41,7 @@ jobs: forkless-nodata-build: - needs: execution-marix + needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] From ac6b15aaffca50ace35172397e241a8bc9341788 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:18:08 +0700 Subject: [PATCH 07/74] fix forkless build and tests workflow steps --- .github/workflows/ci-develop.yml | 10 ++++++---- .github/workflows/forkless.yml | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 702891619e..330eca44b7 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -19,10 +19,12 @@ jobs: yarn-dev: if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/yarn-dev.yml + secrets: inherit unit-test: if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/unit-test.yml + secrets: inherit canary: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-canary')) }} # Conditional check for draft & labels per job. @@ -37,19 +39,19 @@ jobs: collator-selection: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-collator-selection')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/collator-selection.yml + secrets: inherit forkless: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/forkless.yml + secrets: inherit node-only-update: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-node-only-update')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update.yml - - # integration: - # if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }} # Conditional check for draft & labels per job. - # uses: ./.github/workflows/integration-tests.yml + secrets: inherit codestyle: if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/codestyle.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/forkless.yml b/.github/workflows/forkless.yml index f295e425d3..0c95f871eb 100644 --- a/.github/workflows/forkless.yml +++ b/.github/workflows/forkless.yml @@ -10,11 +10,14 @@ jobs: forkless-update-data: name: with data uses: ./.github/workflows/forkless-update-data.yml + secrets: inherit # pass all secrets from initial workflow to nested forkless-update-no-data: name: no data uses: ./.github/workflows/forkless-update-nodata.yml + secrets: inherit # pass all secrets from initial workflow to nested try-runtime: name: try-runtime uses: ./.github/workflows/try-runtime.yml + secrets: inherit # pass all secrets from initial workflow to nested From 6ad9467f3414a4758d0618c6c9aef8f635cc4f2d Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:26:36 +0700 Subject: [PATCH 08/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/try-runtime.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 91ee2d7571..262dd5efd7 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -51,7 +51,7 @@ jobs: matrix: include: ${{fromJson(needs.execution-marix.outputs.matrix)}} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: - name: Clean Workspace diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 65b132dba1..60d2d8cd5f 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -49,7 +49,7 @@ jobs: name: ${{ matrix.network }}-nodata - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 30541f63e3..323a99dd05 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -43,7 +43,7 @@ jobs: # The type of runner that the job will run on runs-on: [self-hosted-ci] - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. name: ${{ matrix.network }}-try-runtime-build strategy: From 612eec975ef7047b3979b6c2ebd147e2c77ee7e1 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:31:30 +0700 Subject: [PATCH 09/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/try-runtime.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 262dd5efd7..1d7b0780e5 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -114,7 +114,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Build the stack - run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../ - name: Log in to Docker Hub uses: docker/login-action@v2.0.0 diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 60d2d8cd5f..5022e9654f 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -120,7 +120,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Build the stack - run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../ - name: Push docker image version run: docker push uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 323a99dd05..444e41283c 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -102,7 +102,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Build the stack - run: cd .docker/ && docker build --no-cache --file ./Dockerfile-try-runtime.${{ matrix.network }}.yml --tag uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA . + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-try-runtime.${{ matrix.network }}.yml --tag uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../ - name: Push docker image version run: docker push uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA From 8c31dcf0fe114c25a9ca9e98278170c379153784 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 21:37:05 +0700 Subject: [PATCH 10/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 1d7b0780e5..d30e24b0bc 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -49,7 +49,7 @@ jobs: name: ${{ matrix.network }}-data strategy: matrix: - include: ${{fromJson(needs.execution-marix.outputs.matrix)}} + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 5022e9654f..418c358da4 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -53,7 +53,7 @@ jobs: strategy: matrix: - include: ${{fromJson(needs.execution-marix.outputs.matrix)}} + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} steps: - name: Clean Workspace From 49905d23e8bf700c7c95028a23f25ba00bf361d8 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 24 Jan 2023 22:46:06 +0700 Subject: [PATCH 11/74] fix forkless build and tests workflow steps --- .docker/docker-compose.forkless-data.j2 | 1 - .docker/docker-compose.forkless-nodata.j2 | 1 - .docker/docker-compose.tmp-xcm-tests.j2 | 27 -------------------- .docker/docker-compose.try-runtime.j2 | 1 - .github/workflows/forkless-update-data.yml | 4 +-- .github/workflows/forkless-update-nodata.yml | 4 +-- .github/workflows/testnet-build.yml | 2 +- .github/workflows/try-runtime.yml | 10 ++++---- .github/workflows/xcm.yml | 4 +-- 9 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 .docker/docker-compose.tmp-xcm-tests.j2 diff --git a/.docker/docker-compose.forkless-data.j2 b/.docker/docker-compose.forkless-data.j2 index 05d1cfd6b0..ced3db8c70 100644 --- a/.docker/docker-compose.forkless-data.j2 +++ b/.docker/docker-compose.forkless-data.j2 @@ -4,7 +4,6 @@ services: forkless-data: image: uniquenetwork/ci-forkless-data-local:{{ NETWORK }}-{{ BUILD_TAG }} container_name: forkless-data - image: forkless-data expose: - 9944 - 9933 diff --git a/.docker/docker-compose.forkless-nodata.j2 b/.docker/docker-compose.forkless-nodata.j2 index 93aed4078c..423e4553f3 100644 --- a/.docker/docker-compose.forkless-nodata.j2 +++ b/.docker/docker-compose.forkless-nodata.j2 @@ -4,7 +4,6 @@ services: forkless-nodata: image: uniquenetwork/ci-forkless-nodata-local:{{ NETWORK }}-{{ BUILD_TAG }} container_name: forkless-nodata - image: forkless-nodata expose: - 9944 - 9933 diff --git a/.docker/docker-compose.tmp-xcm-tests.j2 b/.docker/docker-compose.tmp-xcm-tests.j2 deleted file mode 100644 index da6befcfe8..0000000000 --- a/.docker/docker-compose.tmp-xcm-tests.j2 +++ /dev/null @@ -1,27 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - image: uniquenetwork/ci-xcm-local:{{ NETWORK }}-{{ BUILD_TAG }} - container_name: xcm-{{ NETWORK }}-local - expose: - - 9844 - - 9933 - - 9944 - - 9946 - - 9947 - - 9948 - - 9949 - ports: - - 127.0.0.1:9844:9844 - - 127.0.0.1:9933:9933 - - 127.0.0.1:9944:9944 - - 127.0.0.1:9946:9946 - - 127.0.0.1:9947:9947 - - 127.0.0.1:9948:9948 - - 127.0.0.1:9949:9949 - logging: - options: - max-size: "1m" - max-file: "3" - diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 index 1bae986797..aa99bce7ee 100644 --- a/.docker/docker-compose.try-runtime.j2 +++ b/.docker/docker-compose.try-runtime.j2 @@ -4,7 +4,6 @@ services: try-runtime: image: uniquenetwork/ci-tryruntime-local:{{ NETWORK }}-{{ BUILD_TAG }} container_name: try-runtime - image: try-runtime expose: - 9944 - 9933 diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index d30e24b0bc..a9a62b94f4 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -117,7 +117,7 @@ jobs: run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../ - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -191,7 +191,7 @@ jobs: run: cat .docker/docker-compose.forkless-data.${{ matrix.network }}.yml - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 418c358da4..b7b1073357 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -72,7 +72,7 @@ jobs: uses: ./.github/actions/prepare - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -192,7 +192,7 @@ jobs: run: cat .docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index ac838268ef..b1badb806e 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -103,7 +103,7 @@ jobs: replace: '-' - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 444e41283c..66db00174e 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -34,9 +34,9 @@ jobs: with: matrix: | network {opal}, wasm_name {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} - network {sapphire}, wasm_name {quartz}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}} - network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} +# network {sapphire}, wasm_name {quartz}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}} +# network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} +# network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} try-runtime-build: needs: prepare-execution-marix @@ -68,7 +68,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -178,7 +178,7 @@ jobs: node-version: 16 - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 95f8b307ca..cbf4fb9b18 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -81,7 +81,7 @@ jobs: uses: xom9ikk/dotenv@v2 - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -374,7 +374,7 @@ jobs: node-version: 16 - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} From 0d7ef967b6ed8643c9f9fc691f82d7c3da8fac9a Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 25 Jan 2023 00:13:06 +0700 Subject: [PATCH 12/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 1 - .github/workflows/forkless-update-nodata.yml | 1 - .github/workflows/try-runtime.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index a9a62b94f4..59e8da65fa 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -255,7 +255,6 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}' - images: 'forkless-data' - name: Show Docker logs if: success() || failure() diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b7b1073357..2be29e3ed4 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -256,7 +256,6 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.network }}' - images: 'forkless-nodata' - name: Show docker logs if: success() || failure() diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 66db00174e..36befdba9c 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -191,7 +191,6 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.1 with: dest: './try-runtime-logs.${{ matrix.network }}' - images: 'try-runtime' - name: Show docker logs run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log' From b60949062fe8a4e1a09355990d99e6e3783259eb Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 25 Jan 2023 14:01:44 +0700 Subject: [PATCH 13/74] fix forkless build and tests workflow steps --- .docker/Dockerfile-parachain-upgrade | 82 ----------------- .docker/Dockerfile-parachain-upgrade-data | 87 ------------------- .docker/Dockerfile-try-runtime | 41 --------- .docker/docker-compose.tmp-forkless-data.j2 | 43 --------- .docker/docker-compose.tmp-forkless-nodata.j2 | 34 -------- .docker/docker-compose.xcm.j2 | 22 +++++ .github/workflows/forkless-update-data.yml | 6 +- .github/workflows/forkless-update-nodata.yml | 4 +- .github/workflows/try-runtime.yml | 8 +- 9 files changed, 31 insertions(+), 296 deletions(-) delete mode 100644 .docker/Dockerfile-parachain-upgrade delete mode 100644 .docker/Dockerfile-parachain-upgrade-data delete mode 100644 .docker/Dockerfile-try-runtime delete mode 100644 .docker/docker-compose.tmp-forkless-data.j2 delete mode 100644 .docker/docker-compose.tmp-forkless-nodata.j2 create mode 100644 .docker/docker-compose.xcm.j2 diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade deleted file mode 100644 index 77895a4606..0000000000 --- a/.docker/Dockerfile-parachain-upgrade +++ /dev/null @@ -1,82 +0,0 @@ -ARG POLKADOT_BUILD_BRANCH -FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot - -# ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder - -ARG RUST_TOOLCHAIN= - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD current version ====== -FROM rust-builder as builder-unique-current - -ARG PROFILE=release -ARG NETWORK -ARG MAINNET_BRANCH -ARG REPO_URL - -WORKDIR /unique_parachain - -RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ - cargo build --features=${NETWORK}-runtime --$PROFILE - -# ===== BUILD target version ====== -FROM rust-builder as builder-unique-target - -ARG PROFILE=release -ARG NETWORK - -COPY . /unique_parachain -WORKDIR /unique_parachain - -RUN cargo build --features=${NETWORK}-runtime --$PROFILE - -# ===== RUN ====== -FROM ubuntu:22.04 - -ARG NETWORK -ARG POLKADOT_LAUNCH_BRANCH -ARG WASM_NAME - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -RUN echo "$NETWORK" - -COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$WASM_NAME"-runtime/"$WASM_NAME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$WASM_NAME"-runtime/"$WASM_NAME"_runtime.compact.compressed.wasm - -COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data deleted file mode 100644 index d81215b5ec..0000000000 --- a/.docker/Dockerfile-parachain-upgrade-data +++ /dev/null @@ -1,87 +0,0 @@ -ARG POLKADOT_BUILD_BRANCH -FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot - -# ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder -ARG RUST_TOOLCHAIN= - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD current version ====== -FROM rust-builder as builder-unique-current - -ARG PROFILE=release -ARG NETWORK -ARG MAINNET_BRANCH -ARG REPO_URL - -WORKDIR /unique_parachain - -RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ - cargo build --features=${NETWORK}-runtime --$PROFILE - -# ===== BUILD target version ====== -FROM rust-builder as builder-unique-target - -ARG PROFILE=release -ARG NETWORK - -COPY . /unique_parachain -WORKDIR /unique_parachain - -RUN cargo build --features=${NETWORK}-runtime --$PROFILE - -# ===== RUN ====== -FROM ubuntu:22.04 - -ARG NETWORK -ARG REPLICA_FROM -ENV REPLICA_FROM=${REPLICA_FROM} -ARG POLKADOT_LAUNCH_BRANCH -ARG WASM_NAME - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b ${POLKADOT_LAUNCH_BRANCH} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -RUN echo "$NETWORK" -RUN echo "$REPLICA_FROM" - -COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$WASM_NAME"-runtime/"$WASM_NAME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$WASM_NAME"-runtime/"$WASM_NAME"_runtime.compact.compressed.wasm - -COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ - -COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm - -CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime deleted file mode 100644 index 0f0b8a48f0..0000000000 --- a/.docker/Dockerfile-try-runtime +++ /dev/null @@ -1,41 +0,0 @@ -# ===== Rust builder ===== -FROM uniquenetwork/services:latest as rust-builder - -ARG RUST_TOOLCHAIN - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG PROFILE=release -ARG NETWORK -ARG REPLICA_FROM -ARG WASM_NAME -ENV NETWORK $NETWORK -ENV REPLICA_FROM $REPLICA_FROM -ENV WASM_NAME $WASM_NAME - -COPY . /unique_parachain -WORKDIR /unique_parachain - - -RUN echo "Requested features: ${NETWORK}-runtime\n" && \ - echo "Fork from: $REPLICA_FROM\n" && \ - cargo build --features=try-runtime,${NETWORK}-runtime --release - -CMD cargo run --release --features ${NETWORK}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/${WASM_NAME}-runtime/${WASM_NAME}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri $REPLICA_FROM diff --git a/.docker/docker-compose.tmp-forkless-data.j2 b/.docker/docker-compose.tmp-forkless-data.j2 deleted file mode 100644 index 5f631d191b..0000000000 --- a/.docker/docker-compose.tmp-forkless-data.j2 +++ /dev/null @@ -1,43 +0,0 @@ -version: "3.5" - -services: - node-parachain: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "NETWORK={{ NETWORK }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" - - "MAINNET_TAG={{ MAINNET_TAG }}" - - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - - "REPLICA_FROM={{ REPLICA_FROM }}" - - "WASM_NAME={{ WASM_NAME }}" - context: ../ - dockerfile: .docker/Dockerfile-parachain-upgrade-data - image: node-parachain - container_name: node-parachain - volumes: - - type: bind - source: ./launch-config-forkless-data.json - target: /polkadot-launch/launch-config.json - read_only: true - - type: bind - source: ./forkless-config/fork.jsonnet - target: /polkadot-launch/fork.jsonnet - read_only: true - - type: bind - source: ./forkless-config/typeNames.jsonnet - target: /polkadot-launch/typeNames.jsonnet - read_only: true - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.tmp-forkless-nodata.j2 b/.docker/docker-compose.tmp-forkless-nodata.j2 deleted file mode 100644 index 1be9d4d78a..0000000000 --- a/.docker/docker-compose.tmp-forkless-nodata.j2 +++ /dev/null @@ -1,34 +0,0 @@ -version: "3.5" - -services: - node-parachain: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "NETWORK={{ NETWORK }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" - - "MAINNET_TAG={{ MAINNET_TAG }}" - - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - - "WASM_NAME={{ WASM_NAME }}" - context: ../ - dockerfile: .docker/Dockerfile-parachain-upgrade - image: node-parachain - container_name: node-parachain - volumes: - - type: bind - source: ./launch-config-forkless-nodata.json - target: /polkadot-launch/launch-config.json - read_only: true - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.xcm.j2 b/.docker/docker-compose.xcm.j2 new file mode 100644 index 0000000000..c0747b4591 --- /dev/null +++ b/.docker/docker-compose.xcm.j2 @@ -0,0 +1,22 @@ +version: "3.5" + +services: + xcm_nodes: + image: uniquenetwork/ci-xcm-local:{{ NETWORK }}-{{ BUILD_TAG }} + container_name: xcm-{{ NETWORK }}-local + expose: + - 9844 + - 9933 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9933:9933 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + + diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 59e8da65fa..f579db7d75 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -46,12 +46,12 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - name: ${{ matrix.network }}-data + name: ${{ matrix.network }}-data-build strategy: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: - name: Clean Workspace @@ -262,7 +262,7 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless-data.${{ matrix.network }}.yml" down --volumes + run: docker-compose -f ".docker/docker-compose.forkless-data.${{ matrix.network }}.yml" down --volumes - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2be29e3ed4..47df5a518b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -47,9 +47,9 @@ jobs: timeout-minutes: 1380 - name: ${{ matrix.network }}-nodata + name: ${{ matrix.network }}-nodata-build - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 36befdba9c..ca0b7b751f 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -34,16 +34,16 @@ jobs: with: matrix: | network {opal}, wasm_name {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} -# network {sapphire}, wasm_name {quartz}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}} -# network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} -# network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} + network {sapphire}, wasm_name {quartz}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}} + network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} try-runtime-build: needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci] - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. name: ${{ matrix.network }}-try-runtime-build strategy: From 19c2b94738e6ebd1a9f59dbafd49ed248e16f5a8 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 25 Jan 2023 15:32:21 +0700 Subject: [PATCH 14/74] fix forkless build and tests workflow steps --- .github/workflows/ci-develop.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 330eca44b7..277d9e78ee 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -41,11 +41,26 @@ jobs: uses: ./.github/workflows/collator-selection.yml secrets: inherit - forkless: + # forkless: + # if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. + # uses: ./.github/workflows/forkless.yml + # secrets: inherit + + forkless-update-data: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. + uses: ./.github/workflows/forkless-update-data.yml + secrets: inherit # pass all secrets from initial workflow to nested + + forkless-update-no-data: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. - uses: ./.github/workflows/forkless.yml - secrets: inherit - + uses: ./.github/workflows/forkless-update-nodata.yml + secrets: inherit # pass all secrets from initial workflow to nested + + try-runtime: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. + uses: ./.github/workflows/try-runtime.yml + secrets: inherit # pass all secrets from initial workflow to nested + node-only-update: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-node-only-update')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update.yml From 1128fb0a50a36f7801f290d24e3effcf4d0de67d Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 25 Jan 2023 16:22:13 +0700 Subject: [PATCH 15/74] fix forkless build and tests workflow steps --- .github/workflows/forkless.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/forkless.yml b/.github/workflows/forkless.yml index 0c95f871eb..6edee3467c 100644 --- a/.github/workflows/forkless.yml +++ b/.github/workflows/forkless.yml @@ -1,23 +1,23 @@ # Intermediate Nested Workflow for calling subworkflows as a parallel tasks. -name: Nesting Forkless +# name: Nesting Forkless -on: - workflow_call: +# on: +# workflow_call: -jobs: +# jobs: - forkless-update-data: - name: with data - uses: ./.github/workflows/forkless-update-data.yml - secrets: inherit # pass all secrets from initial workflow to nested +# forkless-update-data: +# name: with data +# uses: ./.github/workflows/forkless-update-data.yml +# secrets: inherit # pass all secrets from initial workflow to nested - forkless-update-no-data: - name: no data - uses: ./.github/workflows/forkless-update-nodata.yml - secrets: inherit # pass all secrets from initial workflow to nested +# forkless-update-no-data: +# name: no data +# uses: ./.github/workflows/forkless-update-nodata.yml +# secrets: inherit # pass all secrets from initial workflow to nested - try-runtime: - name: try-runtime - uses: ./.github/workflows/try-runtime.yml - secrets: inherit # pass all secrets from initial workflow to nested +# try-runtime: +# name: try-runtime +# uses: ./.github/workflows/try-runtime.yml +# secrets: inherit # pass all secrets from initial workflow to nested From 71169bd25710c439d90f96f1d68f71117902be76 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 25 Jan 2023 16:27:19 +0700 Subject: [PATCH 16/74] fix forkless build and tests workflow steps --- .github/workflows/forkless-update-data.yml | 4 ++-- .github/workflows/forkless-update-nodata.yml | 4 ++-- .github/workflows/market-test.yml | 2 +- .github/workflows/node-only-update.yml | 2 +- .github/workflows/polkadot-types.yml | 2 +- .github/workflows/testnet-build.yml | 2 +- .github/workflows/try-runtime.yml | 4 ++-- .github/workflows/unit-test.yml | 2 +- .github/workflows/xcm.yml | 4 ++-- .github/workflows/yarn-dev.yml | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index f579db7d75..9c373d7f9f 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -51,7 +51,7 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: - name: Clean Workspace @@ -140,7 +140,7 @@ jobs: name: ${{ matrix.network }}-data-tests - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 47df5a518b..b045e60555 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -49,7 +49,7 @@ jobs: name: ${{ matrix.network }}-nodata-build - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -141,7 +141,7 @@ jobs: name: ${{ matrix.network }}-nodata-tests - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml index 873e7b7bdc..a5b01a7b0c 100644 --- a/.github/workflows/market-test.yml +++ b/.github/workflows/market-test.yml @@ -18,7 +18,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index 0d945b8554..6e7633b77b 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -52,7 +52,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/polkadot-types.yml b/.github/workflows/polkadot-types.yml index 6b62cd232d..70e829a8b0 100644 --- a/.github/workflows/polkadot-types.yml +++ b/.github/workflows/polkadot-types.yml @@ -24,7 +24,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index b1badb806e..0f72eeb62c 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -53,7 +53,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index ca0b7b751f..18a8f1ff07 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -43,7 +43,7 @@ jobs: # The type of runner that the job will run on runs-on: [self-hosted-ci] - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. name: ${{ matrix.network }}-try-runtime-build strategy: @@ -123,7 +123,7 @@ jobs: name: ${{ matrix.network }}-try-runtime-tests - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 82465350d5..6a399fb1df 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,7 +17,7 @@ jobs: name: ${{ github.base_ref }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. steps: diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index cbf4fb9b18..6d0c531543 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -54,7 +54,7 @@ jobs: name: ${{ matrix.network }}-build - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: @@ -319,7 +319,7 @@ jobs: name: ${{ matrix.network }}-tests - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: diff --git a/.github/workflows/yarn-dev.yml b/.github/workflows/yarn-dev.yml index 8f9053c3fb..318cb0d4bd 100644 --- a/.github/workflows/yarn-dev.yml +++ b/.github/workflows/yarn-dev.yml @@ -18,7 +18,7 @@ jobs: name: ${{ matrix.network }} - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: From ea504ce1b32d698c79f38ab1ca78ff41ab2d79d6 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 11 Apr 2023 11:15:43 +0700 Subject: [PATCH 17/74] set ubuntu 22.04 --- .docker/Dockerfile-parachain-upgrade-data.j2 | 2 +- .docker/Dockerfile-parachain-upgrade.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade-data.j2 b/.docker/Dockerfile-parachain-upgrade-data.j2 index 9b41a80a91..e96c9f40b2 100644 --- a/.docker/Dockerfile-parachain-upgrade-data.j2 +++ b/.docker/Dockerfile-parachain-upgrade-data.j2 @@ -39,7 +39,7 @@ WORKDIR /unique_parachain RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE # ===== RUN ====== -FROM ubuntu:20.04 +FROM ubuntu:22.04 ENV REPLICA_FROM={{ REPLICA_FROM }} diff --git a/.docker/Dockerfile-parachain-upgrade.j2 b/.docker/Dockerfile-parachain-upgrade.j2 index 6b13eab18c..879d28a186 100644 --- a/.docker/Dockerfile-parachain-upgrade.j2 +++ b/.docker/Dockerfile-parachain-upgrade.j2 @@ -39,7 +39,7 @@ WORKDIR /unique_parachain RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE # ===== RUN ====== -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get -y update && \ apt-get -y install curl git && \ From 716a9196be601c4ffd9521f0e43fb2b8f1fd3f75 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 11 Apr 2023 15:06:40 +0700 Subject: [PATCH 18/74] fix xcm tests --- .docker/docker-compose.xcm.j2 | 2 ++ .github/workflows/xcm.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.docker/docker-compose.xcm.j2 b/.docker/docker-compose.xcm.j2 index c0747b4591..00d6b426e0 100644 --- a/.docker/docker-compose.xcm.j2 +++ b/.docker/docker-compose.xcm.j2 @@ -11,6 +11,7 @@ services: - 9946 - 9947 - 9948 + - 9949 ports: - 127.0.0.1:9844:9844 - 127.0.0.1:9933:9933 @@ -18,5 +19,6 @@ services: - 127.0.0.1:9946:9946 - 127.0.0.1:9947:9947 - 127.0.0.1:9948:9948 + - 127.0.0.1:9949:9949 diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 6d0c531543..c3063521fd 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -452,7 +452,7 @@ jobs: - name: Show container logs if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" logs + run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" logs - name: Stop running containers if: always() # run this step always From 0ca6b86a4f85d876668705d166fb2629eab78754 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 11 Apr 2023 19:41:48 +0700 Subject: [PATCH 19/74] update version for actions --- .github/workflows/forkless-update-data.yml | 4 ++-- .github/workflows/forkless-update-nodata.yml | 4 ++-- .github/workflows/testnet-build.yml | 2 +- .github/workflows/try-runtime.yml | 4 ++-- .github/workflows/xcm.yml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 9c373d7f9f..1dc88a7cb6 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -101,7 +101,7 @@ jobs: run: cat .docker/forkless-config/launch-config-forkless-data.json - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@3 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} @@ -168,7 +168,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b045e60555..923f3222a7 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -107,7 +107,7 @@ jobs: run: cat .docker/forkless-config/launch-config-forkless-nodata.json - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@3 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} @@ -169,7 +169,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index 0f72eeb62c..0b178ff54c 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -95,7 +95,7 @@ jobs: run: cat launch-config.json - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 18a8f1ff07..d6f2a831b2 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -89,7 +89,7 @@ jobs: run: cat .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@3 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} @@ -151,7 +151,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index c3063521fd..166d2c9509 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -286,7 +286,7 @@ jobs: run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@3 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} @@ -347,7 +347,7 @@ jobs: echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 + uses: mad9000/actions-find-and-replace-string@4 id: branchname with: source: ${{ github.head_ref }} From c31950238af63af2b7b0fbbb629786ec7f04a7d9 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Apr 2023 19:29:44 +0200 Subject: [PATCH 20/74] fix: qtz/unq reject foreign unregistered tokens --- tests/src/util/playgrounds/unique.dev.ts | 13 +++ tests/src/xcm/xcmQuartz.test.ts | 133 ++++++++++++++++++----- tests/src/xcm/xcmUnique.test.ts | 133 ++++++++++++++++++----- 3 files changed, 225 insertions(+), 54 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 74335deef5..ad7a35adde 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -632,6 +632,19 @@ class WaitGroup { }); return promise; } + + async eventOutcome(maxBlocksToWait: number, eventSection: string, eventMethod: string) { + const eventRecord = await this.event(maxBlocksToWait, eventSection, eventMethod); + + if (eventRecord == null) { + return null; + } + + const event = eventRecord!.event; + const outcome = event.data[1] as EventT; + + return outcome; + } } class SessionGroup { diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index baa50a146e..09d0524b82 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -19,6 +19,7 @@ import {blake2AsHex} from '@polkadot/util-crypto'; import config from '../config'; import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util'; +import {DevUniqueHelper} from '../util/playgrounds/unique.dev'; const QUARTZ_CHAIN = 2095; const STATEMINE_CHAIN = 1000; @@ -643,61 +644,139 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { }); }); -// These tests are relevant only when the foreign asset pallet is disabled +// These tests are relevant only when +// the the corresponding foreign assets are not registered describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { let alice: IKeyringPair; + let alith: IKeyringPair; + + const testAmount = 100_000_000_000n; + let quartzParachainJunction; + let quartzAccountJunction; + + let quartzParachainMultilocation: any; + let quartzAccountMultilocation: any; + let quartzCombinedMultilocation: any; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { alice = await privateKey('//Alice'); - // Set the default version to wrap the first message to other chains. - await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); - }); - }); + quartzParachainJunction = {Parachain: QUARTZ_CHAIN}; + quartzAccountJunction = { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }; - itSub('Quartz rejects KAR tokens from Karura', async ({helper}) => { - await usingKaruraPlaygrounds(karuraUrl, async (helper) => { - const destination = { + quartzParachainMultilocation = { V1: { parents: 1, interior: { - X2: [ - {Parachain: QUARTZ_CHAIN}, - { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }, - ], + X1: quartzParachainJunction, }, }, }; - const id = { - Token: 'KAR', + quartzAccountMultilocation = { + V1: { + parents: 0, + interior: { + X1: quartzAccountJunction, + }, + }, + }; + + quartzCombinedMultilocation = { + V1: { + parents: 1, + interior: { + X2: [quartzParachainJunction, quartzAccountJunction], + }, + }, }; - await helper.xTokens.transfer(alice, id, 100_000_000_000n, destination, 'Unlimited'); + // Set the default version to wrap the first message to other chains. + await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); + }); + + // eslint-disable-next-line require-await + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + alith = helper.account.alithAccount(); }); + }); + const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { const maxWaitBlocks = 3; - const xcmpQueueFailEvent = await helper.wait.event(maxWaitBlocks, 'xcmpQueue', 'Fail'); + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); expect( xcmpQueueFailEvent != null, - '[Karura] xcmpQueue.FailEvent event is expected', + `[reject ${network} tokens] 'xcmpQueue.FailEvent' event is expected`, ).to.be.true; - const event = xcmpQueueFailEvent!.event; - const outcome = event.data[1] as XcmV2TraitsError; - expect( - outcome.isFailedToTransactAsset, - '[Karura] The XCM error should be `FailedToTransactAsset`', + xcmpQueueFailEvent!.isFailedToTransactAsset, + `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset'`, ).to.be.true; + }; + + itSub('Quartz rejects KAR tokens from Karura', async ({helper}) => { + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { + const id = { + Token: 'KAR', + }; + const destination = quartzCombinedMultilocation; + await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited'); + }); + + await expectFailedToTransact('KAR', helper); + }); + + itSub('Quartz rejects MOVR tokens from Moonriver', async ({helper}) => { + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const id = 'SelfReserve'; + const destination = quartzCombinedMultilocation; + await helper.xTokens.transfer(alith, id, testAmount, destination, 'Unlimited'); + }); + + await expectFailedToTransact('MOVR', helper); + }); + + itSub('Quartz rejects SDN tokens from Shiden', async ({helper}) => { + await usingShidenPlaygrounds(shidenUrl, async (helper) => { + const destinationParachain = quartzParachainMultilocation; + const beneficiary = quartzAccountMultilocation; + const assets = { + V1: [{ + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: testAmount, + }, + }], + }; + const feeAssetItem = 0; + + await helper.executeExtrinsic(alice, 'api.tx.polkadotXcm.reserveWithdrawAssets', [ + destinationParachain, + beneficiary, + assets, + feeAssetItem, + ]); + }); + + await expectFailedToTransact('SDN', helper); }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 18e103de57..a1f7a3e9c5 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -19,6 +19,7 @@ import {blake2AsHex} from '@polkadot/util-crypto'; import config from '../config'; import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds} from '../util'; +import {DevUniqueHelper} from '../util/playgrounds/unique.dev'; const UNIQUE_CHAIN = 2037; const STATEMINT_CHAIN = 1000; @@ -645,61 +646,139 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { }); }); -// These tests are relevant only when the foreign asset pallet is disabled +// These tests are relevant only when +// the the corresponding foreign assets are not registered describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { let alice: IKeyringPair; + let alith: IKeyringPair; + + const testAmount = 100_000_000_000n; + let uniqueParachainJunction; + let uniqueAccountJunction; + + let uniqueParachainMultilocation: any; + let uniqueAccountMultilocation: any; + let uniqueCombinedMultilocation: any; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { alice = await privateKey('//Alice'); - // Set the default version to wrap the first message to other chains. - await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); - }); - }); + uniqueParachainJunction = {Parachain: UNIQUE_CHAIN}; + uniqueAccountJunction = { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }; - itSub('Unique rejects ACA tokens from Acala', async ({helper}) => { - await usingAcalaPlaygrounds(acalaUrl, async (helper) => { - const destination = { + uniqueParachainMultilocation = { V1: { parents: 1, interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }, - ], + X1: uniqueParachainJunction, }, }, }; - const id = { - Token: 'ACA', + uniqueAccountMultilocation = { + V1: { + parents: 0, + interior: { + X1: uniqueAccountJunction, + }, + }, + }; + + uniqueCombinedMultilocation = { + V1: { + parents: 1, + interior: { + X2: [uniqueParachainJunction, uniqueAccountJunction], + }, + }, }; - await helper.xTokens.transfer(alice, id, 100_000_000_000n, destination, 'Unlimited'); + // Set the default version to wrap the first message to other chains. + await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); + }); + + // eslint-disable-next-line require-await + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + alith = helper.account.alithAccount(); }); + }); + const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { const maxWaitBlocks = 3; - const xcmpQueueFailEvent = await helper.wait.event(maxWaitBlocks, 'xcmpQueue', 'Fail'); + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); expect( xcmpQueueFailEvent != null, - '[Acala] xcmpQueue.FailEvent event is expected', + `[reject ${network} tokens] 'xcmpQueue.FailEvent' event is expected`, ).to.be.true; - const event = xcmpQueueFailEvent!.event; - const outcome = event.data[1] as XcmV2TraitsError; - expect( - outcome.isFailedToTransactAsset, - '[Acala] The XCM error should be `FailedToTransactAsset`', + xcmpQueueFailEvent!.isFailedToTransactAsset, + `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset'`, ).to.be.true; + }; + + itSub('Unique rejects ACA tokens from Acala', async ({helper}) => { + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { + const id = { + Token: 'ACA', + }; + const destination = uniqueCombinedMultilocation; + await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited'); + }); + + await expectFailedToTransact('ACA', helper); + }); + + itSub('Unique rejects GLMR tokens from Moonbeam', async ({helper}) => { + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const id = 'SelfReserve'; + const destination = uniqueCombinedMultilocation; + await helper.xTokens.transfer(alith, id, testAmount, destination, 'Unlimited'); + }); + + await expectFailedToTransact('GLMR', helper); + }); + + itSub('Unique rejects ASTR tokens from Astar', async ({helper}) => { + await usingAstarPlaygrounds(astarUrl, async (helper) => { + const destinationParachain = uniqueParachainMultilocation; + const beneficiary = uniqueAccountMultilocation; + const assets = { + V1: [{ + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: testAmount, + }, + }], + }; + const feeAssetItem = 0; + + await helper.executeExtrinsic(alice, 'api.tx.polkadotXcm.reserveWithdrawAssets', [ + destinationParachain, + beneficiary, + assets, + feeAssetItem, + ]); + }); + + await expectFailedToTransact('ASTR', helper); }); }); From abe0498b88a3b05ffbc9e4f7e4ab4c1176176a61 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 12 Apr 2023 12:38:18 +0200 Subject: [PATCH 21/74] test: other chains can spend only up to balance --- tests/src/util/playgrounds/unique.dev.ts | 57 ++++++++ tests/src/util/playgrounds/unique.ts | 4 + tests/src/xcm/xcmQuartz.test.ts | 160 +++++++++++++++++++++++ tests/src/xcm/xcmUnique.test.ts | 160 +++++++++++++++++++++++ 4 files changed, 381 insertions(+) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index ad7a35adde..670b418571 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -420,6 +420,63 @@ export class ArrangeGroup { return capture; } + + makeXcmProgramWithdrawDeposit(beneficiary: Uint8Array, amount: bigint | string) { + return { + V2: [ + { + WithdrawAsset: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: amount, + }, + }, + ], + }, + { + BuyExecution: { + fees: { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: amount, + }, + }, + weightLimit: 'Unlimited' + }, + }, + { + DepositAsset: { + assets: { + Wild: 'All' + }, + maxAssets: 1, + beneficiary: { + parents: 0, + interior: { + X1: { + AccountId32: { + network: 'Any', + id: beneficiary + }, + }, + }, + }, + } + }, + ], + }; + } } class MoonbeamAccountGroup { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 9135c9a6e2..0208dc43e8 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2446,6 +2446,10 @@ class BalanceGroup extends HelperGroup { return this.ethBalanceGroup.getEthereum(address); } + async setBalanceSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string, reservedAmount: bigint | string = 0n) { + await this.helper.executeExtrinsic(signer, 'api.tx.balances.setBalance', [address, amount, reservedAmount], true); + } + /** * Transfer tokens to substrate address * @param signer keyring of signer diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 09d0524b82..19abad4969 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -642,6 +642,84 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); + + itSub('Karura can send only up to its balance', async ({helper}) => { + // set Karura's sovereign account's balance + const karuraBalance = 10000n * (10n ** QTZ_DECIMALS); + const karuraSovereignAccount = helper.address.paraSiblingSovereignAccount(KARURA_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, karuraSovereignAccount, karuraBalance); + + const moreThanKaruraHas = karuraBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanKaruraHas); + + // Try to trick Quartz + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + quartzMultilocation, + maliciousXcmProgram, + ], + true, + ); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + `The XCM error should be 'FailedToTransactAsset'`, + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Karura still can send the correct amount + const validTransferAmount = karuraBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + quartzMultilocation, + validXcmProgram, + ], + true, + ); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); + }); }); // These tests are relevant only when @@ -1060,6 +1138,10 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); + + itSub.skip('Moonriver can send only up to its balance', async ({helper}) => { + throw Error("Not yet implemented"); + }); }); describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { @@ -1272,4 +1354,82 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { console.log(`QTZ Balance on Quartz after XCM is: ${balanceQTZ}`); expect(balanceQTZ).to.eq(balanceAfterQuartzToShidenXCM + qtzFromShidenTransfered); }); + + itSub('Shiden can send only up to its balance', async ({helper}) => { + // set Shiden's sovereign account's balance + const shidenBalance = 10000n * (10n ** QTZ_DECIMALS); + const shidenSovereignAccount = helper.address.paraSiblingSovereignAccount(SHIDEN_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, shidenSovereignAccount, shidenBalance); + + const moreThanShidenHas = shidenBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanShidenHas); + + // Try to trick Quartz + await usingShidenPlaygrounds(shidenUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + quartzMultilocation, + maliciousXcmProgram, + ], + true, + ); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + `The XCM error should be 'FailedToTransactAsset'`, + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Shiden still can send the correct amount + const validTransferAmount = shidenBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + + await usingShidenPlaygrounds(shidenUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + quartzMultilocation, + validXcmProgram, + ], + true, + ); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); + }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index a1f7a3e9c5..2f663bcb30 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -644,6 +644,84 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); + + itSub('Acala can send only up to its balance', async ({helper}) => { + // set Acala's sovereign account's balance + const acalaBalance = 10000n * (10n ** UNQ_DECIMALS); + const acalaSovereignAccount = helper.address.paraSiblingSovereignAccount(ACALA_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, acalaSovereignAccount, acalaBalance); + + const moreThanAcalaHas = acalaBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanAcalaHas); + + // Try to trick Unique + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + uniqueMultilocation, + maliciousXcmProgram, + ], + true, + ); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + `The XCM error should be 'FailedToTransactAsset'`, + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Acala still can send the correct amount + const validTransferAmount = acalaBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + uniqueMultilocation, + validXcmProgram, + ], + true, + ); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); + }); }); // These tests are relevant only when @@ -1063,6 +1141,10 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); + + itSub.skip('Moonbeam can send only up to its balance', async ({helper}) => { + throw Error("Not yet implemented"); + }); }); describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { @@ -1330,4 +1412,82 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { await helper.xcm.limitedReserveTransferAssets(randomAccount, destination, beneficiary, assets, feeAssetItem, 'Unlimited'); }); }); + + itSub('Astar can send only up to its balance', async ({helper}) => { + // set Astar's sovereign account's balance + const astarBalance = 10000n * (10n ** UNQ_DECIMALS); + const astarSovereignAccount = helper.address.paraSiblingSovereignAccount(ASTAR_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, astarSovereignAccount, astarBalance); + + const moreThanShidenHas = astarBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanShidenHas); + + // Try to trick Unique + await usingAstarPlaygrounds(astarUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + uniqueMultilocation, + maliciousXcmProgram, + ], + true, + ); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + `The XCM error should be 'FailedToTransactAsset'`, + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Astar still can send the correct amount + const validTransferAmount = astarBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + + await usingAstarPlaygrounds(astarUrl, async (helper) => { + await helper.getSudo().executeExtrinsic( + alice, + 'api.tx.polkadotXcm.send', + [ + uniqueMultilocation, + validXcmProgram, + ], + true, + ); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); + }); }); From 1b19b1f3b608722897632e745c34cb33f2b9707a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 12 Apr 2023 14:38:52 +0200 Subject: [PATCH 22/74] test: untrusted reserve locations --- tests/src/util/playgrounds/unique.dev.ts | 61 ++++-- tests/src/util/playgrounds/unique.ts | 14 ++ tests/src/xcm/xcmQuartz.test.ts | 200 ++++++++++++++---- tests/src/xcm/xcmUnique.test.ts | 257 ++++++++++++++--------- 4 files changed, 384 insertions(+), 148 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 670b418571..3086d1b5cb 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -421,18 +421,13 @@ export class ArrangeGroup { return capture; } - makeXcmProgramWithdrawDeposit(beneficiary: Uint8Array, amount: bigint | string) { + makeXcmProgramWithdrawDeposit(beneficiary: Uint8Array, id: any, amount: bigint | string) { return { V2: [ { WithdrawAsset: [ { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, + id, fun: { Fungible: amount, }, @@ -442,12 +437,54 @@ export class ArrangeGroup { { BuyExecution: { fees: { - id: { - Concrete: { - parents: 0, - interior: 'Here', + id, + fun: { + Fungible: amount, + }, + }, + weightLimit: 'Unlimited' + }, + }, + { + DepositAsset: { + assets: { + Wild: 'All' + }, + maxAssets: 1, + beneficiary: { + parents: 0, + interior: { + X1: { + AccountId32: { + network: 'Any', + id: beneficiary + }, }, }, + }, + }, + }, + ], + }; + } + + makeXcmProgramReserveAssetDeposited(beneficiary: Uint8Array, id: any, amount: bigint | string) { + return { + V2: [ + { + ReserveAssetDeposited: [ + { + id, + fun: { + Fungible: amount, + }, + }, + ], + }, + { + BuyExecution: { + fees: { + id, fun: { Fungible: amount, }, @@ -472,7 +509,7 @@ export class ArrangeGroup { }, }, }, - } + }, }, ], }; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0208dc43e8..9d088ec87f 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -3021,6 +3021,18 @@ class XcmGroup extends HelperGroup { await this.teleportAssets(signer, destination, beneficiary, assets, feeAssetItem); } + + async send(signer: IKeyringPair, destination: any, message: any) { + await this.helper.executeExtrinsic( + signer, + `api.tx.${this.palletName}.send`, + [ + destination, + message, + ], + true, + ); + } } class XTokensGroup extends HelperGroup { @@ -3284,6 +3296,7 @@ export class AcalaHelper extends XcmChainHelper { assetRegistry: AcalaAssetRegistryGroup; xTokens: XTokensGroup; tokens: TokensGroup; + xcm: XcmGroup; constructor(logger?: ILogger, options: {[key: string]: any} = {}) { super(logger, options.helperBase ?? AcalaHelper); @@ -3292,6 +3305,7 @@ export class AcalaHelper extends XcmChainHelper { this.assetRegistry = new AcalaAssetRegistryGroup(this); this.xTokens = new XTokensGroup(this); this.tokens = new TokensGroup(this); + this.xcm = new XcmGroup(this, 'polkadotXcm'); } getSudo() { diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 19abad4969..d9f432e386 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -663,19 +663,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanKaruraHas); + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanKaruraHas, + ); // Try to trick Quartz await usingKaruraPlaygrounds(karuraUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - quartzMultilocation, - maliciousXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); }); const maxWaitBlocks = 3; @@ -701,18 +702,19 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { // But Karura still can send the correct amount const validTransferAmount = karuraBalance / 2n; - const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); await usingKaruraPlaygrounds(karuraUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - quartzMultilocation, - validXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, quartzMultilocation, validXcmProgram); }); await helper.wait.newBlocks(maxWaitBlocks); @@ -720,6 +722,62 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(validTransferAmount); }); + + itSub('Should not accept reserve transfer of QTZ from Karura', async ({helper}) => { + const testAmount = 10_000n * (10n ** QTZ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 1, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + `The XCM error should be 'isUntrustedReserveLocation'`, + ).to.be.true; + + const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + }); }); // These tests are relevant only when @@ -1142,6 +1200,10 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { itSub.skip('Moonriver can send only up to its balance', async ({helper}) => { throw Error("Not yet implemented"); }); + + itSub.skip('Should not accept reserve transfer of QTZ from Moonriver', async ({helper}) => { + throw Error("Not yet implemented"); + }); }); describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { @@ -1375,19 +1437,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanShidenHas); + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanShidenHas, + ); // Try to trick Quartz await usingShidenPlaygrounds(shidenUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - quartzMultilocation, - maliciousXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); }); const maxWaitBlocks = 3; @@ -1413,18 +1476,19 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { // But Shiden still can send the correct amount const validTransferAmount = shidenBalance / 2n; - const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); await usingShidenPlaygrounds(shidenUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - quartzMultilocation, - validXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, quartzMultilocation, validXcmProgram); }); await helper.wait.newBlocks(maxWaitBlocks); @@ -1432,4 +1496,60 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(validTransferAmount); }); + + itSub('Should not accept reserve transfer of QTZ from Shiden', async ({helper}) => { + const testAmount = 10_000n * (10n ** QTZ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 1, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + await usingShidenPlaygrounds(shidenUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + `The XCM error should be 'isUntrustedReserveLocation'`, + ).to.be.true; + + const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 2f663bcb30..da565c1823 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -665,19 +665,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanAcalaHas); + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanAcalaHas, + ); // Try to trick Unique await usingAcalaPlaygrounds(acalaUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - uniqueMultilocation, - maliciousXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); }); const maxWaitBlocks = 3; @@ -703,18 +704,19 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { // But Acala still can send the correct amount const validTransferAmount = acalaBalance / 2n; - const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); await usingAcalaPlaygrounds(acalaUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - uniqueMultilocation, - validXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, validXcmProgram); }); await helper.wait.newBlocks(maxWaitBlocks); @@ -722,6 +724,62 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(validTransferAmount); }); + + itSub('Should not accept reserve transfer of UNQ from Acala', async ({helper}) => { + const testAmount = 10_000n * (10n ** UNQ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 1, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + `The XCM error should be 'isUntrustedReserveLocation'`, + ).to.be.true; + + const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + }); }); // These tests are relevant only when @@ -1145,6 +1203,10 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { itSub.skip('Moonbeam can send only up to its balance', async ({helper}) => { throw Error("Not yet implemented"); }); + + itSub.skip('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { + throw Error("Not yet implemented"); + }); }); describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { @@ -1357,62 +1419,6 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect(balanceUNQ).to.eq(balanceAfterUniqueToAstarXCM + unqFromAstarTransfered); }); - itSub.skip('Should not accept limitedReserveTransfer of UNQ from ASTAR', async ({helper}) => { - await usingAstarPlaygrounds(astarUrl, async (helper) => { - const destination = { - V1: { - parents: 1, - interior: { - X1: { - Parachain: UNIQUE_CHAIN, - }, - }, - }, - }; - - const beneficiary = { - V1: { - parents: 0, - interior: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 1, - interior: { - X1: { - Parachain: UNIQUE_CHAIN, - }, - }, - }, - }, - fun: { - Fungible: unqFromAstarTransfered, - }, - }, - ], - }; - - // Initial balance is 1 ASTAR - expect(await helper.balance.getSubstrate(randomAccount.address)).to.eq(astarInitialBalance); - - const feeAssetItem = 0; - // TODO: expect rejected: - await helper.xcm.limitedReserveTransferAssets(randomAccount, destination, beneficiary, assets, feeAssetItem, 'Unlimited'); - }); - }); - itSub('Astar can send only up to its balance', async ({helper}) => { // set Astar's sovereign account's balance const astarBalance = 10000n * (10n ** UNQ_DECIMALS); @@ -1433,19 +1439,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, moreThanShidenHas); + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanShidenHas, + ); // Try to trick Unique await usingAstarPlaygrounds(astarUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - uniqueMultilocation, - maliciousXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); }); const maxWaitBlocks = 3; @@ -1471,18 +1478,19 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { // But Astar still can send the correct amount const validTransferAmount = astarBalance / 2n; - const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit(targetAccount.addressRaw, validTransferAmount); + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); await usingAstarPlaygrounds(astarUrl, async (helper) => { - await helper.getSudo().executeExtrinsic( - alice, - 'api.tx.polkadotXcm.send', - [ - uniqueMultilocation, - validXcmProgram, - ], - true, - ); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, validXcmProgram); }); await helper.wait.newBlocks(maxWaitBlocks); @@ -1490,4 +1498,61 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(validTransferAmount); }); + + itSub('Should not accept reserve transfer of UNQ from Astar', async ({helper}) => { + const testAmount = 10_000n * (10n ** UNQ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 1, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + await usingAstarPlaygrounds(astarUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); + }); + + const maxWaitBlocks = 3; + + const xcmpQueueFailEvent = await helper.wait.eventOutcome( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + ); + + expect( + xcmpQueueFailEvent != null, + `'xcmpQueue.FailEvent' event is expected`, + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + `The XCM error should be 'isUntrustedReserveLocation'`, + ).to.be.true; + + const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + }); + }); From 2d2f157aedaf2a7a313be0fab140740b52d4c707 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 12 Apr 2023 14:59:23 +0200 Subject: [PATCH 23/74] fix: yarn fix --- tests/src/util/playgrounds/unique.dev.ts | 12 ++++++------ tests/src/util/playgrounds/unique.ts | 2 +- tests/src/xcm/xcmQuartz.test.ts | 22 ++++++++++++---------- tests/src/xcm/xcmUnique.test.ts | 22 ++++++++++++---------- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 3086d1b5cb..61ee909fc3 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -442,13 +442,13 @@ export class ArrangeGroup { Fungible: amount, }, }, - weightLimit: 'Unlimited' + weightLimit: 'Unlimited', }, }, { DepositAsset: { assets: { - Wild: 'All' + Wild: 'All', }, maxAssets: 1, beneficiary: { @@ -457,7 +457,7 @@ export class ArrangeGroup { X1: { AccountId32: { network: 'Any', - id: beneficiary + id: beneficiary, }, }, }, @@ -489,13 +489,13 @@ export class ArrangeGroup { Fungible: amount, }, }, - weightLimit: 'Unlimited' + weightLimit: 'Unlimited', }, }, { DepositAsset: { assets: { - Wild: 'All' + Wild: 'All', }, maxAssets: 1, beneficiary: { @@ -504,7 +504,7 @@ export class ArrangeGroup { X1: { AccountId32: { network: 'Any', - id: beneficiary + id: beneficiary, }, }, }, diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 9d088ec87f..7c61aac538 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -3031,7 +3031,7 @@ class XcmGroup extends HelperGroup { message, ], true, - ); + ); } } diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index d9f432e386..c00c0dc659 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -689,12 +689,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset'`, + 'The XCM error should be \'FailedToTransactAsset\'', ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -767,12 +767,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation'`, + 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; const accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1197,12 +1197,14 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect(qtzFees == 0n).to.be.true; }); + // eslint-disable-next-line require-await itSub.skip('Moonriver can send only up to its balance', async ({helper}) => { - throw Error("Not yet implemented"); + throw Error('Not yet implemented'); }); + // eslint-disable-next-line require-await itSub.skip('Should not accept reserve transfer of QTZ from Moonriver', async ({helper}) => { - throw Error("Not yet implemented"); + throw Error('Not yet implemented'); }); }); @@ -1463,12 +1465,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset'`, + 'The XCM error should be \'FailedToTransactAsset\'', ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1541,12 +1543,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation'`, + 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; const accountBalance = await helper.balance.getSubstrate(targetAccount.address); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index da565c1823..e9cacf8e39 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -691,12 +691,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset'`, + 'The XCM error should be \'FailedToTransactAsset\'', ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -769,12 +769,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation'`, + 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; const accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1200,12 +1200,14 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect(unqFees == 0n).to.be.true; }); + // eslint-disable-next-line require-await itSub.skip('Moonbeam can send only up to its balance', async ({helper}) => { - throw Error("Not yet implemented"); + throw Error('Not yet implemented'); }); + // eslint-disable-next-line require-await itSub.skip('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { - throw Error("Not yet implemented"); + throw Error('Not yet implemented'); }); }); @@ -1465,12 +1467,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset'`, + 'The XCM error should be \'FailedToTransactAsset\'', ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1543,12 +1545,12 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect( xcmpQueueFailEvent != null, - `'xcmpQueue.FailEvent' event is expected`, + '\'xcmpQueue.FailEvent\' event is expected', ).to.be.true; expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation'`, + 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; const accountBalance = await helper.balance.getSubstrate(targetAccount.address); From e4e4e5305a09b78d4cc6131ac3674b7e55186bfc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 12 Apr 2023 17:38:19 +0200 Subject: [PATCH 24/74] fix: remove string type variant from balances --- tests/src/util/playgrounds/unique.dev.ts | 4 ++-- tests/src/util/playgrounds/unique.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 61ee909fc3..47da8feecf 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -421,7 +421,7 @@ export class ArrangeGroup { return capture; } - makeXcmProgramWithdrawDeposit(beneficiary: Uint8Array, id: any, amount: bigint | string) { + makeXcmProgramWithdrawDeposit(beneficiary: Uint8Array, id: any, amount: bigint) { return { V2: [ { @@ -468,7 +468,7 @@ export class ArrangeGroup { }; } - makeXcmProgramReserveAssetDeposited(beneficiary: Uint8Array, id: any, amount: bigint | string) { + makeXcmProgramReserveAssetDeposited(beneficiary: Uint8Array, id: any, amount: bigint) { return { V2: [ { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 7c61aac538..5806148a2a 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2446,7 +2446,7 @@ class BalanceGroup extends HelperGroup { return this.ethBalanceGroup.getEthereum(address); } - async setBalanceSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string, reservedAmount: bigint | string = 0n) { + async setBalanceSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint, reservedAmount: bigint = 0n) { await this.helper.executeExtrinsic(signer, 'api.tx.balances.setBalance', [address, amount, reservedAmount], true); } From b836b20acc8c1079a49ca3b49596d4096d47af31 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 12 Apr 2023 17:39:59 +0200 Subject: [PATCH 25/74] fix: yarn fix --- tests/src/util/playgrounds/unique.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 5806148a2a..7a723168be 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2446,7 +2446,7 @@ class BalanceGroup extends HelperGroup { return this.ethBalanceGroup.getEthereum(address); } - async setBalanceSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint, reservedAmount: bigint = 0n) { + async setBalanceSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint, reservedAmount = 0n) { await this.helper.executeExtrinsic(signer, 'api.tx.balances.setBalance', [address, amount, reservedAmount], true); } From bcc1c229c277d05edfff91e1d4225ca5621a9dab Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Apr 2023 03:41:21 +0200 Subject: [PATCH 26/74] fix: add/extend xcm tests for moonbeam, extend untrusted reserve location --- tests/src/util/playgrounds/unique.dev.ts | 107 +++++- tests/src/util/playgrounds/unique.ts | 4 + tests/src/xcm/xcmQuartz.test.ts | 391 +++++++++++++++------ tests/src/xcm/xcmUnique.test.ts | 419 ++++++++++++++++------- 4 files changed, 701 insertions(+), 220 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 47da8feecf..9b404a40e6 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import {stringToU8a} from '@polkadot/util'; -import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; +import {blake2AsHex, encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper, MoonbeamHelper, ChainHelperBase, AcalaHelper, RelayHelper, WestmintHelper, AstarHelper} from './unique'; import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; @@ -155,6 +155,7 @@ export class DevStatemintHelper extends DevWestmintHelper {} export class DevMoonbeamHelper extends MoonbeamHelper { account: MoonbeamAccountGroup; wait: WaitGroup; + fastDemocracy: MoonbeamFastDemocracyGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { options.helperBase = options.helperBase ?? DevMoonbeamHelper; @@ -163,6 +164,7 @@ export class DevMoonbeamHelper extends MoonbeamHelper { super(logger, options); this.account = new MoonbeamAccountGroup(this); this.wait = new WaitGroup(this); + this.fastDemocracy = new MoonbeamFastDemocracyGroup(this); } } @@ -554,6 +556,103 @@ class MoonbeamAccountGroup { } } +class MoonbeamFastDemocracyGroup { + helper: DevMoonbeamHelper; + + constructor(helper: DevMoonbeamHelper) { + this.helper = helper; + } + + async executeProposal(proposalDesciption: string, encodedProposal: string) { + const proposalHash = blake2AsHex(encodedProposal); + + const alithAccount = this.helper.account.alithAccount(); + const baltatharAccount = this.helper.account.baltatharAccount(); + const dorothyAccount = this.helper.account.dorothyAccount(); + + const councilVotingThreshold = 2; + const technicalCommitteeThreshold = 2; + const fastTrackVotingPeriod = 3; + const fastTrackDelayPeriod = 0; + + console.log(`[democracy] executing '${proposalDesciption}' proposal`); + + // >>> Propose external motion through council >>> + console.log('\t* Propose external motion through council.......'); + const externalMotion = this.helper.democracy.externalProposeMajority({Inline: encodedProposal}); + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('\t* Motion hash is %s', motionHash); + + await this.helper.collective.council.propose( + baltatharAccount, + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + + const councilProposalIdx = await this.helper.collective.council.proposalCount() - 1; + await this.helper.collective.council.vote(dorothyAccount, motionHash, councilProposalIdx, true); + await this.helper.collective.council.vote(baltatharAccount, motionHash, councilProposalIdx, true); + + await this.helper.collective.council.close( + dorothyAccount, + motionHash, + councilProposalIdx, + { + refTime: 1_000_000_000, + proofSize: 1_000_000, + }, + externalMotion.encodedLength, + ); + console.log('\t* Propose external motion through council.......DONE'); + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + console.log('\t* Fast track proposal through technical committee.......'); + const fastTrack = this.helper.democracy.fastTrack(proposalHash, fastTrackVotingPeriod, fastTrackDelayPeriod); + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('\t* FastTrack hash is %s', fastTrackHash); + + await this.helper.collective.techCommittee.propose(alithAccount, technicalCommitteeThreshold, fastTrack, fastTrack.encodedLength); + + const techProposalIdx = await this.helper.collective.techCommittee.proposalCount() - 1; + await this.helper.collective.techCommittee.vote(baltatharAccount, fastTrackHash, techProposalIdx, true); + await this.helper.collective.techCommittee.vote(alithAccount, fastTrackHash, techProposalIdx, true); + + await this.helper.collective.techCommittee.close( + baltatharAccount, + fastTrackHash, + techProposalIdx, + { + refTime: 1_000_000_000, + proofSize: 1_000_000, + }, + fastTrack.encodedLength, + ); + console.log('\t* Fast track proposal through technical committee.......DONE'); + // <<< Fast track proposal through technical committee <<< + + const refIndexField = 0; + const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); + + // >>> Referendum voting >>> + console.log(`\t* Referendum #${referendumIndex} voting.......`); + await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex, { + balance: 10_000_000_000_000_000_000n, + vote: {aye: true, conviction: 1}, + }); + console.log(`\t* Referendum #${referendumIndex} voting.......DONE`); + // <<< Referendum voting <<< + + // Wait for the democracy execute + await this.helper.wait.newBlocks(5); + + console.log(`[democracy] executing '${proposalDesciption}' proposal.......DONE`); + } +} + class WaitGroup { helper: ChainHelperBase; @@ -727,7 +826,7 @@ class WaitGroup { return promise; } - async eventOutcome(maxBlocksToWait: number, eventSection: string, eventMethod: string) { + async eventData(maxBlocksToWait: number, eventSection: string, eventMethod: string, fieldIndex: number) { const eventRecord = await this.event(maxBlocksToWait, eventSection, eventMethod); if (eventRecord == null) { @@ -735,9 +834,9 @@ class WaitGroup { } const event = eventRecord!.event; - const outcome = event.data[1] as EventT; + const data = event.data[fieldIndex] as EventT; - return outcome; + return data; } } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 7a723168be..eb2c88ba48 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -642,6 +642,10 @@ export class ChainHelperBase { return call(...params); } + encodeApiCall(apiCall: string, params: any[]) { + return this.constructApiCall(apiCall, params).method.toHex(); + } + async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true, options: Partial|null = null/*, failureMessage='expected success'*/) { if(this.api === null) throw Error('API not initialized'); if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`); diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index c00c0dc659..cb2f9c2815 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {blake2AsHex} from '@polkadot/util-crypto'; import config from '../config'; import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util'; @@ -680,11 +679,13 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { }); const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -738,7 +739,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( targetAccount.addressRaw, { Concrete: { @@ -753,16 +754,55 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { testAmount, ); + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Quartz using full QTZ identification await usingKaruraPlaygrounds(karuraUrl, async (helper) => { - await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramFullId); }); const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + // Try to trick Quartz using shortened QTZ identification + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramHereId); + }); + + xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -775,7 +815,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; - const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); }); }); @@ -845,11 +885,13 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -918,7 +960,7 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Quartz constants - let quartzDonor: IKeyringPair; + let alice: IKeyringPair; let quartzAssetLocation; let randomAccountQuartz: IKeyringPair; @@ -927,11 +969,6 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Moonriver constants let assetId: string; - const councilVotingThreshold = 2; - const technicalCommitteeThreshold = 2; - const votingPeriod = 3; - const delayPeriod = 0; - const quartzAssetMetadata = { name: 'xcQuartz', symbol: 'xcQTZ', @@ -952,13 +989,12 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - quartzDonor = await privateKey('//Alice'); - [randomAccountQuartz] = await helper.arrange.createAccounts([0n], quartzDonor); + alice = await privateKey('//Alice'); + [randomAccountQuartz] = await helper.arrange.createAccounts([0n], alice); balanceForeignQtzTokenInit = 0n; // Set the default version to wrap the first message to other chains. - const alice = quartzDonor; await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); }); @@ -994,85 +1030,14 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { unitsPerSecond, numAssetsWeightHint, }); - const proposalHash = blake2AsHex(encodedProposal); console.log('Encoded proposal for registerForeignAsset & setAssetUnitsPerSecond is %s', encodedProposal); - console.log('Encoded length %d', encodedProposal.length); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - - // >>> Note motion preimage >>> - console.log('Note motion preimage.......'); - await helper.democracy.notePreimage(baltatharAccount, encodedProposal); - console.log('Note motion preimage.......DONE'); - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - console.log('Propose external motion through council.......'); - const externalMotion = helper.democracy.externalProposeMajority({Legacy: proposalHash}); - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - await helper.collective.council.propose(baltatharAccount, councilVotingThreshold, externalMotion, externalMotion.encodedLength); - - const councilProposalIdx = await helper.collective.council.proposalCount() - 1; - await helper.collective.council.vote(dorothyAccount, motionHash, councilProposalIdx, true); - await helper.collective.council.vote(baltatharAccount, motionHash, councilProposalIdx, true); - - await helper.collective.council.close( - dorothyAccount, - motionHash, - councilProposalIdx, - { - refTime: 1_000_000_000, - proofSize: 1_000_000, - }, - externalMotion.encodedLength, - ); - console.log('Propose external motion through council.......DONE'); - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - console.log('Fast track proposal through technical committee.......'); - const fastTrack = helper.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - await helper.collective.techCommittee.propose(alithAccount, technicalCommitteeThreshold, fastTrack, fastTrack.encodedLength); - - const techProposalIdx = await helper.collective.techCommittee.proposalCount() - 1; - await helper.collective.techCommittee.vote(baltatharAccount, fastTrackHash, techProposalIdx, true); - await helper.collective.techCommittee.vote(alithAccount, fastTrackHash, techProposalIdx, true); - - await helper.collective.techCommittee.close( - baltatharAccount, - fastTrackHash, - techProposalIdx, - { - refTime: 1_000_000_000, - proofSize: 1_000_000, - }, - fastTrack.encodedLength, - ); - console.log('Fast track proposal through technical committee.......DONE'); - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - console.log('Referendum voting.......'); - await helper.democracy.referendumVote(dorothyAccount, 0, { - balance: 10_000_000_000_000_000_000n, - vote: {aye: true, conviction: 1}, - }); - console.log('Referendum voting.......DONE'); - // <<< Referendum voting <<< + + await helper.fastDemocracy.executeProposal('register QTZ foreign asset', encodedProposal); // >>> Acquire Quartz AssetId Info on Moonriver >>> console.log('Acquire Quartz AssetId Info on Moonriver.......'); - // Wait for the democracy execute - await helper.wait.newBlocks(5); - assetId = (await helper.assetManager.assetTypeId(quartzAssetLocation)).toString(); console.log('QTZ asset ID is %s', assetId); @@ -1089,7 +1054,7 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { }); await usingPlaygrounds(async (helper) => { - await helper.balance.transferToSubstrate(quartzDonor, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); + await helper.balance.transferToSubstrate(alice, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccountQuartz.address); }); }); @@ -1197,14 +1162,197 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect(qtzFees == 0n).to.be.true; }); - // eslint-disable-next-line require-await - itSub.skip('Moonriver can send only up to its balance', async ({helper}) => { - throw Error('Not yet implemented'); + itSub('Moonriver can send only up to its balance', async ({helper}) => { + // set Moonriver's sovereign account's balance + const moonriverBalance = 10000n * (10n ** QTZ_DECIMALS); + const moonriverSovereignAccount = helper.address.paraSiblingSovereignAccount(MOONRIVER_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, moonriverSovereignAccount, moonriverBalance); + + const moreThanMoonriverHas = moonriverBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanMoonriverHas, + ); + + // Try to trick Quartz + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, maliciousXcmProgram]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to spend more QTZ than Moonriver has', batchCall); + }); + + const maxWaitBlocks = 3; + const outcomeField = 1; + + const xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + 'The XCM error should be \'FailedToTransactAsset\'', + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Moonriver still can send the correct amount + const validTransferAmount = moonriverBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); + + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, validXcmProgram]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('Spend the correct amount of QTZ', batchCall); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - // eslint-disable-next-line require-await - itSub.skip('Should not accept reserve transfer of QTZ from Moonriver', async ({helper}) => { - throw Error('Not yet implemented'); + itSub('Should not accept reserve transfer of QTZ from Moonriver', async ({helper}) => { + const testAmount = 10_000n * (10n ** QTZ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const quartzMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: { + X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Quartz using full QTZ identification + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, maliciousXcmProgramFullId]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to act like a reserve location for QTZ using path asset identification', batchCall); + }); + + const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + + // Try to trick Quartz using shortened QTZ identification + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, maliciousXcmProgramHereId]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to act like a reserve location for QTZ using "here" asset identification', batchCall); + }); + + xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); }); }); @@ -1456,11 +1604,13 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { }); const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -1514,7 +1664,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( targetAccount.addressRaw, { Concrete: { @@ -1529,16 +1679,55 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { testAmount, ); + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Quartz using full QTZ identification await usingShidenPlaygrounds(shidenUrl, async (helper) => { - await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramFullId); }); const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + + // Try to trick Quartz using shortened QTZ identification + await usingShidenPlaygrounds(shidenUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramHereId); + }); - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -1551,7 +1740,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; - const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index e9cacf8e39..7bde820b3d 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {blake2AsHex} from '@polkadot/util-crypto'; import config from '../config'; import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds} from '../util'; @@ -682,11 +681,13 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { }); const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -725,7 +726,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - itSub('Should not accept reserve transfer of UNQ from Acala', async ({helper}) => { + itSub.only('Should not accept reserve transfer of UNQ from Acala', async ({helper}) => { const testAmount = 10_000n * (10n ** UNQ_DECIMALS); const [targetAccount] = await helper.arrange.createAccounts([0n], alice); @@ -740,7 +741,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( targetAccount.addressRaw, { Concrete: { @@ -755,16 +756,55 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { testAmount, ); + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Unique using full UNQ identification await usingAcalaPlaygrounds(acalaUrl, async (helper) => { - await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramFullId); }); const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + // Try to trick Unique using shortened UNQ identification + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramHereId); + }); + + xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -777,7 +817,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; - const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); }); }); @@ -847,11 +887,13 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -920,7 +962,7 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants - let uniqueDonor: IKeyringPair; + let alice: IKeyringPair; let uniqueAssetLocation; let randomAccountUnique: IKeyringPair; @@ -929,11 +971,6 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Moonbeam constants let assetId: string; - const councilVotingThreshold = 2; - const technicalCommitteeThreshold = 2; - const votingPeriod = 3; - const delayPeriod = 0; - const uniqueAssetMetadata = { name: 'xcUnique', symbol: 'xcUNQ', @@ -954,13 +991,12 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - uniqueDonor = await privateKey('//Alice'); - [randomAccountUnique] = await helper.arrange.createAccounts([0n], uniqueDonor); + alice = await privateKey('//Alice'); + [randomAccountUnique] = await helper.arrange.createAccounts([0n], alice); balanceForeignUnqTokenInit = 0n; // Set the default version to wrap the first message to other chains. - const alice = uniqueDonor; await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION); }); @@ -996,85 +1032,14 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { unitsPerSecond, numAssetsWeightHint, }); - const proposalHash = blake2AsHex(encodedProposal); console.log('Encoded proposal for registerForeignAsset & setAssetUnitsPerSecond is %s', encodedProposal); - console.log('Encoded length %d', encodedProposal.length); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - - // >>> Note motion preimage >>> - console.log('Note motion preimage.......'); - await helper.democracy.notePreimage(baltatharAccount, encodedProposal); - console.log('Note motion preimage.......DONE'); - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - console.log('Propose external motion through council.......'); - const externalMotion = helper.democracy.externalProposeMajority({Legacy: proposalHash}); - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - await helper.collective.council.propose(baltatharAccount, councilVotingThreshold, externalMotion, externalMotion.encodedLength); - - const councilProposalIdx = await helper.collective.council.proposalCount() - 1; - await helper.collective.council.vote(dorothyAccount, motionHash, councilProposalIdx, true); - await helper.collective.council.vote(baltatharAccount, motionHash, councilProposalIdx, true); - - await helper.collective.council.close( - dorothyAccount, - motionHash, - councilProposalIdx, - { - refTime: 1_000_000_000, - proofSize: 1_000_000, - }, - externalMotion.encodedLength, - ); - console.log('Propose external motion through council.......DONE'); - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - console.log('Fast track proposal through technical committee.......'); - const fastTrack = helper.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - await helper.collective.techCommittee.propose(alithAccount, technicalCommitteeThreshold, fastTrack, fastTrack.encodedLength); - - const techProposalIdx = await helper.collective.techCommittee.proposalCount() - 1; - await helper.collective.techCommittee.vote(baltatharAccount, fastTrackHash, techProposalIdx, true); - await helper.collective.techCommittee.vote(alithAccount, fastTrackHash, techProposalIdx, true); - - await helper.collective.techCommittee.close( - baltatharAccount, - fastTrackHash, - techProposalIdx, - { - refTime: 1_000_000_000, - proofSize: 1_000_000, - }, - fastTrack.encodedLength, - ); - console.log('Fast track proposal through technical committee.......DONE'); - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - console.log('Referendum voting.......'); - await helper.democracy.referendumVote(dorothyAccount, 0, { - balance: 10_000_000_000_000_000_000n, - vote: {aye: true, conviction: 1}, - }); - console.log('Referendum voting.......DONE'); - // <<< Referendum voting <<< + + await helper.fastDemocracy.executeProposal('register UNQ foreign asset', encodedProposal); // >>> Acquire Unique AssetId Info on Moonbeam >>> console.log('Acquire Unique AssetId Info on Moonbeam.......'); - // Wait for the democracy execute - await helper.wait.newBlocks(5); - assetId = (await helper.assetManager.assetTypeId(uniqueAssetLocation)).toString(); console.log('UNQ asset ID is %s', assetId); @@ -1091,7 +1056,7 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { }); await usingPlaygrounds(async (helper) => { - await helper.balance.transferToSubstrate(uniqueDonor, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); + await helper.balance.transferToSubstrate(alice, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccountUnique.address); }); }); @@ -1200,14 +1165,197 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect(unqFees == 0n).to.be.true; }); - // eslint-disable-next-line require-await - itSub.skip('Moonbeam can send only up to its balance', async ({helper}) => { - throw Error('Not yet implemented'); + itSub('Moonbeam can send only up to its balance', async ({helper}) => { + // set Moonbeam's sovereign account's balance + const moonbeamBalance = 10000n * (10n ** UNQ_DECIMALS); + const moonbeamSovereignAccount = helper.address.paraSiblingSovereignAccount(MOONBEAM_CHAIN); + await helper.getSudo().balance.setBalanceSubstrate(alice, moonbeamSovereignAccount, moonbeamBalance); + + const moreThanMoonbeamHas = moonbeamBalance * 2n; + + let targetAccountBalance = 0n; + const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }; + + const maliciousXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + moreThanMoonbeamHas, + ); + + // Try to trick Unique + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, maliciousXcmProgram]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to spend more UNQ than Moonbeam has', batchCall); + }); + + const maxWaitBlocks = 3; + const outcomeField = 1; + + const xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isFailedToTransactAsset, + 'The XCM error should be \'FailedToTransactAsset\'', + ).to.be.true; + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(0n); + + // But Moonbeam still can send the correct amount + const validTransferAmount = moonbeamBalance / 2n; + const validXcmProgram = helper.arrange.makeXcmProgramWithdrawDeposit( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + validTransferAmount, + ); + + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, validXcmProgram]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('Spend the correct amount of UNQ', batchCall); + }); + + await helper.wait.newBlocks(maxWaitBlocks); + + targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - // eslint-disable-next-line require-await - itSub.skip('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { - throw Error('Not yet implemented'); + itSub.only('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { + const testAmount = 10_000n * (10n ** UNQ_DECIMALS); + const [targetAccount] = await helper.arrange.createAccounts([0n], alice); + + const uniqueMultilocation = { + V1: { + parents: 1, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }; + + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: { + X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }, + }, + testAmount, + ); + + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Unique using full UNQ identification + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, maliciousXcmProgramFullId]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to act like a reserve location for UNQ using path asset identification', batchCall); + }); + + const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + + // Try to trick Unique using shortened UNQ identification + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, maliciousXcmProgramHereId]); + + // Needed to bypass the call filter. + const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); + await helper.fastDemocracy.executeProposal('try to act like a reserve location for UNQ using "here" asset identification', batchCall); + }); + + xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); }); }); @@ -1215,14 +1363,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; - const UNQ_ASSET_ID_ON_SHIDEN = 1; - const UNQ_MINIMAL_BALANCE_ON_SHIDEN = 1n; + const UNQ_ASSET_ID_ON_ASTAR = 1; + const UNQ_MINIMAL_BALANCE_ON_ASTAR = 1n; // Unique -> Astar - const astarInitialBalance = 1n * (10n ** ASTAR_DECIMALS); // 1 ASTR, existential deposit required to actually create the account on Shiden. + const astarInitialBalance = 1n * (10n ** ASTAR_DECIMALS); // 1 ASTR, existential deposit required to actually create the account on Astar. const unitsPerSecond = 228_000_000_000n; // This is Phala's value. What will be ours? const unqToAstarTransferred = 10n * (10n ** UNQ_DECIMALS); // 10 UNQ - const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Shiden takes a commision in foreign tokens + const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Astar takes a commision in foreign tokens // Astar -> Unique const unqFromAstarTransfered = 5n * (10n ** UNQ_DECIMALS); // 5 UNQ @@ -1245,14 +1393,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { // TODO update metadata with values from production await helper.assets.create( alice, - UNQ_ASSET_ID_ON_SHIDEN, + UNQ_ASSET_ID_ON_ASTAR, alice.address, - UNQ_MINIMAL_BALANCE_ON_SHIDEN, + UNQ_MINIMAL_BALANCE_ON_ASTAR, ); await helper.assets.setMetadata( alice, - UNQ_ASSET_ID_ON_SHIDEN, + UNQ_ASSET_ID_ON_ASTAR, 'Cross chain UNQ', 'xcUNQ', Number(UNQ_DECIMALS), @@ -1270,7 +1418,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { }, }; - await helper.getSudo().executeExtrinsic(alice, 'api.tx.xcAssetConfig.registerAssetLocation', [assetLocation, UNQ_ASSET_ID_ON_SHIDEN]); + await helper.getSudo().executeExtrinsic(alice, 'api.tx.xcAssetConfig.registerAssetLocation', [assetLocation, UNQ_ASSET_ID_ON_ASTAR]); console.log('3. Set UNQ payment for XCM execution on Astar'); await helper.getSudo().executeExtrinsic(alice, 'api.tx.xcAssetConfig.setAssetUnitsPerSecond', [assetLocation, unitsPerSecond]); @@ -1337,7 +1485,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { await usingAstarPlaygrounds(astarUrl, async (helper) => { await helper.wait.newBlocks(3); - const xcUNQbalance = await helper.assets.account(UNQ_ASSET_ID_ON_SHIDEN, randomAccount.address); + const xcUNQbalance = await helper.assets.account(UNQ_ASSET_ID_ON_ASTAR, randomAccount.address); const astarBalance = await helper.balance.getSubstrate(randomAccount.address); console.log(`xcUNQ balance on Astar after XCM is: ${xcUNQbalance}`); @@ -1405,7 +1553,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { // this is non-standard polkadotXcm extension for Astar only. It calls InitiateReserveWithdraw await helper.executeExtrinsic(randomAccount, 'api.tx.polkadotXcm.reserveWithdrawAssets', [destination, beneficiary, assets, feeAssetItem]); - const xcUNQbalance = await helper.assets.account(UNQ_ASSET_ID_ON_SHIDEN, randomAccount.address); + const xcUNQbalance = await helper.assets.account(UNQ_ASSET_ID_ON_ASTAR, randomAccount.address); const balanceAstar = await helper.balance.getSubstrate(randomAccount.address); console.log(`xcUNQ balance on Astar after XCM is: ${xcUNQbalance}`); @@ -1427,7 +1575,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { const astarSovereignAccount = helper.address.paraSiblingSovereignAccount(ASTAR_CHAIN); await helper.getSudo().balance.setBalanceSubstrate(alice, astarSovereignAccount, astarBalance); - const moreThanShidenHas = astarBalance * 2n; + const moreThanAstarHas = astarBalance * 2n; let targetAccountBalance = 0n; const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice); @@ -1449,7 +1597,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { interior: 'Here', }, }, - moreThanShidenHas, + moreThanAstarHas, ); // Try to trick Unique @@ -1458,11 +1606,13 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { }); const maxWaitBlocks = 3; + const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + const xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -1501,7 +1651,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - itSub('Should not accept reserve transfer of UNQ from Astar', async ({helper}) => { + itSub.only('Should not accept reserve transfer of UNQ from Astar', async ({helper}) => { const testAmount = 10_000n * (10n ** UNQ_DECIMALS); const [targetAccount] = await helper.arrange.createAccounts([0n], alice); @@ -1516,7 +1666,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { }, }; - const maliciousXcmProgram = helper.arrange.makeXcmProgramReserveAssetDeposited( + const maliciousXcmProgramFullId = helper.arrange.makeXcmProgramReserveAssetDeposited( targetAccount.addressRaw, { Concrete: { @@ -1531,16 +1681,55 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { testAmount, ); + const maliciousXcmProgramHereId = helper.arrange.makeXcmProgramReserveAssetDeposited( + targetAccount.addressRaw, + { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + testAmount, + ); + + // Try to trick Unique using full UNQ identification await usingAstarPlaygrounds(astarUrl, async (helper) => { - await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramFullId); }); const maxWaitBlocks = 3; + const outcomeField = 1; + + let xcmpQueueFailEvent = await helper.wait.eventData( + maxWaitBlocks, + 'xcmpQueue', + 'Fail', + outcomeField, + ); + + expect( + xcmpQueueFailEvent != null, + '\'xcmpQueue.FailEvent\' event is expected', + ).to.be.true; + + expect( + xcmpQueueFailEvent!.isUntrustedReserveLocation, + 'The XCM error should be \'isUntrustedReserveLocation\'', + ).to.be.true; + + let accountBalance = await helper.balance.getSubstrate(targetAccount.address); + expect(accountBalance).to.be.equal(0n); + + // Try to trick Unique using shortened UNQ identification + await usingAstarPlaygrounds(astarUrl, async (helper) => { + await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramHereId); + }); - const xcmpQueueFailEvent = await helper.wait.eventOutcome( + xcmpQueueFailEvent = await helper.wait.eventData( maxWaitBlocks, 'xcmpQueue', 'Fail', + outcomeField, ); expect( @@ -1553,7 +1742,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { 'The XCM error should be \'isUntrustedReserveLocation\'', ).to.be.true; - const accountBalance = await helper.balance.getSubstrate(targetAccount.address); + accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); }); From 603147b1fffd2780def09fa22119217b4b650ba8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Apr 2023 11:45:05 +0200 Subject: [PATCH 27/74] fix: wait for proposal to pass --- tests/src/util/playgrounds/unique.dev.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 9b404a40e6..37568ac992 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -635,19 +635,20 @@ class MoonbeamFastDemocracyGroup { // <<< Fast track proposal through technical committee <<< const refIndexField = 0; - const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); + const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); // >>> Referendum voting >>> console.log(`\t* Referendum #${referendumIndex} voting.......`); - await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex, { + await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex!, { balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}, }); console.log(`\t* Referendum #${referendumIndex} voting.......DONE`); // <<< Referendum voting <<< - // Wait for the democracy execute - await this.helper.wait.newBlocks(5); + // Wait the proposal to pass + await this.helper.wait.event(3, 'democracy', 'Passed'); + await this.helper.wait.newBlocks(1); console.log(`[democracy] executing '${proposalDesciption}' proposal.......DONE`); } From 22a4d5338189662a3bbbb7239bb88a97557b57fc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Apr 2023 11:45:19 +0200 Subject: [PATCH 28/74] fix: remove .only --- tests/src/xcm/xcmUnique.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 7bde820b3d..6f6885f142 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -726,7 +726,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - itSub.only('Should not accept reserve transfer of UNQ from Acala', async ({helper}) => { + itSub('Should not accept reserve transfer of UNQ from Acala', async ({helper}) => { const testAmount = 10_000n * (10n ** UNQ_DECIMALS); const [targetAccount] = await helper.arrange.createAccounts([0n], alice); @@ -1255,7 +1255,7 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - itSub.only('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { + itSub('Should not accept reserve transfer of UNQ from Moonbeam', async ({helper}) => { const testAmount = 10_000n * (10n ** UNQ_DECIMALS); const [targetAccount] = await helper.arrange.createAccounts([0n], alice); @@ -1651,7 +1651,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect(targetAccountBalance).to.be.equal(validTransferAmount); }); - itSub.only('Should not accept reserve transfer of UNQ from Astar', async ({helper}) => { + itSub('Should not accept reserve transfer of UNQ from Astar', async ({helper}) => { const testAmount = 10_000n * (10n ** UNQ_DECIMALS); const [targetAccount] = await helper.arrange.createAccounts([0n], alice); From 778bcae0785290d4169cb2819251225162bc8dca Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Apr 2023 21:59:17 +0200 Subject: [PATCH 29/74] fix: xcm error event log --- tests/src/xcm/xcmQuartz.test.ts | 20 ++++++++++---------- tests/src/xcm/xcmUnique.test.ts | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index cb2f9c2815..4e553102b8 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -695,7 +695,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -787,7 +787,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -812,7 +812,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -901,7 +901,7 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset'`, + `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; }; @@ -1219,7 +1219,7 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1319,7 +1319,7 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1348,7 +1348,7 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1620,7 +1620,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1712,7 +1712,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1737,7 +1737,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 6f6885f142..54406a18a0 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -697,7 +697,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -789,7 +789,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -814,7 +814,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -903,7 +903,7 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset'`, + `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; }; @@ -1222,7 +1222,7 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1322,7 +1322,7 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1351,7 +1351,7 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1622,7 +1622,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect( xcmpQueueFailEvent!.isFailedToTransactAsset, - 'The XCM error should be \'FailedToTransactAsset\'', + `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1714,7 +1714,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; let accountBalance = await helper.balance.getSubstrate(targetAccount.address); @@ -1739,7 +1739,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { expect( xcmpQueueFailEvent!.isUntrustedReserveLocation, - 'The XCM error should be \'isUntrustedReserveLocation\'', + `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, ).to.be.true; accountBalance = await helper.balance.getSubstrate(targetAccount.address); From a91b7330df0013fff0910222b6a056e4582737e8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Apr 2023 10:00:16 +0200 Subject: [PATCH 30/74] build: upgrade polkadot to v0.9.41 Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 1450 ++++++++++---------- Cargo.toml | 303 ++-- node/cli/Cargo.toml | 1 + node/cli/src/service.rs | 28 +- node/rpc/Cargo.toml | 3 +- node/rpc/src/lib.rs | 18 +- pallets/app-promotion/src/lib.rs | 1 - pallets/collator-selection/src/lib.rs | 1 - pallets/common/src/lib.rs | 1 - pallets/configuration/src/lib.rs | 1 - pallets/evm-contract-helpers/src/lib.rs | 1 - pallets/evm-migration/src/lib.rs | 1 - pallets/evm-transaction-payment/src/lib.rs | 1 - pallets/fungible/src/lib.rs | 1 - pallets/identity/src/lib.rs | 1 - pallets/inflation/src/lib.rs | 1 - pallets/maintenance/src/lib.rs | 1 - pallets/nonfungible/src/lib.rs | 1 - pallets/refungible/src/lib.rs | 1 - pallets/scheduler-v2/Cargo.toml | 5 +- pallets/scheduler-v2/src/lib.rs | 1 - pallets/scheduler-v2/src/mock.rs | 1 - runtime/common/config/ethereum.rs | 5 +- runtime/opal/Cargo.toml | 2 - runtime/opal/src/lib.rs | 2 +- runtime/quartz/Cargo.toml | 2 - runtime/quartz/src/lib.rs | 2 +- runtime/tests/Cargo.toml | 40 +- runtime/tests/src/lib.rs | 5 +- runtime/unique/Cargo.toml | 2 - runtime/unique/src/lib.rs | 2 +- test-pallets/utils/src/lib.rs | 1 - 32 files changed, 1024 insertions(+), 862 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b507b19cab..bf93aa31c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,42 +205,51 @@ dependencies = [ [[package]] name = "anstream" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" dependencies = [ "anstyle", "anstyle-parse", + "anstyle-query", "anstyle-wincon", - "concolor-override", - "concolor-query", + "colorchoice", "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "0.3.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" [[package]] name = "anstyle-parse" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" dependencies = [ "utf8parse", ] +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "anstyle-wincon" -version = "0.2.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" dependencies = [ "anstyle", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -384,6 +393,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-io" version = "1.13.0" @@ -421,7 +441,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -532,65 +552,12 @@ dependencies = [ "serde", ] -[[package]] -name = "beefy-gadget" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "array-bytes 4.2.0", - "async-trait", - "fnv", - "futures", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-client-api", - "sc-consensus", - "sc-keystore", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-utils", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-beefy", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keystore", - "sp-mmr-primitives", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "beefy-gadget-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "beefy-gadget", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-rpc", - "serde", - "sp-beefy", - "sp-core", - "sp-runtime", - "thiserror", -] - [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", ] @@ -1039,9 +1006,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" +checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a" dependencies = [ "clap_builder", "clap_derive", @@ -1050,9 +1017,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6" dependencies = [ "anstream", "anstyle", @@ -1070,7 +1037,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1101,6 +1068,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "comfy-table" version = "6.1.4" @@ -1112,21 +1085,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "concolor-override" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" - -[[package]] -name = "concolor-query" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" -dependencies = [ - "windows-sys 0.45.0", -] - [[package]] name = "concurrent-queue" version = "2.2.0" @@ -1453,7 +1411,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "clap", "parity-scale-codec", @@ -1468,7 +1426,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1491,7 +1449,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1520,7 +1478,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -1544,7 +1502,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1567,7 +1525,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1591,7 +1549,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1603,11 +1561,11 @@ dependencies = [ "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", "futures", - "parking_lot 0.12.1", "polkadot-primitives", "sc-client-api", "sc-consensus", "sc-network", + "sc-network-sync", "sc-network-transactions", "sc-rpc", "sc-service", @@ -1626,7 +1584,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "frame-support", "frame-system", @@ -1642,7 +1600,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1659,7 +1617,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1688,7 +1646,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1699,7 +1657,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1715,7 +1673,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1735,7 +1693,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -1751,7 +1709,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1774,7 +1732,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "futures", @@ -1787,7 +1745,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1805,7 +1763,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1830,7 +1788,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1838,19 +1796,17 @@ dependencies = [ "jsonrpsee-core", "parity-scale-codec", "polkadot-overseer", - "polkadot-service", "sc-client-api", "sp-api", "sp-blockchain", "sp-state-machine", "thiserror", - "tokio", ] [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "array-bytes 6.0.0", "async-trait", @@ -1868,15 +1824,11 @@ dependencies = [ "polkadot-service", "sc-authority-discovery", "sc-client-api", - "sc-consensus", - "sc-keystore", "sc-network", "sc-network-common", "sc-service", - "sc-telemetry", "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", + "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", @@ -1884,13 +1836,12 @@ dependencies = [ "sp-runtime", "tokio", "tracing", - "url", ] [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1900,9 +1851,10 @@ dependencies = [ "jsonrpsee", "lru 0.9.0", "parity-scale-codec", - "polkadot-service", + "polkadot-overseer", "sc-client-api", "sc-rpc-api", + "sc-service", "serde", "serde_json", "sp-api", @@ -1919,7 +1871,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1993,7 +1945,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2010,7 +1962,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2417,7 +2369,7 @@ checksum = "9d2c772ccdbdfd1967b4f5d79d17c98ebf92009fdcc838db7aa434462f600c26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2428,7 +2380,7 @@ checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2463,6 +2415,17 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + [[package]] name = "errno" version = "0.3.1" @@ -2507,13 +2470,13 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", "scale-info", "serde", - "sha3 0.10.6", + "sha3 0.10.7", "triehash", ] @@ -2557,7 +2520,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.6", + "sha3 0.10.7", ] [[package]] @@ -2581,7 +2544,7 @@ dependencies = [ "hex", "proc-macro2", "quote", - "sha3 0.10.6", + "sha3 0.10.7", "syn 1.0.109", ] @@ -2628,7 +2591,7 @@ dependencies = [ "environmental", "evm-core", "primitive-types", - "sha3 0.10.6", + "sha3 0.10.7", ] [[package]] @@ -2665,6 +2628,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -2714,7 +2690,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "async-trait", "fc-db", @@ -2723,7 +2699,6 @@ dependencies = [ "sc-consensus", "sp-api", "sp-block-builder", - "sp-blockchain", "sp-consensus", "sp-runtime", "thiserror", @@ -2732,7 +2707,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2751,7 +2726,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "fc-db", "fc-storage", @@ -2769,7 +2744,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -2778,6 +2753,7 @@ dependencies = [ "fc-rpc-core", "fc-storage", "fp-ethereum", + "fp-evm", "fp-rpc", "fp-storage", "futures", @@ -2786,6 +2762,7 @@ dependencies = [ "libsecp256k1", "log", "lru 0.8.1", + "pallet-evm", "parity-scale-codec", "prometheus", "rand 0.8.5", @@ -2793,6 +2770,7 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-service", "sc-transaction-pool", @@ -2804,6 +2782,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-state-machine", + "sp-storage", "substrate-prometheus-endpoint", "tokio", ] @@ -2811,7 +2791,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -2824,7 +2804,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -2949,7 +2929,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", ] @@ -2963,10 +2943,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fp-account" +version = "1.0.0-dev" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" +dependencies = [ + "hex", + "impl-serde", + "libsecp256k1", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "parity-scale-codec", @@ -2978,7 +2976,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -2992,7 +2990,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "evm", "frame-support", @@ -3004,19 +3002,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "fp-evm-mapping" -version = "0.1.0" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" -dependencies = [ - "frame-support", - "sp-core", -] - [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -3026,13 +3015,14 @@ dependencies = [ "sp-api", "sp-core", "sp-runtime", + "sp-state-machine", "sp-std", ] [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "frame-support", "parity-scale-codec", @@ -3044,7 +3034,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "parity-scale-codec", "serde", @@ -3059,7 +3049,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-support-procedural", @@ -3084,7 +3074,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -3131,7 +3121,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3142,7 +3132,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3159,7 +3149,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -3188,7 +3178,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "log", @@ -3204,9 +3194,10 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "bitflags", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", @@ -3236,7 +3227,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "Inflector", "cfg-expr", @@ -3251,7 +3242,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -3263,7 +3254,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro2", "quote", @@ -3273,7 +3264,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "log", @@ -3291,7 +3282,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -3306,7 +3297,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "sp-api", @@ -3315,7 +3306,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "parity-scale-codec", @@ -3340,6 +3331,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea55201cc351fdb478217c0fb641b59813da9b4efe4c414a9d8f989a657d149" +dependencies = [ + "libc", + "rustix 0.35.13", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -3418,7 +3420,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -3597,9 +3599,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" dependencies = [ "bytes", "fnv", @@ -3634,6 +3636,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -4029,6 +4037,12 @@ dependencies = [ "webrtc-util", ] +[[package]] +name = "io-lifetimes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" + [[package]] name = "io-lifetimes" version = "1.0.10" @@ -4071,7 +4085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", - "io-lifetimes", + "io-lifetimes 1.0.10", "rustix 0.37.11", "windows-sys 0.48.0", ] @@ -4256,8 +4270,8 @@ dependencies = [ [[package]] name = "kusama-runtime" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "frame-benchmarking", @@ -4286,7 +4300,7 @@ dependencies = [ "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-grandpa", - "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39)", + "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41)", "pallet-im-online", "pallet-indices", "pallet-membership", @@ -4330,9 +4344,9 @@ dependencies = [ "sp-api", "sp-arithmetic", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -4354,8 +4368,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-support", "polkadot-primitives", @@ -4999,6 +5013,12 @@ dependencies = [ "nalgebra", ] +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -5158,15 +5178,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -5178,12 +5189,11 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -5245,7 +5255,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "log", @@ -5253,9 +5263,9 @@ dependencies = [ "sc-client-api", "sc-offchain", "sp-api", - "sp-beefy", "sp-blockchain", "sp-consensus", + "sp-consensus-beefy", "sp-core", "sp-mmr-primitives", "sp-runtime", @@ -5264,7 +5274,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "anyhow", "jsonrpsee", @@ -5365,7 +5375,7 @@ dependencies = [ "digest 0.10.6", "multihash-derive", "sha2 0.10.6", - "sha3 0.10.6", + "sha3 0.10.7", "unsigned-varint", ] @@ -5536,20 +5546,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", - "static_assertions", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5711,7 +5707,7 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opal-runtime" -version = "0.9.39" +version = "0.9.41" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -5725,7 +5721,6 @@ dependencies = [ "derivative", "evm-coder", "fp-evm", - "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -5830,9 +5825,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e7d5b6bb115db09390bed8842c94180893dd83df3dfce7354f2a2aa090a4ee" +checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015" dependencies = [ "async-trait", "dyn-clonable", @@ -5847,9 +5842,9 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2af4dabb2286b0be0e9711d2d24e25f6217048b71210cffd3daddc3b5c84e1f" +checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" dependencies = [ "expander 0.0.6", "itertools", @@ -5872,7 +5867,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "frame-support", "frame-system", @@ -5887,7 +5882,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5906,7 +5901,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "frame-support", "parity-scale-codec", @@ -5920,7 +5915,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "frame-support", "frame-system", @@ -5935,7 +5930,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "frame-support", "orml-traits", @@ -5949,7 +5944,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.39#a0751540591c88ccc2d4029464de887933727183" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.41#71e9e0c73a2abc1ff8c1c3511869d60f57caa2c0" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6025,7 +6020,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6041,7 +6036,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6057,7 +6052,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6071,7 +6066,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6095,7 +6090,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6115,7 +6110,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6130,7 +6125,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "fp-evm", "frame-support", @@ -6144,7 +6139,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6153,7 +6148,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-beefy", + "sp-consensus-beefy", "sp-runtime", "sp-session", "sp-staking", @@ -6163,7 +6158,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree", @@ -6177,7 +6172,7 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-beefy", + "sp-consensus-beefy", "sp-core", "sp-io", "sp-runtime", @@ -6187,7 +6182,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6205,7 +6200,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6251,7 +6246,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6305,7 +6300,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6322,7 +6317,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6340,7 +6335,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6363,7 +6358,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6376,7 +6371,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6394,7 +6389,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "ethereum", "ethereum-types", @@ -6402,16 +6397,13 @@ dependencies = [ "fp-consensus", "fp-ethereum", "fp-evm", - "fp-evm-mapping", "fp-rpc", - "fp-self-contained", "fp-storage", "frame-support", "frame-system", "pallet-evm", "pallet-timestamp", "parity-scale-codec", - "rlp", "scale-info", "sp-io", "sp-runtime", @@ -6421,12 +6413,12 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "environmental", "evm", + "fp-account", "fp-evm", - "fp-evm-mapping", "frame-benchmarking", "frame-support", "frame-system", @@ -6501,7 +6493,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.39#708aebf2255bcf90b15b309134bcf13b0ec7884b" +source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.41#1ed335108b39dcdaeacdaed8eeb33c2e7657273e" dependencies = [ "fp-evm", "ripemd", @@ -6527,7 +6519,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6587,7 +6579,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6598,8 +6590,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", "sp-session", @@ -6627,7 +6619,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6643,7 +6635,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6663,7 +6655,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6709,7 +6701,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6726,7 +6718,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6743,7 +6735,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6759,7 +6751,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6775,7 +6767,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6792,7 +6784,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6812,7 +6804,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -6844,7 +6836,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -6861,7 +6853,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6885,7 +6877,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6902,7 +6894,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6917,7 +6909,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6935,7 +6927,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6950,7 +6942,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6989,7 +6981,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7006,7 +6998,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -7027,7 +7019,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7043,7 +7035,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -7057,7 +7049,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7080,7 +7072,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7091,7 +7083,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "log", "sp-arithmetic", @@ -7100,7 +7092,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "sp-api", @@ -7109,7 +7101,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7142,7 +7134,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -7156,7 +7148,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.39#7e74e3937a2c08bf29a00084a5c2f1ca6676d87a" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#65d810e69aa1f5d79e08d0d4e607ffd70c877603" dependencies = [ "frame-benchmarking", "frame-support", @@ -7188,7 +7180,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7206,7 +7198,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7225,7 +7217,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-support", "frame-system", @@ -7241,7 +7233,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -7257,7 +7249,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -7269,7 +7261,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7327,7 +7319,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7343,7 +7335,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7358,7 +7350,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-benchmarking", "frame-support", @@ -7372,8 +7364,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -7393,8 +7385,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-benchmarking", "frame-support", @@ -7413,7 +7405,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.39#d6eef144421ef5c3f339f681484d06bb729dfa82" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.41#ae4e75b077c220bdf29b299b36a63b87ccb46b4c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -7619,7 +7611,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -7711,8 +7703,8 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkadot-approval-distribution" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "polkadot-node-metrics", @@ -7726,8 +7718,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "polkadot-node-network-protocol", @@ -7740,8 +7732,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "derive_more", "fatality", @@ -7763,8 +7755,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "fatality", "futures", @@ -7784,8 +7776,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "clap", "frame-benchmarking-cli", @@ -7812,8 +7804,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "frame-benchmarking", @@ -7834,13 +7826,13 @@ dependencies = [ "sc-service", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-keyring", "sp-mmr-primitives", @@ -7854,8 +7846,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "always-assert", "bitvec", @@ -7876,8 +7868,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "parity-scale-codec", "scale-info", @@ -7888,8 +7880,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "derive_more", "fatality", @@ -7913,8 +7905,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -7927,8 +7919,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "futures-timer", @@ -7947,8 +7939,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "always-assert", "async-trait", @@ -7963,7 +7955,6 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-network", - "sc-network-common", "sp-consensus", "thiserror", "tracing-gum", @@ -7971,8 +7962,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "parity-scale-codec", @@ -7989,8 +7980,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "derive_more", @@ -8018,8 +8009,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "futures", @@ -8039,8 +8030,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "fatality", @@ -8058,8 +8049,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "polkadot-node-subsystem", @@ -8073,8 +8064,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "futures", @@ -8093,8 +8084,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "polkadot-node-metrics", @@ -8108,8 +8099,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "futures-timer", @@ -8125,8 +8116,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "fatality", "futures", @@ -8144,8 +8135,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "futures", @@ -8161,8 +8152,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "fatality", @@ -8179,8 +8170,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "always-assert", "assert_matches", @@ -8207,6 +8198,7 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-tracing", "sp-wasm-interface", + "substrate-build-script-utils", "tempfile", "tikv-jemalloc-ctl", "tokio", @@ -8215,8 +8207,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "polkadot-node-primitives", @@ -8231,8 +8223,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "futures", "lru 0.9.0", @@ -8246,8 +8238,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "lazy_static", "log", @@ -8264,8 +8256,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bs58", "futures", @@ -8283,8 +8275,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "derive_more", @@ -8298,7 +8290,6 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", - "sc-network-common", "strum", "thiserror", "tracing-gum", @@ -8306,8 +8297,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bounded-vec", "futures", @@ -8329,8 +8320,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -8339,8 +8330,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "derive_more", @@ -8362,8 +8353,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "derive_more", @@ -8395,8 +8386,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", "futures", @@ -8418,8 +8409,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bounded-collections", "derive_more", @@ -8435,8 +8426,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "env_logger 0.9.3", "kusama-runtime", @@ -8451,8 +8442,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "hex-literal", @@ -8477,11 +8468,9 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ - "beefy-gadget", - "beefy-gadget-rpc", "jsonrpsee", "mmr-rpc", "pallet-transaction-payment-rpc", @@ -8490,9 +8479,11 @@ dependencies = [ "sc-client-api", "sc-consensus-babe", "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-finality-grandpa-rpc", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", @@ -8509,8 +8500,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "frame-benchmarking", @@ -8537,7 +8528,7 @@ dependencies = [ "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-grandpa", - "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39)", + "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41)", "pallet-im-online", "pallet-indices", "pallet-membership", @@ -8575,9 +8566,9 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -8599,8 +8590,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "frame-benchmarking", @@ -8613,7 +8604,6 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", - "pallet-beefy-mmr", "pallet-election-provider-multi-phase", "pallet-fast-unstake", "pallet-session", @@ -8632,7 +8622,6 @@ dependencies = [ "serde_derive", "slot-range-helper", "sp-api", - "sp-beefy", "sp-core", "sp-inherents", "sp-io", @@ -8647,8 +8636,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-support", "polkadot-primitives", @@ -8661,8 +8650,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bs58", "parity-scale-codec", @@ -8673,8 +8662,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitflags", "bitvec", @@ -8717,11 +8706,10 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "async-trait", - "beefy-gadget", "frame-benchmarking-cli", "frame-support", "frame-system-rpc-runtime-api", @@ -8782,12 +8770,14 @@ dependencies = [ "sc-client-db", "sc-consensus", "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", "sc-consensus-slots", "sc-executor", - "sc-finality-grandpa", "sc-keystore", "sc-network", "sc-network-common", + "sc-network-sync", "sc-offchain", "sc-service", "sc-sync-state-rpc", @@ -8798,13 +8788,13 @@ dependencies = [ "serde_json", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keystore", @@ -8825,8 +8815,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8846,8 +8836,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -9080,9 +9070,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -9090,9 +9080,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -9125,9 +9115,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", @@ -9138,9 +9128,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ "prost", ] @@ -9156,7 +9146,7 @@ dependencies = [ [[package]] name = "quartz-runtime" -version = "0.9.39" +version = "0.9.41" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -9170,7 +9160,6 @@ dependencies = [ "derivative", "evm-coder", "fp-evm", - "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -9505,7 +9494,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -9637,8 +9626,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -9662,7 +9651,7 @@ dependencies = [ "pallet-democracy", "pallet-elections-phragmen", "pallet-grandpa", - "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39)", + "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41)", "pallet-im-online", "pallet-indices", "pallet-membership", @@ -9700,9 +9689,9 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -9723,8 +9712,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-support", "polkadot-primitives", @@ -9767,7 +9756,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix 0.24.3", + "nix", "thiserror", "tokio", ] @@ -9832,6 +9821,20 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.35.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" +dependencies = [ + "bitflags", + "errno 0.2.8", + "io-lifetimes 0.7.5", + "libc", + "linux-raw-sys 0.0.46", + "windows-sys 0.42.0", +] + [[package]] name = "rustix" version = "0.36.12" @@ -9839,8 +9842,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0af200a3324fa5bcd922e84e9b55a298ea9f431a489f01961acdebc6e908f25" dependencies = [ "bitflags", - "errno", - "io-lifetimes", + "errno 0.3.1", + "io-lifetimes 1.0.10", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", @@ -9853,8 +9856,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" dependencies = [ "bitflags", - "errno", - "io-lifetimes", + "errno 0.3.1", + "io-lifetimes 1.0.10", "libc", "linux-raw-sys 0.3.1", "windows-sys 0.48.0", @@ -9950,7 +9953,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "log", "sp-core", @@ -9961,7 +9964,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -9974,6 +9977,7 @@ dependencies = [ "prost-build", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", "sp-api", "sp-authority-discovery", @@ -9988,7 +9992,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "futures-timer", @@ -10011,7 +10015,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -10021,28 +10025,31 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "memmap2", "sc-chain-spec-derive", - "sc-network-common", + "sc-client-api", + "sc-executor", + "sc-network", "sc-telemetry", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", + "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10053,7 +10060,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -10093,7 +10100,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "fnv", "futures", @@ -10119,9 +10126,9 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -10145,7 +10152,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -10170,7 +10177,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -10199,7 +10206,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "fork-tree", @@ -10238,7 +10245,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "jsonrpsee", @@ -10257,10 +10264,64 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-network-sync", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10270,10 +10331,70 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "ahash 0.8.3", + "array-bytes 4.2.0", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "finality-grandpa", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "assert_matches", "async-trait", @@ -10307,7 +10428,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -10330,7 +10451,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "lru 0.8.1", "parity-scale-codec", @@ -10354,7 +10475,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -10367,7 +10488,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "log", "sc-allocator", @@ -10380,7 +10501,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "anyhow", "cfg-if", @@ -10395,76 +10516,17 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "ahash 0.8.3", - "array-bytes 4.2.0", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-finality-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "finality-grandpa", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", - "serde", - "sp-blockchain", - "sp-core", - "sp-runtime", - "thiserror", -] - [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ansi_term", "futures", "futures-timer", "log", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -10473,7 +10535,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10488,12 +10550,12 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", + "async-channel", "async-trait", "asynchronous-codec", - "backtrace", "bytes", "either", "fnv", @@ -10501,6 +10563,7 @@ dependencies = [ "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", "lru 0.8.1", "mockall", @@ -10531,7 +10594,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "cid", "futures", @@ -10540,6 +10603,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -10550,33 +10614,35 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ + "array-bytes 4.2.0", "async-trait", "bitflags", "bytes", "futures", "futures-timer", "libp2p", - "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", "sc-peerset", + "sc-utils", "serde", "smallvec", "sp-blockchain", "sp-consensus", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ahash 0.8.3", "futures", @@ -10584,6 +10650,7 @@ dependencies = [ "libp2p", "log", "lru 0.8.1", + "sc-network", "sc-network-common", "sc-peerset", "sp-runtime", @@ -10594,7 +10661,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10604,6 +10671,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sp-blockchain", @@ -10615,12 +10683,13 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "async-trait", "fork-tree", "futures", + "futures-timer", "libp2p", "log", "lru 0.8.1", @@ -10630,6 +10699,7 @@ dependencies = [ "prost-build", "sc-client-api", "sc-consensus", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -10637,8 +10707,8 @@ dependencies = [ "sp-arithmetic", "sp-blockchain", "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -10647,7 +10717,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10655,6 +10725,7 @@ dependencies = [ "log", "parity-scale-codec", "pin-project", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -10666,7 +10737,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -10682,6 +10753,7 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -10696,7 +10768,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "libp2p", @@ -10709,7 +10781,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10718,7 +10790,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "jsonrpsee", @@ -10748,7 +10820,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10767,7 +10839,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "http", "jsonrpsee", @@ -10782,7 +10854,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10808,7 +10880,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "directories", @@ -10874,7 +10946,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "log", "parity-scale-codec", @@ -10885,12 +10957,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "clap", + "fs4", "futures", "log", - "nix 0.26.2", "sc-client-db", "sc-utils", "sp-core", @@ -10901,7 +10973,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10909,7 +10981,7 @@ dependencies = [ "sc-client-api", "sc-consensus-babe", "sc-consensus-epochs", - "sc-finality-grandpa", + "sc-consensus-grandpa", "serde", "serde_json", "sp-blockchain", @@ -10920,7 +10992,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "libc", @@ -10939,7 +11011,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "chrono", "futures", @@ -10958,7 +11030,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ansi_term", "atty", @@ -10989,7 +11061,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11000,7 +11072,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -11027,7 +11099,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -11041,15 +11113,16 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "backtrace", + "async-channel", "futures", "futures-timer", "lazy_static", "log", "parking_lot 0.12.1", "prometheus", + "sp-arithmetic", ] [[package]] @@ -11250,29 +11323,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -11354,9 +11427,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +checksum = "54c2bb1a323307527314a36bfb73f24febb08ce2b8a554bf4ffd6f51ad15198c" dependencies = [ "digest 0.10.6", "keccak", @@ -11438,8 +11511,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "enumn", "parity-scale-codec", @@ -11516,9 +11589,9 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "sp-api-proc-macro", @@ -11534,9 +11607,11 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ + "Inflector", "blake2", + "expander 1.0.0", "proc-macro-crate", "proc-macro2", "quote", @@ -11546,7 +11621,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -11559,7 +11634,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "integer-sqrt", "num-traits", @@ -11573,7 +11648,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -11583,29 +11658,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "sp-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "lazy_static", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", - "strum", -] - [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "sp-api", @@ -11617,7 +11673,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "log", @@ -11635,25 +11691,22 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", "log", - "parity-scale-codec", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "parity-scale-codec", @@ -11671,7 +11724,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "merlin", @@ -11691,10 +11744,47 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -11706,7 +11796,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -11719,7 +11809,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "array-bytes 4.2.0", "base58", @@ -11729,7 +11819,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra", "futures", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", @@ -11762,13 +11852,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.6", "sha2 0.10.6", - "sha3 0.10.6", + "sha3 0.10.7", "sp-std", "twox-hash", ] @@ -11776,7 +11866,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro2", "quote", @@ -11787,7 +11877,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11796,7 +11886,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro2", "quote", @@ -11806,7 +11896,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "environmental", "parity-scale-codec", @@ -11814,28 +11904,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11850,7 +11922,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "bytes", "ed25519", @@ -11875,7 +11947,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "lazy_static", "sp-core", @@ -11886,7 +11958,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures", @@ -11903,7 +11975,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "thiserror", "zstd", @@ -11912,7 +11984,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -11930,7 +12002,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -11944,7 +12016,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "sp-api", "sp-core", @@ -11954,7 +12026,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "backtrace", "lazy_static", @@ -11964,7 +12036,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "rustc-hash", "serde", @@ -11974,7 +12046,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "either", "hash256-std-hasher", @@ -11996,7 +12068,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -12014,7 +12086,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "Inflector", "proc-macro-crate", @@ -12026,7 +12098,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -12040,7 +12112,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -12052,9 +12124,9 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -12072,12 +12144,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12090,7 +12162,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "futures-timer", @@ -12105,7 +12177,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "sp-std", @@ -12117,7 +12189,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "sp-api", "sp-runtime", @@ -12126,7 +12198,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "log", @@ -12142,10 +12214,10 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ahash 0.8.3", - "hash-db", + "hash-db 0.16.0", "hashbrown 0.12.3", "lazy_static", "memory-db", @@ -12158,14 +12230,14 @@ dependencies = [ "sp-std", "thiserror", "tracing", - "trie-db 0.25.1", + "trie-db 0.27.1", "trie-root", ] [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12182,7 +12254,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -12193,7 +12265,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -12207,7 +12279,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "parity-scale-codec", "scale-info", @@ -12408,7 +12480,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "platforms 2.0.0", ] @@ -12416,7 +12488,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -12435,7 +12507,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "hyper", "log", @@ -12447,7 +12519,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "jsonrpsee", @@ -12460,7 +12532,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "jsonrpsee", "log", @@ -12473,13 +12545,13 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-trie", - "trie-db 0.25.1", + "trie-db 0.27.1", ] [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "futures", "substrate-test-utils-derive", @@ -12489,7 +12561,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12500,7 +12572,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "ansi_term", "build-helper", @@ -12542,9 +12614,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -12629,7 +12701,6 @@ name = "tests" version = "0.1.1" dependencies = [ "evm-coder", - "fp-evm-mapping", "frame-support", "frame-system", "pallet-balances", @@ -12674,7 +12745,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -12854,7 +12925,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -13008,8 +13079,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -13019,8 +13090,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -13079,7 +13150,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ - "hash-db", + "hash-db 0.15.2", "hashbrown 0.12.3", "log", "smallvec", @@ -13087,11 +13158,11 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", "log", "rustc-hex", @@ -13100,11 +13171,11 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -13113,7 +13184,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -13172,7 +13243,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41#980eb16791bab5d63b47c07657bb9dc198d9307b" dependencies = [ "async-trait", "clap", @@ -13335,7 +13406,7 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unique-node" -version = "0.9.39" +version = "0.9.41" dependencies = [ "app-promotion-rpc", "clap", @@ -13374,6 +13445,7 @@ dependencies = [ "sc-consensus-manual-seal", "sc-executor", "sc-network", + "sc-network-sync", "sc-service", "sc-sysinfo", "sc-telemetry", @@ -13420,8 +13492,9 @@ dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc", "sc-client-api", - "sc-finality-grandpa", + "sc-consensus-grandpa", "sc-network", + "sc-network-sync", "sc-rpc", "sc-rpc-api", "sc-service", @@ -13441,7 +13514,7 @@ dependencies = [ [[package]] name = "unique-runtime" -version = "0.9.39" +version = "0.9.41" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -13455,7 +13528,6 @@ dependencies = [ "derivative", "evm-coder", "fp-evm", - "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -13579,7 +13651,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.39" +version = "0.9.41" dependencies = [ "cumulus-primitives-core", "fp-rpc", @@ -13638,7 +13710,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.39#7e74e3937a2c08bf29a00084a5c2f1ca6676d87a" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#65d810e69aa1f5d79e08d0d4e607ffd70c877603" dependencies = [ "impl-trait-for-tuples", ] @@ -14344,7 +14416,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix 0.24.3", + "nix", "rand 0.8.5", "thiserror", "tokio", @@ -14353,8 +14425,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bitvec", "frame-benchmarking", @@ -14379,7 +14451,7 @@ dependencies = [ "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-grandpa", - "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39)", + "pallet-identity 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.41)", "pallet-im-online", "pallet-indices", "pallet-membership", @@ -14421,9 +14493,9 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -14445,8 +14517,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-support", "polkadot-primitives", @@ -14802,8 +14874,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "bounded-collections", "derivative", @@ -14818,8 +14890,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "frame-support", "frame-system", @@ -14839,8 +14911,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "environmental", "frame-benchmarking", @@ -14859,8 +14931,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.39-1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.39#c22e1c4173bf6966f5d1980f4299f7abe836f0c1" +version = "0.9.41" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.41#e203bfb396ed949f102720debf32fb98166787af" dependencies = [ "Inflector", "proc-macro2", @@ -14908,7 +14980,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b510014f68..d7eeb6c0b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ members = [ 'runtime/tests', 'runtime/unique', ] -package.version = "0.9.39" +package.version = "0.9.41" resolver = "2" [profile.release] @@ -29,7 +29,7 @@ opt-level = 3 app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false } evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.1", default-features = false } pallet-app-promotion = { path = "pallets/app-promotion", default-features = false } -pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.41" } pallet-collator-selection = { default-features = false, path = "pallets/collator-selection" } pallet-common = { default-features = false, path = "pallets/common" } pallet-configuration = { default-features = false, path = "pallets/configuration" } @@ -56,7 +56,7 @@ up-common = { path = "primitives/common", default-features = false } up-data-structs = { path = "primitives/data-structs", default-features = false } up-pov-estimate-rpc = { path = "primitives/pov-estimate-rpc", default-features = false } up-rpc = { path = "primitives/rpc", default-features = false } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.41" } # Unique: Runtimes opal-runtime = { path = "runtime/opal" } @@ -64,124 +64,124 @@ quartz-runtime = { path = "runtime/quartz" } unique-runtime = { path = "runtime/unique" } # Frontier (Unique patches over the Parity version) -fc-consensus = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fc-consensus = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } # Parity codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = "3.2.2" } -cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-pallet-aura-ext = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-pallet-dmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-pallet-parachain-system = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-pallet-xcm = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-pallet-xcmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-primitives-core = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-primitives-timestamp = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-primitives-utility = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-preimage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.39" } -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } -polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-pallet-aura-ext = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-pallet-dmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-pallet-parachain-system = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-pallet-xcm = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-pallet-xcmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-primitives-core = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-primitives-timestamp = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-primitives-utility = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-preimage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41", default-features = false } +parachain-info = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.41" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41" } +polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-version = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.41", default-features = false } # Parity: Build utils -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } # Parity: Benchmarking -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } # Parity: Try Runtime -frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } # ORML -orml-tokens = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } -orml-traits = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } -orml-vesting = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } -orml-xtokens = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } -orml-xcm-support = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } +orml-tokens = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.41" } +orml-traits = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.41" } +orml-vesting = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.41" } +orml-xtokens = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.41" } +orml-xcm-support = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.41" } # Other derivative = { version = "2.2.0", features = ["use_core"] } @@ -219,4 +219,89 @@ cumulus-relay-chain-inprocess-interface = { git = "https://github.com/uniquenetw cumulus-relay-chain-interface = { git = "https://github.com/uniquenetwork/cumulus", branch = "polkadot-v0.9.39" } cumulus-relay-chain-minimal-node = { git = "https://github.com/uniquenetwork/cumulus", branch = "polkadot-v0.9.39" } parachain-info = { git = "https://github.com/uniquenetwork/cumulus", branch = "polkadot-v0.9.39" } +pallet-template-transaction-payment = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +up-sponsorship = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +fc-consensus = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fc-db = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fc-rpc = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fp-evm = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fp-rpc = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fp-self-contained = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +fp-storage = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-base-fee = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-evm = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-evm-precompile-simple = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 04a0f88b70..ba67ac289a 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -56,6 +56,7 @@ sc-consensus = { workspace = true } sc-consensus-manual-seal = { workspace = true } sc-executor = { workspace = true } sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-service = { workspace = true } sc-sysinfo = { workspace = true } sc-telemetry = { workspace = true } diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 268b2f6009..6dfdbbbc16 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -44,14 +44,15 @@ use cumulus_client_cli::CollatorOptions; use cumulus_client_network::BlockAnnounceValidator; use cumulus_primitives_core::ParaId; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; -use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; +use cumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node; // Substrate Imports use sp_api::BlockT; use sc_executor::NativeElseWasmExecutor; use sc_executor::NativeExecutionDispatch; -use sc_network::{NetworkService, NetworkBlock}; +use sc_network::NetworkBlock; +use sc_network_sync::SyncingService; use sc_service::{BasePath, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sp_keystore::SyncCryptoStorePtr; @@ -420,7 +421,7 @@ where &TaskManager, Arc, Arc>>, - Arc>, + Arc>, SyncCryptoStorePtr, bool, ) -> Result>, sc_service::Error>, @@ -445,10 +446,7 @@ where hwbench.clone(), ) .await - .map_err(|e| match e { - RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x, - s => s.to_string().into(), - })?; + .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface.clone(), id); @@ -458,7 +456,7 @@ where let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let (network, system_rpc_tx, tx_handler_controller, start_network) = + let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: ¶chain_config, client: client.clone(), @@ -475,6 +473,7 @@ where let rpc_pool = transaction_pool.clone(); let select_chain = params.select_chain.clone(); let rpc_network = network.clone(); + let rpc_sync_service = sync_service.clone(); let rpc_frontier_backend = frontier_backend.clone(); @@ -532,6 +531,7 @@ where enable_dev_signer: false, filter_pool: filter_pool.clone(), network: rpc_network.clone(), + sync: rpc_sync_service.clone(), select_chain: select_chain.clone(), is_authority: validator, // TODO: Unhardcode @@ -558,6 +558,7 @@ where keystore: params.keystore_container.sync_keystore(), backend: backend.clone(), network: network.clone(), + sync_service: sync_service.clone(), system_rpc_tx, telemetry: telemetry.as_mut(), tx_handler_controller, @@ -577,9 +578,9 @@ where } let announce_block = { - let network = network.clone(); + let sync_service = sync_service.clone(); Arc::new(Box::new(move |hash, data| { - network.announce_block(hash, data) + sync_service.announce_block(hash, data) })) }; @@ -598,7 +599,7 @@ where &task_manager, relay_chain_interface.clone(), transaction_pool, - network, + sync_service.clone(), params.keystore_container.sync_keystore(), force_authoring, )?; @@ -896,7 +897,7 @@ where prometheus_registry.clone(), )); - let (network, system_rpc_tx, tx_handler_controller, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, client: client.clone(), @@ -1032,6 +1033,7 @@ where let rpc_client = client.clone(); let rpc_pool = transaction_pool.clone(); let rpc_network = network.clone(); + let rpc_sync_service = sync_service.clone(); let rpc_frontier_backend = frontier_backend.clone(); #[cfg(feature = "pov-estimate")] @@ -1062,6 +1064,7 @@ where enable_dev_signer: false, filter_pool: filter_pool.clone(), network: rpc_network.clone(), + sync: rpc_sync_service.clone(), select_chain: select_chain.clone(), is_authority: collator, // TODO: Unhardcode @@ -1081,6 +1084,7 @@ where sc_service::spawn_tasks(sc_service::SpawnTasksParams { network, + sync_service, client, keystore: keystore_container.sync_keystore(), task_manager: &mut task_manager, diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index ae9b4838c8..a5c373db3b 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -14,8 +14,9 @@ jsonrpsee = { workspace = true } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } pallet-transaction-payment-rpc = { workspace = true } sc-client-api = { workspace = true } -sc-finality-grandpa = { workspace = true } +sc-consensus-grandpa = { workspace = true } sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-service = { workspace = true } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index c57274caac..391eea32cd 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -27,10 +27,11 @@ use sc_client_api::{ client::BlockchainEvents, StateBackend, Backend, }; -use sc_finality_grandpa::{ +use sc_consensus_grandpa::{ FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState, }; use sc_network::NetworkService; +use sc_network_sync::SyncingService; use sc_rpc::SubscriptionTaskExecutor; pub use sc_rpc_api::DenyUnsafe; use sc_transaction_pool::{ChainApi, Pool}; @@ -75,6 +76,8 @@ pub struct FullDeps { pub enable_dev_signer: bool, /// Network service pub network: Arc>, + /// Syncing service + pub sync: Arc>, /// Whether to deny unsafe calls pub deny_unsafe: DenyUnsafe, /// EthFilterApi pool. @@ -162,6 +165,12 @@ where CA: ChainApi + 'static, R: RuntimeInstance + Send + Sync + 'static, ::CrossAccountId: serde::Serialize, + C: sp_api::CallApiAt< + sp_runtime::generic::Block< + sp_runtime::generic::Header, + sp_runtime::OpaqueExtrinsic, + >, + >, for<'de> ::CrossAccountId: serde::Deserialize<'de>, { use fc_rpc::{ @@ -191,6 +200,7 @@ where enable_dev_signer, is_authority, network, + sync, deny_unsafe, filter_pool, @@ -225,7 +235,7 @@ where pool.clone(), graph, Some(::get_transaction_converter()), - network.clone(), + sync.clone(), signers, overrides.clone(), eth_backend.clone(), @@ -280,9 +290,7 @@ where io.merge(Web3::new(client.clone()).into_rpc())?; - io.merge( - EthPubSub::new(pool, client, network, subscription_task_executor, overrides).into_rpc(), - )?; + io.merge(EthPubSub::new(pool, client, sync, subscription_task_executor, overrides).into_rpc())?; Ok(io) } diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index b554f27504..5f303d6323 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -152,7 +152,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::event] diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index 47e48b97f5..5493d16343 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -161,7 +161,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// The invulnerable, fixed collators. diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 1247b1f289..f9a4efb10e 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -462,7 +462,6 @@ pub mod pallet { #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::extra_constants] diff --git a/pallets/configuration/src/lib.rs b/pallets/configuration/src/lib.rs index a71bf6ed2a..10d6756e58 100644 --- a/pallets/configuration/src/lib.rs +++ b/pallets/configuration/src/lib.rs @@ -249,7 +249,6 @@ mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 3a67a8b500..f067a6931e 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -70,7 +70,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(trait Store)] pub struct Pallet(_); /// Store owner for contract. diff --git a/pallets/evm-migration/src/lib.rs b/pallets/evm-migration/src/lib.rs index cb57457e4c..6e532e891f 100644 --- a/pallets/evm-migration/src/lib.rs +++ b/pallets/evm-migration/src/lib.rs @@ -46,7 +46,6 @@ pub mod pallet { type SelfWeightOf = ::WeightInfo; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::event] diff --git a/pallets/evm-transaction-payment/src/lib.rs b/pallets/evm-transaction-payment/src/lib.rs index 6bf0976fab..184aa25850 100644 --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -50,7 +50,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); } diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index abdc3e7324..10042aaac4 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -141,7 +141,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// Total amount of fungible tokens inside a collection. diff --git a/pallets/identity/src/lib.rs b/pallets/identity/src/lib.rs index 24510ba60e..a4562d8d71 100644 --- a/pallets/identity/src/lib.rs +++ b/pallets/identity/src/lib.rs @@ -169,7 +169,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// Information that is pertinent to identify the entity behind an account. diff --git a/pallets/inflation/src/lib.rs b/pallets/inflation/src/lib.rs index df35262366..9c754cacf5 100644 --- a/pallets/inflation/src/lib.rs +++ b/pallets/inflation/src/lib.rs @@ -78,7 +78,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// starting year total issuance diff --git a/pallets/maintenance/src/lib.rs b/pallets/maintenance/src/lib.rs index 226c391d18..e86ca882c8 100644 --- a/pallets/maintenance/src/lib.rs +++ b/pallets/maintenance/src/lib.rs @@ -66,7 +66,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::storage] diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index b10eccbfb7..25347a9c17 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -175,7 +175,6 @@ pub mod pallet { #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// Total amount of minted tokens in a collection. diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 8d96adc65d..7e7f0de700 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -158,7 +158,6 @@ pub mod pallet { #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// Total amount of minted tokens in a collection. diff --git a/pallets/scheduler-v2/Cargo.toml b/pallets/scheduler-v2/Cargo.toml index fd8e975ca7..36ebdf119d 100644 --- a/pallets/scheduler-v2/Cargo.toml +++ b/pallets/scheduler-v2/Cargo.toml @@ -9,6 +9,9 @@ readme = "README.md" repository = "https://github.com/UniqueNetwork/unique-chain" version = "0.1.0" +[package.metadata.deppatcher.originals.dev-dependencies] +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } + [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. codec = { workspace = true, package = "parity-scale-codec" } @@ -25,7 +28,7 @@ sp-std = { workspace = true } [dev-dependencies] pallet-preimage = { workspace = true } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } [features] default = ["std"] diff --git a/pallets/scheduler-v2/src/lib.rs b/pallets/scheduler-v2/src/lib.rs index b82a2fd003..3e76666a97 100644 --- a/pallets/scheduler-v2/src/lib.rs +++ b/pallets/scheduler-v2/src/lib.rs @@ -460,7 +460,6 @@ pub mod pallet { const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); diff --git a/pallets/scheduler-v2/src/mock.rs b/pallets/scheduler-v2/src/mock.rs index cce1575307..6bda42fad8 100644 --- a/pallets/scheduler-v2/src/mock.rs +++ b/pallets/scheduler-v2/src/mock.rs @@ -65,7 +65,6 @@ pub mod logger { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(PhantomData); #[pallet::hooks] diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index b9a76fb840..80e750fd9d 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -56,8 +56,8 @@ impl> FindAuthor for EthereumFindAuthor { impl pallet_evm::Config for Runtime { type CrossAccountId = CrossAccountId; - type EvmAddressMapping = pallet_evm::HashedAddressMapping; - type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated; + type AddressMapping = HashedAddressMapping; + type BackwardsAddressMapping = HashedAddressMapping; type BlockGasLimit = BlockGasLimit; type FeeCalculator = pallet_configuration::FeeCalculator; type GasWeightMapping = pallet_evm::FixedGasWeightMapping; @@ -65,7 +65,6 @@ impl pallet_evm::Config for Runtime { type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressTruncated; type WithdrawOrigin = EnsureAddressTruncated; - type AddressMapping = HashedAddressMapping; type PrecompilesType = UniquePrecompiles; type PrecompilesValue = PrecompilesValue; type Currency = Balances; diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index d1f1abf3fd..0f083bca9d 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -76,7 +76,6 @@ std = [ "sp-consensus-aura/std", 'app-promotion-rpc/std', 'evm-coder/std', - 'fp-evm-mapping/std', 'fp-rpc/std', 'fp-self-contained/std', 'pallet-app-promotion/std', @@ -254,7 +253,6 @@ app-promotion-rpc = { workspace = true } derivative = { workspace = true } evm-coder = { workspace = true } fp-evm = { workspace = true } -fp-evm-mapping = { workspace = true } fp-rpc = { workspace = true } fp-self-contained = { workspace = true } log = { workspace = true } diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 063e1173c2..5710e93feb 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -51,7 +51,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 939054, + spec_version: 941054, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index e3a3b3c051..316fdda5a4 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -77,7 +77,6 @@ std = [ "sp-consensus-aura/std", 'app-promotion-rpc/std', 'evm-coder/std', - 'fp-evm-mapping/std', 'fp-rpc/std', 'fp-self-contained/std', 'pallet-app-promotion/std', @@ -245,7 +244,6 @@ xcm-executor = { workspace = true } app-promotion-rpc = { workspace = true } derivative = { workspace = true } fp-evm = { workspace = true } -fp-evm-mapping = { workspace = true } log = { workspace = true } pallet-app-promotion = { workspace = true } pallet-collator-selection = { workspace = true } diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 6d2c494f99..85a2ce83d1 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -54,7 +54,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 939054, + spec_version: 941054, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 31bfb14e83..50d000043d 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -3,6 +3,20 @@ edition = "2021" name = "tests" version = "0.1.1" +[package.metadata.deppatcher.originals.dependencies] +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +up-sponsorship = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-evm = { git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } + [features] default = ['refungible'] @@ -11,22 +25,20 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = "../../primitives/data-structs" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } - -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.39" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/unique-frontier", branch = "unique-polkadot-v0.9.41" } pallet-common.path = "../../pallets/common" pallet-fungible.path = "../../pallets/fungible" @@ -41,7 +53,7 @@ parity-scale-codec = { version = "3.2.2", default-features = false, features = [ scale-info = "*" evm-coder = { workspace = true } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.39" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.41" } xcm = { workspace = true } pallet-xcm = { workspace = true } pallet-configuration = { workspace = true } diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index 7cd1247ac7..d0680e631b 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -216,15 +216,14 @@ impl pallet_ethereum::Config for Test { impl pallet_evm::Config for Test { type CrossAccountId = TestCrossAccountId; - type EvmAddressMapping = TestEvmAddressMapping; - type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping; + type AddressMapping = TestEvmAddressMapping; + type BackwardsAddressMapping = TestEvmBackwardsAddressMapping; type RuntimeEvent = RuntimeEvent; type FeeCalculator = (); type GasWeightMapping = pallet_evm::FixedGasWeightMapping; type WeightPerGas = WeightPerGas; type CallOrigin = EnsureAddressNever; type WithdrawOrigin = EnsureAddressNever; - type AddressMapping = TestEvmAddressMapping; type Currency = Balances; type PrecompilesType = (); type PrecompilesValue = (); diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 1e285089ee..abc454922b 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -75,7 +75,6 @@ std = [ "sp-consensus-aura/std", 'app-promotion-rpc/std', 'evm-coder/std', - 'fp-evm-mapping/std', 'fp-rpc/std', 'fp-self-contained/std', 'pallet-app-promotion/std', @@ -263,7 +262,6 @@ up-rpc = { workspace = true } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } evm-coder = { workspace = true } fp-evm = { workspace = true } -fp-evm-mapping = { workspace = true } fp-rpc = { workspace = true } fp-self-contained = { workspace = true } num_enum = { workspace = true } diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 00b8de0224..9452f99d8a 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -51,7 +51,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 939054, + spec_version: 941054, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/test-pallets/utils/src/lib.rs b/test-pallets/utils/src/lib.rs index df207f2242..f10538062e 100644 --- a/test-pallets/utils/src/lib.rs +++ b/test-pallets/utils/src/lib.rs @@ -56,7 +56,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::storage] From e96f2a6aaec67b8c68e57c73cce2ba51a4a0b13e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Apr 2023 10:24:19 +0200 Subject: [PATCH 31/74] test: fix unit test build --- runtime/tests/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index d0680e631b..64ae4c4d71 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -30,10 +30,9 @@ use sp_runtime::{ use pallet_transaction_payment::CurrencyAdapter; use frame_system as system; use pallet_evm::{ - AddressMapping, account::CrossAccountId, EnsureAddressNever, SubstrateBlockHashMapping, + AddressMapping, account::CrossAccountId, EnsureAddressNever, SubstrateBlockHashMapping, BackwardsAddressMapping }; use pallet_ethereum::PostLogContent; -use fp_evm_mapping::EvmBackwardsAddressMapping; use parity_scale_codec::{Encode, Decode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -162,7 +161,7 @@ impl AddressMapping for TestEvmAddressMapping { } pub struct TestEvmBackwardsAddressMapping; -impl EvmBackwardsAddressMapping for TestEvmBackwardsAddressMapping { +impl BackwardsAddressMapping for TestEvmBackwardsAddressMapping { fn from_account_id(_account_id: u64) -> sp_core::H160 { unimplemented!() } From 2993020f2458dd027fb3ad927b11b612c8bf8185 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Apr 2023 10:26:34 +0200 Subject: [PATCH 32/74] style: fix formatting --- runtime/tests/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index 64ae4c4d71..543f64a09a 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -30,7 +30,8 @@ use sp_runtime::{ use pallet_transaction_payment::CurrencyAdapter; use frame_system as system; use pallet_evm::{ - AddressMapping, account::CrossAccountId, EnsureAddressNever, SubstrateBlockHashMapping, BackwardsAddressMapping + AddressMapping, account::CrossAccountId, EnsureAddressNever, SubstrateBlockHashMapping, + BackwardsAddressMapping, }; use pallet_ethereum::PostLogContent; use parity_scale_codec::{Encode, Decode, MaxEncodedLen}; From eddd70a301c002b844486c7ed5af9c047eb8f9b6 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 14 Apr 2023 16:37:23 +0700 Subject: [PATCH 33/74] fix reusable workflows --- .github/workflows/ci-develop.yml | 5 ----- .github/workflows/ci-master.yml | 33 ++++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 277d9e78ee..3911a9e2ea 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -41,11 +41,6 @@ jobs: uses: ./.github/workflows/collator-selection.yml secrets: inherit - # forkless: - # if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. - # uses: ./.github/workflows/forkless.yml - # secrets: inherit - forkless-update-data: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/forkless-update-data.yml diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 6c1622c71d..698feda7f6 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -18,15 +18,11 @@ jobs: yarn-dev: uses: ./.github/workflows/yarn-dev.yml + secrets: inherit unit-test: uses: ./.github/workflows/unit-test.yml - - node-only-update: - uses: ./.github/workflows/node-only-update.yml - - forkless: - uses: ./.github/workflows/forkless.yml + secrets: inherit # canary: # uses: ./.github/workflows/canary.yml @@ -38,13 +34,30 @@ jobs: collator-selection: uses: ./.github/workflows/collator-selection.yml + secrets: inherit - # testnet: - # uses: ./.github/workflows/testnet-build.yml - # secrets: inherit # pass all secrets from initial workflow to nested + forkless-update-data: + uses: ./.github/workflows/forkless-update-data.yml + secrets: inherit # pass all secrets from initial workflow to nested + + forkless-update-no-data: + uses: ./.github/workflows/forkless-update-nodata.yml + secrets: inherit # pass all secrets from initial workflow to nested + + try-runtime: + uses: ./.github/workflows/try-runtime.yml + secrets: inherit # pass all secrets from initial workflow to nested + + node-only-update: + uses: ./.github/workflows/node-only-update.yml + secrets: inherit codestyle: uses: ./.github/workflows/codestyle.yml + secrets: inherit polkadot-types: - uses: ./.github/workflows/polkadot-types.yml \ No newline at end of file + uses: ./.github/workflows/polkadot-types.yml + + + \ No newline at end of file From e69c3debd10bf568d03f8376b08c56501d8753da Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 14 Apr 2023 16:38:16 +0700 Subject: [PATCH 34/74] fix reusable workflows --- .github/workflows/forkless.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/forkless.yml diff --git a/.github/workflows/forkless.yml b/.github/workflows/forkless.yml deleted file mode 100644 index 6edee3467c..0000000000 --- a/.github/workflows/forkless.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Intermediate Nested Workflow for calling subworkflows as a parallel tasks. - -# name: Nesting Forkless - -# on: -# workflow_call: - -# jobs: - -# forkless-update-data: -# name: with data -# uses: ./.github/workflows/forkless-update-data.yml -# secrets: inherit # pass all secrets from initial workflow to nested - -# forkless-update-no-data: -# name: no data -# uses: ./.github/workflows/forkless-update-nodata.yml -# secrets: inherit # pass all secrets from initial workflow to nested - -# try-runtime: -# name: try-runtime -# uses: ./.github/workflows/try-runtime.yml -# secrets: inherit # pass all secrets from initial workflow to nested From b77279fcac4df5a62d0cf45378201807fdc6f5f4 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 17 Apr 2023 08:19:13 +0000 Subject: [PATCH 35/74] feat: add crossBalanceOf --- pallets/nonfungible/src/erc.rs | 11 +++++ pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 6145 -> 6170 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 16 ++++++- pallets/refungible/src/erc.rs | 11 +++++ .../refungible/src/stubs/UniqueRefungible.sol | 16 ++++++- .../common/ethereum/sponsoring/refungible.rs | 1 + tests/src/eth/abi/nonFungible.json | 17 ++++++++ tests/src/eth/api/UniqueNFT.sol | 11 ++++- tests/src/eth/api/UniqueRefungible.sol | 11 ++++- tests/src/eth/nonFungible.test.ts | 32 ++++++++++++++ tests/src/eth/reFungible.test.ts | 40 ++++++++++++++++++ 11 files changed, 162 insertions(+), 4 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index e214ba8a4b..bc4a0c6c2e 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -755,6 +755,17 @@ where .map_err(|_| Error::Revert("token not found".into())) } + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An cross address for whom to query the balance + /// @return The number of NFTs owned by `owner`, possibly zero + fn cross_balance_of(&self, owner: eth::CrossAddress) -> Result { + self.consume_store_reads(1)?; + let balance = >::get((self.id, owner.into_sub_cross_account::()?)); + Ok(balance.into()) + } + /// Returns the token properties. /// /// @param tokenId Id for the token. diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index e18131270a46d45ac3cf64142af80cc19584f627..4c5786e986f9317038604fe49084e3b843772830 100644 GIT binary patch literal 6170 zcma)A3vg7`8Q#-PU^mHbcC!zN$;g6^sP$Q0sY+$Vp+kMtyE~9YSIapGRH+b=M^T}A zpPLux-AzcKIu2^9*iJ1)#-ff|txoM!u$5XBEugJ+sMe0vsrZQW`_Fx30M{a!vEOl!~o% zl=u`qPI_L39vH(jT82-t7_V>F7|)brgxg+JR1nHjok6yy$@4u$U7ODt1IZIGSW)QH zQPT39;V0J?)THP`MGzdqXGTW}Zp1YF3Y+tAa9Kym#GgKxkx}^+BMwiJz|Ms+CN#6t zi;88ie2E8Id9ZA^wYR1@v+TA>)_m~o0bjuKjBYKbD+4JFxNY6x6*-jofmj^!hoU6zi z5+edJH!r;IoR|o{fTt`!(5`kZ8h&OZF4*Cs+O>1T<@*301MsC6E^3U6z%Ky4m+Af+ zz;!N|6cg40{Li=6*Z}(g{`dT6R{*?=z#aQ{Bt_jljxI+GP4vD$B!-pcoD!om(1S@Wvw1B znGX%4Ks{3TS`bu?03SR3$_1cW4)F2nrt@&>GpxSp;+gQb3e?6|?zj-3a6u_n?b?~kMIAB3sxT9{~hqo@)){* z^T7L1wi^rtx=~raML!eZA8@+j#NSQ__y&RI-_sD|+f3zVv6o+ z*amR9tE`jVX1coA;osj6kld~Bf64+;9N>h}eJE!X0on(8s|da=f^VL~>qKZBZv2FY zI!XZ?ekOt+$-}$o@MZLxT;5KlsNFDv)k@I*K++LX)J+u=K9oeFE>y8aI7){zT_NGA z5+xhsmbRc>NlQ5(1(mNqoUeUq$c%fMS^L!ZHlFH+e7kC-L8oKTb}=ztV^GtnwE~*R zRbO$_JB~QVW2w0AGf^k~kK6~`IM*U?;-tP^)K8-LkZWS%(i%Bl(?EGJ(-SY-cw@pILci_=|x@g`8Akqtfh1^QW@`H zG7FLk_kH2;Q=|o>IN$m0wq5+KHk3&n6BBl$K2ul9j8PS1g9v;X75_41PR*-2(+gN1 z3Y=r>UoVNLBC)!%uZecBis}DVsNeD>i%_cwor$G~+JfgrDDLCOoKR(iGE9UzseAAo z@>0N|+foQirrHJkQnM1ocY7C^krU`tAbZgY-BXhatw+&0hfF^X*tg_cF` z7&gXWtCl8#BhERry;sEMXEBZC%LYSIVC9QgmQWWNz04S#<5OC(p|P~Z zumO4*%E0Xagz}8ROc8nxvGYv`pXI1hveJ6hu>{S}F~s!@spUDtBCo=WT(82*3=uxB zqcp@bgZ3cH4$7?5Zm~7HFN(y*s!BgO+BkJRHVLvGD&ix;Ybl!)QG^_;E`t~8BT&Bq z>Nh-UFW5OJ*x^rIvl@aTTtR{q(Gb<8fs}NeWn~$=MH%2OTf;Y8w$O+HchGRiRqnXj zaJeV*3e%LxA)c%8Ro+MG5VmvCpce6w<|(|sjS7vV>6DKa(Qt<&%T2Wm0(f?SXNTkw z4ZrhT2dfA_f@;+YCUS<%lK9tM0X%~hADNuN0~Ol-Sp|2`FD+MHV}q|QBO0fO#$yc8 zKnWD~v)vmUgD5Z*~F}rL+L*oSw4@#+IVnY{=uNU2VfVnF9*oZGK0aY6<*}b?% zIej3AR52|9%sLk%8WAcapvPoc179sf9|{H1|}=0dCn0Z8&{`V(V1=7TrD%Zq#90SjJ#f` znykthB8eQB%oa^okx`lv%XBv*0asxpj3nT0RuvJMB*oAZLX$&Q zZ1P;G))Z&to32H;BqB1`ua=_}O5_@c{K$nuIgj)c1?ogZHuaT_0XLr}jCL{^xsKF( zoiei1*Y9@-2-)qNipXA5MeFwjW3K;9}ep`(`<~kdF z#%ZfZsN?84nxIAtUsrKE9N4?APuHYuy7%S)k%#z>DMe~ZH zXznx(L`(K;a*-AR^zeLz6;N2Hd>bqjm}cy}N@Zl&2@B#}{j5H;_H z1-nJ_tsNz+fVTvxRM}$k!ue{qllOiAn?G|MjnyN6Xmu1oT;y?`AU4$@GBIK_R!)eR z+yB+9h~-fCy6lqlilrXctW9SIZax}huYszLEp)ia`I2s;v|?sa#8x|Z&1na+55yK> zIdI#Q*Jb=-kNwm&l-2^emNibqo^o(UY-3*fYw6#2WyL=6sz$^^JYzb2L*8`REs`1mW%sh-6GLsPOv#NYAcAELBnoxEk` z28xSVt)LBkwf=vMjxe>*up*3252kp3^=eT7EUI;3iPP8L$GkDua^S zKqc4mq9@5>LrO`vP;`kii%8Jzl*tw^|1BR&Gx7Q@8xx6%4wIGD3L=62-{X{n++A7mNbyyOZB;6pH@Tfx4n}92`SRW_yDY6Dsk4jtjCENR+Iz}ax-b$^5S(MN_xpTmvXej> zw*hmW#+k0QR}|Gqt0INDFhCr32IIU;<2?0#QJZIC&e9<0!#CDfI!Xq^ zSS~3;wW0X@o<&QRe}CnIX)T#cFL`ip{^sFzPcD3NQs>rnckiFKKqChAXIBV6lOIBvOuJ2y8LUgUl0A8|e`O?M97I&{&yePAzJJT&zE&1W% F{{eBmB*y>% literal 6145 zcma)A3y@RQ8O|}gOR|q_l1&1*j08}8)Jm-ee6_M z|Nj5;oj;fF=h-};&Q(pz+ns^&Z}QD&a|S9f)zM zGMiCQEQ95WJTQ?5OLqIDi7C!3yM4U10CIaE7qC31Czeu`qAopSw-)+JET=CRG}$2X zT4A;cFWEwPY3bxU+gK=DEGPB$+3oyb3aYgQ6o8^YLThLC0>mOx(~woRg9py$fzL*` zin^gNA`o@!!s}*6MetcXW%&L{YS*HnXNO~g9WJO{JJwyc7v!-ZUwP^LrkDu)66A;J z?sq}n;gSi_&Z{2KzTn_Tz=RVg1(js!(zHJFnH|*GQ)L`o@Z0+m0^W21}e+uOO z)q7WC^&*f5tOL)1obL%d+p}i{j2*xhk=TlW+I0{4TMUh_g4|mFT#a2ldj(J_n0{5Bj}nlwCp;NI>?1>Q@b)vm}3jlYhG;I-JAF!Ve^56*N+2n>Uq`f_muL2MC;E$ZCRg!q3!QX0coZFv;r zTq1vWArgeXl2EC3vLBhQ0d{!T7La?vRKMnF3rr0KU!{!H@Grl?DahBqaX2p+1~BJ?>ep6)6Mhvb$- z!_DnMyONT6zzQzke)z1~r^az(o~G44HNA+Zx_;lU8f~!YIJ8AH9ISDuIZ>;inL_mq zH@{5k-W7FwDdLuOcp4K-%Py?c2Swco?Ncyf+~qa8BbSnVzZa|<24!+Ik7L7$bkm-f zc&X8skK8>*8(H%?BjjnlKGwa~23j2c!r~pZa;>}Z1AEY`CZrcX)UKykz2+Fn3x2XhIL<9 zdKyEGppuQo#}Z@33<*jT(G=7 zY7Vw++?r(7F(|q13RqRh5VverVhY-t7&pCOD@wIO;{tb76LY|0mgn*4+hcY0kS<%X z$EZ4r-JcTg`YJB@ufqMjuUUiwA~XTB4FQ24#X*06Gze8@D9uD@F5v~wqAqzXx*$Tk zI*Nllz208W zGV5hkYKPUD5f@EjVm9bImzWfCBBFJ$hOGNSQUUg!`N z;mzn)EpMV`s4S^}##O-6nB-B(Sv*joA)i%n_WaiJ%zfgUON*uk(ZmeVNPtgzb!4Qz zYFFD$v{FUWm|Zeqq3Hxi2CY;yF^G$%X9{jVz+IJMY?5Q1cBp9g;TUE0fgno7v^MN? zkuY{d(^6T0vdJ>`DU|_Pmn&TY#v2k>&6`k3J&D9dKi>l#d#>naUs>!OHA(NiD}IDo-U z-@#X80`)dn-u(iIb`8MO5}nQF_dSCjqhE10t57o{)zA}ClSNf*id?DIG-u0X*CQMf z(K5sDmZLOE%cTzcksF0--m-!?s2f`D>Mt1sZaqyn?NqWQPv$+OY`M?3?;`}1YT6mItPY$f=qk*N6Jq&>)Q2s5-tSi^ zV)DTGX78cs{RFnY>jv8T0qO^+qXgn0k3oWH$YC;Z#b~V5CZaC>s~HhJ5q+;ql%zK) z^*CnjIx}$c0g!zLx;lE1BTc~U0M*)E1k3Ez=6bp=sXMuE=+kS<2QSBt?MX_ z1#~QHf`~rk?CD2>F|Yi!{I9#ZqHlX$BcdPiwCUi6Jn0hS2qjdmT4jQXnEU-%#Kv3F zgY}Atoxsz8Mh7%_)?(xV$Dh$V8-m|;&BZP+>wON66OeAG3<6P{NZh+K*5k3>;ohBu zK1TuO(I$>!kII&D>XwlcC=Oz^0vIqED-#;U zT>PiJIFnS{tb(PH=D1&fT&h{kxzCWI`01|t_}R{FCNC8dxWwDIasd5>1X(V)Y5B4Y zkeF_Cm~ca~483w&!@omAK)md((>x;L8^<(U12vohFL0{TXt{ONa`DGJO%@wein@iS zYnxC&f$pYC#=ZK-_e(eNmMs$%@eds#E2HH_9Qa>$+Cff0081PUa*C=vsEGJeXjZx- z=%Q8Wx}`j=$8R`+?I6Kk&FQXbzc%+f`w`owVbP(lx#N6DJ_r3L$R-Ut5*RJsVx*l^3Hk z&3rkwOO&NiB-viTXB1^sSTC0_bm2-wLvW74-pBdGVW)s}-3HA08fUsTsiLSxN)<_r ze|H(Fs#3HJytfuf)qibm<+=0L+B#H(ZUfkwW*T0?CVx_(7sev_D4f^}-G}iGSkIfu zB+jnRh7@NtFhCM^8rOM=uJh#U1#P~GdzLPOetctnvZH7)T+2meur?JV4=h@;{F;>u zr^eH({&B$>C!X+8xWByV<}E+Je$nv3KQ){?^3BDc&AO-aF9TEOEn0cwvaa(3p=jWY q-s_gEOn2Sb-P Result { + self.consume_store_reads(1)?; + let balance = >::get((self.id, owner.into_sub_cross_account::()?)); + Ok(balance.into()) + } + /// Returns the token properties. /// /// @param tokenId Id for the token. diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 6162feab0b..2c68e4740f 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -774,7 +774,7 @@ contract ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0xb365c124 +/// @dev the ERC-165 identifier for this interface is 0x9780edce contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -815,6 +815,20 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return CrossAddress(0x0000000000000000000000000000000000000000, 0); } + /// @notice Count all RFTs assigned to an owner + /// @dev RFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An cross address for whom to query the balance + /// @return The number of RFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x24e52cea, + /// or in textual repr: crossBalanceOf((address,uint256)) + function crossBalanceOf(CrossAddress memory owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + /// Returns the token properties. /// /// @param tokenId Id for the token. diff --git a/runtime/common/ethereum/sponsoring/refungible.rs b/runtime/common/ethereum/sponsoring/refungible.rs index f3aab42acf..23659b6ca6 100644 --- a/runtime/common/ethereum/sponsoring/refungible.rs +++ b/runtime/common/ethereum/sponsoring/refungible.rs @@ -227,6 +227,7 @@ mod erc721 { | Symbol | Description | CrossOwnerOf { .. } + | CrossBalanceOf { .. } | Properties { .. } | NextTokenId | TokenContractAddress { .. } diff --git a/tests/src/eth/abi/nonFungible.json b/tests/src/eth/abi/nonFungible.json index 4607aa9ad1..225fc47582 100644 --- a/tests/src/eth/abi/nonFungible.json +++ b/tests/src/eth/abi/nonFungible.json @@ -384,6 +384,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "owner", + "type": "tuple" + } + ], + "name": "crossBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 0fbde27162..fcf5d2544b 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -533,7 +533,7 @@ interface ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0x16de3152 +/// @dev the ERC-165 identifier for this interface is 0x323b1db8 interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -557,6 +557,15 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// or in textual repr: crossOwnerOf(uint256) function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An cross address for whom to query the balance + /// @return The number of NFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x24e52cea, + /// or in textual repr: crossBalanceOf((address,uint256)) + function crossBalanceOf(CrossAddress memory owner) external view returns (uint256); + /// Returns the token properties. /// /// @param tokenId Id for the token. diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 6f115228b4..c39f3bdbf7 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -533,7 +533,7 @@ interface ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0xb365c124 +/// @dev the ERC-165 identifier for this interface is 0x9780edce interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -557,6 +557,15 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// or in textual repr: crossOwnerOf(uint256) function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// @notice Count all RFTs assigned to an owner + /// @dev RFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An cross address for whom to query the balance + /// @return The number of RFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x24e52cea, + /// or in textual repr: crossBalanceOf((address,uint256)) + function crossBalanceOf(CrossAddress memory owner) external view returns (uint256); + /// Returns the token properties. /// /// @param tokenId Id for the token. diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 066c114e80..104a47e0d5 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -662,6 +662,38 @@ describe('NFT: Plain calls', () => { // Cannot transfer token if it does not exist: await expect(collectionEvm.methods[testCase](receiver, 999999).send({from: sender})).to.be.rejected; })); + + itEth('Check crossBalanceOf()', async ({helper}) => { + const collection = await helper.nft.mintCollection(minter, {}); + const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); + + expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === 0n).to.be.true; + + for (let i = 1n; i < 100n; i++) { + await collection.mintToken(minter, {Ethereum: owner.eth}); + expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === i).to.be.true; + } + }); + + itEth('Check crossOwnerOf()', async ({helper}) => { + const collection = await helper.nft.mintCollection(minter, {}); + let owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); + const {tokenId} = await collection.mintToken(minter, {Ethereum: owner.eth}); + + for (let i = 1n; i < 100n; i++) { + const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + expect(ownerCross.eth).to.be.eq(owner.eth); + expect(ownerCross.sub).to.be.eq(owner.sub); + + const newOwner = await helper.ethCrossAccount.createAccountWithBalance(donor); + await collectionEvm.methods.transferCross(newOwner, tokenId).send({from: owner.eth}); + owner = newOwner; + } + }); }); describe('NFT: Fees', () => { diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 47fca4af42..b638ec8219 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -584,6 +584,46 @@ describe('Refungible: Plain calls', () => { expect(event.returnValues.to).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); expect(event.returnValues.tokenId).to.equal(tokenId.toString()); }); + + itEth('Check crossBalanceOf()', async ({helper}) => { + const collection = await helper.rft.mintCollection(minter, {}); + const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); + + expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === 0n).to.be.true; + + for (let i = 1n; i < 100n; i++) { + await collection.mintToken(minter, 100n, {Ethereum: owner.eth}); + expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === i).to.be.true; + } + }); + + itEth.only('Check crossOwnerOf()', async ({helper}) => { + const collection = await helper.rft.mintCollection(minter, {}); + let owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); + const {tokenId} = await collection.mintToken(minter, 100n,{Ethereum: owner.eth}); + + for (let i = 1n; i < 100n; i++) { + const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + expect(ownerCross.eth).to.be.eq(owner.eth); + expect(ownerCross.sub).to.be.eq(owner.sub); + + const newOwner = await helper.ethCrossAccount.createAccountWithBalance(donor); + await collectionEvm.methods.transferCross(newOwner, tokenId).send({from: owner.eth}); + owner = newOwner; + } + + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth, true); + const newOwner = await helper.ethCrossAccount.createAccountWithBalance(donor); + await tokenContract.methods.transferCross(newOwner, 50).send({from: owner.eth}); + const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + expect(ownerCross.eth.toUpperCase()).to.be.eq('0XFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'); + expect(ownerCross.sub).to.be.eq('0'); + }); }); describe('RFT: Fees', () => { From ab8fc135746e79c16072c1d11880140a588900c5 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 17 Apr 2023 14:02:25 +0000 Subject: [PATCH 36/74] Change prefixed names to postfixed --- pallets/nonfungible/src/erc.rs | 12 ++- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 6170 -> 6170 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 28 ++++--- pallets/refungible/src/erc.rs | 12 ++- .../refungible/src/stubs/UniqueRefungible.raw | Bin 6145 -> 6170 bytes .../refungible/src/stubs/UniqueRefungible.sol | 28 ++++--- .../common/ethereum/sponsoring/refungible.rs | 3 +- tests/src/eth/abi/nonFungible.json | 72 +++++++++--------- tests/src/eth/abi/reFungible.json | 55 ++++++++----- tests/src/eth/api/UniqueNFT.sol | 23 +++--- tests/src/eth/api/UniqueRefungible.sol | 23 +++--- tests/src/eth/nonFungible.test.ts | 10 +-- tests/src/eth/reFungible.test.ts | 10 +-- tests/src/eth/tokens/minting.test.ts | 10 +-- 14 files changed, 173 insertions(+), 113 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index bc4a0c6c2e..761b241d2b 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -749,18 +749,24 @@ where /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. + #[solidity(hide)] fn cross_owner_of(&self, token_id: U256) -> Result { + Self::owner_of_cross(&self, token_id) + } + + /// Returns the owner (in cross format) of the token. + /// + /// @param tokenId Id for the token. + fn owner_of_cross(&self, token_id: U256) -> Result { Self::token_owner(&self, token_id.try_into()?) .map(|o| eth::CrossAddress::from_sub_cross_account::(&o)) .map_err(|_| Error::Revert("token not found".into())) } /// @notice Count all NFTs assigned to an owner - /// @dev NFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of NFTs owned by `owner`, possibly zero - fn cross_balance_of(&self, owner: eth::CrossAddress) -> Result { + fn balance_of_cross(&self, owner: eth::CrossAddress) -> Result { self.consume_store_reads(1)?; let balance = >::get((self.id, owner.into_sub_cross_account::()?)); Ok(balance.into()) diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 4c5786e986f9317038604fe49084e3b843772830..bae4e0ff85a35c8abaef73b196267992b73a70ca 100644 GIT binary patch delta 1347 zcmY+DeQZ-z7{+&YZ@U(@_TGMMIL6kBA9Lu~jN=bR=GZh5hG8wzPAl0xbc>5@6Nife zk>1|kJB?A?dUU{0GKHuM2_p56nFYZJ@+G1n7=vsgagzFNAW@@aJZEiZm*ytF^S;mf zzR!D3I#e}Ob?_o7?#%yclT67}Pz{eQeyjyp4E(O=`C4|JG)6eMsA)f9m$yx9b5XMo zm^6~dfvvz_%xovHE2!kCH$rOo^xl16$}}g56i1|P1)jU@Mi;OKc)n@vsEdlX056)-5Np0+kTZzbl7>obFT%0Imm z-FZunC_c(j|DiBl(7So%GT_UI>Tg|mFT0js@$^{@cMEsyMXeR8?xQ1r0{P8u9M&S$ z;5ReVDlQsRGR^%Rxz(MYUj=Hwu-{t>xbDopzrGLA@<0UPv68%CVvIM~^N z=smy(KY3OI)@EwCf2jCFE`H|mM}hwWmo+E1K*g7@>m4xx|)y#4{Ec6_TKDX_EXutq)ogaLG$)xS&+7Ki5C{xaNe4_X`|B?AT(Fa z7~(Z484o#k;WXped6wt+maNoLGbT^a}tG%KDMsZj`i_49?O4CRruCV!!! z^$|MfCG7NnpK*3ja^>2tvCpI$lRrr94RN`gl(4(xha&!9)TjEC+^9tD2aq~I?X7{3 z;qN0px4X|E{InYTzl^$TVjuM-Zo@&{lLBUF; zGSbP~9gE13#DHU5Ag%1F!VXt@F)J2x-xtJ(#n{h<6P^X8vEGK#6Z4{n7ajj^vPrI6 XqjmVix`!(gMWesozULp7EULZ^c2u9rgQQV9fSpbbQG0_bT!DtOD7=cv&P!kgVVZrD0V;QDt@;lG_ zKJWXSd)tvUBWup3$+EuT=@T|e9)y(M$#=KR0ha-@CnipVLHj{kaU1CX+2 zgFCA9o@xAYCuaSP%9!zkDfqV**KiZg@1UfezB&r*0qP^4{!+l?SD9zvZ7Uk~e?9gu zM$e*)W8onj{77v9{s1*n_w6d+4UXEM70&3QOYsL>nEO)CYwZO`|I(jdDX9AmD?f(1 zuDGqPd-9fzmh$B7!~MH~DsY>_vlqx;1VQcCvX(l8}K}eiA})1=&{;i$QOzu z`5c_Xs6F+~Ar-g>xTXKc+rUG>uJOI~K)q;a?aB^f+eMT(qO=b9CS6|o;T+Pl1ZNiG1jekwt6uuz# z_o(6C07B*ee-h)VwR7P0=0>CwcNs8j+U|k+_3O zYx9EQrIL^RWb@Q_=LNngtZI^rN?M3Y16uCBYCeHR5>)DAmG&y@Cxxx%6Dm5`PJ08% zOeF2s3?#}9RP1&Zu4KWLT#tqD#g*8din*H2ou8%sgTqHIbzgG#j2=0i*}CUL=L~%_ Pe&BH0SH4kTS$E5S`6$>F diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index d303e68943..4182b3bee7 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -774,7 +774,7 @@ contract ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0x323b1db8 +/// @dev the ERC-165 identifier for this interface is 0x307b061a contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -803,12 +803,24 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return ""; } + // /// Returns the owner (in cross format) of the token. + // /// + // /// @param tokenId Id for the token. + // /// @dev EVM selector for this function is: 0x2b29dace, + // /// or in textual repr: crossOwnerOf(uint256) + // function crossOwnerOf(uint256 tokenId) public view returns (CrossAddress memory) { + // require(false, stub_error); + // tokenId; + // dummy; + // return CrossAddress(0x0000000000000000000000000000000000000000,0); + // } + /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. - /// @dev EVM selector for this function is: 0x2b29dace, - /// or in textual repr: crossOwnerOf(uint256) - function crossOwnerOf(uint256 tokenId) public view returns (CrossAddress memory) { + /// @dev EVM selector for this function is: 0xcaa3a4d0, + /// or in textual repr: ownerOfCross(uint256) + function ownerOfCross(uint256 tokenId) public view returns (CrossAddress memory) { require(false, stub_error); tokenId; dummy; @@ -816,13 +828,11 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } /// @notice Count all NFTs assigned to an owner - /// @dev NFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of NFTs owned by `owner`, possibly zero - /// @dev EVM selector for this function is: 0x24e52cea, - /// or in textual repr: crossBalanceOf((address,uint256)) - function crossBalanceOf(CrossAddress memory owner) public view returns (uint256) { + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) public view returns (uint256) { require(false, stub_error); owner; dummy; diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 9decb93903..59b7d029ab 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -783,7 +783,15 @@ where /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. + #[solidity(hide)] fn cross_owner_of(&self, token_id: U256) -> Result { + Self::owner_of_cross(&self, token_id) + } + + /// Returns the owner (in cross format) of the token. + /// + /// @param tokenId Id for the token. + fn owner_of_cross(&self, token_id: U256) -> Result { Self::token_owner(&self, token_id.try_into()?) .map(|o| eth::CrossAddress::from_sub_cross_account::(&o)) .or_else(|err| match err { @@ -795,11 +803,9 @@ where } /// @notice Count all RFTs assigned to an owner - /// @dev RFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of RFTs owned by `owner`, possibly zero - fn cross_balance_of(&self, owner: eth::CrossAddress) -> Result { + fn balance_of_cross(&self, owner: eth::CrossAddress) -> Result { self.consume_store_reads(1)?; let balance = >::get((self.id, owner.into_sub_cross_account::()?)); Ok(balance.into()) diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 45a6b0ca616f6c7068833df4e5ce74d3d3dd1b27..4d1230c1d54bfce0dc732ac1ee88ecab9b810f5c 100644 GIT binary patch literal 6170 zcma)A4UkjS70xxgOR_)N{KL9b0y^qA6{Q*-kxG=}_|w*x47)*7%e}i$MVA#}Q4wq3 zZ?emRzJz5L6&xzI>NxceMp0YERy*1vwo-pu70}i?w5VfsDiwi#=f3x{SqE%^g!Aq_ zfA^eozjN~V9-hhZ6S=BsIlId@{xiPu9L_-brr0{Z-|j3ZXQ~NMr{}p(Jy=k>eC+)?!m$pXj#tiH`DIdr0V^7FzmLna$S zT+7Th;U$|3FD;#XXY2AMi)E$We!HFTPeQfUK?hJ2NNDZM?!Z|@at5NxwsPM&-1q4r zt|D(pjPQlsyzsiS!ovRwp3;2JM76uuf8wTyV2AT+_tU3cF&E^qAa^hM@wpM<`vu64 zQoVl#d5cTNMZ*e^|N8cgHpl^x|33GHB_Qu6a?9>5aZxwq*mBgwMg4==+H>o!TfvnD zx!2nJ0?2tF_cg3p2Xc`o@Via-{sG4JVv9&@O#%7J2?rN}OoQBcX~$MrXao7$E3=xg zI?IzK_p$XMwtiJvHyw8OgM5C;&g;R|0P@8Zo$r8*djjRhcVCS2RdSUPV(Ng03LAdbd6B2}la= z;*I(=kQ+$j$-g-XtJ`Ms?Jr^!8r-oqc8Eg@W zt!IfG?ztKQr-GdQ+>JWOb3tC#v;6~*7kjegJ_HV6YlgD-W^B>X&s+9DJxB`q`Noys z1v$wRh<`Y}HzNF3Ve9zhM|~jAa!IIpl*p}1PzBP3ljm*yJII%@ddgp{!yrGbRfFfn z*qV@RApuIvgyHQZFa&bStA#@#*Lwni3DGZMY!kMK#1@rJ@Q3$p21&&fd}=nrCJQ2R z>g-}%`2Xa}cCp(``KWfY!!O+jlIp*H<#QJJ>5L5rccJ1?^nedwtMGpy{O_H`>qOud z-1vsgodq8jzZCw@<>KA6_y({hleH5Gf*VG(TK3zYNNvQ{{;HugWW^11sQ?*Y`za)LdswXw_u;RFIuNW7paiRH`S_REx zls9i9b$dkJTXe>j6?huse#;ZJvY{EoUGxs)YNAMu#%Zj(p{r`;>G-4aq5j$@xmOKA z==a#GUo_U4&|zBC$1b)m!(vsg^`%;!;iV+7S&T#OkSZr5;oFF1vU}w4L$%`JUA0dU zL~+#J$W3GR9;tnbT}hmtPI(lVZ8)8RDxb)MQHIzZV}xI(Jue4RRkiBkO|<7ld~9r; zY?a4`Bc6sp!_U96cmU@|E6#RZ*#0tqza2$W$3(*p)Mw%f85*i$Oc1`WbCrHVf3cCLoHAmroziLth+C*R)h8}_i?-YSZb$`^d zDkGF)BG5(X!86E94vQ|N&@P?9&f!ZN;3Iis2n@iP6#&wpO@vg=aw70i9+RKNG?pzI3`v2PuVPq2U8M9P zV>le2)P@O-B`t;t(9IBJpaM#H%3!7lyolIUT?n4xm{QWxd)4s-;O98vo(xIl8N;Ge z1?Rh`3NA84aC&E9h^N-rYgl@X%u4MPTQmD2nropFL4Jm9+3=oi5<5~PU6kS-mhr0Xm#%h;_}A9uwXzvYSr zMhqNhuMCarB}Q)1*pbIa+EjRbJ5>*{=oI9rXk6?_yZMtRgUkSA2BeH=T<@I+q9XVt zN>Iz0NCeVF>K}C#@D%2Dq~~nzE7M5N%D76^dhyKdu9{1U#?M6K$A)Mm%qP7%j#*!^ zEA1xgqpWGnE}F2=6mw)y9|aR*w`jsR;3OIDs&vMtvx!AJSg`wXH!}L5AMs~e3_DqO zM>Jh7qgpaq+Q9Dx(R6KfXZh-tMn7YsaUPt&birtv7@;k8)69|~@@)S75uN9)(qWrc!Mbz6F{&)F1B`z;(!H16muP{}J5o3x~W zLV7ll&~Z(4To~MNljYPb=ZKGu`%o$C%rk zE~4S*Ttodgd-dPkBST`Oc~A?B<`s@R$U+9;Lv?^v1^}Z=^N3_EE28;llxc|u0M?AW zIPevbK)wx@bARq320nONqzl*lntRaZU8bz(3e@bAYUuhQG#O;Yrjsj`n&NC}aXmui zi%Zt_vOap4qY9Wz=jCLsC6P@R2~_2B7_jtV*KRln~ML-Dy523h*}?l2M>u>9MQ_* zEkGhsw3xhmRkN~~s{w3%+dXLO`$#3aDFqOBdJHIpnZsnFg=nl86XB?{pr%C_nEA0T z0h3;#)Z@mr>&yTM04w_q6nJ>1!%T-S=q9QxJU=hO9nQ6LkU>I1_&aF+E@F9rQ?2{3 zigBi>n^e%2CpGosVbff18)ay6A?^i@xj#fFrEZlNe+)AC5r?Uc!=m;dO0q?>sCmJW;9I7i4zYdH}c z&r>C*9OMK9T*bv9rzp!qiirLh#Z2vlda_ELnd)Z^zTpJ6>Gs<-x4)+RV($EN#BzD(8Q6AJv(n;`{Ogrffe&j2UXSznBwoZJ^|}pOrMC z`%9~6rTgJ<>3; zl8q4TluN8k$Q;M-TBUr)Iv1H``*H@Kug89g!Zfuc&dlR8iozf-+PaibMCzU%2>3OXp6Bre;sua;R^{q3KgEeCm;H`!=NR3_h`;wC9@A z>&cT}+MbzZ&R=?6PxmZeAnZG%@9Kq1Q{C6~_AL?JeJRij7cK5tuxLSV--7w6g}td> K(YNr11^)#fODACf literal 6145 zcma)A3vg7`8Q$Y2VKz5#=>fJLjV*3kuDZ5ORnr0U%jve>nHP6AdcMhx+7>3!}d zJnG#gB&gL=?GzcOV@JV(+A6l<;EYvj26e;&McWP?t5s`ra*n8$OGzVN$Co($2v>h zS6+6{t^7a-4;1(u-caDD@W5z^GfkUf>uDAIT}A#AJzZ5wJflaoAXbcGz0`DHN~zjP zXNgbMV`S$I*nu-VqhP|s?MNW)8zU{QP&o7#=!C{999(i zbe6O{XZXo=1U0Gpa1jiL@tNIO!ZD&6eud2iSh%9IWa7^N+{mbWsu9CUlGwcr&X};w z&MGRF!SW>@n9PG^yJO1aG-sCGG0|EGxe>?(EYIo5<#e^AOV8L{#r`tO>k9`>Hi)=Z znQg*Lwg_HYI{D5v6e||XOTGPe2S1#KYHcAMKv5u}bufD&&LYw?5LLE~2hQh#kB@K_ zc|&4EAnN9YH_VEP;0t)l@&i-U?jLpCd2vjzqeZoQ+uE!4fjkl9o>wnviHX3kLB5~q zc?aaZE}0ZfT_8XD<{dW3^ z+_w^|b3q=m4($ZFz!P|(cjQ(WJA^GFu@wQi>z>ZPfSdyI)l)`q26;Njk@*X^!C1tT zCHGOg=dV?Qi_&+-SKoRC$m+KQbfboZF&kMRZ#f1 zmm*duF(;y3?5Cz{iyeJw6UcpFYFzca1*WDVFav-pf^Uo98?$(W2z8^)n;z&a1+e&` z2)-v5Em{Ps@m$_cr3hmf(P}kle=PZEQ#7PS(_YCWf}>Sigg&9gvt1?Okld1JxUnN> zSJP4tSi$An51&{6)I6d7spV19caQH$ojj~KF5EAg4%fNRa;RQG>p11Dn@HUr(XgA& z*w%%oaqhQ0TrV4$fv3ixXgEULbQm$=>N-o2E3pFSoQQeHph%9zar|*2J+$WqUTXB^ zBlnHdM%H}J$ZL3N)We@c9ZI6a-t$-Jk8I*xM-ae6tBa(>k%KC0(*@^k0-116_{rD^Tw77rpV zxN-Acb36XT|JH#rX<(vhD=IQIM`n!b7K1|Ii@5j~ZRXUxsx!TSDWSkQh6`4($IQW& zja!qfItC@TT?MNO8RC|uOH4sq6BA|@ZAGb7X0xL&05!zG4fM+p{<;w;`QsCuw%tWY*j9z98hvQQxV-RC$i(%07GL*rwasHJ& zV=z;Mo_E;r61n)iz4*A3B3C{KEI9J8@z*E&qpM^)39T{g+Wr;ZHjqhw;b z7A+f!Zj#}yN@r}5(}Ffyvis2+Iem2y@n>2BJLi!wc0@}~MzvzHtbwluqNU*P@U^Rq ze#S)eTsVQ|Fj&^srQX|p9&^orS#f!^0ahp%P%Kr0;lF4;f)XBDj|Kdr;QFQ3^0e!F zwyIEYoZ57w+%n>9ikAHr4kwzoc9y8*m6}ajGQc7|pGxUy6CDkM4mVjr&2x_U*yx8^ zRcE$gbG6Lul4>}SG4gt$X0jS*h$M1gGF!9)H_(VikaG?7-|E$W>(w$OMwW-QsA%nS z+(8y{2p_5gtTF(IUh7K9T2(~r8p^ap0|0AIHV%A6B#>`|72I!ih(Q3JmZ{-df9D>w zb*Cxoxdt^OQVq2qLX$&QY&yA8t1Hgd|F|AewX`+()pDFdX>%v|V;2hLylpNiq-tne zFi}Xgh?jjeuGJTy=ouEhAW7%?bbt z5n-Ak*M|n!&>)Q2$U46IiZ%=kioIc&9H4)60F`qG>LRmTUn4maq2End=cLTRI`^CM z#*Uzz43WjWjdJ5Tjfn}%>SGa6{aBoUVj07Czt$sXprnhme05F&(zk-YQYl@(5@Q@Qhgs}b&nC8E*_)=CWm7GGB&IU%Ah{;OFLJrymYOF*SJDUImJ z4xJeQ31Dfzfd+`m1{jrxFX<+#FnUu_M6Y$)(m@Uh8PWL|4qQa@0Lkx*=o;5i8Vjg{ z>ku#cn6sxJ3-P@4*Ym&W>Wco=s~QpgfM-kxVk9U?I3z$(xoTAiQDW|QZxNelNe|X3 zBK8%Y0g948H6V(`$ODc)V|O+Lzw4TdU0u=p9mprlU0)pp_&6tVdneZGvEJ+U4guA1 zFnp|tW1Af@&#G!<5%}11&Z?fp07DmQT*O}U^zWy%Wu3fbuGkS* zDdOTxQi<6`OC!y3KmWLYbDDGYAw==BUG?$vor_Q2KO}Iuw{h)i)E5GTQA^%^TA?Bj zNKCi526LD@=#|?l{%x8U;uX&ktc&=DaRt{z1!uqubX5i=x0XsSzTMMgu|cJzTPV83 zq#_b@A7wJ`_3xvVL^!$( zH#(PL;w48+Bt|UME+84VVd9|0b5y)|#IdO9>#jo|Vv~)oY%=osW^vjO`83%7xqVb; zib{?Y2TXbWlrd(g`TlZ2BySw3c-PM=8qtH5H8gTyg11+*npIO)d!t73*`mbOAdoKk z^CCVH>5Re}Lb^2=1Zt4*rjS*bLXrm3FuaNl6RcD#tV+n6#Mf4(djAF&dFA!x3_f3s z?Gj~aYDskz@fkx|71k?d%xAbgQ4pMCu=jC3dDKZD-OK@VfySAxO{prXkyb^j8!xVn zbWJH)2HsnXlwhG*NYi*5|pxXepW|)STu&IZN^uk!Ao`Mtmp!+D^0qX@bl|t|8 zY)Eld1FK2G&fw-R)6JiHv#2dFanI64Fo18Y&vljzh8w)34AzI@$RmrFF27;LqUrI> zzQlpuC;jG%6(=2f=(Ea$v-h5H@`>v9S4Jj%df_GK%sF`G(~DQ!vaI`(KqwkGr|-t4 nD>B`;^z`+L?!FA@r8h5Mw&dm|J$*|SXO{M4dPLvS+n4+gzQ-Jn diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 2c68e4740f..49d4614b00 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -774,7 +774,7 @@ contract ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0x9780edce +/// @dev the ERC-165 identifier for this interface is 0x95c0f66c contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -803,12 +803,24 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return ""; } + // /// Returns the owner (in cross format) of the token. + // /// + // /// @param tokenId Id for the token. + // /// @dev EVM selector for this function is: 0x2b29dace, + // /// or in textual repr: crossOwnerOf(uint256) + // function crossOwnerOf(uint256 tokenId) public view returns (CrossAddress memory) { + // require(false, stub_error); + // tokenId; + // dummy; + // return CrossAddress(0x0000000000000000000000000000000000000000,0); + // } + /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. - /// @dev EVM selector for this function is: 0x2b29dace, - /// or in textual repr: crossOwnerOf(uint256) - function crossOwnerOf(uint256 tokenId) public view returns (CrossAddress memory) { + /// @dev EVM selector for this function is: 0xcaa3a4d0, + /// or in textual repr: ownerOfCross(uint256) + function ownerOfCross(uint256 tokenId) public view returns (CrossAddress memory) { require(false, stub_error); tokenId; dummy; @@ -816,13 +828,11 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } /// @notice Count all RFTs assigned to an owner - /// @dev RFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of RFTs owned by `owner`, possibly zero - /// @dev EVM selector for this function is: 0x24e52cea, - /// or in textual repr: crossBalanceOf((address,uint256)) - function crossBalanceOf(CrossAddress memory owner) public view returns (uint256) { + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) public view returns (uint256) { require(false, stub_error); owner; dummy; diff --git a/runtime/common/ethereum/sponsoring/refungible.rs b/runtime/common/ethereum/sponsoring/refungible.rs index 23659b6ca6..8e8ae29974 100644 --- a/runtime/common/ethereum/sponsoring/refungible.rs +++ b/runtime/common/ethereum/sponsoring/refungible.rs @@ -227,7 +227,8 @@ mod erc721 { | Symbol | Description | CrossOwnerOf { .. } - | CrossBalanceOf { .. } + | OwnerOfCross { .. } + | BalanceOfCross { .. } | Properties { .. } | NextTokenId | TokenContractAddress { .. } diff --git a/tests/src/eth/abi/nonFungible.json b/tests/src/eth/abi/nonFungible.json index 225fc47582..341270458f 100644 --- a/tests/src/eth/abi/nonFungible.json +++ b/tests/src/eth/abi/nonFungible.json @@ -175,6 +175,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "owner", + "type": "tuple" + } + ], + "name": "balanceOfCross", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } @@ -384,42 +401,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { "internalType": "address", "name": "eth", "type": "address" }, - { "internalType": "uint256", "name": "sub", "type": "uint256" } - ], - "internalType": "struct CrossAddress", - "name": "owner", - "type": "tuple" - } - ], - "name": "crossBalanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "crossOwnerOf", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "eth", "type": "address" }, - { "internalType": "uint256", "name": "sub", "type": "uint256" } - ], - "internalType": "struct CrossAddress", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "string[]", "name": "keys", "type": "string[]" } @@ -555,6 +536,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "ownerOfCross", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, diff --git a/tests/src/eth/abi/reFungible.json b/tests/src/eth/abi/reFungible.json index bb3574e406..47c5d39e05 100644 --- a/tests/src/eth/abi/reFungible.json +++ b/tests/src/eth/abi/reFungible.json @@ -157,6 +157,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "owner", + "type": "tuple" + } + ], + "name": "balanceOfCross", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } @@ -366,25 +383,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], - "name": "crossOwnerOf", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "eth", "type": "address" }, - { "internalType": "uint256", "name": "sub", "type": "uint256" } - ], - "internalType": "struct CrossAddress", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "string[]", "name": "keys", "type": "string[]" } @@ -520,6 +518,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "ownerOfCross", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index fcf5d2544b..fb623f11cc 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -533,7 +533,7 @@ interface ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0x323b1db8 +/// @dev the ERC-165 identifier for this interface is 0x307b061a interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -550,21 +550,26 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// or in textual repr: description() function description() external view returns (string memory); + // /// Returns the owner (in cross format) of the token. + // /// + // /// @param tokenId Id for the token. + // /// @dev EVM selector for this function is: 0x2b29dace, + // /// or in textual repr: crossOwnerOf(uint256) + // function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. - /// @dev EVM selector for this function is: 0x2b29dace, - /// or in textual repr: crossOwnerOf(uint256) - function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// @dev EVM selector for this function is: 0xcaa3a4d0, + /// or in textual repr: ownerOfCross(uint256) + function ownerOfCross(uint256 tokenId) external view returns (CrossAddress memory); /// @notice Count all NFTs assigned to an owner - /// @dev NFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of NFTs owned by `owner`, possibly zero - /// @dev EVM selector for this function is: 0x24e52cea, - /// or in textual repr: crossBalanceOf((address,uint256)) - function crossBalanceOf(CrossAddress memory owner) external view returns (uint256); + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) external view returns (uint256); /// Returns the token properties. /// diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index c39f3bdbf7..4cd9fd3028 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -533,7 +533,7 @@ interface ERC721UniqueMintable is Dummy, ERC165 { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0x9780edce +/// @dev the ERC-165 identifier for this interface is 0x95c0f66c interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice A descriptive name for a collection of NFTs in this contract /// @dev EVM selector for this function is: 0x06fdde03, @@ -550,21 +550,26 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// or in textual repr: description() function description() external view returns (string memory); + // /// Returns the owner (in cross format) of the token. + // /// + // /// @param tokenId Id for the token. + // /// @dev EVM selector for this function is: 0x2b29dace, + // /// or in textual repr: crossOwnerOf(uint256) + // function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// Returns the owner (in cross format) of the token. /// /// @param tokenId Id for the token. - /// @dev EVM selector for this function is: 0x2b29dace, - /// or in textual repr: crossOwnerOf(uint256) - function crossOwnerOf(uint256 tokenId) external view returns (CrossAddress memory); + /// @dev EVM selector for this function is: 0xcaa3a4d0, + /// or in textual repr: ownerOfCross(uint256) + function ownerOfCross(uint256 tokenId) external view returns (CrossAddress memory); /// @notice Count all RFTs assigned to an owner - /// @dev RFTs assigned to the zero address are considered invalid, and this - /// function throws for queries about the zero address. /// @param owner An cross address for whom to query the balance /// @return The number of RFTs owned by `owner`, possibly zero - /// @dev EVM selector for this function is: 0x24e52cea, - /// or in textual repr: crossBalanceOf((address,uint256)) - function crossBalanceOf(CrossAddress memory owner) external view returns (uint256); + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) external view returns (uint256); /// Returns the token properties. /// diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 104a47e0d5..b5174d23be 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -663,21 +663,21 @@ describe('NFT: Plain calls', () => { await expect(collectionEvm.methods[testCase](receiver, 999999).send({from: sender})).to.be.rejected; })); - itEth('Check crossBalanceOf()', async ({helper}) => { + itEth('Check balanceOfCross()', async ({helper}) => { const collection = await helper.nft.mintCollection(minter, {}); const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); - expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; for (let i = 1n; i < 100n; i++) { await collection.mintToken(minter, {Ethereum: owner.eth}); - expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === i).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; } }); - itEth('Check crossOwnerOf()', async ({helper}) => { + itEth('Check ownerOfCross()', async ({helper}) => { const collection = await helper.nft.mintCollection(minter, {}); let owner = await helper.ethCrossAccount.createAccountWithBalance(donor); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); @@ -685,7 +685,7 @@ describe('NFT: Plain calls', () => { const {tokenId} = await collection.mintToken(minter, {Ethereum: owner.eth}); for (let i = 1n; i < 100n; i++) { - const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + const ownerCross = await collectionEvm.methods.ownerOfCross(tokenId).call({from: owner.eth}); expect(ownerCross.eth).to.be.eq(owner.eth); expect(ownerCross.sub).to.be.eq(owner.sub); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index b638ec8219..a143cb9b40 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -591,15 +591,15 @@ describe('Refungible: Plain calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); - expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; for (let i = 1n; i < 100n; i++) { await collection.mintToken(minter, 100n, {Ethereum: owner.eth}); - expect(BigInt(await collectionEvm.methods.crossBalanceOf(owner).call({from: owner.eth})) === i).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; } }); - itEth.only('Check crossOwnerOf()', async ({helper}) => { + itEth('Check ownerOfCross()', async ({helper}) => { const collection = await helper.rft.mintCollection(minter, {}); let owner = await helper.ethCrossAccount.createAccountWithBalance(donor); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); @@ -607,7 +607,7 @@ describe('Refungible: Plain calls', () => { const {tokenId} = await collection.mintToken(minter, 100n,{Ethereum: owner.eth}); for (let i = 1n; i < 100n; i++) { - const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + const ownerCross = await collectionEvm.methods.ownerOfCross(tokenId).call({from: owner.eth}); expect(ownerCross.eth).to.be.eq(owner.eth); expect(ownerCross.sub).to.be.eq(owner.sub); @@ -620,7 +620,7 @@ describe('Refungible: Plain calls', () => { const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth, true); const newOwner = await helper.ethCrossAccount.createAccountWithBalance(donor); await tokenContract.methods.transferCross(newOwner, 50).send({from: owner.eth}); - const ownerCross = await collectionEvm.methods.crossOwnerOf(tokenId).call({from: owner.eth}); + const ownerCross = await collectionEvm.methods.ownerOfCross(tokenId).call({from: owner.eth}); expect(ownerCross.eth.toUpperCase()).to.be.eq('0XFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'); expect(ownerCross.sub).to.be.eq('0'); }); diff --git a/tests/src/eth/tokens/minting.test.ts b/tests/src/eth/tokens/minting.test.ts index 3e6759d3c5..c88f01e51a 100644 --- a/tests/src/eth/tokens/minting.test.ts +++ b/tests/src/eth/tokens/minting.test.ts @@ -19,7 +19,7 @@ import {Pallets} from '../../util'; import {expect, itEth, usingEthPlaygrounds} from '../util'; -describe('Minting tokens', () => { +describe.only('Minting tokens', () => { let donor: IKeyringPair; let alice: IKeyringPair; @@ -63,7 +63,7 @@ describe('Minting tokens', () => { const tokenId = event.returnValues.tokenId; expect(tokenId).to.be.equal('1'); expect(await helper.collection.getLastTokenId(collection.collectionId)).to.eq(1); - expect(await contract.methods.crossOwnerOf(tokenId).call()).to.be.like([receiver, '0']); + expect(await contract.methods.ownerOfCross(tokenId).call()).to.be.like([receiver, '0']); } }); }); @@ -97,7 +97,7 @@ describe('Minting tokens', () => { const tokenId = event.returnValues.tokenId; expect(tokenId).to.be.equal('1'); expect(await helper.collection.getLastTokenId(collectionId)).to.eq(1); - expect(await collection.methods.crossOwnerOf(tokenId).call()).to.be.like([receiver, '0']); + expect(await collection.methods.ownerOfCross(tokenId).call()).to.be.like([receiver, '0']); } }); }); @@ -131,7 +131,7 @@ describe('Minting tokens', () => { const tokenId = event.returnValues.tokenId; expect(tokenId).to.be.equal('1'); expect(await helper.collection.getLastTokenId(collectionId)).to.eq(1); - expect(await collection.methods.crossOwnerOf(tokenId).call()).to.be.like([receiver, '0']); + expect(await collection.methods.ownerOfCross(tokenId).call()).to.be.like([receiver, '0']); } }); }); @@ -157,7 +157,7 @@ describe('Minting tokens', () => { expect(event.returnValues.to).to.be.equal(receiver); expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); - expect(await contract.methods.crossOwnerOf(tokenId).call()).to.be.like([receiver, '0']); + expect(await contract.methods.ownerOfCross(tokenId).call()).to.be.like([receiver, '0']); // TODO: this wont work right now, need release 919000 first // await helper.methods.setOffchainSchema(collectionIdAddress, 'https://offchain-service.local/token-info/{id}').send(); // const tokenUri = await contract.methods.tokenURI(nextTokenId).call(); From d94f2dfdf0cfac4aca9a6b66684a19de6b185e31 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 17 Apr 2023 16:06:58 +0200 Subject: [PATCH 37/74] refactor(pallet-unique): switch to #[pallet] macro Signed-off-by: Yaroslav Bolyukin --- pallets/unique/src/eth/mod.rs | 4 +- pallets/unique/src/lib.rs | 804 ++++++++++++++++++++++------------ runtime/common/sponsoring.rs | 1 - 3 files changed, 519 insertions(+), 290 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 8f8b934467..50ff65ad5e 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -27,7 +27,7 @@ use pallet_common::{ dispatch::CollectionDispatch, erc::{CollectionHelpersEvents, static_property::key}, eth::{map_eth_to_id, collection_id_to_address}, - Pallet as PalletCommon, + Pallet as PalletCommon, CollectionHandle, }; use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; use pallet_evm_coder_substrate::{ @@ -262,7 +262,7 @@ where let collection = pallet_common::eth::map_eth_to_id(&collection).ok_or("not a collection address")?; let mut collection = - >::new(collection).ok_or("collection not found")?; + >::new(collection).ok_or("collection not found")?; if !matches!( collection.mode, diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 205f73e43a..05389dbbdc 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -73,42 +73,52 @@ extern crate alloc; -use frame_support::{ - decl_module, decl_storage, decl_error, - dispatch::DispatchResult, - ensure, fail, - weights::{Weight}, - pallet_prelude::{DispatchResultWithPostInfo, ConstU32}, - BoundedVec, -}; -use scale_info::TypeInfo; -use frame_system::{self as system, ensure_signed, ensure_root}; -use sp_std::{vec, vec::Vec}; -use up_data_structs::{ - MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, - MAX_PROPERTIES_PER_ITEM, MAX_PROPERTY_KEY_LENGTH, MAX_PROPERTY_VALUE_LENGTH, - MAX_COLLECTION_PROPERTIES_SIZE, COLLECTION_ADMINS_LIMIT, MAX_TOKEN_PROPERTIES_SIZE, - CreateItemData, CollectionLimits, CollectionPermissions, CollectionId, CollectionMode, TokenId, - CreateCollectionData, CreateItemExData, budget, Property, PropertyKey, PropertyKeyPermission, -}; -use pallet_evm::account::CrossAccountId; -use pallet_common::{ - CollectionHandle, Pallet as PalletCommon, CommonWeightInfo, dispatch::dispatch_tx, - dispatch::CollectionDispatch, RefungibleExtensionsWeightInfo, -}; +pub use pallet::*; +use frame_support::pallet_prelude::*; +use frame_system::pallet_prelude::*; pub mod eth; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; pub mod weights; -use weights::WeightInfo; -/// A maximum number of levels of depth in the token nesting tree. -pub const NESTING_BUDGET: u32 = 5; +#[frame_support::pallet] +pub mod pallet { + use super::*; + + use frame_support::{ + dispatch::DispatchResult, + ensure, fail, + weights::{Weight}, + pallet_prelude::{*}, + BoundedVec, + storage::Key, + }; + use frame_system::pallet_prelude::*; + use scale_info::TypeInfo; + use frame_system::{self as system, ensure_signed, ensure_root}; + use sp_std::{vec, vec::Vec}; + use up_data_structs::{ + MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, + MAX_PROPERTIES_PER_ITEM, MAX_PROPERTY_KEY_LENGTH, MAX_PROPERTY_VALUE_LENGTH, + MAX_COLLECTION_PROPERTIES_SIZE, COLLECTION_ADMINS_LIMIT, MAX_TOKEN_PROPERTIES_SIZE, + CreateItemData, CollectionLimits, CollectionPermissions, CollectionId, CollectionMode, + TokenId, CreateCollectionData, CreateItemExData, budget, Property, PropertyKey, + PropertyKeyPermission, + }; + use pallet_evm::account::CrossAccountId; + use pallet_common::{ + CollectionHandle, Pallet as PalletCommon, CommonWeightInfo, dispatch::dispatch_tx, + dispatch::CollectionDispatch, RefungibleExtensionsWeightInfo, + }; + use weights::WeightInfo; + + /// A maximum number of levels of depth in the token nesting tree. + pub const NESTING_BUDGET: u32 = 5; -decl_error! { /// Errors for the common Unique transactions. - pub enum Error for Module { + #[pallet::error] + pub enum Error { /// Decimal_points parameter must be lower than [`up_data_structs::MAX_DECIMAL_POINTS`]. CollectionDecimalPointLimitExceeded, /// Length of items properties must be greater than 0. @@ -116,135 +126,219 @@ decl_error! { /// Repertition is only supported by refungible collection. RepartitionCalledOnNonRefungibleCollection, } -} - -/// Configuration trait of this pallet. -pub trait Config: system::Config + pallet_common::Config + Sized + TypeInfo { - /// Weight information for extrinsics in this pallet. - type WeightInfo: WeightInfo; - /// Weight information for common pallet operations. - type CommonWeightInfo: CommonWeightInfo; + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config + pallet_common::Config + Sized + TypeInfo { + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; - /// Weight info information for extra refungible pallet operations. - type RefungibleExtensionsWeightInfo: RefungibleExtensionsWeightInfo; -} + /// Weight information for common pallet operations. + type CommonWeightInfo: CommonWeightInfo; -type SelfWeightOf = ::WeightInfo; - -// # Used definitions -// -// ## User control levels -// -// chain-controlled - key is uncontrolled by user -// i.e autoincrementing index -// can use non-cryptographic hash -// real - key is controlled by user -// but it is hard to generate enough colliding values, i.e owner of signed txs -// can use non-cryptographic hash -// controlled - key is completly controlled by users -// i.e maps with mutable keys -// should use cryptographic hash -// -// ## User control level downgrade reasons -// -// ?1 - chain-controlled -> controlled -// collections/tokens can be destroyed, resulting in massive holes -// ?2 - chain-controlled -> controlled -// same as ?1, but can be only added, resulting in easier exploitation -// ?3 - real -> controlled -// no confirmation required, so addresses can be easily generated -decl_storage! { - trait Store for Module as Unique { - - //#region Private members - /// Used for migrations - ChainVersion: u64; - //#endregion - - //#region Tokens transfer sponosoring rate limit baskets - /// (Collection id (controlled?2), who created (real)) - /// TODO: Off chain worker should remove from this map when collection gets removed - pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => Option; - /// Collection id (controlled?2), token id (controlled?2) - pub NftTransferBasket get(fn nft_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - /// Collection id (controlled?2), owning user (real) - pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => Option; - /// Collection id (controlled?2), token id (controlled?2) - pub ReFungibleTransferBasket get(fn refungible_transfer_basket): nmap hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId, hasher(twox_64_concat) T::AccountId => Option; - //#endregion - - /// Variable metadata sponsoring - /// Collection id (controlled?2), token id (controlled?2) - #[deprecated] - pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - /// Last sponsoring of token property setting // todo:doc rephrase this and the following - pub TokenPropertyBasket get(fn token_property_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - - /// Last sponsoring of NFT approval in a collection - pub NftApproveBasket get(fn nft_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - /// Last sponsoring of fungible tokens approval in a collection - pub FungibleApproveBasket get(fn fungible_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => Option; - /// Last sponsoring of RFT approval in a collection - pub RefungibleApproveBasket get(fn refungible_approve_basket): nmap hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId, hasher(twox_64_concat) T::AccountId => Option; + /// Weight info information for extra refungible pallet operations. + type RefungibleExtensionsWeightInfo: RefungibleExtensionsWeightInfo; } -} - -decl_module! { - /// Type alias to Pallet, to be used by construct_runtime. - pub struct Module for enum Call - where - origin: T::RuntimeOrigin - { - type Error = Error; - - #[doc = "A maximum number of levels of depth in the token nesting tree."] - const NESTING_BUDGET: u32 = NESTING_BUDGET; - - #[doc = "Maximal length of a collection name."] - const MAX_COLLECTION_NAME_LENGTH: u32 = MAX_COLLECTION_NAME_LENGTH; - #[doc = "Maximal length of a collection description."] - const MAX_COLLECTION_DESCRIPTION_LENGTH: u32 = MAX_COLLECTION_DESCRIPTION_LENGTH; + #[pallet::pallet] + pub struct Pallet(_); + + pub type SelfWeightOf = ::WeightInfo; + + // # Used definitions + // + // ## User control levels + // + // chain-controlled - key is uncontrolled by user + // i.e autoincrementing index + // can use non-cryptographic hash + // real - key is controlled by user + // but it is hard to generate enough colliding values, i.e owner of signed txs + // can use non-cryptographic hash + // controlled - key is completly controlled by users + // i.e maps with mutable keys + // should use cryptographic hash + // + // ## User control level downgrade reasons + // + // ?1 - chain-controlled -> controlled + // collections/tokens can be destroyed, resulting in massive holes + // ?2 - chain-controlled -> controlled + // same as ?1, but can be only added, resulting in easier exploitation + // ?3 - real -> controlled + // no confirmation required, so addresses can be easily generated + + //#region Private members + /// Used for migrations + #[pallet::storage] + pub type ChainVersion = StorageValue<_, u64, ValueQuery>; + //#endregion + + //#region Tokens transfer sponosoring rate limit baskets + /// (Collection id (controlled?2), who created (real)) + /// TODO: Off chain worker should remove from this map when collection gets removed + #[pallet::storage] + #[pallet::getter(fn create_item_busket)] + pub type CreateItemBasket = StorageMap< + Hasher = Blake2_128Concat, + Key = (CollectionId, T::AccountId), + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + /// Collection id (controlled?2), token id (controlled?2) + #[pallet::storage] + #[pallet::getter(fn nft_transfer_basket)] + pub type NftTransferBasket = StorageDoubleMap< + Hasher1 = Blake2_128Concat, + Key1 = CollectionId, + Hasher2 = Blake2_128Concat, + Key2 = TokenId, + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + /// Collection id (controlled?2), owning user (real) + #[pallet::storage] + #[pallet::getter(fn fungible_transfer_basket)] + pub type FungibleTransferBasket = StorageDoubleMap< + Hasher1 = Blake2_128Concat, + Key1 = CollectionId, + Hasher2 = Twox64Concat, + Key2 = T::AccountId, + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + /// Collection id (controlled?2), token id (controlled?2) + #[pallet::storage] + #[pallet::getter(fn refungible_transfer_basket)] + pub type ReFungibleTransferBasket = StorageNMap< + Key = ( + Key, + Key, + Key, + ), + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + //#endregion + + /// Last sponsoring of token property setting // todo:doc rephrase this and the following + #[pallet::storage] + #[pallet::getter(fn token_property_basket)] + pub type TokenPropertyBasket = StorageDoubleMap< + Hasher1 = Blake2_128Concat, + Key1 = CollectionId, + Hasher2 = Blake2_128Concat, + Key2 = TokenId, + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + + /// Last sponsoring of NFT approval in a collection + #[pallet::storage] + #[pallet::getter(fn nft_approve_basket)] + pub type NftApproveBasket = StorageDoubleMap< + Hasher1 = Blake2_128Concat, + Key1 = CollectionId, + Hasher2 = Blake2_128Concat, + Key2 = TokenId, + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + /// Last sponsoring of fungible tokens approval in a collection + #[pallet::storage] + #[pallet::getter(fn fungible_approve_basket)] + pub type FungibleApproveBasket = StorageDoubleMap< + Hasher1 = Blake2_128Concat, + Key1 = CollectionId, + Hasher2 = Twox64Concat, + Key2 = T::AccountId, + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + /// Last sponsoring of RFT approval in a collection + #[pallet::storage] + #[pallet::getter(fn refungible_approve_basket)] + pub type RefungibleApproveBasket = StorageNMap< + Key = ( + Key, + Key, + Key, + ), + Value = T::BlockNumber, + QueryKind = OptionQuery, + >; + + #[pallet::extra_constants] + impl Pallet { + /// A maximum number of levels of depth in the token nesting tree. + fn nesting_budget() -> u32 { + NESTING_BUDGET + } - #[doc = "Maximal length of a token prefix."] - const MAX_TOKEN_PREFIX_LENGTH: u32 = MAX_TOKEN_PREFIX_LENGTH; + /// Maximal length of a collection name. + fn max_collection_name_length() -> u32 { + MAX_COLLECTION_NAME_LENGTH + } - #[doc = "Maximum admins per collection."] - const COLLECTION_ADMINS_LIMIT: u32 = COLLECTION_ADMINS_LIMIT; + /// Maximal length of a collection description. + fn max_collection_description_length() -> u32 { + MAX_COLLECTION_DESCRIPTION_LENGTH + } - #[doc = "Maximal length of a property key."] - const MAX_PROPERTY_KEY_LENGTH: u32 = MAX_PROPERTY_KEY_LENGTH; + /// Maximal length of a token prefix. + fn max_token_prefix_length() -> u32 { + MAX_TOKEN_PREFIX_LENGTH + } - #[doc = "Maximal length of a property value."] - const MAX_PROPERTY_VALUE_LENGTH: u32 = MAX_PROPERTY_VALUE_LENGTH; + /// Maximum admins per collection. + fn collection_admins_limit() -> u32 { + COLLECTION_ADMINS_LIMIT + } - #[doc = "A maximum number of token properties."] - const MAX_PROPERTIES_PER_ITEM: u32 = MAX_PROPERTIES_PER_ITEM; + /// Maximal length of a property key. + fn max_property_key_length() -> u32 { + MAX_PROPERTY_KEY_LENGTH + } - #[doc = "Maximum size for all collection properties."] - const MAX_COLLECTION_PROPERTIES_SIZE: u32 = MAX_COLLECTION_PROPERTIES_SIZE; + /// Maximal length of a property value. + fn max_property_value_length() -> u32 { + MAX_PROPERTY_VALUE_LENGTH + } - #[doc = "Maximum size of all token properties."] - const MAX_TOKEN_PROPERTIES_SIZE: u32 = MAX_TOKEN_PROPERTIES_SIZE; + /// A maximum number of token properties. + fn max_properties_per_item() -> u32 { + MAX_PROPERTIES_PER_ITEM + } - #[doc = "Default NFT collection limit."] - const NFT_DEFAULT_COLLECTION_LIMITS: CollectionLimits = CollectionLimits::with_default_limits(CollectionMode::NFT); + /// Maximum size for all collection properties. + fn max_collection_properties_size() -> u32 { + MAX_COLLECTION_PROPERTIES_SIZE + } - #[doc = "Default RFT collection limit."] - const RFT_DEFAULT_COLLECTION_LIMITS: CollectionLimits = CollectionLimits::with_default_limits(CollectionMode::ReFungible); + /// Maximum size of all token properties. + fn max_token_properties_size() -> u32 { + MAX_TOKEN_PROPERTIES_SIZE + } - #[doc = "Default FT collection limit."] - const FT_DEFAULT_COLLECTION_LIMITS: CollectionLimits = CollectionLimits::with_default_limits(CollectionMode::Fungible(0)); + /// Default NFT collection limit. + fn nft_default_collection_limits() -> CollectionLimits { + CollectionLimits::with_default_limits(CollectionMode::NFT) + } - fn on_initialize(_now: T::BlockNumber) -> Weight { - Weight::zero() + /// Default RFT collection limit. + fn rft_default_collection_limits() -> CollectionLimits { + CollectionLimits::with_default_limits(CollectionMode::ReFungible) } - fn on_runtime_upgrade() -> Weight { - Weight::zero() + /// Default FT collection limit. + fn ft_default_collection_limits() -> CollectionLimits { + CollectionLimits::with_default_limits(CollectionMode::Fungible(0)) } + } + /// Type alias to Pallet, to be used by construct_runtime. + #[pallet::call] + impl Pallet { /// Create a collection of tokens. /// /// Each Token may have multiple properties encoded as an array of bytes @@ -270,13 +364,14 @@ decl_module! { /// returns collection ID /// /// Deprecated: `create_collection_ex` is more up-to-date and advanced, prefer it instead. - #[weight = >::create_collection()] - fn create_collection( - origin, + #[pallet::call_index(0)] + #[pallet::weight(>::create_collection())] + pub fn create_collection( + origin: OriginFor, collection_name: BoundedVec>, collection_description: BoundedVec>, token_prefix: BoundedVec>, - mode: CollectionMode + mode: CollectionMode, ) -> DispatchResult { let data: CreateCollectionData = CreateCollectionData { name: collection_name, @@ -299,13 +394,18 @@ decl_module! { /// # Arguments /// /// * `data`: Explicit data of a collection used for its creation. - #[weight = >::create_collection()] - pub fn create_collection_ex(origin, data: CreateCollectionData) -> DispatchResult { + #[pallet::call_index(1)] + #[pallet::weight(>::create_collection())] + pub fn create_collection_ex( + origin: OriginFor, + data: CreateCollectionData, + ) -> DispatchResult { let sender = ensure_signed(origin)?; // ========= let sender = T::CrossAccountId::from_sub(sender); - let _id = T::CollectionDispatch::create(sender.clone(), sender, data, Default::default())?; + let _id = + T::CollectionDispatch::create(sender.clone(), sender, data, Default::default())?; Ok(()) } @@ -319,8 +419,12 @@ decl_module! { /// # Arguments /// /// * `collection_id`: Collection to destroy. - #[weight = >::destroy_collection()] - pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult { + #[pallet::call_index(2)] + #[pallet::weight(>::destroy_collection())] + pub fn destroy_collection( + origin: OriginFor, + collection_id: CollectionId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); Self::destroy_collection_internal(sender, collection_id) @@ -337,19 +441,18 @@ decl_module! { /// /// * `collection_id`: ID of the modified collection. /// * `address`: ID of the address to be added to the allowlist. - #[weight = >::add_to_allow_list()] - pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ - + #[pallet::call_index(3)] + #[pallet::weight(>::add_to_allow_list())] + pub fn add_to_allow_list( + origin: OriginFor, + collection_id: CollectionId, + address: T::CrossAccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; collection.check_is_internal()?; - >::toggle_allowlist( - &collection, - &sender, - &address, - true, - )?; + >::toggle_allowlist(&collection, &sender, &address, true)?; Ok(()) } @@ -365,19 +468,18 @@ decl_module! { /// /// * `collection_id`: ID of the modified collection. /// * `address`: ID of the address to be removed from the allowlist. - #[weight = >::remove_from_allow_list()] - pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ - + #[pallet::call_index(4)] + #[pallet::weight(>::remove_from_allow_list())] + pub fn remove_from_allow_list( + origin: OriginFor, + collection_id: CollectionId, + address: T::CrossAccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; collection.check_is_internal()?; - >::toggle_allowlist( - &collection, - &sender, - &address, - false, - )?; + >::toggle_allowlist(&collection, &sender, &address, false)?; Ok(()) } @@ -392,8 +494,13 @@ decl_module! { /// /// * `collection_id`: ID of the modified collection. /// * `new_owner`: ID of the account that will become the owner. - #[weight = >::change_collection_owner()] - pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult { + #[pallet::call_index(5)] + #[pallet::weight(>::change_collection_owner())] + pub fn change_collection_owner( + origin: OriginFor, + collection_id: CollectionId, + new_owner: T::AccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let new_owner = T::CrossAccountId::from_sub(new_owner); let mut target_collection = >::try_get(collection_id)?; @@ -416,8 +523,13 @@ decl_module! { /// /// * `collection_id`: ID of the Collection to add an admin for. /// * `new_admin`: Address of new admin to add. - #[weight = >::add_collection_admin()] - pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult { + #[pallet::call_index(6)] + #[pallet::weight(>::add_collection_admin())] + pub fn add_collection_admin( + origin: OriginFor, + collection_id: CollectionId, + new_admin_id: T::CrossAccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; >::toggle_admin(&collection, &sender, &new_admin_id, true) @@ -437,8 +549,13 @@ decl_module! { /// /// * `collection_id`: ID of the collection to remove the admin for. /// * `account_id`: Address of the admin to remove. - #[weight = >::remove_collection_admin()] - pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult { + #[pallet::call_index(7)] + #[pallet::weight(>::remove_collection_admin())] + pub fn remove_collection_admin( + origin: OriginFor, + collection_id: CollectionId, + account_id: T::CrossAccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; >::toggle_admin(&collection, &sender, &account_id, false) @@ -457,8 +574,13 @@ decl_module! { /// /// * `collection_id`: ID of the modified collection. /// * `new_sponsor`: ID of the account of the sponsor-to-be. - #[weight = >::set_collection_sponsor()] - pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult { + #[pallet::call_index(8)] + #[pallet::weight(>::set_collection_sponsor())] + pub fn set_collection_sponsor( + origin: OriginFor, + collection_id: CollectionId, + new_sponsor: T::AccountId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; target_collection.set_sponsor(&sender, new_sponsor.clone()) @@ -477,8 +599,12 @@ decl_module! { /// # Arguments /// /// * `collection_id`: ID of the collection with the pending sponsor. - #[weight = >::confirm_sponsorship()] - pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult { + #[pallet::call_index(9)] + #[pallet::weight(>::confirm_sponsorship())] + pub fn confirm_sponsorship( + origin: OriginFor, + collection_id: CollectionId, + ) -> DispatchResult { let sender = ensure_signed(origin)?; let mut target_collection = >::try_get(collection_id)?; target_collection.confirm_sponsorship(&sender) @@ -493,8 +619,12 @@ decl_module! { /// # Arguments /// /// * `collection_id`: ID of the collection with the sponsor to remove. - #[weight = >::remove_collection_sponsor()] - pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult { + #[pallet::call_index(10)] + #[pallet::weight(>::remove_collection_sponsor())] + pub fn remove_collection_sponsor( + origin: OriginFor, + collection_id: CollectionId, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; target_collection.remove_sponsor(&sender) @@ -518,12 +648,20 @@ decl_module! { /// * `collection_id`: ID of the collection to which an item would belong. /// * `owner`: Address of the initial owner of the item. /// * `data`: Token data describing the item to store on chain. - #[weight = T::CommonWeightInfo::create_item(&data)] - pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo { + #[pallet::call_index(11)] + #[pallet::weight(T::CommonWeightInfo::create_item(&data))] + pub fn create_item( + origin: OriginFor, + collection_id: CollectionId, + owner: T::CrossAccountId, + data: CreateItemData, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.create_item(sender, owner, data, &budget)) + dispatch_tx::(collection_id, |d| { + d.create_item(sender, owner, data, &budget) + }) } /// Create multiple items within a collection. @@ -544,13 +682,21 @@ decl_module! { /// * `collection_id`: ID of the collection to which the tokens would belong. /// * `owner`: Address of the initial owner of the tokens. /// * `items_data`: Vector of data describing each item to be created. - #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)] - pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec) -> DispatchResultWithPostInfo { + #[pallet::call_index(12)] + #[pallet::weight(T::CommonWeightInfo::create_multiple_items(&items_data))] + pub fn create_multiple_items( + origin: OriginFor, + collection_id: CollectionId, + owner: T::CrossAccountId, + items_data: Vec, + ) -> DispatchResultWithPostInfo { ensure!(!items_data.is_empty(), Error::::EmptyArgument); let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget)) + dispatch_tx::(collection_id, |d| { + d.create_multiple_items(sender, owner, items_data, &budget) + }) } /// Add or change collection properties. @@ -565,17 +711,20 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `properties`: Vector of key-value pairs stored as the collection's metadata. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. - #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] + #[pallet::call_index(13)] + #[pallet::weight(T::CommonWeightInfo::set_collection_properties(properties.len() as u32))] pub fn set_collection_properties( - origin, + origin: OriginFor, collection_id: CollectionId, - properties: Vec + properties: Vec, ) -> DispatchResultWithPostInfo { ensure!(!properties.is_empty(), Error::::EmptyArgument); let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - dispatch_tx::(collection_id, |d| d.set_collection_properties(sender, properties)) + dispatch_tx::(collection_id, |d| { + d.set_collection_properties(sender, properties) + }) } /// Delete specified collection properties. @@ -590,9 +739,10 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `property_keys`: Vector of keys of the properties to be deleted. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. - #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)] + #[pallet::call_index(14)] + #[pallet::weight(T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32))] pub fn delete_collection_properties( - origin, + origin: OriginFor, collection_id: CollectionId, property_keys: Vec, ) -> DispatchResultWithPostInfo { @@ -600,7 +750,9 @@ decl_module! { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - dispatch_tx::(collection_id, |d| d.delete_collection_properties(&sender, property_keys)) + dispatch_tx::(collection_id, |d| { + d.delete_collection_properties(&sender, property_keys) + }) } /// Add or change token properties according to collection's permissions. @@ -621,19 +773,22 @@ decl_module! { /// * `token_id`: ID of the modified token. /// * `properties`: Vector of key-value pairs stored as the token's metadata. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. - #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)] + #[pallet::call_index(15)] + #[pallet::weight(T::CommonWeightInfo::set_token_properties(properties.len() as u32))] pub fn set_token_properties( - origin, + origin: OriginFor, collection_id: CollectionId, token_id: TokenId, - properties: Vec + properties: Vec, ) -> DispatchResultWithPostInfo { ensure!(!properties.is_empty(), Error::::EmptyArgument); let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.set_token_properties(sender, token_id, properties, &budget)) + dispatch_tx::(collection_id, |d| { + d.set_token_properties(sender, token_id, properties, &budget) + }) } /// Delete specified token properties. Currently properties only work with NFTs. @@ -651,19 +806,22 @@ decl_module! { /// * `token_id`: ID of the modified token. /// * `property_keys`: Vector of keys of the properties to be deleted. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. - #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)] + #[pallet::call_index(16)] + #[pallet::weight(T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32))] pub fn delete_token_properties( - origin, + origin: OriginFor, collection_id: CollectionId, token_id: TokenId, - property_keys: Vec + property_keys: Vec, ) -> DispatchResultWithPostInfo { ensure!(!property_keys.is_empty(), Error::::EmptyArgument); let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.delete_token_properties(sender, token_id, property_keys, &budget)) + dispatch_tx::(collection_id, |d| { + d.delete_token_properties(sender, token_id, property_keys, &budget) + }) } /// Add or change token property permissions of a collection. @@ -681,9 +839,10 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `property_permissions`: Vector of permissions for property keys. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. - #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)] + #[pallet::call_index(17)] + #[pallet::weight(T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32))] pub fn set_token_property_permissions( - origin, + origin: OriginFor, collection_id: CollectionId, property_permissions: Vec, ) -> DispatchResultWithPostInfo { @@ -691,7 +850,9 @@ decl_module! { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - dispatch_tx::(collection_id, |d| d.set_token_property_permissions(&sender, property_permissions)) + dispatch_tx::(collection_id, |d| { + d.set_token_property_permissions(&sender, property_permissions) + }) } /// Create multiple items within a collection with explicitly specified initial parameters. @@ -709,12 +870,19 @@ decl_module! { /// /// * `collection_id`: ID of the collection to which the tokens would belong. /// * `data`: Explicit item creation data. - #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] - pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { + #[pallet::call_index(18)] + #[pallet::weight(T::CommonWeightInfo::create_multiple_items_ex(&data))] + pub fn create_multiple_items_ex( + origin: OriginFor, + collection_id: CollectionId, + data: CreateItemExData, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.create_multiple_items_ex(sender, data, &budget)) + dispatch_tx::(collection_id, |d| { + d.create_multiple_items_ex(sender, data, &budget) + }) } /// Completely allow or disallow transfers for a particular collection. @@ -727,8 +895,13 @@ decl_module! { /// /// * `collection_id`: ID of the collection. /// * `value`: New value of the flag, are transfers allowed? - #[weight = >::set_transfers_enabled_flag()] - pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult { + #[pallet::call_index(19)] + #[pallet::weight(>::set_transfers_enabled_flag())] + pub fn set_transfers_enabled_flag( + origin: OriginFor, + collection_id: CollectionId, + value: bool, + ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; target_collection.check_is_internal()?; @@ -756,11 +929,18 @@ decl_module! { /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. /// * Fungible Mode: The desired number of pieces to burn. /// * Re-Fungible Mode: The desired number of pieces to burn. - #[weight = T::CommonWeightInfo::burn_item()] - pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { + #[pallet::call_index(20)] + #[pallet::weight(T::CommonWeightInfo::burn_item())] + pub fn burn_item( + origin: OriginFor, + collection_id: CollectionId, + item_id: TokenId, + value: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - let post_info = dispatch_tx::(collection_id, |d| d.burn_item(sender, item_id, value))?; + let post_info = + dispatch_tx::(collection_id, |d| d.burn_item(sender, item_id, value))?; if value == 1 { >::remove(collection_id, item_id); >::remove(collection_id, item_id); @@ -794,12 +974,21 @@ decl_module! { /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. /// * Fungible Mode: The desired number of pieces to burn. /// * Re-Fungible Mode: The desired number of pieces to burn. - #[weight = T::CommonWeightInfo::burn_from()] - pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { + #[pallet::call_index(21)] + #[pallet::weight(T::CommonWeightInfo::burn_from())] + pub fn burn_from( + origin: OriginFor, + collection_id: CollectionId, + from: T::CrossAccountId, + item_id: TokenId, + value: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.burn_from(sender, from, item_id, value, &budget)) + dispatch_tx::(collection_id, |d| { + d.burn_from(sender, from, item_id, value, &budget) + }) } /// Change ownership of the token. @@ -823,12 +1012,21 @@ decl_module! { /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. /// * Fungible Mode: The desired number of pieces to transfer. /// * Re-Fungible Mode: The desired number of pieces to transfer. - #[weight = T::CommonWeightInfo::transfer()] - pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { + #[pallet::call_index(22)] + #[pallet::weight(T::CommonWeightInfo::transfer())] + pub fn transfer( + origin: OriginFor, + recipient: T::CrossAccountId, + collection_id: CollectionId, + item_id: TokenId, + value: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.transfer(sender, recipient, item_id, value, &budget)) + dispatch_tx::(collection_id, |d| { + d.transfer(sender, recipient, item_id, value, &budget) + }) } /// Allow a non-permissioned address to transfer or burn an item. @@ -846,11 +1044,20 @@ decl_module! { /// * `item_id`: ID of the item transactions on which are now approved. /// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs). /// Set to 0 to revoke the approval. - #[weight = T::CommonWeightInfo::approve()] - pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { + #[pallet::call_index(23)] + #[pallet::weight(T::CommonWeightInfo::approve())] + pub fn approve( + origin: OriginFor, + spender: T::CrossAccountId, + collection_id: CollectionId, + item_id: TokenId, + amount: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - dispatch_tx::(collection_id, |d| d.approve(sender, spender, item_id, amount)) + dispatch_tx::(collection_id, |d| { + d.approve(sender, spender, item_id, amount) + }) } /// Allow a non-permissioned address to transfer or burn an item from owner's eth mirror. @@ -869,11 +1076,21 @@ decl_module! { /// * `item_id`: ID of the item transactions on which are now approved. /// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs). /// Set to 0 to revoke the approval. - #[weight = T::CommonWeightInfo::approve_from()] - pub fn approve_from(origin, from:T::CrossAccountId, to: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { + #[pallet::call_index(24)] + #[pallet::weight(T::CommonWeightInfo::approve_from())] + pub fn approve_from( + origin: OriginFor, + from: T::CrossAccountId, + to: T::CrossAccountId, + collection_id: CollectionId, + item_id: TokenId, + amount: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); - dispatch_tx::(collection_id, |d| d.approve_from(sender, from, to, item_id, amount)) + dispatch_tx::(collection_id, |d| { + d.approve_from(sender, from, to, item_id, amount) + }) } /// Change ownership of an item on behalf of the owner as a non-owner account. @@ -900,12 +1117,22 @@ decl_module! { /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. /// * Fungible Mode: The desired number of pieces to transfer. /// * Re-Fungible Mode: The desired number of pieces to transfer. - #[weight = T::CommonWeightInfo::transfer_from()] - pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo { + #[pallet::call_index(25)] + #[pallet::weight(T::CommonWeightInfo::transfer_from())] + pub fn transfer_from( + origin: OriginFor, + from: T::CrossAccountId, + recipient: T::CrossAccountId, + collection_id: CollectionId, + item_id: TokenId, + value: u128, + ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); - dispatch_tx::(collection_id, |d| d.transfer_from(sender, from, recipient, item_id, value, &budget)) + dispatch_tx::(collection_id, |d| { + d.transfer_from(sender, from, recipient, item_id, value, &budget) + }) } /// Set specific limits of a collection. Empty, or None fields mean chain default. @@ -920,9 +1147,10 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `new_limit`: New limits of the collection. Fields that are not set (None) /// will not overwrite the old ones. - #[weight = >::set_collection_limits()] + #[pallet::call_index(26)] + #[pallet::weight(>::set_collection_limits())] pub fn set_collection_limits( - origin, + origin: OriginFor, collection_id: CollectionId, new_limit: CollectionLimits, ) -> DispatchResult { @@ -943,19 +1171,16 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `new_permission`: New permissions of the collection. Fields that are not set (None) /// will not overwrite the old ones. - #[weight = >::set_collection_limits()] + #[pallet::call_index(27)] + #[pallet::weight(>::set_collection_limits())] pub fn set_collection_permissions( - origin, + origin: OriginFor, collection_id: CollectionId, new_permission: CollectionPermissions, ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; - >::update_permissions( - &sender, - &mut target_collection, - new_permission - ) + >::update_permissions(&sender, &mut target_collection, new_permission) } /// Re-partition a refungible token, while owning all of its parts/pieces. @@ -969,9 +1194,10 @@ decl_module! { /// * `collection_id`: ID of the collection the RFT belongs to. /// * `token_id`: ID of the RFT. /// * `amount`: New number of parts/pieces into which the token shall be partitioned. - #[weight = T::RefungibleExtensionsWeightInfo::repartition()] + #[pallet::call_index(28)] + #[pallet::weight(T::RefungibleExtensionsWeightInfo::repartition())] pub fn repartition( - origin, + origin: OriginFor, collection_id: CollectionId, token_id: TokenId, amount: u128, @@ -995,9 +1221,10 @@ decl_module! { /// * `owner`: Token owner /// * `operator`: Operator /// * `approve`: Should operator status be granted or revoked? - #[weight = T::CommonWeightInfo::set_allowance_for_all()] + #[pallet::call_index(29)] + #[pallet::weight(T::CommonWeightInfo::set_allowance_for_all())] pub fn set_allowance_for_all( - origin, + origin: OriginFor, collection_id: CollectionId, operator: T::CrossAccountId, approve: bool, @@ -1013,9 +1240,10 @@ decl_module! { /// # Arguments /// /// * `collection_id`: ID of the collection to repair. - #[weight = >::force_repair_collection()] + #[pallet::call_index(30)] + #[pallet::weight(>::force_repair_collection())] pub fn force_repair_collection( - origin, + origin: OriginFor, collection_id: CollectionId, ) -> DispatchResult { ensure_root(origin)?; @@ -1028,69 +1256,71 @@ decl_module! { /// /// * `collection_id`: ID of the collection the item belongs to. /// * `item_id`: ID of the item. - #[weight = T::CommonWeightInfo::force_repair_item()] + #[pallet::call_index(31)] + #[pallet::weight(T::CommonWeightInfo::force_repair_item())] pub fn force_repair_item( - origin, + origin: OriginFor, collection_id: CollectionId, item_id: TokenId, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; - dispatch_tx::(collection_id, |d| { - d.repair_item(item_id) - }) + dispatch_tx::(collection_id, |d| d.repair_item(item_id)) } } -} -impl Pallet { - /// Force set `sponsor` for `collection`. - /// - /// Differs from [`set_collection_sponsor`][`Pallet::set_collection_sponsor`] in that confirmation - /// from the `sponsor` is not required. - /// - /// # Arguments - /// - /// * `sponsor`: ID of the account of the sponsor-to-be. - /// * `collection_id`: ID of the modified collection. - pub fn force_set_sponsor(sponsor: T::AccountId, collection_id: CollectionId) -> DispatchResult { - let mut target_collection = >::try_get(collection_id)?; - target_collection.force_set_sponsor(sponsor.clone()) - } + impl Pallet { + /// Force set `sponsor` for `collection`. + /// + /// Differs from [`set_collection_sponsor`][`Pallet::set_collection_sponsor`] in that confirmation + /// from the `sponsor` is not required. + /// + /// # Arguments + /// + /// * `sponsor`: ID of the account of the sponsor-to-be. + /// * `collection_id`: ID of the modified collection. + pub fn force_set_sponsor( + sponsor: T::AccountId, + collection_id: CollectionId, + ) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.force_set_sponsor(sponsor.clone()) + } - /// Force remove `sponsor` for `collection`. - /// - /// Differs from `remove_sponsor` in that - /// it doesn't require consent from the `owner` of the collection. - /// - /// # Arguments - /// - /// * `collection_id`: ID of the modified collection. - pub fn force_remove_collection_sponsor(collection_id: CollectionId) -> DispatchResult { - let mut target_collection = >::try_get(collection_id)?; - target_collection.force_remove_sponsor() - } + /// Force remove `sponsor` for `collection`. + /// + /// Differs from `remove_sponsor` in that + /// it doesn't require consent from the `owner` of the collection. + /// + /// # Arguments + /// + /// * `collection_id`: ID of the modified collection. + pub fn force_remove_collection_sponsor(collection_id: CollectionId) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.force_remove_sponsor() + } - #[inline(always)] - pub(crate) fn destroy_collection_internal( - sender: T::CrossAccountId, - collection_id: CollectionId, - ) -> DispatchResult { - let collection = >::try_get(collection_id)?; - collection.check_is_internal()?; + #[inline(always)] + pub(crate) fn destroy_collection_internal( + sender: T::CrossAccountId, + collection_id: CollectionId, + ) -> DispatchResult { + let collection = >::try_get(collection_id)?; + collection.check_is_internal()?; - T::CollectionDispatch::destroy(sender, collection)?; + T::CollectionDispatch::destroy(sender, collection)?; - // TODO: basket cleanup should be moved elsewhere - // Maybe runtime dispatch.rs should perform it? + // TODO: basket cleanup should be moved elsewhere + // Maybe runtime dispatch.rs should perform it? - let _ = >::clear_prefix(collection_id, u32::MAX, None); - let _ = >::clear_prefix(collection_id, u32::MAX, None); - let _ = >::clear_prefix((collection_id,), u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); - let _ = >::clear_prefix(collection_id, u32::MAX, None); - let _ = >::clear_prefix(collection_id, u32::MAX, None); - let _ = >::clear_prefix((collection_id,), u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); - Ok(()) + Ok(()) + } } } diff --git a/runtime/common/sponsoring.rs b/runtime/common/sponsoring.rs index 62452a9d29..56971266da 100644 --- a/runtime/common/sponsoring.rs +++ b/runtime/common/sponsoring.rs @@ -18,7 +18,6 @@ use core::marker::PhantomData; use up_sponsorship::SponsorshipHandler; use frame_support::{ traits::{IsSubType}, - storage::{StorageMap, StorageDoubleMap, StorageNMap}, }; use up_data_structs::{ CollectionId, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, NFT_SPONSOR_TRANSFER_TIMEOUT, From f1240aee4923b5434f644c633aa6df163c0902eb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 17 Apr 2023 16:56:02 +0200 Subject: [PATCH 38/74] fix: run app-promotion benchmarks by default --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c17f501c3..ea5809cc3b 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ bench-xcm: .PHONY: bench # Disabled: bench-scheduler, bench-collator-selection, bench-identity -bench: bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm +bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm .PHONY: check check: From 07a293d2e35eb4c34c92bf36fd3d08df356c2727 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 17 Apr 2023 16:56:24 +0200 Subject: [PATCH 39/74] ci: upgrade weight template --- .maintain/frame-weight-template.hbs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.maintain/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs index 58d5c1c5bd..36d6c6412b 100644 --- a/.maintain/frame-weight-template.hbs +++ b/.maintain/frame-weight-template.hbs @@ -3,8 +3,9 @@ //! Autogenerated weights for {{pallet}} //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` //! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` +//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` //! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} // Executed Command: @@ -15,8 +16,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; From b1f22167a9418fa6174308ea0b9246ce6feadda8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 17 Apr 2023 16:58:49 +0200 Subject: [PATCH 40/74] fix: remove from_ref_time usages --- pallets/common/src/dispatch.rs | 2 +- pallets/common/src/lib.rs | 13 ++++++++++--- pallets/evm-coder-substrate/src/execution.rs | 5 +++-- pallets/evm-migration/src/lib.rs | 1 + pallets/unique/src/benchmarking.rs | 17 +++++++++++------ pallets/unique/src/lib.rs | 5 +---- primitives/common/src/constants.rs | 7 ++++--- runtime/common/config/ethereum.rs | 2 +- runtime/common/mod.rs | 3 ++- 9 files changed, 34 insertions(+), 21 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 3a75e52599..51285382cc 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -19,7 +19,7 @@ pub fn dispatch_weight() -> Weight { // Read collection ::DbWeight::get().reads(1) // Dynamic dispatch? - + Weight::from_ref_time(6_000_000) + + Weight::from_parts(6_000_000, 0) // submit_logs is measured as part of collection pallets } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index f9a4efb10e..ebe7a5f081 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -92,6 +92,7 @@ pub mod benchmarking; pub mod dispatch; pub mod erc; pub mod eth; +#[allow(missing_docs)] pub mod weights; /// Weight info. @@ -157,10 +158,12 @@ impl CollectionHandle { reads: u64, ) -> pallet_evm_coder_substrate::execution::Result<()> { self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_parts( ::DbWeight::get() .read .saturating_mul(reads), + // TODO: measure proof + 0, ))) } @@ -170,10 +173,12 @@ impl CollectionHandle { writes: u64, ) -> pallet_evm_coder_substrate::execution::Result<()> { self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_parts( ::DbWeight::get() .write .saturating_mul(writes), + // TODO: measure proof + 0, ))) } @@ -187,8 +192,10 @@ impl CollectionHandle { let reads = weight.read.saturating_mul(reads); let writes = weight.read.saturating_mul(writes); self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_parts( reads.saturating_add(writes), + // TODO: measure proof + 0, ))) } diff --git a/pallets/evm-coder-substrate/src/execution.rs b/pallets/evm-coder-substrate/src/execution.rs index 19a3c2819f..0303a30764 100644 --- a/pallets/evm-coder-substrate/src/execution.rs +++ b/pallets/evm-coder-substrate/src/execution.rs @@ -61,7 +61,7 @@ impl PreDispatch for ERC165Call { fn dispatch_info(&self) -> DispatchInfo { DispatchInfo { // ERC165 impl should be cheap - weight: Weight::from_ref_time(200), + weight: Weight::from_parts(200, 0), } } } @@ -77,10 +77,11 @@ impl From for DispatchInfo { Self { weight } } } +// TODO: use 2-dimensional weight after frontier upgrade impl From for DispatchInfo { fn from(weight: u64) -> Self { Self { - weight: Weight::from_ref_time(weight), + weight: Weight::from_parts(weight, 0), } } } diff --git a/pallets/evm-migration/src/lib.rs b/pallets/evm-migration/src/lib.rs index 6e532e891f..0b7397fbe2 100644 --- a/pallets/evm-migration/src/lib.rs +++ b/pallets/evm-migration/src/lib.rs @@ -21,6 +21,7 @@ pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; +#[allow(missing_docs)] pub mod weights; #[frame_support::pallet] diff --git a/pallets/unique/src/benchmarking.rs b/pallets/unique/src/benchmarking.rs index 62e05e5168..986214577f 100644 --- a/pallets/unique/src/benchmarking.rs +++ b/pallets/unique/src/benchmarking.rs @@ -26,6 +26,11 @@ use pallet_common::{ Config as CommonConfig, benchmarking::{create_data, create_u16_data}, }; +use up_data_structs::{ + CollectionId, CollectionMode, MAX_COLLECTION_NAME_LENGTH, MAX_TOKEN_PREFIX_LENGTH, + MAX_COLLECTION_DESCRIPTION_LENGTH, CollectionLimits, +}; +use pallet_common::erc::CrossAccountId; const SEED: u32 = 1; @@ -34,9 +39,9 @@ fn create_collection_helper( mode: CollectionMode, ) -> Result { ::Currency::deposit_creating(&owner, T::CollectionCreationPrice::get()); - let col_name = create_u16_data::(); - let col_desc = create_u16_data::(); - let token_prefix = create_data::(); + let col_name = create_u16_data::<{ MAX_COLLECTION_NAME_LENGTH }>(); + let col_desc = create_u16_data::<{ MAX_COLLECTION_DESCRIPTION_LENGTH }>(); + let token_prefix = create_data::<{ MAX_TOKEN_PREFIX_LENGTH }>(); >::create_collection( RawOrigin::Signed(owner).into(), col_name, @@ -54,9 +59,9 @@ pub fn create_nft_collection( benchmarks! { create_collection { - let col_name = create_u16_data::(); - let col_desc = create_u16_data::(); - let token_prefix = create_data::(); + let col_name = create_u16_data::<{MAX_COLLECTION_NAME_LENGTH}>(); + let col_desc = create_u16_data::<{MAX_COLLECTION_DESCRIPTION_LENGTH}>(); + let token_prefix = create_data::<{MAX_TOKEN_PREFIX_LENGTH}>(); let mode: CollectionMode = CollectionMode::NFT; let caller: T::AccountId = account("caller", 0, SEED); ::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get()); diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 05389dbbdc..6c2a6e6bc0 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -89,14 +89,11 @@ pub mod pallet { use frame_support::{ dispatch::DispatchResult, ensure, fail, - weights::{Weight}, - pallet_prelude::{*}, BoundedVec, storage::Key, }; - use frame_system::pallet_prelude::*; use scale_info::TypeInfo; - use frame_system::{self as system, ensure_signed, ensure_root}; + use frame_system::{ensure_signed, ensure_root}; use sp_std::{vec, vec::Vec}; use up_data_structs::{ MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index bc91c95305..1bc1afc90c 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -64,9 +64,10 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6 second average block time. -pub const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND.saturating_div(2)) - .set_proof_size(MAX_POV_SIZE as u64); +pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), + MAX_POV_SIZE as u64, +); parameter_types! { pub const TransactionByteFee: Balance = 501 * MICROUNIQUE / 2; diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index 80e750fd9d..a4f3bab7a0 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -28,7 +28,7 @@ parameter_types! { pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; pub const WeightTimePerGas: u64 = WEIGHT_REF_TIME_PER_SECOND / GasPerSecond::get(); - pub const WeightPerGas: Weight = Weight::from_ref_time(WeightTimePerGas::get()); + pub const WeightPerGas: Weight = Weight::from_parts(WeightTimePerGas::get(), 0); } /// Limiting EVM execution to 50% of block for substrate users and management tasks diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 665d4834b3..9749eb3263 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -27,6 +27,7 @@ pub mod runtime_apis; pub mod scheduler; pub mod sponsoring; +#[allow(missing_docs)] pub mod weights; #[cfg(test)] @@ -152,7 +153,7 @@ impl BlockNumberProvider } #[cfg(feature = "runtime-benchmarks")] fn set_block_number(block: Self::BlockNumber) { - cumulus_pallet_parachain_system::RelaychainBlockNumberProvider::::set_block_number(block) + cumulus_pallet_parachain_system::RelaychainDataProvider::::set_block_number(block) } } From 374e37517d0d834c5bbb1e9d4e772ee3da037178 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 17 Apr 2023 17:03:22 +0200 Subject: [PATCH 41/74] style: fix formatting --- pallets/unique/src/lib.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 6c2a6e6bc0..368c9ee1cf 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -86,12 +86,7 @@ pub mod weights; pub mod pallet { use super::*; - use frame_support::{ - dispatch::DispatchResult, - ensure, fail, - BoundedVec, - storage::Key, - }; + use frame_support::{dispatch::DispatchResult, ensure, fail, BoundedVec, storage::Key}; use scale_info::TypeInfo; use frame_system::{ensure_signed, ensure_root}; use sp_std::{vec, vec::Vec}; From fc48e60fac082b67d31e36677d427beda00d44f9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 18 Apr 2023 05:29:17 +0000 Subject: [PATCH 42/74] feat: balanceOfCross for fingible --- pallets/fungible/src/erc.rs | 9 +++++++++ pallets/fungible/src/stubs/UniqueFungible.raw | Bin 4698 -> 4739 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 14 +++++++++++++- tests/src/eth/abi/fungible.json | 17 +++++++++++++++++ tests/src/eth/api/UniqueFungible.sol | 9 ++++++++- tests/src/eth/fungible.test.ts | 16 ++++++++++++++++ tests/src/eth/reFungible.test.ts | 2 +- tests/src/eth/tokens/minting.test.ts | 2 +- 8 files changed, 65 insertions(+), 4 deletions(-) diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index c49d8f521c..d6e2852269 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -327,6 +327,15 @@ where fn collection_helper_address(&self) -> Result
{ Ok(T::ContractAddress::get()) } + + /// @notice Balance of account + /// @param owner An cross address for whom to query the balance + /// @return The number of fingibles owned by `owner`, possibly zero + fn balance_of_cross(&self, owner: CrossAddress) -> Result { + self.consume_store_reads(1)?; + let balance = >::get((self.id, owner.into_sub_cross_account::()?)); + Ok(balance.into()) + } } #[solidity_interface( diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 4a16a583e03078ce9231913e6e88f4f89fdcdf60..44f66929fcb4b48fbce3deb13387d9bd8e5f27b2 100644 GIT binary patch literal 4739 zcma)A4Um*&9e~|07|)e6boPWQ>mc;7CWCCl@bCv!)9B)if#hc}SeEHi z(u^W!_$_oq3{Uh)6$B^oxwNFgjf{am3Ht^hK3~#o{5K3Uaysv{THwiaoL&oKY-ncl zRN1juQR7lOkCfexneAE59Jk{A_rs{97YFoyWoq+>_k-AUM?-<(uvbtN8XSa zA!UNR@cIQAQMV6Ic|JZgRZ#D#AUu5p10RI7kzGrv;9ke%xhRw+yA7~MEb8&QqeC$rx zcq9M=hO551I|`6YC_LBP4v+${*t%so#KZy0PprNWU>4wt)>*3oUQjC>4BK%uXK(*u zfZqc+_aPAm@8e(E`!=w9fxYkz=L|p!=_OYjy$#^&p_ue5jX#8qU&9fB0aeRIOUu(m z-7~<>$fij65(3A5MG|iW_>uh=bphN6aP|T1G{C_?VmG_j4p`Zlmv;gDEr_CqMz`HMBRysD`LlhtO{vprKeC&!&|jyaf#TM zRdsk8AcU|Y#Cp?XM@Pi1WNXf=^5b71>TikY@){H3e_ zHm=3f6!V)tO6TKM^=Ce$_<$FuNqN3Yp{}M!Nmuph1w7S%YN~?d8-!du6`7*xQsqm1 zmq>a<$B6elBYQ_{=KjYE& zL=5#lRm(ePVbnbja!kaoq;BB_L{9-SXdyZ!O|F7JdR_;5x`-)$XZu@Nf{Lk`<+-iyR+iuD`A~ZgskyzN3|xcVb|&~ST1+!@9)#VY;v*Waq!dx) z5L(<;7_7~njeIA_cZTF)R11Do8=eUbdr35W5t)!h!vVw>CQ^1ymiOu@C?1K2Y##({ zv3|=E4G0@K%YA3#t-)dZeB1U8M|q*fTP{^y!WB!zm#X-9_Q^cjfyqiPA**^I4mUR% z(PqBNhU=4vZ}ia?{5F`=D&m`bgq|1i2St3FDdL|*gE!m-SKv#m;#N9LW--??m^)~Z zh@bi#BQ_h+OgjV2QP^^D$nmT;6`L+~ykN7fvWP!d((WHay66W6=FmQ7v8~NS<(Q}; zG_B1Py~w%E3>PIbQZb>+<$9U9nr=aQVv%YUO@-8PHsX%33T|JnNOYp=#_p?1mJBPx zxq-4t+~ON3605xISb3f>G9oeHqv2HnNw*l04uzzyM_Q3Z;vt@MP}JxZj0Haf6ji9L zC>B$KdoB_u!RRv8Y2w$Rl-E$&D1s4)IqHkSlOK${E054GWvQAHif3c9ijS8`(KwrT z+FnT_p6BIzuVKoy7Z7s-sa4 zBu!R_PF2;o&Bvp`E3y+v`+k7Si^hG`3ZdeNQgNW2aUDi+40+D{-Y0e(rdhZ=i>4M; z&pT9ljqlTufm=gUWb?4Ki80YgH+Dp{%!) zj}5c2QD}5gZg}+&O-o^e`(Y#eu5bEL7zkd6dYT-N)uwBr*Pf|O=Y_TD-GH+utjS0y zO(a|XS6Gw5d)ryUnp{qD5Y{rbgs~-p(q=|$n@IKqc#&M=)%LK(@&UXuSrUMe+{q;~kv zs=kB<^X1%HsXV+4riNj`ut;52(i{aZcx`QEhk1i0RGY%>4$%!4QpyVeDme8l$_Eny zt(`-NCcB8@n>tKkn$W0`4OVUyspCEZGd6YVzf)ZuuU-eGJAC5F@tQ8EB7KQJS^PQZ z4Zw5`J2aSom@6*EYw)T}k)%C@-YL2mw5SVQxUTUhfM3gL!`I^93oxW;m;^`L{Uc+l zSLr7Mj`TCOiHSnJJ4%a~#=18RclgsVeJCV++woTd#$oz>hZj&SwDb@(idoG(tOmGw zM!?%V%is7I$j$RG<}i?9q{l*zlEProH7^TUx`Msw@z}foBfTB#@0|amCTL4EKd9m} zSra;{VzA7pJkWf&EaLuAt;%M@4;;-V$-cqh%rs_JWZlZ@qWLJkI({JWyQ*(sRZp(BFV`mqdhb~EACFmgm;e9( literal 4698 zcma)A3yf6N8NO#{XLjB*3%jH1Zp-i}wX~u}M?)bv1R)}|xpT|TCB0G4VWCKb#lqUO zYTNsqT^^-(mUW?Ok-maxqKKr@qOGP{(+HZDSd`R)u^Kf|gIY>s7W)17F*|Ds?Jl$Y z_doypdG7F&ysYqo?r}ZGN(wOA24WTNOToOJf>mhSB4i1s(J&RQ^M=P?t4cH1kFT7)x#Dn%3Zw>#khY z_!P69^c;g87{iN3kxy|LkM8(@qL&Fpej zb}UxWxYWfXHMhH`tH7D#c3PR`tH!7vK2Rb|Jk4@bwk%&j&adfE}V$2Y6z` z_vZp!0Py5vOOFBE2JnMo|C<0G0C;-t^BVv@OyGeN2RcM#zOU97j^{Lv_C_B#)FE2V z0z7p2Hir8mTCYz106@&=akO%9`Y6Dw2poNGN5H!_ z{pXDV*dLks3xLN!(ErTdQ=nZC8aBP~!9crcN#SUo{O(<_@wosD80O!(HwutUC_kI) z3Iedey7_Csz7MRt|Mpn`KLxma^3>ZQJkcy1M+T0jAKdUdz#jvgxl4q>yY$wBZv*>N zU}qh7&H<#5UODfr)c~Ik#bl2p_rb=SaYSH1)qdHc8m##xuoo9HB>YkWM-P+4`2a6@ z`LbSsw*Z{>7ws&-wSmMHY?~dhvU7jh1MoK>if(?^0r&>M*x27A04bA+TlPEwkg}fm z?IQ9tt)d+;D@4naqGkUzyj8?zqk>z1U)3Za4~v!;JS3HM>znAEa>ecJr1oJ1>-C8H zu}4RTqUDr`N*{H<=KBfz*Ub6I1CaG$`Q`!#)vtgnUe1kEaRdC;v(3&o|Vc`;6iz zy*Q1_^IZycrS2kKji>wZ)Y?8#LHcn*&YXzMe6g7?b2pJJ5z&X6oXUEhUJ)cGyOukx88*R`$^%w!{>%uBx_u7>fp0j#FTB zQ}-GrM3`a6N4ksx30&gip{=6ZaNOIzBDPz_u6CHgDm9BCXt2`8dh-O<7(*oalrHR4 zR&W@0b{N4T+?F7e7cFLs80uR06`~h?eSrfohLEzAa{n7`E;RFK&0Yv(k3Y zhvw@=)1?Gu;2Lc8x!}iWH_iM-oucg~6(7;oK`ElhA+)%JFj!kSANf5Xzb7OQqgwW( z+BO;*woA0lLMCL6P074hR`iGQ}hbwHZxq5$Z*|+E|=>y=4!eH z>4}1BRZNA{aW?D@vpOzSu85yT)s5cUkSrNigmVKmpSapLP$cGg*|ADIVdO<(sgH(N zWhC8VM0#sTy4oYH%OY_nFFGh{^a{p;p8<+0)YcV?DZ%v>iIZS-jp{VUo#S(_OX$r-qa zBce5ie8OoPfu#CI)nnau8TPe z23BRzQADbY+c?@1!=}E8RU9i)+rkv|vPdmAFj0UX-NZ&mpwUIS;f+G1dSHY5StIt`X%J0-ZV*?hyT>ZyJaw6F07Tx!^>cXt0KciroE~; z3f|i~J8KT}22H3ogZo_5LdtjnKm})ZpnNbP(Aq_WXuOLkzL^6QrZJ5g*Lit{qIya#;eysnU8$p@$s6yNEO+*KUw@a=ncTkzpz7t`G>jUV!Q@#z!XW^L+G7~ zi$ROJU?TcCe**ZmoL%l~@$Ur~QZ!70qmBNNG105+=71wRYMYoS)Vm|Jh-s{Q({Q&x z4YN;#gikyEO29bG9(H&c)j~@TL8F*8&BMmV&wd#4p7A$6268TjF^7Q+BRv*!loSSw zE;lV;$$cf*n;wtN%P`X0vHs5aKWc)uL~cOEXS^nKRK;M8QF);Ga9PCtqfwPPyx3FV zXf{dqGJ`YI=&8%PRnSH5DSRVh6^3QavG9e6$i3G1KEzSD|8;UoK#wc6MUknQT<{vC z7^Ip!@{^t6Je8|wf4*|f9pBoxeA=YqwXdD}@*AsXJ~;csFTDBqM~^)EVqQG9b;ct% z-uCLJcT4LIEn2y8{o1~TQamqRHE`RSjm5t8{R10B-#`)Ynss-qUA1mi|G=u1#WnrK Lelf7-JFET!Q$J&Q diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 2b299917f6..eee96c7961 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -511,7 +511,7 @@ struct Property { bytes value; } -/// @dev the ERC-165 identifier for this interface is 0x85d7dea6 +/// @dev the ERC-165 identifier for this interface is 0x69d14d3e contract ERC20UniqueExtensions is Dummy, ERC165 { /// @dev Function to check the amount of tokens that an owner allowed to a spender. /// @param owner crossAddress The address which owns the funds. @@ -630,6 +630,18 @@ contract ERC20UniqueExtensions is Dummy, ERC165 { dummy; return 0x0000000000000000000000000000000000000000; } + + /// @notice Balance of account + /// @param owner An cross address for whom to query the balance + /// @return The number of fingibles owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } } struct AmountForAddress { diff --git a/tests/src/eth/abi/fungible.json b/tests/src/eth/abi/fungible.json index b0dfdbbd2a..85de61f751 100644 --- a/tests/src/eth/abi/fungible.json +++ b/tests/src/eth/abi/fungible.json @@ -173,6 +173,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "owner", + "type": "tuple" + } + ], + "name": "balanceOfCross", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 5f212fca06..ef343d84ce 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -353,7 +353,7 @@ struct Property { bytes value; } -/// @dev the ERC-165 identifier for this interface is 0x85d7dea6 +/// @dev the ERC-165 identifier for this interface is 0x69d14d3e interface ERC20UniqueExtensions is Dummy, ERC165 { /// @dev Function to check the amount of tokens that an owner allowed to a spender. /// @param owner crossAddress The address which owns the funds. @@ -416,6 +416,13 @@ interface ERC20UniqueExtensions is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x1896cce6, /// or in textual repr: collectionHelperAddress() function collectionHelperAddress() external view returns (address); + + /// @notice Balance of account + /// @param owner An cross address for whom to query the balance + /// @return The number of fingibles owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) external view returns (uint256); } struct AmountForAddress { diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 505f576dd0..328f2680f3 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -427,6 +427,22 @@ describe('Fungible: Plain calls', () => { const toBalanceAfter = await collection.getBalance({Ethereum: receiver}); expect(toBalanceAfter - toBalanceBefore).to.be.eq(51n); }); + + itEth('Check balanceOfCross()', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}); + const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth); + + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + + let sum = 0n; + for (let i = 1n; i < 100n; i++) { + await collection.mint(alice, 100n, {Ethereum: owner.eth}); + sum += 100n; + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === sum).to.be.true; + } + }); }); describe('Fungible: Fees', () => { diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index a143cb9b40..718c849585 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -585,7 +585,7 @@ describe('Refungible: Plain calls', () => { expect(event.returnValues.tokenId).to.equal(tokenId.toString()); }); - itEth('Check crossBalanceOf()', async ({helper}) => { + itEth('Check balanceOfCross()', async ({helper}) => { const collection = await helper.rft.mintCollection(minter, {}); const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); diff --git a/tests/src/eth/tokens/minting.test.ts b/tests/src/eth/tokens/minting.test.ts index c88f01e51a..a2ece00e2c 100644 --- a/tests/src/eth/tokens/minting.test.ts +++ b/tests/src/eth/tokens/minting.test.ts @@ -19,7 +19,7 @@ import {Pallets} from '../../util'; import {expect, itEth, usingEthPlaygrounds} from '../util'; -describe.only('Minting tokens', () => { +describe('Minting tokens', () => { let donor: IKeyringPair; let alice: IKeyringPair; From 9871bd2fd60599834b15223ca91a96808bda6a05 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 18 Apr 2023 06:02:41 +0000 Subject: [PATCH 43/74] feat: balanceOfCross for RFT token --- pallets/refungible/src/erc_token.rs | 10 ++++++++++ .../src/stubs/UniqueRefungibleToken.raw | Bin 1892 -> 1945 bytes .../src/stubs/UniqueRefungibleToken.sol | 14 +++++++++++++- .../common/ethereum/sponsoring/refungible.rs | 8 +++++--- tests/src/eth/abi/reFungibleToken.json | 17 +++++++++++++++++ tests/src/eth/api/UniqueRefungibleToken.sol | 9 ++++++++- tests/src/eth/reFungibleToken.test.ts | 15 +++++++++++++++ 7 files changed, 68 insertions(+), 5 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 710d100320..35254755a1 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -283,6 +283,16 @@ where .map_err(dispatch_to_evm::)?; Ok(true) } + + /// @notice Balance of account + /// @param owner An cross address for whom to query the balance + /// @return The number of fingibles owned by `owner`, possibly zero + fn balance_of_cross(&self, owner: CrossAddress) -> Result { + self.consume_store_reads(1)?; + let balance = >::get((self.id, self.1, owner.into_sub_cross_account::()?)); + Ok(balance.into()) + } + /// @dev Function that changes total amount of the tokens. /// Throws if `msg.sender` doesn't owns all of the tokens. /// @param amount New total amount of the tokens. diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 78b3c791da1a4b9224206f41d156ce4f8329bc53..a37eec5983fba37722684f268be2ef5c032580ef 100644 GIT binary patch delta 1194 zcmaKqYe*DP6vy|@+*!>?H*vRQMOTfA3Suh*Az~zo$dGZ78F3))b)(0Jz#b4pu=8B8 zgl3&yVu%$Y6;TpIAoVpQC3;6uY|ulnVW;?ROukl`D&7($CJuD^AF;VHlsFYHWyHoD>6ZorFh+BIZE z0dIRYC^OD%mqN=w`a=+2WXW~l{fe56O;IC7>(&!YxkIu_xu`qA zRVHN0DY8n$R*E*K9LfztYfi|Q6;y+)>W0befTPDq1i@H=W}H=5JPpY>snFlL?tBC+ zFx?}X$eR%a&rq2ENA4xYk-wMVMpn&P9WJOY7gSFnst>Hi*3K>AN%AfXVKAax3)~fd zmDO#~(NerKs}k}b8F)kti!TpSE}44)dP6pHI?Pw#%|?Y0fevd(z7O~fQ(yQhWf#4%6evWT*pk|;h;A{N^%tB%ws^?7&Ia(Bh~ zkC)=R*(>B{EFwZ+wgke7xxX1t&E+;tuNTqG81Y$cIzfi+?(-Ly3l$1Un4vyNwatLe zQz7bh`|A^s9>F^ib}Cdj0k)aSWXOnF!5|UB20AU}PJPGOm+3@^PfhB9AQgHPz0ERE z%(0QvgQ(CYt0p=lNvd?R|E%QwJf`m#4%#f^&@e; zNfHQ=eMDB2kWL-7Pn~gu9vHV#S=19IHa|)3k|Xk?0NO!qqhUGnp}v0%usee;ijshH zvklt-e*w<_j;{h<23$Pzvleg-Fge~h@1k5TM9S+@IuTma(7N;KZarWF;A7$5Bw#Dx zWL31S6}ZE46neHV!r*1-F@zQyQTC#T;Z4B(3tGxF$dT$}OXmQG;I(TcRt@;fib1KF zF{pjevaf&P0omZ3_Oa)HY;fMY+zG&ra8xpPrKpmkih~4GPHK@TSJ)zvK$GrvDY{jfQnGFEuel}5P8M#PxP7q}_cX^7a1 zG~*E7>v|d16ck5IS`3i@3dIoR?i*dWrkwke{@4jU$jmYc#5LyTbJFjWFNjla!I;55 zRAVgRQWP-+p;YKGUn_*&`9qd)R8=W28mEPlQ?ISJ_bQlMq=6viKNC@du}~#~B%mU{ z9voo5?49|486&5~OzGx1xX5@b_*(rL0j|?Dm}W-flNt&1A+v;Rd29B@Nx0kcUS-R( zJt)3TM3rr2)Y-iy4=uqH^OTH2B>`9*F4OHh3-H%4iN-wxK}m}{6`tZX None, // Not sponsored - AllowanceCross { .. } | BurnFrom { .. } | BurnFromCross { .. } | Repartition { .. } => { - None - } + AllowanceCross { .. } + | BalanceOfCross { .. } + | BurnFrom { .. } + | BurnFromCross { .. } + | Repartition { .. } => None, TransferCross { .. } | TransferFromCross { .. } => { let RefungibleTokenHandle(handle, token_id) = token; diff --git a/tests/src/eth/abi/reFungibleToken.json b/tests/src/eth/abi/reFungibleToken.json index fc14c3e499..d476a80923 100644 --- a/tests/src/eth/abi/reFungibleToken.json +++ b/tests/src/eth/abi/reFungibleToken.json @@ -122,6 +122,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "eth", "type": "address" }, + { "internalType": "uint256", "name": "sub", "type": "uint256" } + ], + "internalType": "struct CrossAddress", + "name": "owner", + "type": "tuple" + } + ], + "name": "balanceOfCross", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index 019d7af306..3f73c2850d 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -23,7 +23,7 @@ interface ERC1633 is Dummy, ERC165 { function parentTokenId() external view returns (uint256); } -/// @dev the ERC-165 identifier for this interface is 0x01d536fc +/// @dev the ERC-165 identifier for this interface is 0xedd3a564 interface ERC20UniqueExtensions is Dummy, ERC165 { /// @dev Function to check the amount of tokens that an owner allowed to a spender. /// @param owner crossAddress The address which owns the funds. @@ -60,6 +60,13 @@ interface ERC20UniqueExtensions is Dummy, ERC165 { /// or in textual repr: approveCross((address,uint256),uint256) function approveCross(CrossAddress memory spender, uint256 amount) external returns (bool); + /// @notice Balance of account + /// @param owner An cross address for whom to query the balance + /// @return The number of fingibles owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0xec069398, + /// or in textual repr: balanceOfCross((address,uint256)) + function balanceOfCross(CrossAddress memory owner) external view returns (uint256); + /// @dev Function that changes total amount of the tokens. /// Throws if `msg.sender` doesn't owns all of the tokens. /// @param amount New total amount of the tokens. diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 4d6161141e..d1cd1fc667 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -466,6 +466,21 @@ describe('Refungible: Plain calls', () => { expect(await collection.getTokenBalance(tokenId, {Substrate: ownerSub.address})).to.be.equal(150n); } }); + + itEth('Check balanceOfCross()', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner.eth}); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth); + + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 200n).to.be.true; + + for (let i = 1n; i < 100n; i++) { + await tokenContract.methods.repartition(i).send({from: owner.eth}); + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; + } + }); }); describe('Refungible: Fees', () => { From 29762d93da0eae2f05b57460b2a3755da5ce00d3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 18 Apr 2023 09:22:10 +0000 Subject: [PATCH 44/74] fix: tests --- tests/src/eth/fungible.test.ts | 23 +++++++++++++++++------ tests/src/eth/nonFungible.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 2 +- tests/src/eth/reFungibleToken.test.ts | 22 ++++++++++++++++++---- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 328f2680f3..064952b5fe 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -431,17 +431,28 @@ describe('Fungible: Plain calls', () => { itEth('Check balanceOfCross()', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {}); const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const other = await helper.ethCrossAccount.createAccountWithBalance(donor); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth); expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; - let sum = 0n; - for (let i = 1n; i < 100n; i++) { - await collection.mint(alice, 100n, {Ethereum: owner.eth}); - sum += 100n; - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === sum).to.be.true; - } + await collection.mint(alice, 100n, {Ethereum: owner.eth}); + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + + await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth}); + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true; + + await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth}); + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true; + + await collectionEvm.methods.transferCross(owner, 100n).send({from: other.eth}); + expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; + expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; }); }); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index b5174d23be..c8b9ed71ef 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -671,7 +671,7 @@ describe('NFT: Plain calls', () => { expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; - for (let i = 1n; i < 100n; i++) { + for (let i = 1n; i < 10n; i++) { await collection.mintToken(minter, {Ethereum: owner.eth}); expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; } diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 718c849585..d7e396a866 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -593,7 +593,7 @@ describe('Refungible: Plain calls', () => { expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; - for (let i = 1n; i < 100n; i++) { + for (let i = 1n; i < 10n; i++) { await collection.mintToken(minter, 100n, {Ethereum: owner.eth}); expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; } diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index d1cd1fc667..2eb20543b2 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -470,16 +470,30 @@ describe('Refungible: Plain calls', () => { itEth('Check balanceOfCross()', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {}); const owner = await helper.ethCrossAccount.createAccountWithBalance(donor); + const other = await helper.ethCrossAccount.createAccountWithBalance(donor); const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner.eth}); const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth); expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 200n).to.be.true; + expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; - for (let i = 1n; i < 100n; i++) { - await tokenContract.methods.repartition(i).send({from: owner.eth}); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; - } + await tokenContract.methods.repartition(100n).send({from: owner.eth}); + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; + expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + + await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth}); + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true; + expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true; + + await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth}); + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true; + + await tokenContract.methods.repartition(1000n).send({from: other.eth}); + await tokenContract.methods.transferCross(owner, 500n).send({from: other.eth}); + expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 500n).to.be.true; + expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 500n).to.be.true; }); }); From 7445bbe5b1ba483a18c4a8e0115ba0b7d3839ebe Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 18 Apr 2023 11:51:41 +0000 Subject: [PATCH 45/74] fix: tests --- tests/src/eth/fungible.test.ts | 20 ++++++++++---------- tests/src/eth/nonFungible.test.ts | 6 +++--- tests/src/eth/reFungible.test.ts | 4 ++-- tests/src/eth/reFungibleToken.test.ts | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 064952b5fe..ea7755c71a 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -435,24 +435,24 @@ describe('Fungible: Plain calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner.eth); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; - expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0'); + expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0'); await collection.mint(alice, 100n, {Ethereum: owner.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; - expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100'); + expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0'); await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true; - expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50'); + expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50'); await collectionEvm.methods.transferCross(other, 50n).send({from: owner.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; - expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0'); + expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100'); await collectionEvm.methods.transferCross(owner, 100n).send({from: other.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; - expect(BigInt(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100'); + expect(await collectionEvm.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0'); }); }); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index c8b9ed71ef..4c8de46749 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -669,11 +669,11 @@ describe('NFT: Plain calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0'); - for (let i = 1n; i < 10n; i++) { + for (let i = 1; i < 10; i++) { await collection.mintToken(minter, {Ethereum: owner.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq(i.toString()); } }); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index d7e396a866..4bb5ba0e15 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -591,11 +591,11 @@ describe('Refungible: Plain calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0'); for (let i = 1n; i < 10n; i++) { await collection.mintToken(minter, 100n, {Ethereum: owner.eth}); - expect(BigInt(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})) === i).to.be.true; + expect(await collectionEvm.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq(i.toString()); } }); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 2eb20543b2..c71eae8e9a 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -475,25 +475,25 @@ describe('Refungible: Plain calls', () => { const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); const tokenContract = await helper.ethNativeContract.rftToken(tokenAddress, owner.eth); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 200n).to.be.true; - expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('200'); + expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0'); await tokenContract.methods.repartition(100n).send({from: owner.eth}); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 100n).to.be.true; - expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 0n).to.be.true; + expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('100'); + expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('0'); await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth}); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 50n).to.be.true; - expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 50n).to.be.true; + expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('50'); + expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('50'); await tokenContract.methods.transferCross(other, 50n).send({from: owner.eth}); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 0n).to.be.true; - expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 100n).to.be.true; + expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('0'); + expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('100'); await tokenContract.methods.repartition(1000n).send({from: other.eth}); await tokenContract.methods.transferCross(owner, 500n).send({from: other.eth}); - expect(BigInt(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})) === 500n).to.be.true; - expect(BigInt(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})) === 500n).to.be.true; + expect(await tokenContract.methods.balanceOfCross(owner).call({from: owner.eth})).to.be.eq('500'); + expect(await tokenContract.methods.balanceOfCross(other).call({from: owner.eth})).to.be.eq('500'); }); }); From a1d8979156dfbeb4d4f3e0d3de9e6a28711d669d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 19 Apr 2023 05:36:59 +0000 Subject: [PATCH 46/74] fix: tests --- tests/src/eth/nonFungible.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 4c8de46749..98d01a386a 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -684,7 +684,7 @@ describe('NFT: Plain calls', () => { const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); const {tokenId} = await collection.mintToken(minter, {Ethereum: owner.eth}); - for (let i = 1n; i < 100n; i++) { + for (let i = 1n; i < 10n; i++) { const ownerCross = await collectionEvm.methods.ownerOfCross(tokenId).call({from: owner.eth}); expect(ownerCross.eth).to.be.eq(owner.eth); expect(ownerCross.sub).to.be.eq(owner.sub); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 4bb5ba0e15..67d2d39811 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -606,7 +606,7 @@ describe('Refungible: Plain calls', () => { const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner.eth); const {tokenId} = await collection.mintToken(minter, 100n,{Ethereum: owner.eth}); - for (let i = 1n; i < 100n; i++) { + for (let i = 1n; i < 10n; i++) { const ownerCross = await collectionEvm.methods.ownerOfCross(tokenId).call({from: owner.eth}); expect(ownerCross.eth).to.be.eq(owner.eth); expect(ownerCross.sub).to.be.eq(owner.sub); From 2c040b3e73e984159cc69c2350b02e00e0121464 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 19 Apr 2023 11:48:08 +0000 Subject: [PATCH 47/74] fix: unused `on_runtime_upgrade()` was removed - AppPromo - Common - NonFungible --- Cargo.lock | 6 +++--- pallets/app-promotion/CHANGELOG.md | 5 +++++ pallets/app-promotion/Cargo.toml | 2 +- pallets/app-promotion/src/lib.rs | 10 ---------- pallets/common/CHANGELOG.md | 7 ++++++- pallets/common/Cargo.toml | 2 +- pallets/common/src/lib.rs | 9 --------- pallets/nonfungible/CHANGELOG.md | 7 ++++++- pallets/nonfungible/Cargo.toml | 2 +- pallets/nonfungible/src/lib.rs | 10 ---------- 10 files changed, 23 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf93aa31c0..8ccf03c69d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5996,7 +5996,7 @@ dependencies = [ [[package]] name = "pallet-app-promotion" -version = "0.1.5" +version = "0.1.6" dependencies = [ "frame-benchmarking", "frame-support", @@ -6262,7 +6262,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.13" +version = "0.1.14" dependencies = [ "ethereum", "evm-coder", @@ -6814,7 +6814,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.13" +version = "0.1.14" dependencies = [ "evm-coder", "frame-benchmarking", diff --git a/pallets/app-promotion/CHANGELOG.md b/pallets/app-promotion/CHANGELOG.md index 9fc8bf5793..a4c2454f53 100644 --- a/pallets/app-promotion/CHANGELOG.md +++ b/pallets/app-promotion/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. +## [0.1.6] - 2023-04-19 + +- ### Fixed + +- Useless `on_runtime_upgrade()` has been removed ## [0.1.5] - 2023-02-14 diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index d35207932c..e236b80b6d 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-app-promotion' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.5' +version = '0.1.6' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 5f303d6323..70451a85f1 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -263,10 +263,6 @@ pub mod pallet { pub type PreviousCalculatedRecord = StorageValue; - #[pallet::storage] - pub(crate) type UpgradedToReserves = - StorageValue; - #[pallet::hooks] impl Hooks> for Pallet { /// Block overflow is impossible due to the fact that the unstake algorithm in on_initialize @@ -290,12 +286,6 @@ pub mod pallet { ::WeightInfo::on_initialize(counter) } - - fn on_runtime_upgrade() -> Weight { - >::kill(); - - T::DbWeight::get().reads_writes(0, 1) - } } #[pallet::call] diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 8ba0abbbb8..12564abcdb 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. +## [0.1.14] - 2023-04-19 + +- ### Fixed + +- Useless `on_runtime_upgrade()` has been removed ## [0.1.13] - 2023-01-20 @@ -76,7 +81,7 @@ in the same block However, we don't use prefix removal limits, so upgrade is straightforward -Upstream-Change: https://github.com/paritytech/substrate/pull/11490 +Upstream-Change: - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 8851455385..4a77672d0c 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -2,7 +2,7 @@ edition = "2021" license = "GPLv3" name = "pallet-common" -version = "0.1.13" +version = "0.1.14" [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index ebe7a5f081..d93ce12db1 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -869,15 +869,6 @@ pub mod pallet { ), QueryKind = OptionQuery, >; - - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - StorageVersion::new(1).put::>(); - - Weight::zero() - } - } } impl Pallet { diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 42a144769d..4916092a27 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. +## [0.1.14] - 2023-04-19 + +- ### Fixed + +- Useless `on_runtime_upgrade()` has been removed ## [0.1.13] - 2023-01-20 @@ -77,7 +82,7 @@ in the same block However, we don't use prefix removal limits, so upgrade is straightforward -Upstream-Change: https://github.com/paritytech/substrate/pull/11490 +Upstream-Change: - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 0c46ede401..d1311cd899 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -2,7 +2,7 @@ edition = "2021" license = "GPLv3" name = "pallet-nonfungible" -version = "0.1.13" +version = "0.1.14" [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 25347a9c17..4046a835e5 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -281,16 +281,6 @@ pub mod pallet { Value = bool, QueryKind = ValueQuery, >; - - /// Upgrade from the old schema to properties. - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - StorageVersion::new(1).put::>(); - - Weight::zero() - } - } } pub struct NonfungibleHandle(pallet_common::CollectionHandle); From b4ec6cd8c8b00e82ca860d92fb3d95a12f3e03b6 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 28 Mar 2023 21:58:47 +0700 Subject: [PATCH 48/74] feat(weight): added benchs for decompose weight Changed weight calculation system for `transfer` & `transfer_from` (NFT) --- Cargo.lock | 4 +-- pallets/app-promotion/src/lib.rs | 8 ----- pallets/common/CHANGELOG.md | 6 ++++ pallets/common/Cargo.toml | 2 +- pallets/common/src/benchmarking.rs | 39 +++++++++++++++++++++++-- pallets/common/src/weights.rs | 7 +---- pallets/nonfungible/CHANGELOG.md | 6 ++++ pallets/nonfungible/Cargo.toml | 2 +- pallets/nonfungible/src/benchmarking.rs | 4 +-- pallets/nonfungible/src/common.rs | 16 ++++------ pallets/nonfungible/src/erc.rs | 21 +++++++------ pallets/nonfungible/src/lib.rs | 30 +++++++++++++++---- pallets/nonfungible/src/weights.rs | 2 +- 13 files changed, 98 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf93aa31c0..33586da994 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6262,7 +6262,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.13" +version = "0.1.14" dependencies = [ "ethereum", "evm-coder", @@ -6814,7 +6814,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.13" +version = "0.1.14" dependencies = [ "evm-coder", "frame-benchmarking", diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 5f303d6323..b626f5b230 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -845,7 +845,6 @@ impl Pallet { /// - `staker`: staker account. pub fn total_staked_by_id(staker: impl EncodeLike) -> Option> { let staked = Staked::::iter_prefix((staker,)) - .into_iter() .fold(>::default(), |acc, (_, (amount, _))| { acc + amount }); @@ -864,7 +863,6 @@ impl Pallet { staker: impl EncodeLike, ) -> Option)>> { let mut staked = Staked::::iter_prefix((staker,)) - .into_iter() .map(|(block, (amount, _))| (block, amount)) .collect::>(); staked.sort_by_key(|(block, _)| *block); @@ -884,12 +882,6 @@ impl Pallet { }) } - // pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf { - // Self::get_locked_balance(staker.as_sub()) - // .map(|l| l.amount) - // .unwrap_or_default() - // } - /// Returns all relay block numbers when stake was made, /// the amount of the stake. /// diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 8ba0abbbb8..3d81f6e94b 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. +## [0.1.14] - 2023-03-28 + +### Added + +- Added benchmark to check if user is contained in AllowList (`check_accesslist()`). + ## [0.1.13] - 2023-01-20 ### Changed diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 8851455385..4a77672d0c 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -2,7 +2,7 @@ edition = "2021" license = "GPLv3" name = "pallet-common" -version = "0.1.13" +version = "0.1.14" [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index ed053dc793..7743f58890 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -22,8 +22,9 @@ use pallet_evm::account::CrossAccountId; use frame_benchmarking::{benchmarks, account}; use up_data_structs::{ CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey, - PropertyValue, CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH, - MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM, + PropertyValue, CollectionPermissions, NestingPermissions, AccessMode, + MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, + MAX_PROPERTIES_PER_ITEM, }; use frame_support::{ traits::{Currency, Get}, @@ -193,4 +194,38 @@ benchmarks! { >::set_collection_properties(&collection, &owner, props.into_iter())?; let to_delete = (0..b).map(|p| property_key(p as usize)).collect::>(); }: {>::delete_collection_properties(&collection, &owner, to_delete.into_iter())?} + + check_accesslist{ + bench_init!{ + owner: sub; collection: collection(owner); + sender: cross_from_sub(owner); receiver: cross_sub; + }; + + let mut collection_handle = >::try_get(collection.id)?; + >::update_permissions( + &sender, + &mut collection_handle, + CollectionPermissions { access: Some(AccessMode::AllowList), ..Default::default() } + )?; + + >::toggle_allowlist( + &collection, + &sender, + &sender, + true, + )?; + + >::toggle_allowlist( + &collection, + &sender, + &receiver, + true, + )?; + + assert_eq!(collection_handle.permissions.access(), AccessMode::AllowList); + + collection_handle.check_allowlist(&sender)?; + collection_handle.check_allowlist(&receiver)?; + + }: {collection_handle.check_allowlist(&sender)?;} } diff --git a/pallets/common/src/weights.rs b/pallets/common/src/weights.rs index 5db4e2b8e2..b308968240 100644 --- a/pallets/common/src/weights.rs +++ b/pallets/common/src/weights.rs @@ -36,6 +36,7 @@ use sp_std::marker::PhantomData; pub trait WeightInfo { fn set_collection_properties(b: u32, ) -> Weight; fn delete_collection_properties(b: u32, ) -> Weight; + fn check_accesslist() -> Weight; } /// Weights for pallet_common using the Substrate node and recommended hardware. @@ -66,11 +67,8 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(6_684_000, 43467) // Standard Error: 67_984 .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } -} - // For backwards compatibility and tests impl WeightInfo for () { /// Storage: Common CollectionProperties (r:1 w:1) @@ -98,8 +96,5 @@ impl WeightInfo for () { Weight::from_parts(6_684_000, 43467) // Standard Error: 67_984 .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } -} - diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 42a144769d..7218b8ceb4 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. +## [0.1.14] - 2023-03-28 + +### Fixed + +- The weight of `transfer` and `transfer_from`. + ## [0.1.13] - 2023-01-20 ### Fixed diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 0c46ede401..d1311cd899 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -2,7 +2,7 @@ edition = "2021" license = "GPLv3" name = "pallet-nonfungible" -version = "0.1.13" +version = "0.1.14" [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index c96094e222..6a203393ec 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -146,14 +146,14 @@ benchmarks! { let item = create_max_item(&collection, &owner, owner_eth.clone())?; }: {>::set_allowance_from(&collection, &sender, &owner_eth, item, Some(&spender))?} - transfer_from { + checks_for_transfer_from { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub; }; let item = create_max_item(&collection, &owner, sender.clone())?; >::set_allowance(&collection, &sender, item, Some(&spender))?; - }: {>::transfer_from(&collection, &spender, &sender, &receiver, item, &Unlimited)?} + }: {>::check_allowed(&collection, &spender, &sender, item, &Unlimited)?} burn_from { bench_init!{ diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 454fd85d43..bfb1c13c08 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -23,7 +23,7 @@ use up_data_structs::{ }; use pallet_common::{ CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, - weights::WeightInfo as _, + weights::WeightInfo as _, SelfWeightOf as PalletCommonWeightOf, }; use sp_runtime::DispatchError; use sp_std::{vec::Vec, vec}; @@ -91,7 +91,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer() -> Weight { - >::transfer() + >::transfer() + >::check_accesslist() * 2 } fn approve() -> Weight { @@ -103,7 +103,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer_from() -> Weight { - >::transfer_from() + Self::transfer() + >::checks_for_transfer_from() } fn burn_from() -> Weight { @@ -325,10 +325,7 @@ impl CommonCollectionOperations for NonfungibleHandle { ) -> DispatchResultWithPostInfo { ensure!(amount <= 1, >::NonfungibleItemsHaveNoAmount); if amount == 1 { - with_weight( - >::transfer(self, &from, &to, token, nesting_budget), - >::transfer(), - ) + >::transfer(self, &from, &to, token, nesting_budget) } else { >::check_token_immediate_ownership(self, token, &from)?; Ok(().into()) @@ -386,10 +383,7 @@ impl CommonCollectionOperations for NonfungibleHandle { ensure!(amount <= 1, >::NonfungibleItemsHaveNoAmount); if amount == 1 { - with_weight( - >::transfer_from(self, &sender, &from, &to, token, nesting_budget), - >::transfer_from(), - ) + >::transfer_from(self, &sender, &from, &to, token, nesting_budget) } else { >::check_allowed(self, &sender, &from, token, nesting_budget)?; diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 761b241d2b..3004909ba0 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -39,6 +39,7 @@ use pallet_common::{ CollectionHandle, CollectionPropertyPermissions, CommonCollectionOperations, erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key}, eth::{self, TokenUri}, + CommonWeightInfo, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::call; @@ -47,7 +48,7 @@ use sp_core::{U256, Get}; use crate::{ AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted, - TokenProperties, SelfWeightOf, weights::WeightInfo, + TokenProperties, SelfWeightOf, weights::WeightInfo, common::CommonWeights, }; /// Nft events. @@ -458,7 +459,7 @@ impl NonfungibleHandle { /// @param from The current owner of the NFT /// @param to The new owner /// @param tokenId The NFT to transfer - #[weight(>::transfer_from())] + #[weight(>::transfer_from())] fn transfer_from( &mut self, caller: Caller, @@ -475,7 +476,7 @@ impl NonfungibleHandle { .weight_calls_budget(>::find_parent()); >::transfer_from(self, &caller, &from, &to, token, &budget) - .map_err(dispatch_to_evm::)?; + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(()) } @@ -824,7 +825,7 @@ where /// is the zero address. Throws if `tokenId` is not a valid NFT. /// @param to The new owner /// @param tokenId The NFT to transfer - #[weight(>::transfer())] + #[weight(>::transfer())] fn transfer(&mut self, caller: Caller, to: Address, token_id: U256) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); @@ -833,7 +834,8 @@ where .recorder .weight_calls_budget(>::find_parent()); - >::transfer(self, &caller, &to, token, &budget).map_err(dispatch_to_evm::)?; + >::transfer(self, &caller, &to, token, &budget) + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(()) } @@ -842,7 +844,7 @@ where /// is the zero address. Throws if `tokenId` is not a valid NFT. /// @param to The new owner /// @param tokenId The NFT to transfer - #[weight(>::transfer())] + #[weight(>::transfer())] fn transfer_cross( &mut self, caller: Caller, @@ -856,7 +858,8 @@ where .recorder .weight_calls_budget(>::find_parent()); - >::transfer(self, &caller, &to, token, &budget).map_err(dispatch_to_evm::)?; + >::transfer(self, &caller, &to, token, &budget) + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(()) } @@ -866,7 +869,7 @@ where /// @param from Cross acccount address of current owner /// @param to Cross acccount address of new owner /// @param tokenId The NFT to transfer - #[weight(>::transfer())] + #[weight(>::transfer_from())] fn transfer_from_cross( &mut self, caller: Caller, @@ -882,7 +885,7 @@ where .recorder .weight_calls_budget(>::find_parent()); Pallet::::transfer_from(self, &caller, &from, &to, token_id, &budget) - .map_err(dispatch_to_evm::)?; + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(()) } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 25347a9c17..85d3ae3a4e 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -108,7 +108,8 @@ use up_data_structs::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_common::{ Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle, - eth::collection_id_to_address, + eth::collection_id_to_address, SelfWeightOf as PalletCommonWeightOf, + weights::WeightInfo as CommonWeightInfo, }; use pallet_structure::{Pallet as PalletStructure, Error as StructureError}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; @@ -802,7 +803,7 @@ impl Pallet { to: &T::CrossAccountId, token: TokenId, nesting_budget: &dyn Budget, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { ensure!( collection.limits.transfers_enabled(), >::TransferNotAllowed @@ -812,7 +813,8 @@ impl Pallet { >::get((collection.id, token)).ok_or(>::TokenNotFound)?; ensure!(&token_data.owner == from, >::NoPermission); - if collection.permissions.access() == AccessMode::AllowList { + let is_allow_list_mode = collection.permissions.access() == AccessMode::AllowList; + if is_allow_list_mode { collection.check_allowlist(from)?; collection.check_allowlist(to)?; } @@ -884,7 +886,18 @@ impl Pallet { to.clone(), 1, )); - Ok(()) + + let actual_weight = match is_allow_list_mode { + true => Some( + >::transfer() + >::check_accesslist() * 2, + ), + false => Some(>::transfer()), + }; + + Ok(PostDispatchInfo { + actual_weight, + pays_fee: Pays::Yes, + }) } /// Batch operation to mint multiple NFT tokens. @@ -1228,13 +1241,18 @@ impl Pallet { to: &T::CrossAccountId, token: TokenId, nesting_budget: &dyn Budget, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { Self::check_allowed(collection, spender, from, token, nesting_budget)?; // ========= // Allowance is reset in [`transfer`] - Self::transfer(collection, from, to, token, nesting_budget) + Self::transfer(collection, from, to, token, nesting_budget).map(|mut p| { + p.actual_weight = Some( + p.actual_weight.unwrap_or_default() + >::checks_for_transfer_from(), + ); + p + }) } /// Burn NFT token for `from` account. diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index e2ce55dea9..0fbf848bdc 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -43,7 +43,7 @@ pub trait WeightInfo { fn transfer() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; - fn transfer_from() -> Weight; + fn checks_for_transfer_from() -> Weight; fn burn_from() -> Weight; fn set_token_property_permissions(b: u32, ) -> Weight; fn set_token_properties(b: u32, ) -> Weight; From f4c0a8800bca0868e3e3959da72ba60e95bc9046 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 29 Mar 2023 22:58:44 +0700 Subject: [PATCH 49/74] refactor: impl of `transfer` `transfer_from` functions, bencmarks for `Common` & `NFT` pallets --- pallets/common/src/benchmarking.rs | 8 ----- pallets/common/src/helpers.rs | 30 ++++++++++++++++++ pallets/common/src/lib.rs | 2 +- pallets/nonfungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/common.rs | 2 +- pallets/nonfungible/src/lib.rs | 25 +++++---------- pallets/nonfungible/src/weights.rs | 42 ++++++------------------- 7 files changed, 50 insertions(+), 61 deletions(-) create mode 100644 pallets/common/src/helpers.rs diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index 7743f58890..bf7a187015 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -215,17 +215,9 @@ benchmarks! { true, )?; - >::toggle_allowlist( - &collection, - &sender, - &receiver, - true, - )?; - assert_eq!(collection_handle.permissions.access(), AccessMode::AllowList); collection_handle.check_allowlist(&sender)?; - collection_handle.check_allowlist(&receiver)?; }: {collection_handle.check_allowlist(&sender)?;} } diff --git a/pallets/common/src/helpers.rs b/pallets/common/src/helpers.rs new file mode 100644 index 0000000000..7cad9deb07 --- /dev/null +++ b/pallets/common/src/helpers.rs @@ -0,0 +1,30 @@ +//! # Helpers module +//! +//! The module contains helpers. +//! +use frame_support::{ + pallet_prelude::DispatchResultWithPostInfo, + weights::Weight, + dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}, +}; + +/// Add weight for a `DispatchResultWithPostInfo` +/// +/// - `target`: DispatchResultWithPostInfo to which weight will be added +/// - `additional_weight`: Weight to be added +pub fn add_weight_to_post_info(target: &mut DispatchResultWithPostInfo, additional_weight: Weight) { + match target { + Ok(PostDispatchInfo { + actual_weight: Some(weight), + .. + }) + | Err(DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(weight), + .. + }, + .. + }) => *weight += additional_weight, + _ => {} + } +} diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index ebe7a5f081..914f21e954 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -92,9 +92,9 @@ pub mod benchmarking; pub mod dispatch; pub mod erc; pub mod eth; +pub mod helpers; #[allow(missing_docs)] pub mod weights; - /// Weight info. pub type SelfWeightOf = ::WeightInfo; diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 6a203393ec..2b1fa8a551 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -146,7 +146,7 @@ benchmarks! { let item = create_max_item(&collection, &owner, owner_eth.clone())?; }: {>::set_allowance_from(&collection, &sender, &owner_eth, item, Some(&spender))?} - checks_for_transfer_from { + checks_allowed_raw { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub; diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index bfb1c13c08..6d1f4eddb3 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -103,7 +103,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer_from() -> Weight { - Self::transfer() + >::checks_for_transfer_from() + Self::transfer() + >::checks_allowed_raw() } fn burn_from() -> Weight { diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 85d3ae3a4e..869670fc59 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -109,7 +109,7 @@ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_common::{ Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle, eth::collection_id_to_address, SelfWeightOf as PalletCommonWeightOf, - weights::WeightInfo as CommonWeightInfo, + weights::WeightInfo as CommonWeightInfo, helpers::add_weight_to_post_info, }; use pallet_structure::{Pallet as PalletStructure, Error as StructureError}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; @@ -809,14 +809,15 @@ impl Pallet { >::TransferNotAllowed ); + let mut actual_weight = >::transfer(); let token_data = >::get((collection.id, token)).ok_or(>::TokenNotFound)?; ensure!(&token_data.owner == from, >::NoPermission); - let is_allow_list_mode = collection.permissions.access() == AccessMode::AllowList; - if is_allow_list_mode { + if collection.permissions.access() == AccessMode::AllowList { collection.check_allowlist(from)?; collection.check_allowlist(to)?; + actual_weight += >::check_accesslist() * 2; } >::ensure_correct_receiver(to)?; @@ -887,15 +888,8 @@ impl Pallet { 1, )); - let actual_weight = match is_allow_list_mode { - true => Some( - >::transfer() + >::check_accesslist() * 2, - ), - false => Some(>::transfer()), - }; - Ok(PostDispatchInfo { - actual_weight, + actual_weight: Some(actual_weight), pays_fee: Pays::Yes, }) } @@ -1247,12 +1241,9 @@ impl Pallet { // ========= // Allowance is reset in [`transfer`] - Self::transfer(collection, from, to, token, nesting_budget).map(|mut p| { - p.actual_weight = Some( - p.actual_weight.unwrap_or_default() + >::checks_for_transfer_from(), - ); - p - }) + let mut result = Self::transfer(collection, from, to, token, nesting_budget); + add_weight_to_post_info(&mut result, >::checks_allowed_raw()); + result } /// Burn NFT token for `from` account. diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 0fbf848bdc..882eff9edb 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -43,7 +43,7 @@ pub trait WeightInfo { fn transfer() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; - fn checks_for_transfer_from() -> Weight; + fn checks_allowed_raw() -> Weight; fn burn_from() -> Weight; fn set_token_property_permissions(b: u32, ) -> Weight; fn set_token_properties(b: u32, ) -> Weight; @@ -252,22 +252,10 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Nonfungible Allowance (r:1 w:1) - /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible TokenData (r:1 w:1) - /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible AccountBalance (r:2 w:2) - /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) - /// Storage: Nonfungible Owned (r:0 w:2) - /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - fn transfer_from() -> Weight { - // Proof Size summary in bytes: - // Measured: `527` - // Estimated: `10144` - // Minimum execution time: 24_919_000 picoseconds. - Weight::from_parts(25_333_000, 10144) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + // Storage: Nonfungible Allowance (r:1 w:0) + fn checks_allowed_raw() -> Weight { + Weight::from_ref_time(3_341_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) @@ -578,22 +566,10 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Nonfungible Allowance (r:1 w:1) - /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible TokenData (r:1 w:1) - /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible AccountBalance (r:2 w:2) - /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) - /// Storage: Nonfungible Owned (r:0 w:2) - /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - fn transfer_from() -> Weight { - // Proof Size summary in bytes: - // Measured: `527` - // Estimated: `10144` - // Minimum execution time: 24_919_000 picoseconds. - Weight::from_parts(25_333_000, 10144) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(6_u64)) + // Storage: Nonfungible Allowance (r:1 w:0) + fn checks_allowed_raw() -> Weight { + Weight::from_ref_time(3_341_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) From 918595f443279f7021ab5ed34523af1f7108fc79 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 30 Mar 2023 09:37:48 +0700 Subject: [PATCH 50/74] fix: bench for common pallet --- pallets/common/src/benchmarking.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index bf7a187015..1ed0f83fb9 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -198,7 +198,7 @@ benchmarks! { check_accesslist{ bench_init!{ owner: sub; collection: collection(owner); - sender: cross_from_sub(owner); receiver: cross_sub; + sender: cross_from_sub(owner); }; let mut collection_handle = >::try_get(collection.id)?; @@ -217,7 +217,5 @@ benchmarks! { assert_eq!(collection_handle.permissions.access(), AccessMode::AllowList); - collection_handle.check_allowlist(&sender)?; - }: {collection_handle.check_allowlist(&sender)?;} } From 908b58f6b3818f258741501e5a6140e7843c7653 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 30 Mar 2023 12:52:12 +0700 Subject: [PATCH 51/74] feat(weight): Changed weight calculation system for transfer & transfer_from (FT) --- Cargo.lock | 2 +- pallets/foreign-assets/src/impl_fungibles.rs | 3 +- pallets/fungible/CHANGELOG.md | 6 +++ pallets/fungible/Cargo.toml | 2 +- pallets/fungible/src/benchmarking.rs | 14 ++++-- pallets/fungible/src/common.rs | 18 +++----- pallets/fungible/src/erc.rs | 17 +++---- pallets/fungible/src/lib.rs | 41 ++++++++++++----- pallets/fungible/src/weights.rs | 47 +++++++++----------- 9 files changed, 88 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33586da994..a9c45da281 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6558,7 +6558,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.10" +version = "0.1.11" dependencies = [ "evm-coder", "frame-benchmarking", diff --git a/pallets/foreign-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs index ddfa526ce3..9afe287e93 100644 --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -452,7 +452,8 @@ where &T::CrossAccountId::from_sub(dest.clone()), amount.into(), &Value::new(0), - )?; + ) + .map_err(|e| e.error)?; Ok(amount) } diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index a67be88890..37181ceab2 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. +## [0.1.11] - 2023-03-28 + +### Fixed + +- The weight of `transfer` and `transfer_from`. + ## [0.1.10] - 2023-02-01 ### Added diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index fc742d9c81..d227f7b8e1 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -2,7 +2,7 @@ edition = "2021" license = "GPLv3" name = "pallet-fungible" -version = "0.1.10" +version = "0.1.11" [dependencies] # Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it. diff --git a/pallets/fungible/src/benchmarking.rs b/pallets/fungible/src/benchmarking.rs index f4dc8a0f1f..cdd544da7e 100644 --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -92,14 +92,22 @@ benchmarks! { >::create_item(&collection, &owner, (owner_eth.clone(), 200), &Unlimited)?; }: {>::set_allowance_from(&collection, &sender, &owner_eth, &spender, 100)?} - transfer_from { + check_allowed_raw { bench_init!{ owner: sub; collection: collection(owner); - owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub; + owner: cross_from_sub; sender: cross_sub; spender: cross_sub; }; >::create_item(&collection, &owner, (sender.clone(), 200), &Unlimited)?; >::set_allowance(&collection, &sender, &spender, 200)?; - }: {>::transfer_from(&collection, &spender, &sender, &receiver, 100, &Unlimited)?} + }: {>::check_allowed(&collection, &spender, &sender, 200, &Unlimited)?;} + + set_allowance_unchecked_raw { + bench_init!{ + owner: sub; collection: collection(owner); + owner: cross_from_sub; sender: cross_sub; spender: cross_sub; + }; + >::create_item(&collection, &owner, (sender.clone(), 200), &Unlimited)?; + }: {>::set_allowance_unchecked(&collection, &sender, &spender, 200);} burn_from { bench_init!{ diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 42041c450e..88bc24b4ca 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -22,7 +22,7 @@ use up_data_structs::{ }; use pallet_common::{ CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, - weights::WeightInfo as _, + weights::WeightInfo as _, SelfWeightOf as PalletCommonWeightOf, }; use pallet_structure::Error as StructureError; use sp_runtime::ArithmeticError; @@ -78,7 +78,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer() -> Weight { - >::transfer() + >::transfer() + >::check_accesslist() * 2 } fn approve() -> Weight { @@ -90,7 +90,9 @@ impl CommonWeightInfo for CommonWeights { } fn transfer_from() -> Weight { - >::transfer_from() + >::transfer() + + >::check_allowed_raw() + + >::set_allowance_unchecked_raw() } fn burn_from() -> Weight { @@ -232,10 +234,7 @@ impl CommonCollectionOperations for FungibleHandle { >::FungibleItemsHaveNoId ); - with_weight( - >::transfer(self, &from, &to, amount, nesting_budget), - >::transfer(), - ) + >::transfer(self, &from, &to, amount, nesting_budget) } fn approve( @@ -289,10 +288,7 @@ impl CommonCollectionOperations for FungibleHandle { >::FungibleItemsHaveNoId ); - with_weight( - >::transfer_from(self, &sender, &from, &to, amount, nesting_budget), - >::transfer_from(), - ) + >::transfer_from(self, &sender, &from, &to, amount, nesting_budget) } fn burn_from( diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index d6e2852269..a40ecade20 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -26,6 +26,7 @@ use pallet_common::{ CollectionHandle, erc::{CommonEvmHandler, PrecompileResult, CollectionCall}, eth::CrossAddress, + CommonWeightInfo as _, }; use sp_std::vec::Vec; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; @@ -39,7 +40,7 @@ use sp_core::{U256, Get}; use crate::{ Allowance, Balance, Config, FungibleHandle, Pallet, TotalSupply, SelfWeightOf, - weights::WeightInfo, + weights::WeightInfo, common::CommonWeights, }; frontier_contract! { @@ -99,7 +100,7 @@ impl FungibleHandle { let balance = >::get((self.id, owner)); Ok(balance.into()) } - #[weight(>::transfer())] + #[weight(>::transfer())] fn transfer(&mut self, caller: Caller, to: Address, amount: U256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); @@ -112,7 +113,7 @@ impl FungibleHandle { Ok(true) } - #[weight(>::transfer_from())] + #[weight(>::transfer_from())] fn transfer_from( &mut self, caller: Caller, @@ -129,7 +130,7 @@ impl FungibleHandle { .weight_calls_budget(>::find_parent()); >::transfer_from(self, &caller, &from, &to, amount, &budget) - .map_err(dispatch_to_evm::)?; + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(true) } #[weight(>::approve())] @@ -201,7 +202,7 @@ where let budget = self .recorder .weight_calls_budget(>::find_parent()); - >::create_item(&self, &caller, (to, amount), &budget) + >::create_item(self, &caller, (to, amount), &budget) .map_err(dispatch_to_evm::)?; Ok(true) } @@ -289,7 +290,7 @@ where Ok(true) } - #[weight(>::transfer())] + #[weight(>::transfer())] fn transfer_cross(&mut self, caller: Caller, to: CrossAddress, amount: U256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = to.into_sub_cross_account::()?; @@ -302,7 +303,7 @@ where Ok(true) } - #[weight(>::transfer_from())] + #[weight(>::transfer_from())] fn transfer_from_cross( &mut self, caller: Caller, @@ -319,7 +320,7 @@ where .weight_calls_budget(>::find_parent()); >::transfer_from(self, &caller, &from, &to, amount, &budget) - .map_err(dispatch_to_evm::)?; + .map_err(|e| dispatch_to_evm::(e.error))?; Ok(true) } diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 10042aaac4..dde9f0a965 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -80,7 +80,11 @@ use core::ops::Deref; use evm_coder::ToLog; -use frame_support::ensure; +use frame_support::{ + ensure, + pallet_prelude::{DispatchResultWithPostInfo, Pays}, + dispatch::PostDispatchInfo, +}; use pallet_evm::account::CrossAccountId; use up_data_structs::{ AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData, @@ -88,7 +92,8 @@ use up_data_structs::{ }; use pallet_common::{ Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, - eth::collection_id_to_address, + eth::collection_id_to_address, SelfWeightOf as PalletCommonWeightOf, + weights::WeightInfo as CommonWeightInfo, helpers::add_weight_to_post_info, }; use pallet_evm::Pallet as PalletEvm; use pallet_structure::Pallet as PalletStructure; @@ -96,7 +101,7 @@ use pallet_evm_coder_substrate::WithRecorder; use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult}; use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; - +use weights::WeightInfo; pub use pallet::*; use crate::erc::ERC20Events; @@ -389,18 +394,20 @@ impl Pallet { to: &T::CrossAccountId, amount: u128, nesting_budget: &dyn Budget, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { ensure!( collection.limits.transfers_enabled(), >::TransferNotAllowed, ); + let mut actual_weight = >::transfer(); + if collection.permissions.access() == AccessMode::AllowList { collection.check_allowlist(from)?; collection.check_allowlist(to)?; + actual_weight += >::check_accesslist() * 2; } >::ensure_correct_receiver(to)?; - let balance_from = >::get((collection.id, from)) .checked_sub(amount) .ok_or(>::TokenValueTooLow)?; @@ -451,7 +458,11 @@ impl Pallet { to.clone(), amount, )); - Ok(()) + + Ok(PostDispatchInfo { + actual_weight: Some(actual_weight), + pays_fee: Pays::Yes, + }) } /// Minting tokens for multiple IDs. @@ -464,8 +475,8 @@ impl Pallet { nesting_budget: &dyn Budget, ) -> DispatchResult { let total_supply = data - .iter() - .map(|(_, v)| *v) + .values() + .copied() .try_fold(>::get(collection.id), |acc, v| { acc.checked_add(v) }) @@ -718,7 +729,6 @@ impl Pallet { /// Same as the [`transfer`][`Pallet::transfer`] but spender doesn't needs to be an owner of the token pieces. /// The owner should set allowance for the spender to transfer pieces. /// See [`set_allowance`][`Pallet::set_allowance`] for more details. - pub fn transfer_from( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -726,16 +736,23 @@ impl Pallet { to: &T::CrossAccountId, amount: u128, nesting_budget: &dyn Budget, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { let allowance = Self::check_allowed(collection, spender, from, amount, nesting_budget)?; // ========= - Self::transfer(collection, from, to, amount, nesting_budget)?; + let mut result = Self::transfer(collection, from, to, amount, nesting_budget); + add_weight_to_post_info(&mut result, >::check_allowed_raw()); + result?; + if let Some(allowance) = allowance { Self::set_allowance_unchecked(collection, from, spender, allowance); + add_weight_to_post_info( + &mut result, + >::set_allowance_unchecked_raw(), + ) } - Ok(()) + result } /// Burn fungible tokens from the account. diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index a94c79d585..336cb6bfd3 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -40,7 +40,8 @@ pub trait WeightInfo { fn transfer() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; - fn transfer_from() -> Weight; + fn check_allowed_raw() -> Weight; + fn set_allowance_unchecked_raw() -> Weight; fn burn_from() -> Weight; } @@ -129,18 +130,16 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Fungible Allowance (r:1 w:1) - /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) - /// Storage: Fungible Balance (r:2 w:2) - /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) - fn transfer_from() -> Weight { - // Proof Size summary in bytes: - // Measured: `300` - // Estimated: `7672` - // Minimum execution time: 21_667_000 picoseconds. - Weight::from_parts(22_166_000, 7672) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Storage: Fungible Allowance (r:1 w:0) + fn check_allowed_raw() -> Weight { + Weight::from_ref_time(3_550_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + } + // Storage: Fungible Allowance (r:1 w:1) + fn set_allowance_unchecked_raw() -> Weight { + Weight::from_ref_time(10_682_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } /// Storage: Fungible Allowance (r:1 w:1) /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) @@ -243,18 +242,16 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Fungible Allowance (r:1 w:1) - /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) - /// Storage: Fungible Balance (r:2 w:2) - /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) - fn transfer_from() -> Weight { - // Proof Size summary in bytes: - // Measured: `300` - // Estimated: `7672` - // Minimum execution time: 21_667_000 picoseconds. - Weight::from_parts(22_166_000, 7672) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Storage: Fungible Allowance (r:1 w:0) + fn check_allowed_raw() -> Weight { + Weight::from_ref_time(3_550_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + } + // Storage: Fungible Allowance (r:1 w:1) + fn set_allowance_unchecked_raw() -> Weight { + Weight::from_ref_time(10_682_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } /// Storage: Fungible Allowance (r:1 w:1) /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) From c35b92370cdad001c75589dbd233dabf05592af5 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 30 Mar 2023 22:46:15 +0700 Subject: [PATCH 52/74] fix: weight calculation for `transfer_from` (FT) --- pallets/fungible/src/common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 88bc24b4ca..a9a8f70580 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -90,7 +90,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer_from() -> Weight { - >::transfer() + Self::transfer() + >::check_allowed_raw() + >::set_allowance_unchecked_raw() } From 008833a7ebae6dfe87dd8be42e95fea36ae99dac Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 31 Mar 2023 12:37:18 +0700 Subject: [PATCH 53/74] refactor(weight): bench rename `transfer` to `transfer_raw` --- pallets/fungible/src/benchmarking.rs | 2 +- pallets/fungible/src/common.rs | 2 +- pallets/fungible/src/lib.rs | 2 +- pallets/fungible/src/weights.rs | 32 ++++++---------- pallets/nonfungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/common.rs | 2 +- pallets/nonfungible/src/lib.rs | 2 +- pallets/nonfungible/src/weights.rs | 50 +++++++++---------------- 8 files changed, 34 insertions(+), 60 deletions(-) diff --git a/pallets/fungible/src/benchmarking.rs b/pallets/fungible/src/benchmarking.rs index cdd544da7e..b18830cc6b 100644 --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -66,7 +66,7 @@ benchmarks! { >::create_item(&collection, &owner, (burner.clone(), 200), &Unlimited)?; }: {>::burn(&collection, &burner, 100)?} - transfer { + transfer_raw { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; to: cross_sub; diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index a9a8f70580..d2894b3460 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -78,7 +78,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer() -> Weight { - >::transfer() + >::check_accesslist() * 2 + >::transfer_raw() + >::check_accesslist() * 2 } fn approve() -> Weight { diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index dde9f0a965..e21311fdf6 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -400,7 +400,7 @@ impl Pallet { >::TransferNotAllowed, ); - let mut actual_weight = >::transfer(); + let mut actual_weight = >::transfer_raw(); if collection.permissions.access() == AccessMode::AllowList { collection.check_allowlist(from)?; diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index 336cb6bfd3..439f91e605 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -37,7 +37,7 @@ pub trait WeightInfo { fn create_item() -> Weight; fn create_multiple_items_ex(b: u32, ) -> Weight; fn burn_item() -> Weight; - fn transfer() -> Weight; + fn transfer_raw() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; fn check_allowed_raw() -> Weight; @@ -93,16 +93,11 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: Fungible Balance (r:2 w:2) - /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `182` - // Estimated: `5104` - // Minimum execution time: 13_832_000 picoseconds. - Weight::from_parts(14_064_000, 5104) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Storage: Fungible Balance (r:2 w:2) + fn transfer_raw() -> Weight { + Weight::from_ref_time(12_041_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } /// Storage: Fungible Balance (r:1 w:0) /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) @@ -205,16 +200,11 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Fungible Balance (r:2 w:2) - /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `182` - // Estimated: `5104` - // Minimum execution time: 13_832_000 picoseconds. - Weight::from_parts(14_064_000, 5104) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Storage: Fungible Balance (r:2 w:2) + fn transfer_raw() -> Weight { + Weight::from_ref_time(12_041_000 as u64) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } /// Storage: Fungible Balance (r:1 w:0) /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 2b1fa8a551..9b4997bcec 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -121,7 +121,7 @@ benchmarks! { } }: {>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?} - transfer { + transfer_raw { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; receiver: cross_sub; diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 6d1f4eddb3..961384b3e3 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -91,7 +91,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer() -> Weight { - >::transfer() + >::check_accesslist() * 2 + >::transfer_raw() + >::check_accesslist() * 2 } fn approve() -> Weight { diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 869670fc59..78caa00b49 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -809,7 +809,7 @@ impl Pallet { >::TransferNotAllowed ); - let mut actual_weight = >::transfer(); + let mut actual_weight = >::transfer_raw(); let token_data = >::get((collection.id, token)).ok_or(>::TokenNotFound)?; ensure!(&token_data.owner == from, >::NoPermission); diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 882eff9edb..75d71342d9 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -40,7 +40,7 @@ pub trait WeightInfo { fn burn_item() -> Weight; fn burn_recursively_self_raw() -> Weight; fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight; - fn transfer() -> Weight; + fn transfer_raw() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; fn checks_allowed_raw() -> Weight; @@ -209,22 +209,14 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into())) } - /// Storage: Nonfungible TokenData (r:1 w:1) - /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible AccountBalance (r:2 w:2) - /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) - /// Storage: Nonfungible Allowance (r:1 w:0) - /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible Owned (r:0 w:2) - /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `10144` - // Minimum execution time: 18_629_000 picoseconds. - Weight::from_parts(18_997_000, 10144) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + // Storage: Nonfungible TokenData (r:1 w:1) + // Storage: Nonfungible AccountBalance (r:2 w:2) + // Storage: Nonfungible Allowance (r:1 w:0) + // Storage: Nonfungible Owned (r:0 w:2) + fn transfer_raw() -> Weight { + Weight::from_ref_time(14_909_000 as u64) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } /// Storage: Nonfungible TokenData (r:1 w:0) /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) @@ -523,22 +515,14 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into())) } - /// Storage: Nonfungible TokenData (r:1 w:1) - /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible AccountBalance (r:2 w:2) - /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) - /// Storage: Nonfungible Allowance (r:1 w:0) - /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - /// Storage: Nonfungible Owned (r:0 w:2) - /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `10144` - // Minimum execution time: 18_629_000 picoseconds. - Weight::from_parts(18_997_000, 10144) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) + // Storage: Nonfungible TokenData (r:1 w:1) + // Storage: Nonfungible AccountBalance (r:2 w:2) + // Storage: Nonfungible Allowance (r:1 w:0) + // Storage: Nonfungible Owned (r:0 w:2) + fn transfer_raw() -> Weight { + Weight::from_ref_time(14_909_000 as u64) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } /// Storage: Nonfungible TokenData (r:1 w:0) /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) From e46e0e3e22a3a44a4aaac1c7f8e05bb0df63d359 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 31 Mar 2023 14:03:01 +0700 Subject: [PATCH 54/74] chore(weight): rebench after rebase --- pallets/common/src/weights.rs | 24 ++++++++++ pallets/fungible/src/weights.rs | 72 +++++++++++++++++++++--------- pallets/nonfungible/src/weights.rs | 66 ++++++++++++++++++--------- 3 files changed, 120 insertions(+), 42 deletions(-) diff --git a/pallets/common/src/weights.rs b/pallets/common/src/weights.rs index b308968240..9f4ecee544 100644 --- a/pallets/common/src/weights.rs +++ b/pallets/common/src/weights.rs @@ -69,6 +69,18 @@ impl WeightInfo for SubstrateWeight { .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: Common Allowlist (r:1 w:0) + /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + fn check_accesslist() -> Weight { + // Proof Size summary in bytes: + // Measured: `340` + // Estimated: `2545` + // Minimum execution time: 2_887_000 picoseconds. + Weight::from_parts(3_072_000, 2545) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } +} + // For backwards compatibility and tests impl WeightInfo for () { /// Storage: Common CollectionProperties (r:1 w:1) @@ -98,3 +110,15 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: Common Allowlist (r:1 w:0) + /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + fn check_accesslist() -> Weight { + // Proof Size summary in bytes: + // Measured: `340` + // Estimated: `2545` + // Minimum execution time: 2_887_000 picoseconds. + Weight::from_parts(3_072_000, 2545) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } +} + diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index 439f91e605..c1cd6550c9 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -93,11 +93,16 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - // Storage: Fungible Balance (r:2 w:2) + /// Storage: Fungible Balance (r:2 w:2) + /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) fn transfer_raw() -> Weight { - Weight::from_ref_time(12_041_000 as u64) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `5104` + // Minimum execution time: 6_678_000 picoseconds. + Weight::from_parts(7_151_000, 5104) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: Fungible Balance (r:1 w:0) /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) @@ -125,16 +130,25 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Fungible Allowance (r:1 w:0) + /// Storage: Fungible Allowance (r:1 w:0) + /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) fn check_allowed_raw() -> Weight { - Weight::from_ref_time(3_550_000 as u64) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + // Proof Size summary in bytes: + // Measured: `210` + // Estimated: `2568` + // Minimum execution time: 2_842_000 picoseconds. + Weight::from_parts(3_077_000, 2568) + .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Fungible Allowance (r:1 w:1) + /// Storage: Fungible Allowance (r:0 w:1) + /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) fn set_allowance_unchecked_raw() -> Weight { - Weight::from_ref_time(10_682_000 as u64) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_532_000 picoseconds. + Weight::from_parts(2_680_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fungible Allowance (r:1 w:1) /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) @@ -200,11 +214,16 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - // Storage: Fungible Balance (r:2 w:2) + /// Storage: Fungible Balance (r:2 w:2) + /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) fn transfer_raw() -> Weight { - Weight::from_ref_time(12_041_000 as u64) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) + // Proof Size summary in bytes: + // Measured: `182` + // Estimated: `5104` + // Minimum execution time: 6_678_000 picoseconds. + Weight::from_parts(7_151_000, 5104) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: Fungible Balance (r:1 w:0) /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen) @@ -232,16 +251,25 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Fungible Allowance (r:1 w:0) + /// Storage: Fungible Allowance (r:1 w:0) + /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) fn check_allowed_raw() -> Weight { - Weight::from_ref_time(3_550_000 as u64) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) + // Proof Size summary in bytes: + // Measured: `210` + // Estimated: `2568` + // Minimum execution time: 2_842_000 picoseconds. + Weight::from_parts(3_077_000, 2568) + .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Fungible Allowance (r:1 w:1) + /// Storage: Fungible Allowance (r:0 w:1) + /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) fn set_allowance_unchecked_raw() -> Weight { - Weight::from_ref_time(10_682_000 as u64) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_532_000 picoseconds. + Weight::from_parts(2_680_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Fungible Allowance (r:1 w:1) /// Proof: Fungible Allowance (max_values: None, max_size: Some(93), added: 2568, mode: MaxEncodedLen) diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 75d71342d9..89d440cd5f 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -209,14 +209,22 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into())) } - // Storage: Nonfungible TokenData (r:1 w:1) - // Storage: Nonfungible AccountBalance (r:2 w:2) - // Storage: Nonfungible Allowance (r:1 w:0) - // Storage: Nonfungible Owned (r:0 w:2) + /// Storage: Nonfungible TokenData (r:1 w:1) + /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) + /// Storage: Nonfungible AccountBalance (r:2 w:2) + /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) + /// Storage: Nonfungible Allowance (r:1 w:0) + /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) + /// Storage: Nonfungible Owned (r:0 w:2) + /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn transfer_raw() -> Weight { - Weight::from_ref_time(14_909_000 as u64) - .saturating_add(T::DbWeight::get().reads(4 as u64)) - .saturating_add(T::DbWeight::get().writes(5 as u64)) + // Proof Size summary in bytes: + // Measured: `412` + // Estimated: `10144` + // Minimum execution time: 9_307_000 picoseconds. + Weight::from_parts(10_108_000, 10144) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Nonfungible TokenData (r:1 w:0) /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) @@ -244,10 +252,15 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Nonfungible Allowance (r:1 w:0) + /// Storage: Nonfungible Allowance (r:1 w:0) + /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn checks_allowed_raw() -> Weight { - Weight::from_ref_time(3_341_000 as u64) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + // Proof Size summary in bytes: + // Measured: `394` + // Estimated: `2532` + // Minimum execution time: 2_668_000 picoseconds. + Weight::from_parts(2_877_000, 2532) + .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) @@ -515,14 +528,22 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(b.into()))) .saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into())) } - // Storage: Nonfungible TokenData (r:1 w:1) - // Storage: Nonfungible AccountBalance (r:2 w:2) - // Storage: Nonfungible Allowance (r:1 w:0) - // Storage: Nonfungible Owned (r:0 w:2) + /// Storage: Nonfungible TokenData (r:1 w:1) + /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) + /// Storage: Nonfungible AccountBalance (r:2 w:2) + /// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen) + /// Storage: Nonfungible Allowance (r:1 w:0) + /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) + /// Storage: Nonfungible Owned (r:0 w:2) + /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn transfer_raw() -> Weight { - Weight::from_ref_time(14_909_000 as u64) - .saturating_add(RocksDbWeight::get().reads(4 as u64)) - .saturating_add(RocksDbWeight::get().writes(5 as u64)) + // Proof Size summary in bytes: + // Measured: `412` + // Estimated: `10144` + // Minimum execution time: 9_307_000 picoseconds. + Weight::from_parts(10_108_000, 10144) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Nonfungible TokenData (r:1 w:0) /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) @@ -550,10 +571,15 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Nonfungible Allowance (r:1 w:0) + /// Storage: Nonfungible Allowance (r:1 w:0) + /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn checks_allowed_raw() -> Weight { - Weight::from_ref_time(3_341_000 as u64) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) + // Proof Size summary in bytes: + // Measured: `394` + // Estimated: `2532` + // Minimum execution time: 2_668_000 picoseconds. + Weight::from_parts(2_877_000, 2532) + .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) From c20e11e488b6b4c9a33bdc2a93d2be2d3cffba50 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 31 Mar 2023 17:20:22 +0700 Subject: [PATCH 55/74] fix(weght): recover deleted lines while rebasing --- pallets/common/src/weights.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/common/src/weights.rs b/pallets/common/src/weights.rs index 9f4ecee544..5c8622efb0 100644 --- a/pallets/common/src/weights.rs +++ b/pallets/common/src/weights.rs @@ -67,6 +67,7 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(6_684_000, 43467) // Standard Error: 67_984 .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Common Allowlist (r:1 w:0) @@ -108,6 +109,7 @@ impl WeightInfo for () { Weight::from_parts(6_684_000, 43467) // Standard Error: 67_984 .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Common Allowlist (r:1 w:0) From ff113261a7a1b86887d4859b980568378e7f868f Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 19 Apr 2023 13:57:06 +0000 Subject: [PATCH 56/74] =?UTF-8?q?chore:=20typos=C2=A0&=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pallets/fungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/common.rs | 2 +- pallets/nonfungible/src/lib.rs | 2 +- pallets/nonfungible/src/weights.rs | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pallets/fungible/src/benchmarking.rs b/pallets/fungible/src/benchmarking.rs index b18830cc6b..ed6280bb8f 100644 --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -92,7 +92,7 @@ benchmarks! { >::create_item(&collection, &owner, (owner_eth.clone(), 200), &Unlimited)?; }: {>::set_allowance_from(&collection, &sender, &owner_eth, &spender, 100)?} - check_allowed_raw { + check_allowed_raw { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; spender: cross_sub; diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 9b4997bcec..e28a7d0438 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -146,7 +146,7 @@ benchmarks! { let item = create_max_item(&collection, &owner, owner_eth.clone())?; }: {>::set_allowance_from(&collection, &sender, &owner_eth, item, Some(&spender))?} - checks_allowed_raw { + check_allowed_raw { bench_init!{ owner: sub; collection: collection(owner); owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub; diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 961384b3e3..64aaeeed31 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -103,7 +103,7 @@ impl CommonWeightInfo for CommonWeights { } fn transfer_from() -> Weight { - Self::transfer() + >::checks_allowed_raw() + Self::transfer() + >::check_allowed_raw() } fn burn_from() -> Weight { diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 78caa00b49..2464f16cb3 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -1242,7 +1242,7 @@ impl Pallet { // Allowance is reset in [`transfer`] let mut result = Self::transfer(collection, from, to, token, nesting_budget); - add_weight_to_post_info(&mut result, >::checks_allowed_raw()); + add_weight_to_post_info(&mut result, >::check_allowed_raw()); result } diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 89d440cd5f..f9e43ed044 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -43,7 +43,7 @@ pub trait WeightInfo { fn transfer_raw() -> Weight; fn approve() -> Weight; fn approve_from() -> Weight; - fn checks_allowed_raw() -> Weight; + fn check_allowed_raw() -> Weight; fn burn_from() -> Weight; fn set_token_property_permissions(b: u32, ) -> Weight; fn set_token_properties(b: u32, ) -> Weight; @@ -254,7 +254,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: Nonfungible Allowance (r:1 w:0) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - fn checks_allowed_raw() -> Weight { + fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: // Measured: `394` // Estimated: `2532` @@ -573,7 +573,7 @@ impl WeightInfo for () { } /// Storage: Nonfungible Allowance (r:1 w:0) /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) - fn checks_allowed_raw() -> Weight { + fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: // Measured: `394` // Estimated: `2532` From fb505f1dbf886c06ed84e7e75b29e190ae70a3b6 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 19 Apr 2023 14:21:54 +0000 Subject: [PATCH 57/74] feat(pallet common): added GenesisConfig --- node/cli/src/chain_spec.rs | 2 ++ pallets/common/src/lib.rs | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 2fa368fa29..1f278ff9b9 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -167,6 +167,7 @@ macro_rules! testnet_genesis { .map(|k| (k, 1 << 100)) .collect(), }, + common: Default::default(), treasury: Default::default(), tokens: TokensConfig { balances: vec![] }, sudo: SudoConfig { @@ -225,6 +226,7 @@ macro_rules! testnet_genesis { .expect("WASM binary was not build, please build it!") .to_vec(), }, + common: Default::default(), balances: BalancesConfig { balances: $endowed_accounts .iter() diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index d93ce12db1..af59b80ff8 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -420,10 +420,11 @@ impl CollectionHandle { #[frame_support::pallet] pub mod pallet { + use core::marker::PhantomData; + use super::*; use dispatch::CollectionDispatch; use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion}; - use frame_system::pallet_prelude::*; use frame_support::traits::Currency; use up_data_structs::{TokenId, mapping::TokenAddressMapping}; use scale_info::TypeInfo; @@ -479,6 +480,22 @@ pub mod pallet { } } + #[pallet::genesis_config] + pub struct GenesisConfig(PhantomData); + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self(Default::default()) + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + StorageVersion::new(1).put::>(); + } + } impl Pallet { /// Helper function that handles deposit events pub fn deposit_event(event: Event) { From 81e4404a75c5da1908bf8cb22d6e04ddac9af05e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 20 Apr 2023 08:26:42 +0000 Subject: [PATCH 58/74] feat(pallet nft): added GenesisConfig --- node/cli/src/chain_spec.rs | 2 ++ pallets/common/src/lib.rs | 1 + pallets/nonfungible/src/lib.rs | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 1f278ff9b9..2c7852a4ea 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -168,6 +168,7 @@ macro_rules! testnet_genesis { .collect(), }, common: Default::default(), + nonfungible: Default::default(), treasury: Default::default(), tokens: TokensConfig { balances: vec![] }, sudo: SudoConfig { @@ -227,6 +228,7 @@ macro_rules! testnet_genesis { .to_vec(), }, common: Default::default(), + nonfungible: Default::default(), balances: BalancesConfig { balances: $endowed_accounts .iter() diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index af59b80ff8..e38abe7f7e 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -496,6 +496,7 @@ pub mod pallet { StorageVersion::new(1).put::>(); } } + impl Pallet { /// Helper function that handles deposit events pub fn deposit_event(event: Event) { diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 4046a835e5..f1d64a7e75 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -281,6 +281,23 @@ pub mod pallet { Value = bool, QueryKind = ValueQuery, >; + + #[pallet::genesis_config] + pub struct GenesisConfig(PhantomData); + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self(Default::default()) + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + StorageVersion::new(1).put::>(); + } + } } pub struct NonfungibleHandle(pallet_common::CollectionHandle); From e3dc2493d20d6db27de8f3f7ff497c206b7f6100 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 20 Apr 2023 14:31:18 +0200 Subject: [PATCH 59/74] build: run benchmarks --- pallets/app-promotion/src/weights.rs | 484 +++++++++++++++++--------- pallets/common/src/weights.rs | 61 ++-- pallets/configuration/src/weights.rs | 53 ++- pallets/evm-migration/src/weights.rs | 89 +++-- pallets/foreign-assets/src/weights.rs | 33 +- pallets/fungible/src/weights.rs | 117 +++---- pallets/maintenance/src/weights.rs | 33 +- pallets/nonfungible/src/weights.rs | 305 ++++++++-------- pallets/refungible/src/weights.rs | 357 ++++++++++--------- pallets/structure/src/weights.rs | 21 +- pallets/unique/src/weights.rs | 209 ++++++----- runtime/common/weights/xcm.rs | 86 ++--- 12 files changed, 998 insertions(+), 850 deletions(-) diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index f6fcba0cf4..c6a1192ca5 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,9 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -16,8 +18,7 @@ // compiled // --extrinsic // * -// --template -// .maintain/frame-weight-template.hbs +// --template=.maintain/frame-weight-template.hbs // --steps=50 // --repeat=80 // --heap-pages=4096 @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -49,194 +48,357 @@ pub trait WeightInfo { /// Weights for pallet_app_promotion using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: AppPromotion PendingUnstake (r:1 w:0) - // Storage: Balances Locks (r:1 w:1) - // Storage: System Account (r:1 w:1) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:3 w:3) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: System Account (r:3 w:3) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[0, 3]`. fn on_initialize(b: u32, ) -> Weight { - Weight::from_ref_time(2_592_346 as u64) - // Standard Error: 23_629 - .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64))) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64))) - } - // Storage: AppPromotion Admin (r:0 w:1) + // Proof Size summary in bytes: + // Measured: `180 + b * (277 ±0)` + // Estimated: `5602 + b * (6377 ±0)` + // Minimum execution time: 3_724_000 picoseconds. + Weight::from_parts(4_538_653, 5602) + // Standard Error: 14_774 + .saturating_add(Weight::from_parts(10_368_686, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into()))) + .saturating_add(Weight::from_parts(0, 6377).saturating_mul(b.into())) + } + /// Storage: AppPromotion Admin (r:0 w:1) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) fn set_admin_address() -> Weight { - Weight::from_ref_time(6_209_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: System Account (r:2 w:2) - // Storage: Balances Locks (r:1 w:1) - // Storage: AppPromotion TotalStaked (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_426_000 picoseconds. + Weight::from_parts(6_149_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1) + /// Proof: AppPromotion PreviousCalculatedRecord (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:1001 w:1000) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: System Account (r:101 w:101) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:100 w:100) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 100]`. fn payout_stakers(b: u32, ) -> Weight { - Weight::from_ref_time(64_917_000 as u64) - // Standard Error: 34_206 - .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().reads((12 as u64).saturating_mul(b as u64))) - .saturating_add(T::DbWeight::get().writes(3 as u64)) - .saturating_add(T::DbWeight::get().writes((12 as u64).saturating_mul(b as u64))) - } - // Storage: AppPromotion StakesPerAccount (r:1 w:1) - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: System Account (r:1 w:1) - // Storage: Balances Locks (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: AppPromotion Staked (r:1 w:1) - // Storage: AppPromotion TotalStaked (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `531 + b * (633 ±0)` + // Estimated: `16194 + b * (32560 ±0)` + // Minimum execution time: 84_632_000 picoseconds. + Weight::from_parts(800_384, 16194) + // Standard Error: 19_457 + .saturating_add(Weight::from_parts(49_393_958, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().reads((12_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((12_u64).saturating_mul(b.into()))) + .saturating_add(Weight::from_parts(0, 32560).saturating_mul(b.into())) + } + /// Storage: AppPromotion StakesPerAccount (r:1 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: AppPromotion Staked (r:1 w:1) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) fn stake() -> Weight { - Weight::from_ref_time(18_208_000 as u64) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(5 as u64)) - } - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: AppPromotion PendingUnstake (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: AppPromotion TotalStaked (r:1 w:1) - // Storage: AppPromotion StakesPerAccount (r:0 w:1) + // Proof Size summary in bytes: + // Measured: `356` + // Estimated: `20260` + // Minimum execution time: 24_750_000 picoseconds. + Weight::from_parts(25_157_000, 20260) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:11 w:10) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: AppPromotion StakesPerAccount (r:0 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn unstake_all() -> Weight { - Weight::from_ref_time(45_018_000 as u64) - .saturating_add(T::DbWeight::get().reads(14 as u64)) - .saturating_add(T::DbWeight::get().writes(13 as u64)) - } - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: AppPromotion PendingUnstake (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: AppPromotion TotalStaked (r:1 w:1) - // Storage: AppPromotion StakesPerAccount (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `796` + // Estimated: `35720` + // Minimum execution time: 53_670_000 picoseconds. + Weight::from_parts(54_376_000, 35720) + .saturating_add(T::DbWeight::get().reads(14_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) + } + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:11 w:10) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: AppPromotion StakesPerAccount (r:1 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn unstake_partial() -> Weight { - Weight::from_ref_time(49_066_000 as u64) - .saturating_add(T::DbWeight::get().reads(15 as u64)) - .saturating_add(T::DbWeight::get().writes(13 as u64)) + // Proof Size summary in bytes: + // Measured: `796` + // Estimated: `39234` + // Minimum execution time: 58_317_000 picoseconds. + Weight::from_parts(59_059_000, 39234) + .saturating_add(T::DbWeight::get().reads(15_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Common CollectionById (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Common CollectionById (r:1 w:1) + /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn sponsor_collection() -> Weight { - Weight::from_ref_time(15_039_000 as u64) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `1027` + // Estimated: `5842` + // Minimum execution time: 18_117_000 picoseconds. + Weight::from_parts(18_634_000, 5842) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Common CollectionById (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Common CollectionById (r:1 w:1) + /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn stop_sponsoring_collection() -> Weight { - Weight::from_ref_time(14_692_000 as u64) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `1059` + // Estimated: `5842` + // Minimum execution time: 16_999_000 picoseconds. + Weight::from_parts(17_417_000, 5842) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: EvmContractHelpers Sponsoring (r:0 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: EvmContractHelpers Sponsoring (r:0 w:1) + /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) fn sponsor_contract() -> Weight { - Weight::from_ref_time(11_810_000 as u64) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `198` + // Estimated: `1517` + // Minimum execution time: 14_438_000 picoseconds. + Weight::from_parts(14_931_000, 1517) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: EvmContractHelpers Sponsoring (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: EvmContractHelpers Sponsoring (r:1 w:1) + /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) fn stop_sponsoring_contract() -> Weight { - Weight::from_ref_time(13_570_000 as u64) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `363` + // Estimated: `5044` + // Minimum execution time: 14_786_000 picoseconds. + Weight::from_parts(15_105_000, 5044) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: AppPromotion PendingUnstake (r:1 w:0) - // Storage: Balances Locks (r:1 w:1) - // Storage: System Account (r:1 w:1) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:3 w:3) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: System Account (r:3 w:3) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[0, 3]`. fn on_initialize(b: u32, ) -> Weight { - Weight::from_ref_time(2_592_346 as u64) - // Standard Error: 23_629 - .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64))) - .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64))) - } - // Storage: AppPromotion Admin (r:0 w:1) + // Proof Size summary in bytes: + // Measured: `180 + b * (277 ±0)` + // Estimated: `5602 + b * (6377 ±0)` + // Minimum execution time: 3_724_000 picoseconds. + Weight::from_parts(4_538_653, 5602) + // Standard Error: 14_774 + .saturating_add(Weight::from_parts(10_368_686, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) + .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(b.into()))) + .saturating_add(Weight::from_parts(0, 6377).saturating_mul(b.into())) + } + /// Storage: AppPromotion Admin (r:0 w:1) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) fn set_admin_address() -> Weight { - Weight::from_ref_time(6_209_000 as u64) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: System Account (r:2 w:2) - // Storage: Balances Locks (r:1 w:1) - // Storage: AppPromotion TotalStaked (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_426_000 picoseconds. + Weight::from_parts(6_149_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1) + /// Proof: AppPromotion PreviousCalculatedRecord (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:1001 w:1000) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: System Account (r:101 w:101) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:100 w:100) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 100]`. fn payout_stakers(b: u32, ) -> Weight { - Weight::from_ref_time(64_917_000 as u64) - // Standard Error: 34_206 - .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64)) - .saturating_add(RocksDbWeight::get().reads(7 as u64)) - .saturating_add(RocksDbWeight::get().reads((12 as u64).saturating_mul(b as u64))) - .saturating_add(RocksDbWeight::get().writes(3 as u64)) - .saturating_add(RocksDbWeight::get().writes((12 as u64).saturating_mul(b as u64))) - } - // Storage: AppPromotion StakesPerAccount (r:1 w:1) - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: System Account (r:1 w:1) - // Storage: Balances Locks (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: AppPromotion Staked (r:1 w:1) - // Storage: AppPromotion TotalStaked (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `531 + b * (633 ±0)` + // Estimated: `16194 + b * (32560 ±0)` + // Minimum execution time: 84_632_000 picoseconds. + Weight::from_parts(800_384, 16194) + // Standard Error: 19_457 + .saturating_add(Weight::from_parts(49_393_958, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().reads((12_u64).saturating_mul(b.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((12_u64).saturating_mul(b.into()))) + .saturating_add(Weight::from_parts(0, 32560).saturating_mul(b.into())) + } + /// Storage: AppPromotion StakesPerAccount (r:1 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: AppPromotion Staked (r:1 w:1) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) fn stake() -> Weight { - Weight::from_ref_time(18_208_000 as u64) - .saturating_add(RocksDbWeight::get().reads(7 as u64)) - .saturating_add(RocksDbWeight::get().writes(5 as u64)) - } - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: AppPromotion PendingUnstake (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: AppPromotion TotalStaked (r:1 w:1) - // Storage: AppPromotion StakesPerAccount (r:0 w:1) + // Proof Size summary in bytes: + // Measured: `356` + // Estimated: `20260` + // Minimum execution time: 24_750_000 picoseconds. + Weight::from_parts(25_157_000, 20260) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) + } + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:11 w:10) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: AppPromotion StakesPerAccount (r:0 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn unstake_all() -> Weight { - Weight::from_ref_time(45_018_000 as u64) - .saturating_add(RocksDbWeight::get().reads(14 as u64)) - .saturating_add(RocksDbWeight::get().writes(13 as u64)) - } - // Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) - // Storage: AppPromotion PendingUnstake (r:1 w:1) - // Storage: AppPromotion Staked (r:11 w:10) - // Storage: AppPromotion TotalStaked (r:1 w:1) - // Storage: AppPromotion StakesPerAccount (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `796` + // Estimated: `35720` + // Minimum execution time: 53_670_000 picoseconds. + Weight::from_parts(54_376_000, 35720) + .saturating_add(RocksDbWeight::get().reads(14_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) + } + /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0) + /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen) + /// Storage: AppPromotion PendingUnstake (r:1 w:1) + /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen) + /// Storage: AppPromotion Staked (r:11 w:10) + /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: AppPromotion TotalStaked (r:1 w:1) + /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: AppPromotion StakesPerAccount (r:1 w:1) + /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn unstake_partial() -> Weight { - Weight::from_ref_time(49_066_000 as u64) - .saturating_add(RocksDbWeight::get().reads(15 as u64)) - .saturating_add(RocksDbWeight::get().writes(13 as u64)) + // Proof Size summary in bytes: + // Measured: `796` + // Estimated: `39234` + // Minimum execution time: 58_317_000 picoseconds. + Weight::from_parts(59_059_000, 39234) + .saturating_add(RocksDbWeight::get().reads(15_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Common CollectionById (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Common CollectionById (r:1 w:1) + /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn sponsor_collection() -> Weight { - Weight::from_ref_time(15_039_000 as u64) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `1027` + // Estimated: `5842` + // Minimum execution time: 18_117_000 picoseconds. + Weight::from_parts(18_634_000, 5842) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: Common CollectionById (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: Common CollectionById (r:1 w:1) + /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn stop_sponsoring_collection() -> Weight { - Weight::from_ref_time(14_692_000 as u64) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `1059` + // Estimated: `5842` + // Minimum execution time: 16_999_000 picoseconds. + Weight::from_parts(17_417_000, 5842) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: EvmContractHelpers Sponsoring (r:0 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: EvmContractHelpers Sponsoring (r:0 w:1) + /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) fn sponsor_contract() -> Weight { - Weight::from_ref_time(11_810_000 as u64) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `198` + // Estimated: `1517` + // Minimum execution time: 14_438_000 picoseconds. + Weight::from_parts(14_931_000, 1517) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: AppPromotion Admin (r:1 w:0) - // Storage: EvmContractHelpers Sponsoring (r:1 w:1) + /// Storage: AppPromotion Admin (r:1 w:0) + /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: EvmContractHelpers Sponsoring (r:1 w:1) + /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) fn stop_sponsoring_contract() -> Weight { - Weight::from_ref_time(13_570_000 as u64) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) + // Proof Size summary in bytes: + // Measured: `363` + // Estimated: `5044` + // Minimum execution time: 14_786_000 picoseconds. + Weight::from_parts(15_105_000, 5044) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } + diff --git a/pallets/common/src/weights.rs b/pallets/common/src/weights.rs index 5c8622efb0..125fd76b1d 100644 --- a/pallets/common/src/weights.rs +++ b/pallets/common/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_common //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -48,11 +47,11 @@ impl WeightInfo for SubstrateWeight { fn set_collection_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `265` - // Estimated: `43467` - // Minimum execution time: 7_163_000 picoseconds. - Weight::from_parts(586_898, 43467) - // Standard Error: 23_783 - .saturating_add(Weight::from_parts(6_089_494, 0).saturating_mul(b.into())) + // Estimated: `44457` + // Minimum execution time: 6_805_000 picoseconds. + Weight::from_parts(6_965_000, 44457) + // Standard Error: 20_175 + .saturating_add(Weight::from_parts(6_191_369, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -61,12 +60,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 64]`. fn delete_collection_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `302 + b * (33030 ±0)` - // Estimated: `43467` - // Minimum execution time: 6_540_000 picoseconds. - Weight::from_parts(6_684_000, 43467) - // Standard Error: 67_984 - .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) + // Measured: `270 + b * (33030 ±0)` + // Estimated: `44457` + // Minimum execution time: 6_284_000 picoseconds. + Weight::from_parts(6_416_000, 44457) + // Standard Error: 81_929 + .saturating_add(Weight::from_parts(23_972_425, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -75,9 +74,9 @@ impl WeightInfo for SubstrateWeight { fn check_accesslist() -> Weight { // Proof Size summary in bytes: // Measured: `340` - // Estimated: `2545` - // Minimum execution time: 2_887_000 picoseconds. - Weight::from_parts(3_072_000, 2545) + // Estimated: `3535` + // Minimum execution time: 5_205_000 picoseconds. + Weight::from_parts(5_438_000, 3535) .saturating_add(T::DbWeight::get().reads(1_u64)) } } @@ -90,11 +89,11 @@ impl WeightInfo for () { fn set_collection_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `265` - // Estimated: `43467` - // Minimum execution time: 7_163_000 picoseconds. - Weight::from_parts(586_898, 43467) - // Standard Error: 23_783 - .saturating_add(Weight::from_parts(6_089_494, 0).saturating_mul(b.into())) + // Estimated: `44457` + // Minimum execution time: 6_805_000 picoseconds. + Weight::from_parts(6_965_000, 44457) + // Standard Error: 20_175 + .saturating_add(Weight::from_parts(6_191_369, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -103,12 +102,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 64]`. fn delete_collection_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `302 + b * (33030 ±0)` - // Estimated: `43467` - // Minimum execution time: 6_540_000 picoseconds. - Weight::from_parts(6_684_000, 43467) - // Standard Error: 67_984 - .saturating_add(Weight::from_parts(21_502_829, 0).saturating_mul(b.into())) + // Measured: `270 + b * (33030 ±0)` + // Estimated: `44457` + // Minimum execution time: 6_284_000 picoseconds. + Weight::from_parts(6_416_000, 44457) + // Standard Error: 81_929 + .saturating_add(Weight::from_parts(23_972_425, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -117,9 +116,9 @@ impl WeightInfo for () { fn check_accesslist() -> Weight { // Proof Size summary in bytes: // Measured: `340` - // Estimated: `2545` - // Minimum execution time: 2_887_000 picoseconds. - Weight::from_parts(3_072_000, 2545) + // Estimated: `3535` + // Minimum execution time: 5_205_000 picoseconds. + Weight::from_parts(5_438_000, 3535) .saturating_add(RocksDbWeight::get().reads(1_u64)) } } diff --git a/pallets/configuration/src/weights.rs b/pallets/configuration/src/weights.rs index 8b12778430..73259db617 100644 --- a/pallets/configuration/src/weights.rs +++ b/pallets/configuration/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_configuration //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -51,8 +50,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_565_000 picoseconds. - Weight::from_parts(1_636_000, 0) + // Minimum execution time: 1_725_000 picoseconds. + Weight::from_parts(1_853_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Configuration MinGasPriceOverride (r:0 w:1) @@ -61,8 +60,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_695_000 picoseconds. - Weight::from_parts(1_798_000, 0) + // Minimum execution time: 1_802_000 picoseconds. + Weight::from_parts(1_903_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Configuration AppPromomotionConfigurationOverride (r:0 w:1) @@ -71,8 +70,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_546_000 picoseconds. - Weight::from_parts(2_796_000, 0) + // Minimum execution time: 2_048_000 picoseconds. + Weight::from_parts(2_157_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:0 w:1) @@ -81,8 +80,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_323_000 picoseconds. - Weight::from_parts(8_251_000, 0) + // Minimum execution time: 7_622_000 picoseconds. + Weight::from_parts(8_014_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionLicenseBondOverride (r:0 w:1) @@ -91,8 +90,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_286_000 picoseconds. - Weight::from_parts(4_442_000, 0) + // Minimum execution time: 4_981_000 picoseconds. + Weight::from_parts(5_811_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:0 w:1) @@ -101,8 +100,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_216_000 picoseconds. - Weight::from_parts(4_389_000, 0) + // Minimum execution time: 4_664_000 picoseconds. + Weight::from_parts(4_816_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -115,8 +114,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_565_000 picoseconds. - Weight::from_parts(1_636_000, 0) + // Minimum execution time: 1_725_000 picoseconds. + Weight::from_parts(1_853_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Configuration MinGasPriceOverride (r:0 w:1) @@ -125,8 +124,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_695_000 picoseconds. - Weight::from_parts(1_798_000, 0) + // Minimum execution time: 1_802_000 picoseconds. + Weight::from_parts(1_903_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Configuration AppPromomotionConfigurationOverride (r:0 w:1) @@ -135,8 +134,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_546_000 picoseconds. - Weight::from_parts(2_796_000, 0) + // Minimum execution time: 2_048_000 picoseconds. + Weight::from_parts(2_157_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:0 w:1) @@ -145,8 +144,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_323_000 picoseconds. - Weight::from_parts(8_251_000, 0) + // Minimum execution time: 7_622_000 picoseconds. + Weight::from_parts(8_014_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionLicenseBondOverride (r:0 w:1) @@ -155,8 +154,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_286_000 picoseconds. - Weight::from_parts(4_442_000, 0) + // Minimum execution time: 4_981_000 picoseconds. + Weight::from_parts(5_811_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:0 w:1) @@ -165,8 +164,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_216_000 picoseconds. - Weight::from_parts(4_389_000, 0) + // Minimum execution time: 4_664_000 picoseconds. + Weight::from_parts(4_816_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/evm-migration/src/weights.rs b/pallets/evm-migration/src/weights.rs index e92cabf32a..3d206b2114 100644 --- a/pallets/evm-migration/src/weights.rs +++ b/pallets/evm-migration/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_evm_migration //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -53,9 +52,9 @@ impl WeightInfo for SubstrateWeight { fn begin() -> Weight { // Proof Size summary in bytes: // Measured: `94` - // Estimated: `7676` - // Minimum execution time: 12_699_000 picoseconds. - Weight::from_parts(12_989_000, 7676) + // Estimated: `10646` + // Minimum execution time: 8_519_000 picoseconds. + Weight::from_parts(8_729_000, 10646) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -67,11 +66,11 @@ impl WeightInfo for SubstrateWeight { fn set_data(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `96` - // Estimated: `2600` - // Minimum execution time: 9_157_000 picoseconds. - Weight::from_parts(7_442_065, 2600) - // Standard Error: 1_138 - .saturating_add(Weight::from_parts(934_789, 0).saturating_mul(b.into())) + // Estimated: `3590` + // Minimum execution time: 6_062_000 picoseconds. + Weight::from_parts(7_193_727, 3590) + // Standard Error: 1_844 + .saturating_add(Weight::from_parts(876_826, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(b.into()))) } @@ -80,14 +79,12 @@ impl WeightInfo for SubstrateWeight { /// Storage: EVM AccountCodes (r:0 w:1) /// Proof Skipped: EVM AccountCodes (max_values: None, max_size: None, mode: Measured) /// The range of component `b` is `[0, 80]`. - fn finish(b: u32, ) -> Weight { + fn finish(_b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `96` - // Estimated: `2600` - // Minimum execution time: 7_719_000 picoseconds. - Weight::from_parts(8_237_929, 2600) - // Standard Error: 266 - .saturating_add(Weight::from_parts(3_473, 0).saturating_mul(b.into())) + // Estimated: `3590` + // Minimum execution time: 7_452_000 picoseconds. + Weight::from_parts(8_531_888, 3590) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -96,20 +93,20 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_193_000 picoseconds. - Weight::from_parts(2_667_314, 0) - // Standard Error: 583 - .saturating_add(Weight::from_parts(690_704, 0).saturating_mul(b.into())) + // Minimum execution time: 1_377_000 picoseconds. + Weight::from_parts(3_388_877, 0) + // Standard Error: 1_205 + .saturating_add(Weight::from_parts(696_701, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 200]`. fn insert_events(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_253_000 picoseconds. - Weight::from_parts(4_685_069, 0) - // Standard Error: 1_036 - .saturating_add(Weight::from_parts(1_322_329, 0).saturating_mul(b.into())) + // Minimum execution time: 1_671_000 picoseconds. + Weight::from_parts(4_402_497, 0) + // Standard Error: 723 + .saturating_add(Weight::from_parts(1_338_678, 0).saturating_mul(b.into())) } } @@ -124,9 +121,9 @@ impl WeightInfo for () { fn begin() -> Weight { // Proof Size summary in bytes: // Measured: `94` - // Estimated: `7676` - // Minimum execution time: 12_699_000 picoseconds. - Weight::from_parts(12_989_000, 7676) + // Estimated: `10646` + // Minimum execution time: 8_519_000 picoseconds. + Weight::from_parts(8_729_000, 10646) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -138,11 +135,11 @@ impl WeightInfo for () { fn set_data(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `96` - // Estimated: `2600` - // Minimum execution time: 9_157_000 picoseconds. - Weight::from_parts(7_442_065, 2600) - // Standard Error: 1_138 - .saturating_add(Weight::from_parts(934_789, 0).saturating_mul(b.into())) + // Estimated: `3590` + // Minimum execution time: 6_062_000 picoseconds. + Weight::from_parts(7_193_727, 3590) + // Standard Error: 1_844 + .saturating_add(Weight::from_parts(876_826, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(b.into()))) } @@ -151,14 +148,12 @@ impl WeightInfo for () { /// Storage: EVM AccountCodes (r:0 w:1) /// Proof Skipped: EVM AccountCodes (max_values: None, max_size: None, mode: Measured) /// The range of component `b` is `[0, 80]`. - fn finish(b: u32, ) -> Weight { + fn finish(_b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `96` - // Estimated: `2600` - // Minimum execution time: 7_719_000 picoseconds. - Weight::from_parts(8_237_929, 2600) - // Standard Error: 266 - .saturating_add(Weight::from_parts(3_473, 0).saturating_mul(b.into())) + // Estimated: `3590` + // Minimum execution time: 7_452_000 picoseconds. + Weight::from_parts(8_531_888, 3590) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -167,20 +162,20 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_193_000 picoseconds. - Weight::from_parts(2_667_314, 0) - // Standard Error: 583 - .saturating_add(Weight::from_parts(690_704, 0).saturating_mul(b.into())) + // Minimum execution time: 1_377_000 picoseconds. + Weight::from_parts(3_388_877, 0) + // Standard Error: 1_205 + .saturating_add(Weight::from_parts(696_701, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 200]`. fn insert_events(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_253_000 picoseconds. - Weight::from_parts(4_685_069, 0) - // Standard Error: 1_036 - .saturating_add(Weight::from_parts(1_322_329, 0).saturating_mul(b.into())) + // Minimum execution time: 1_671_000 picoseconds. + Weight::from_parts(4_402_497, 0) + // Standard Error: 723 + .saturating_add(Weight::from_parts(1_338_678, 0).saturating_mul(b.into())) } } diff --git a/pallets/foreign-assets/src/weights.rs b/pallets/foreign-assets/src/weights.rs index 64115a6575..96dc92cb2f 100644 --- a/pallets/foreign-assets/src/weights.rs +++ b/pallets/foreign-assets/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_foreign_assets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -65,10 +64,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn register_foreign_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `318` - // Estimated: `17918` - // Minimum execution time: 45_521_000 picoseconds. - Weight::from_parts(46_333_000, 17918) + // Measured: `286` + // Estimated: `25838` + // Minimum execution time: 37_778_000 picoseconds. + Weight::from_parts(38_334_000, 25838) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } @@ -79,9 +78,9 @@ impl WeightInfo for SubstrateWeight { fn update_foreign_asset() -> Weight { // Proof Size summary in bytes: // Measured: `197` - // Estimated: `5635` - // Minimum execution time: 13_542_000 picoseconds. - Weight::from_parts(13_913_000, 5635) + // Estimated: `7615` + // Minimum execution time: 13_739_000 picoseconds. + Weight::from_parts(22_366_000, 7615) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -113,10 +112,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn register_foreign_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `318` - // Estimated: `17918` - // Minimum execution time: 45_521_000 picoseconds. - Weight::from_parts(46_333_000, 17918) + // Measured: `286` + // Estimated: `25838` + // Minimum execution time: 37_778_000 picoseconds. + Weight::from_parts(38_334_000, 25838) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) } @@ -127,9 +126,9 @@ impl WeightInfo for () { fn update_foreign_asset() -> Weight { // Proof Size summary in bytes: // Measured: `197` - // Estimated: `5635` - // Minimum execution time: 13_542_000 picoseconds. - Weight::from_parts(13_913_000, 5635) + // Estimated: `7615` + // Minimum execution time: 13_739_000 picoseconds. + Weight::from_parts(22_366_000, 7615) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index c1cd6550c9..fab1f37f7c 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_fungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -55,9 +54,9 @@ impl WeightInfo for SubstrateWeight { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `5055` - // Minimum execution time: 10_152_000 picoseconds. - Weight::from_parts(10_520_000, 5055) + // Estimated: `7035` + // Minimum execution time: 10_168_000 picoseconds. + Weight::from_parts(10_453_000, 7035) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -69,11 +68,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items_ex(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `2503 + b * (2552 ±0)` - // Minimum execution time: 3_437_000 picoseconds. - Weight::from_parts(13_322_752, 2503) - // Standard Error: 1_728 - .saturating_add(Weight::from_parts(3_605_522, 0).saturating_mul(b.into())) + // Estimated: `4483 + b * (2552 ±0)` + // Minimum execution time: 3_248_000 picoseconds. + Weight::from_parts(12_455_981, 4483) + // Standard Error: 2_698 + .saturating_add(Weight::from_parts(3_426_148, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -87,9 +86,9 @@ impl WeightInfo for SubstrateWeight { fn burn_item() -> Weight { // Proof Size summary in bytes: // Measured: `197` - // Estimated: `5055` - // Minimum execution time: 12_894_000 picoseconds. - Weight::from_parts(13_347_000, 5055) + // Estimated: `7035` + // Minimum execution time: 12_717_000 picoseconds. + Weight::from_parts(13_031_000, 7035) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -98,9 +97,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_raw() -> Weight { // Proof Size summary in bytes: // Measured: `182` - // Estimated: `5104` - // Minimum execution time: 6_678_000 picoseconds. - Weight::from_parts(7_151_000, 5104) + // Estimated: `6094` + // Minimum execution time: 13_640_000 picoseconds. + Weight::from_parts(13_935_000, 6094) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -111,9 +110,9 @@ impl WeightInfo for SubstrateWeight { fn approve() -> Weight { // Proof Size summary in bytes: // Measured: `182` - // Estimated: `2552` - // Minimum execution time: 12_417_000 picoseconds. - Weight::from_parts(12_658_000, 2552) + // Estimated: `3542` + // Minimum execution time: 11_769_000 picoseconds. + Weight::from_parts(12_072_000, 3542) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -124,9 +123,9 @@ impl WeightInfo for SubstrateWeight { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `170` - // Estimated: `2552` - // Minimum execution time: 12_322_000 picoseconds. - Weight::from_parts(12_629_000, 2552) + // Estimated: `3542` + // Minimum execution time: 11_603_000 picoseconds. + Weight::from_parts(12_003_000, 3542) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -135,9 +134,9 @@ impl WeightInfo for SubstrateWeight { fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: // Measured: `210` - // Estimated: `2568` - // Minimum execution time: 2_842_000 picoseconds. - Weight::from_parts(3_077_000, 2568) + // Estimated: `3558` + // Minimum execution time: 5_682_000 picoseconds. + Weight::from_parts(5_892_000, 3558) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Fungible Allowance (r:0 w:1) @@ -146,8 +145,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_532_000 picoseconds. - Weight::from_parts(2_680_000, 0) + // Minimum execution time: 6_415_000 picoseconds. + Weight::from_parts(6_599_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fungible Allowance (r:1 w:1) @@ -159,9 +158,9 @@ impl WeightInfo for SubstrateWeight { fn burn_from() -> Weight { // Proof Size summary in bytes: // Measured: `315` - // Estimated: `7623` - // Minimum execution time: 21_271_000 picoseconds. - Weight::from_parts(21_709_000, 7623) + // Estimated: `10593` + // Minimum execution time: 20_257_000 picoseconds. + Weight::from_parts(20_625_000, 10593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -176,9 +175,9 @@ impl WeightInfo for () { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `5055` - // Minimum execution time: 10_152_000 picoseconds. - Weight::from_parts(10_520_000, 5055) + // Estimated: `7035` + // Minimum execution time: 10_168_000 picoseconds. + Weight::from_parts(10_453_000, 7035) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -190,11 +189,11 @@ impl WeightInfo for () { fn create_multiple_items_ex(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `2503 + b * (2552 ±0)` - // Minimum execution time: 3_437_000 picoseconds. - Weight::from_parts(13_322_752, 2503) - // Standard Error: 1_728 - .saturating_add(Weight::from_parts(3_605_522, 0).saturating_mul(b.into())) + // Estimated: `4483 + b * (2552 ±0)` + // Minimum execution time: 3_248_000 picoseconds. + Weight::from_parts(12_455_981, 4483) + // Standard Error: 2_698 + .saturating_add(Weight::from_parts(3_426_148, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -208,9 +207,9 @@ impl WeightInfo for () { fn burn_item() -> Weight { // Proof Size summary in bytes: // Measured: `197` - // Estimated: `5055` - // Minimum execution time: 12_894_000 picoseconds. - Weight::from_parts(13_347_000, 5055) + // Estimated: `7035` + // Minimum execution time: 12_717_000 picoseconds. + Weight::from_parts(13_031_000, 7035) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -219,9 +218,9 @@ impl WeightInfo for () { fn transfer_raw() -> Weight { // Proof Size summary in bytes: // Measured: `182` - // Estimated: `5104` - // Minimum execution time: 6_678_000 picoseconds. - Weight::from_parts(7_151_000, 5104) + // Estimated: `6094` + // Minimum execution time: 13_640_000 picoseconds. + Weight::from_parts(13_935_000, 6094) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -232,9 +231,9 @@ impl WeightInfo for () { fn approve() -> Weight { // Proof Size summary in bytes: // Measured: `182` - // Estimated: `2552` - // Minimum execution time: 12_417_000 picoseconds. - Weight::from_parts(12_658_000, 2552) + // Estimated: `3542` + // Minimum execution time: 11_769_000 picoseconds. + Weight::from_parts(12_072_000, 3542) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -245,9 +244,9 @@ impl WeightInfo for () { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `170` - // Estimated: `2552` - // Minimum execution time: 12_322_000 picoseconds. - Weight::from_parts(12_629_000, 2552) + // Estimated: `3542` + // Minimum execution time: 11_603_000 picoseconds. + Weight::from_parts(12_003_000, 3542) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -256,9 +255,9 @@ impl WeightInfo for () { fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: // Measured: `210` - // Estimated: `2568` - // Minimum execution time: 2_842_000 picoseconds. - Weight::from_parts(3_077_000, 2568) + // Estimated: `3558` + // Minimum execution time: 5_682_000 picoseconds. + Weight::from_parts(5_892_000, 3558) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Fungible Allowance (r:0 w:1) @@ -267,8 +266,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_532_000 picoseconds. - Weight::from_parts(2_680_000, 0) + // Minimum execution time: 6_415_000 picoseconds. + Weight::from_parts(6_599_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Fungible Allowance (r:1 w:1) @@ -280,9 +279,9 @@ impl WeightInfo for () { fn burn_from() -> Weight { // Proof Size summary in bytes: // Measured: `315` - // Estimated: `7623` - // Minimum execution time: 21_271_000 picoseconds. - Weight::from_parts(21_709_000, 7623) + // Estimated: `10593` + // Minimum execution time: 20_257_000 picoseconds. + Weight::from_parts(20_625_000, 10593) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/pallets/maintenance/src/weights.rs b/pallets/maintenance/src/weights.rs index 4e2cd43e7e..e76ba6f1bf 100644 --- a/pallets/maintenance/src/weights.rs +++ b/pallets/maintenance/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_maintenance //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -48,8 +47,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_721_000 picoseconds. - Weight::from_parts(4_918_000, 0) + // Minimum execution time: 4_407_000 picoseconds. + Weight::from_parts(4_556_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Maintenance Enabled (r:0 w:1) @@ -58,8 +57,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_795_000 picoseconds. - Weight::from_parts(5_006_000, 0) + // Minimum execution time: 5_868_000 picoseconds. + Weight::from_parts(6_100_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Preimage StatusFor (r:1 w:0) @@ -69,9 +68,9 @@ impl WeightInfo for SubstrateWeight { fn execute_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `209` - // Estimated: `5250` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_964_000, 5250) + // Estimated: `7230` + // Minimum execution time: 14_046_000 picoseconds. + Weight::from_parts(14_419_000, 7230) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -84,8 +83,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_721_000 picoseconds. - Weight::from_parts(4_918_000, 0) + // Minimum execution time: 4_407_000 picoseconds. + Weight::from_parts(4_556_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Maintenance Enabled (r:0 w:1) @@ -94,8 +93,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_795_000 picoseconds. - Weight::from_parts(5_006_000, 0) + // Minimum execution time: 5_868_000 picoseconds. + Weight::from_parts(6_100_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Preimage StatusFor (r:1 w:0) @@ -105,9 +104,9 @@ impl WeightInfo for () { fn execute_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `209` - // Estimated: `5250` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_964_000, 5250) + // Estimated: `7230` + // Minimum execution time: 14_046_000 picoseconds. + Weight::from_parts(14_419_000, 7230) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index f9e43ed044..f00b840e3f 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_nonfungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -72,9 +71,9 @@ impl WeightInfo for SubstrateWeight { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `59511` - // Minimum execution time: 23_081_000 picoseconds. - Weight::from_parts(23_551_000, 59511) + // Estimated: `63471` + // Minimum execution time: 25_892_000 picoseconds. + Weight::from_parts(26_424_000, 63471) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -94,11 +93,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `24232 + b * (35279 ±0)` - // Minimum execution time: 4_557_000 picoseconds. - Weight::from_parts(5_994_058, 24232) - // Standard Error: 4_326 - .saturating_add(Weight::from_parts(7_369_489, 0).saturating_mul(b.into())) + // Estimated: `28192 + b * (35279 ±0)` + // Minimum execution time: 4_612_000 picoseconds. + Weight::from_parts(6_399_460, 28192) + // Standard Error: 5_119 + .saturating_add(Weight::from_parts(7_230_389, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -121,11 +120,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items_ex(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `21692 + b * (37819 ±0)` - // Minimum execution time: 4_533_000 picoseconds. - Weight::from_parts(2_822_660, 21692) - // Standard Error: 3_650 - .saturating_add(Weight::from_parts(9_100_706, 0).saturating_mul(b.into())) + // Estimated: `25652 + b * (37819 ±0)` + // Minimum execution time: 4_538_000 picoseconds. + Weight::from_parts(4_686_000, 25652) + // Standard Error: 3_518 + .saturating_add(Weight::from_parts(8_905_771, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -148,10 +147,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_item() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `12611` - // Minimum execution time: 23_528_000 picoseconds. - Weight::from_parts(24_680_000, 12611) + // Measured: `380` + // Estimated: `17561` + // Minimum execution time: 24_230_000 picoseconds. + Weight::from_parts(24_672_000, 17561) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -171,10 +170,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_recursively_self_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `12611` - // Minimum execution time: 29_770_000 picoseconds. - Weight::from_parts(30_114_000, 12611) + // Measured: `380` + // Estimated: `17561` + // Minimum execution time: 30_521_000 picoseconds. + Weight::from_parts(31_241_000, 17561) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -197,12 +196,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 200]`. fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1530 + b * (58 ±0)` - // Estimated: `18290 + b * (10097 ±0)` - // Minimum execution time: 31_413_000 picoseconds. - Weight::from_parts(31_865_000, 18290) - // Standard Error: 980_032 - .saturating_add(Weight::from_parts(205_236_443, 0).saturating_mul(b.into())) + // Measured: `1467 + b * (58 ±0)` + // Estimated: `24230 + b * (10097 ±0)` + // Minimum execution time: 31_734_000 picoseconds. + Weight::from_parts(32_162_000, 24230) + // Standard Error: 210_514 + .saturating_add(Weight::from_parts(71_382_804, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) @@ -219,10 +218,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn transfer_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `10144` - // Minimum execution time: 9_307_000 picoseconds. - Weight::from_parts(10_108_000, 10144) + // Measured: `380` + // Estimated: `13114` + // Minimum execution time: 18_305_000 picoseconds. + Weight::from_parts(18_859_000, 13114) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -232,10 +231,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn approve() -> Weight { // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `5064` - // Minimum execution time: 11_507_000 picoseconds. - Weight::from_parts(11_771_000, 5064) + // Measured: `326` + // Estimated: `7044` + // Minimum execution time: 10_977_000 picoseconds. + Weight::from_parts(11_184_000, 7044) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -246,9 +245,9 @@ impl WeightInfo for SubstrateWeight { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `313` - // Estimated: `5064` - // Minimum execution time: 11_558_000 picoseconds. - Weight::from_parts(11_789_000, 5064) + // Estimated: `7044` + // Minimum execution time: 11_456_000 picoseconds. + Weight::from_parts(11_731_000, 7044) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -256,10 +255,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `394` - // Estimated: `2532` - // Minimum execution time: 2_668_000 picoseconds. - Weight::from_parts(2_877_000, 2532) + // Measured: `362` + // Estimated: `3522` + // Minimum execution time: 5_771_000 picoseconds. + Weight::from_parts(5_972_000, 3522) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) @@ -278,10 +277,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_from() -> Weight { // Proof Size summary in bytes: - // Measured: `527` - // Estimated: `12611` - // Minimum execution time: 30_713_000 picoseconds. - Weight::from_parts(31_160_000, 12611) + // Measured: `463` + // Estimated: `17561` + // Minimum execution time: 30_633_000 picoseconds. + Weight::from_parts(31_136_000, 17561) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -291,11 +290,11 @@ impl WeightInfo for SubstrateWeight { fn set_token_property_permissions(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `281` - // Estimated: `19201` - // Minimum execution time: 2_360_000 picoseconds. - Weight::from_parts(2_396_000, 19201) - // Standard Error: 43_257 - .saturating_add(Weight::from_parts(12_085_808, 0).saturating_mul(b.into())) + // Estimated: `20191` + // Minimum execution time: 2_300_000 picoseconds. + Weight::from_parts(2_382_000, 20191) + // Standard Error: 45_076 + .saturating_add(Weight::from_parts(12_000_777, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -306,12 +305,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 64]`. fn set_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `616 + b * (261 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_543_000 picoseconds. - Weight::from_parts(12_686_000, 54480) - // Standard Error: 52_286 - .saturating_add(Weight::from_parts(6_894_785, 0).saturating_mul(b.into())) + // Measured: `584 + b * (261 ±0)` + // Estimated: `56460` + // Minimum execution time: 12_422_000 picoseconds. + Weight::from_parts(5_523_689, 56460) + // Standard Error: 74_137 + .saturating_add(Weight::from_parts(6_320_501, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -322,12 +321,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 64]`. fn delete_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `653 + b * (33291 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_352_000 picoseconds. - Weight::from_parts(12_523_000, 54480) - // Standard Error: 70_401 - .saturating_add(Weight::from_parts(21_959_228, 0).saturating_mul(b.into())) + // Measured: `589 + b * (33291 ±0)` + // Estimated: `56460` + // Minimum execution time: 12_006_000 picoseconds. + Weight::from_parts(12_216_000, 56460) + // Standard Error: 83_431 + .saturating_add(Weight::from_parts(24_556_999, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -335,10 +334,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn token_owner() -> Weight { // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `2532` - // Minimum execution time: 4_797_000 picoseconds. - Weight::from_parts(5_499_000, 2532) + // Measured: `326` + // Estimated: `3522` + // Minimum execution time: 4_827_000 picoseconds. + Weight::from_parts(4_984_000, 3522) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Nonfungible CollectionAllowance (r:0 w:1) @@ -347,8 +346,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_303_000 picoseconds. - Weight::from_parts(6_712_000, 0) + // Minimum execution time: 6_151_000 picoseconds. + Weight::from_parts(6_394_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Nonfungible CollectionAllowance (r:1 w:0) @@ -356,9 +355,9 @@ impl WeightInfo for SubstrateWeight { fn allowance_for_all() -> Weight { // Proof Size summary in bytes: // Measured: `109` - // Estimated: `2586` - // Minimum execution time: 3_798_000 picoseconds. - Weight::from_parts(4_017_000, 2586) + // Estimated: `3576` + // Minimum execution time: 3_791_000 picoseconds. + Weight::from_parts(3_950_000, 3576) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Nonfungible TokenProperties (r:1 w:1) @@ -366,9 +365,9 @@ impl WeightInfo for SubstrateWeight { fn repair_item() -> Weight { // Proof Size summary in bytes: // Measured: `300` - // Estimated: `35279` - // Minimum execution time: 5_531_000 picoseconds. - Weight::from_parts(5_750_000, 35279) + // Estimated: `36269` + // Minimum execution time: 5_364_000 picoseconds. + Weight::from_parts(5_539_000, 36269) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -391,9 +390,9 @@ impl WeightInfo for () { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `59511` - // Minimum execution time: 23_081_000 picoseconds. - Weight::from_parts(23_551_000, 59511) + // Estimated: `63471` + // Minimum execution time: 25_892_000 picoseconds. + Weight::from_parts(26_424_000, 63471) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -413,11 +412,11 @@ impl WeightInfo for () { fn create_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `24232 + b * (35279 ±0)` - // Minimum execution time: 4_557_000 picoseconds. - Weight::from_parts(5_994_058, 24232) - // Standard Error: 4_326 - .saturating_add(Weight::from_parts(7_369_489, 0).saturating_mul(b.into())) + // Estimated: `28192 + b * (35279 ±0)` + // Minimum execution time: 4_612_000 picoseconds. + Weight::from_parts(6_399_460, 28192) + // Standard Error: 5_119 + .saturating_add(Weight::from_parts(7_230_389, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -440,11 +439,11 @@ impl WeightInfo for () { fn create_multiple_items_ex(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `390` - // Estimated: `21692 + b * (37819 ±0)` - // Minimum execution time: 4_533_000 picoseconds. - Weight::from_parts(2_822_660, 21692) - // Standard Error: 3_650 - .saturating_add(Weight::from_parts(9_100_706, 0).saturating_mul(b.into())) + // Estimated: `25652 + b * (37819 ±0)` + // Minimum execution time: 4_538_000 picoseconds. + Weight::from_parts(4_686_000, 25652) + // Standard Error: 3_518 + .saturating_add(Weight::from_parts(8_905_771, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -467,10 +466,10 @@ impl WeightInfo for () { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_item() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `12611` - // Minimum execution time: 23_528_000 picoseconds. - Weight::from_parts(24_680_000, 12611) + // Measured: `380` + // Estimated: `17561` + // Minimum execution time: 24_230_000 picoseconds. + Weight::from_parts(24_672_000, 17561) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -490,10 +489,10 @@ impl WeightInfo for () { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_recursively_self_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `12611` - // Minimum execution time: 29_770_000 picoseconds. - Weight::from_parts(30_114_000, 12611) + // Measured: `380` + // Estimated: `17561` + // Minimum execution time: 30_521_000 picoseconds. + Weight::from_parts(31_241_000, 17561) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -516,12 +515,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 200]`. fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1530 + b * (58 ±0)` - // Estimated: `18290 + b * (10097 ±0)` - // Minimum execution time: 31_413_000 picoseconds. - Weight::from_parts(31_865_000, 18290) - // Standard Error: 980_032 - .saturating_add(Weight::from_parts(205_236_443, 0).saturating_mul(b.into())) + // Measured: `1467 + b * (58 ±0)` + // Estimated: `24230 + b * (10097 ±0)` + // Minimum execution time: 31_734_000 picoseconds. + Weight::from_parts(32_162_000, 24230) + // Standard Error: 210_514 + .saturating_add(Weight::from_parts(71_382_804, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(6_u64)) @@ -538,10 +537,10 @@ impl WeightInfo for () { /// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn transfer_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `412` - // Estimated: `10144` - // Minimum execution time: 9_307_000 picoseconds. - Weight::from_parts(10_108_000, 10144) + // Measured: `380` + // Estimated: `13114` + // Minimum execution time: 18_305_000 picoseconds. + Weight::from_parts(18_859_000, 13114) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -551,10 +550,10 @@ impl WeightInfo for () { /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn approve() -> Weight { // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `5064` - // Minimum execution time: 11_507_000 picoseconds. - Weight::from_parts(11_771_000, 5064) + // Measured: `326` + // Estimated: `7044` + // Minimum execution time: 10_977_000 picoseconds. + Weight::from_parts(11_184_000, 7044) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -565,9 +564,9 @@ impl WeightInfo for () { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `313` - // Estimated: `5064` - // Minimum execution time: 11_558_000 picoseconds. - Weight::from_parts(11_789_000, 5064) + // Estimated: `7044` + // Minimum execution time: 11_456_000 picoseconds. + Weight::from_parts(11_731_000, 7044) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -575,10 +574,10 @@ impl WeightInfo for () { /// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn check_allowed_raw() -> Weight { // Proof Size summary in bytes: - // Measured: `394` - // Estimated: `2532` - // Minimum execution time: 2_668_000 picoseconds. - Weight::from_parts(2_877_000, 2532) + // Measured: `362` + // Estimated: `3522` + // Minimum execution time: 5_771_000 picoseconds. + Weight::from_parts(5_972_000, 3522) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Nonfungible Allowance (r:1 w:1) @@ -597,10 +596,10 @@ impl WeightInfo for () { /// Proof: Nonfungible TokenProperties (max_values: None, max_size: Some(32804), added: 35279, mode: MaxEncodedLen) fn burn_from() -> Weight { // Proof Size summary in bytes: - // Measured: `527` - // Estimated: `12611` - // Minimum execution time: 30_713_000 picoseconds. - Weight::from_parts(31_160_000, 12611) + // Measured: `463` + // Estimated: `17561` + // Minimum execution time: 30_633_000 picoseconds. + Weight::from_parts(31_136_000, 17561) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -610,11 +609,11 @@ impl WeightInfo for () { fn set_token_property_permissions(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `281` - // Estimated: `19201` - // Minimum execution time: 2_360_000 picoseconds. - Weight::from_parts(2_396_000, 19201) - // Standard Error: 43_257 - .saturating_add(Weight::from_parts(12_085_808, 0).saturating_mul(b.into())) + // Estimated: `20191` + // Minimum execution time: 2_300_000 picoseconds. + Weight::from_parts(2_382_000, 20191) + // Standard Error: 45_076 + .saturating_add(Weight::from_parts(12_000_777, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -625,12 +624,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 64]`. fn set_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `616 + b * (261 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_543_000 picoseconds. - Weight::from_parts(12_686_000, 54480) - // Standard Error: 52_286 - .saturating_add(Weight::from_parts(6_894_785, 0).saturating_mul(b.into())) + // Measured: `584 + b * (261 ±0)` + // Estimated: `56460` + // Minimum execution time: 12_422_000 picoseconds. + Weight::from_parts(5_523_689, 56460) + // Standard Error: 74_137 + .saturating_add(Weight::from_parts(6_320_501, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -641,12 +640,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 64]`. fn delete_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `653 + b * (33291 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_352_000 picoseconds. - Weight::from_parts(12_523_000, 54480) - // Standard Error: 70_401 - .saturating_add(Weight::from_parts(21_959_228, 0).saturating_mul(b.into())) + // Measured: `589 + b * (33291 ±0)` + // Estimated: `56460` + // Minimum execution time: 12_006_000 picoseconds. + Weight::from_parts(12_216_000, 56460) + // Standard Error: 83_431 + .saturating_add(Weight::from_parts(24_556_999, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -654,10 +653,10 @@ impl WeightInfo for () { /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn token_owner() -> Weight { // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `2532` - // Minimum execution time: 4_797_000 picoseconds. - Weight::from_parts(5_499_000, 2532) + // Measured: `326` + // Estimated: `3522` + // Minimum execution time: 4_827_000 picoseconds. + Weight::from_parts(4_984_000, 3522) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Nonfungible CollectionAllowance (r:0 w:1) @@ -666,8 +665,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_303_000 picoseconds. - Weight::from_parts(6_712_000, 0) + // Minimum execution time: 6_151_000 picoseconds. + Weight::from_parts(6_394_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Nonfungible CollectionAllowance (r:1 w:0) @@ -675,9 +674,9 @@ impl WeightInfo for () { fn allowance_for_all() -> Weight { // Proof Size summary in bytes: // Measured: `109` - // Estimated: `2586` - // Minimum execution time: 3_798_000 picoseconds. - Weight::from_parts(4_017_000, 2586) + // Estimated: `3576` + // Minimum execution time: 3_791_000 picoseconds. + Weight::from_parts(3_950_000, 3576) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Nonfungible TokenProperties (r:1 w:1) @@ -685,9 +684,9 @@ impl WeightInfo for () { fn repair_item() -> Weight { // Proof Size summary in bytes: // Measured: `300` - // Estimated: `35279` - // Minimum execution time: 5_531_000 picoseconds. - Weight::from_parts(5_750_000, 35279) + // Estimated: `36269` + // Minimum execution time: 5_364_000 picoseconds. + Weight::from_parts(5_539_000, 36269) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/refungible/src/weights.rs b/pallets/refungible/src/weights.rs index d1e11cf10a..58ea241ab5 100644 --- a/pallets/refungible/src/weights.rs +++ b/pallets/refungible/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_refungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -81,9 +80,9 @@ impl WeightInfo for SubstrateWeight { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `59511` - // Minimum execution time: 25_287_000 picoseconds. - Weight::from_parts(25_741_000, 59511) + // Estimated: `63471` + // Minimum execution time: 30_759_000 picoseconds. + Weight::from_parts(31_321_000, 63471) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -105,11 +104,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `24232 + b * (35279 ±0)` - // Minimum execution time: 4_618_000 picoseconds. - Weight::from_parts(1_425_218, 24232) - // Standard Error: 4_343 - .saturating_add(Weight::from_parts(9_154_733, 0).saturating_mul(b.into())) + // Estimated: `28192 + b * (35279 ±0)` + // Minimum execution time: 4_024_000 picoseconds. + Weight::from_parts(4_145_000, 28192) + // Standard Error: 3_332 + .saturating_add(Weight::from_parts(8_967_757, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -134,11 +133,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `21692 + b * (37819 ±0)` - // Minimum execution time: 4_063_000 picoseconds. - Weight::from_parts(4_160_000, 21692) - // Standard Error: 2_386 - .saturating_add(Weight::from_parts(10_836_802, 0).saturating_mul(b.into())) + // Estimated: `25652 + b * (37819 ±0)` + // Minimum execution time: 3_715_000 picoseconds. + Weight::from_parts(3_881_000, 25652) + // Standard Error: 3_275 + .saturating_add(Weight::from_parts(10_525_271, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -163,11 +162,11 @@ impl WeightInfo for SubstrateWeight { fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `56971 + b * (2540 ±0)` - // Minimum execution time: 14_637_000 picoseconds. - Weight::from_parts(19_042_423, 56971) - // Standard Error: 1_632 - .saturating_add(Weight::from_parts(5_976_694, 0).saturating_mul(b.into())) + // Estimated: `60931 + b * (2540 ±0)` + // Minimum execution time: 13_150_000 picoseconds. + Weight::from_parts(15_655_930, 60931) + // Standard Error: 4_170 + .saturating_add(Weight::from_parts(5_673_702, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -185,9 +184,9 @@ impl WeightInfo for SubstrateWeight { fn burn_item_partial() -> Weight { // Proof Size summary in bytes: // Measured: `490` - // Estimated: `12747` - // Minimum execution time: 35_018_000 picoseconds. - Weight::from_parts(35_596_000, 12747) + // Estimated: `15717` + // Minimum execution time: 28_992_000 picoseconds. + Weight::from_parts(29_325_000, 15717) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -206,9 +205,9 @@ impl WeightInfo for SubstrateWeight { fn burn_item_fully() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `10110` - // Minimum execution time: 30_441_000 picoseconds. - Weight::from_parts(31_000_000, 10110) + // Estimated: `14070` + // Minimum execution time: 27_980_000 picoseconds. + Weight::from_parts(28_582_000, 14070) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -219,9 +218,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_normal() -> Weight { // Proof Size summary in bytes: // Measured: `398` - // Estimated: `7643` - // Minimum execution time: 20_055_000 picoseconds. - Weight::from_parts(20_533_000, 7643) + // Estimated: `9623` + // Minimum execution time: 18_746_000 picoseconds. + Weight::from_parts(19_096_000, 9623) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -236,9 +235,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_creating() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `10183` - // Minimum execution time: 23_443_000 picoseconds. - Weight::from_parts(23_791_000, 10183) + // Estimated: `13153` + // Minimum execution time: 21_719_000 picoseconds. + Weight::from_parts(22_219_000, 13153) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -253,9 +252,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_removing() -> Weight { // Proof Size summary in bytes: // Measured: `490` - // Estimated: `10183` - // Minimum execution time: 26_489_000 picoseconds. - Weight::from_parts(27_103_000, 10183) + // Estimated: `13153` + // Minimum execution time: 24_784_000 picoseconds. + Weight::from_parts(25_231_000, 13153) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -270,9 +269,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_creating_removing() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `12723` - // Minimum execution time: 26_719_000 picoseconds. - Weight::from_parts(27_038_000, 12723) + // Estimated: `15693` + // Minimum execution time: 24_865_000 picoseconds. + Weight::from_parts(25_253_000, 15693) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -283,9 +282,9 @@ impl WeightInfo for SubstrateWeight { fn approve() -> Weight { // Proof Size summary in bytes: // Measured: `256` - // Estimated: `2564` - // Minimum execution time: 12_949_000 picoseconds. - Weight::from_parts(13_181_000, 2564) + // Estimated: `3554` + // Minimum execution time: 12_318_000 picoseconds. + Weight::from_parts(12_597_000, 3554) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -296,9 +295,9 @@ impl WeightInfo for SubstrateWeight { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `244` - // Estimated: `2564` - // Minimum execution time: 12_942_000 picoseconds. - Weight::from_parts(13_268_000, 2564) + // Estimated: `3554` + // Minimum execution time: 12_276_000 picoseconds. + Weight::from_parts(12_557_000, 3554) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -311,9 +310,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_from_normal() -> Weight { // Proof Size summary in bytes: // Measured: `528` - // Estimated: `10223` - // Minimum execution time: 28_907_000 picoseconds. - Weight::from_parts(29_487_000, 10223) + // Estimated: `13193` + // Minimum execution time: 26_852_000 picoseconds. + Weight::from_parts(27_427_000, 13193) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -330,9 +329,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_from_creating() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `12763` - // Minimum execution time: 31_271_000 picoseconds. - Weight::from_parts(32_293_000, 12763) + // Estimated: `16723` + // Minimum execution time: 29_893_000 picoseconds. + Weight::from_parts(30_345_000, 16723) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -349,9 +348,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_from_removing() -> Weight { // Proof Size summary in bytes: // Measured: `620` - // Estimated: `12763` - // Minimum execution time: 34_295_000 picoseconds. - Weight::from_parts(34_924_000, 12763) + // Estimated: `16723` + // Minimum execution time: 32_784_000 picoseconds. + Weight::from_parts(33_322_000, 16723) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -368,9 +367,9 @@ impl WeightInfo for SubstrateWeight { fn transfer_from_creating_removing() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `15303` - // Minimum execution time: 35_447_000 picoseconds. - Weight::from_parts(35_896_000, 15303) + // Estimated: `19263` + // Minimum execution time: 32_987_000 picoseconds. + Weight::from_parts(33_428_000, 19263) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -391,9 +390,9 @@ impl WeightInfo for SubstrateWeight { fn burn_from() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `12690` - // Minimum execution time: 39_395_000 picoseconds. - Weight::from_parts(40_119_000, 12690) + // Estimated: `17640` + // Minimum execution time: 38_277_000 picoseconds. + Weight::from_parts(38_983_000, 17640) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -403,11 +402,11 @@ impl WeightInfo for SubstrateWeight { fn set_token_property_permissions(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `281` - // Estimated: `19201` - // Minimum execution time: 2_337_000 picoseconds. - Weight::from_parts(2_434_000, 19201) - // Standard Error: 43_425 - .saturating_add(Weight::from_parts(12_286_502, 0).saturating_mul(b.into())) + // Estimated: `20191` + // Minimum execution time: 2_254_000 picoseconds. + Weight::from_parts(2_335_000, 20191) + // Standard Error: 44_906 + .saturating_add(Weight::from_parts(12_118_499, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -418,12 +417,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 64]`. fn set_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `490 + b * (261 ±0)` - // Estimated: `54480` - // Minimum execution time: 11_857_000 picoseconds. - Weight::from_parts(12_007_000, 54480) - // Standard Error: 22_963 - .saturating_add(Weight::from_parts(6_609_180, 0).saturating_mul(b.into())) + // Measured: `458 + b * (261 ±0)` + // Estimated: `56460` + // Minimum execution time: 11_249_000 picoseconds. + Weight::from_parts(11_420_000, 56460) + // Standard Error: 72_033 + .saturating_add(Weight::from_parts(7_008_012, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -434,12 +433,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[0, 64]`. fn delete_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `527 + b * (33291 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_001_000 picoseconds. - Weight::from_parts(12_197_000, 54480) - // Standard Error: 70_580 - .saturating_add(Weight::from_parts(21_847_004, 0).saturating_mul(b.into())) + // Measured: `463 + b * (33291 ±0)` + // Estimated: `56460` + // Minimum execution time: 11_368_000 picoseconds. + Weight::from_parts(11_546_000, 56460) + // Standard Error: 85_444 + .saturating_add(Weight::from_parts(24_644_980, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -450,9 +449,9 @@ impl WeightInfo for SubstrateWeight { fn repartition_item() -> Weight { // Proof Size summary in bytes: // Measured: `321` - // Estimated: `5079` - // Minimum execution time: 14_497_000 picoseconds. - Weight::from_parts(14_825_000, 5079) + // Estimated: `7059` + // Minimum execution time: 13_586_000 picoseconds. + Weight::from_parts(14_489_000, 7059) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -461,9 +460,9 @@ impl WeightInfo for SubstrateWeight { fn token_owner() -> Weight { // Proof Size summary in bytes: // Measured: `321` - // Estimated: `5128` - // Minimum execution time: 8_888_000 picoseconds. - Weight::from_parts(9_373_000, 5128) + // Estimated: `6118` + // Minimum execution time: 7_049_000 picoseconds. + Weight::from_parts(7_320_000, 6118) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: Refungible CollectionAllowance (r:0 w:1) @@ -472,8 +471,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(7_245_000, 0) + // Minimum execution time: 6_432_000 picoseconds. + Weight::from_parts(6_642_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Refungible CollectionAllowance (r:1 w:0) @@ -481,9 +480,9 @@ impl WeightInfo for SubstrateWeight { fn allowance_for_all() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2586` - // Minimum execution time: 3_425_000 picoseconds. - Weight::from_parts(3_554_000, 2586) + // Estimated: `3576` + // Minimum execution time: 3_030_000 picoseconds. + Weight::from_parts(3_206_000, 3576) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Refungible TokenProperties (r:1 w:1) @@ -491,9 +490,9 @@ impl WeightInfo for SubstrateWeight { fn repair_item() -> Weight { // Proof Size summary in bytes: // Measured: `174` - // Estimated: `35279` - // Minimum execution time: 4_684_000 picoseconds. - Weight::from_parts(4_805_000, 35279) + // Estimated: `36269` + // Minimum execution time: 4_371_000 picoseconds. + Weight::from_parts(4_555_000, 36269) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -518,9 +517,9 @@ impl WeightInfo for () { fn create_item() -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `59511` - // Minimum execution time: 25_287_000 picoseconds. - Weight::from_parts(25_741_000, 59511) + // Estimated: `63471` + // Minimum execution time: 30_759_000 picoseconds. + Weight::from_parts(31_321_000, 63471) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -542,11 +541,11 @@ impl WeightInfo for () { fn create_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `24232 + b * (35279 ±0)` - // Minimum execution time: 4_618_000 picoseconds. - Weight::from_parts(1_425_218, 24232) - // Standard Error: 4_343 - .saturating_add(Weight::from_parts(9_154_733, 0).saturating_mul(b.into())) + // Estimated: `28192 + b * (35279 ±0)` + // Minimum execution time: 4_024_000 picoseconds. + Weight::from_parts(4_145_000, 28192) + // Standard Error: 3_332 + .saturating_add(Weight::from_parts(8_967_757, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -571,11 +570,11 @@ impl WeightInfo for () { fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `21692 + b * (37819 ±0)` - // Minimum execution time: 4_063_000 picoseconds. - Weight::from_parts(4_160_000, 21692) - // Standard Error: 2_386 - .saturating_add(Weight::from_parts(10_836_802, 0).saturating_mul(b.into())) + // Estimated: `25652 + b * (37819 ±0)` + // Minimum execution time: 3_715_000 picoseconds. + Weight::from_parts(3_881_000, 25652) + // Standard Error: 3_275 + .saturating_add(Weight::from_parts(10_525_271, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -600,11 +599,11 @@ impl WeightInfo for () { fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `285` - // Estimated: `56971 + b * (2540 ±0)` - // Minimum execution time: 14_637_000 picoseconds. - Weight::from_parts(19_042_423, 56971) - // Standard Error: 1_632 - .saturating_add(Weight::from_parts(5_976_694, 0).saturating_mul(b.into())) + // Estimated: `60931 + b * (2540 ±0)` + // Minimum execution time: 13_150_000 picoseconds. + Weight::from_parts(15_655_930, 60931) + // Standard Error: 4_170 + .saturating_add(Weight::from_parts(5_673_702, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -622,9 +621,9 @@ impl WeightInfo for () { fn burn_item_partial() -> Weight { // Proof Size summary in bytes: // Measured: `490` - // Estimated: `12747` - // Minimum execution time: 35_018_000 picoseconds. - Weight::from_parts(35_596_000, 12747) + // Estimated: `15717` + // Minimum execution time: 28_992_000 picoseconds. + Weight::from_parts(29_325_000, 15717) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -643,9 +642,9 @@ impl WeightInfo for () { fn burn_item_fully() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `10110` - // Minimum execution time: 30_441_000 picoseconds. - Weight::from_parts(31_000_000, 10110) + // Estimated: `14070` + // Minimum execution time: 27_980_000 picoseconds. + Weight::from_parts(28_582_000, 14070) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -656,9 +655,9 @@ impl WeightInfo for () { fn transfer_normal() -> Weight { // Proof Size summary in bytes: // Measured: `398` - // Estimated: `7643` - // Minimum execution time: 20_055_000 picoseconds. - Weight::from_parts(20_533_000, 7643) + // Estimated: `9623` + // Minimum execution time: 18_746_000 picoseconds. + Weight::from_parts(19_096_000, 9623) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -673,9 +672,9 @@ impl WeightInfo for () { fn transfer_creating() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `10183` - // Minimum execution time: 23_443_000 picoseconds. - Weight::from_parts(23_791_000, 10183) + // Estimated: `13153` + // Minimum execution time: 21_719_000 picoseconds. + Weight::from_parts(22_219_000, 13153) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -690,9 +689,9 @@ impl WeightInfo for () { fn transfer_removing() -> Weight { // Proof Size summary in bytes: // Measured: `490` - // Estimated: `10183` - // Minimum execution time: 26_489_000 picoseconds. - Weight::from_parts(27_103_000, 10183) + // Estimated: `13153` + // Minimum execution time: 24_784_000 picoseconds. + Weight::from_parts(25_231_000, 13153) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -707,9 +706,9 @@ impl WeightInfo for () { fn transfer_creating_removing() -> Weight { // Proof Size summary in bytes: // Measured: `375` - // Estimated: `12723` - // Minimum execution time: 26_719_000 picoseconds. - Weight::from_parts(27_038_000, 12723) + // Estimated: `15693` + // Minimum execution time: 24_865_000 picoseconds. + Weight::from_parts(25_253_000, 15693) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -720,9 +719,9 @@ impl WeightInfo for () { fn approve() -> Weight { // Proof Size summary in bytes: // Measured: `256` - // Estimated: `2564` - // Minimum execution time: 12_949_000 picoseconds. - Weight::from_parts(13_181_000, 2564) + // Estimated: `3554` + // Minimum execution time: 12_318_000 picoseconds. + Weight::from_parts(12_597_000, 3554) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -733,9 +732,9 @@ impl WeightInfo for () { fn approve_from() -> Weight { // Proof Size summary in bytes: // Measured: `244` - // Estimated: `2564` - // Minimum execution time: 12_942_000 picoseconds. - Weight::from_parts(13_268_000, 2564) + // Estimated: `3554` + // Minimum execution time: 12_276_000 picoseconds. + Weight::from_parts(12_557_000, 3554) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -748,9 +747,9 @@ impl WeightInfo for () { fn transfer_from_normal() -> Weight { // Proof Size summary in bytes: // Measured: `528` - // Estimated: `10223` - // Minimum execution time: 28_907_000 picoseconds. - Weight::from_parts(29_487_000, 10223) + // Estimated: `13193` + // Minimum execution time: 26_852_000 picoseconds. + Weight::from_parts(27_427_000, 13193) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -767,9 +766,9 @@ impl WeightInfo for () { fn transfer_from_creating() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `12763` - // Minimum execution time: 31_271_000 picoseconds. - Weight::from_parts(32_293_000, 12763) + // Estimated: `16723` + // Minimum execution time: 29_893_000 picoseconds. + Weight::from_parts(30_345_000, 16723) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -786,9 +785,9 @@ impl WeightInfo for () { fn transfer_from_removing() -> Weight { // Proof Size summary in bytes: // Measured: `620` - // Estimated: `12763` - // Minimum execution time: 34_295_000 picoseconds. - Weight::from_parts(34_924_000, 12763) + // Estimated: `16723` + // Minimum execution time: 32_784_000 picoseconds. + Weight::from_parts(33_322_000, 16723) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -805,9 +804,9 @@ impl WeightInfo for () { fn transfer_from_creating_removing() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `15303` - // Minimum execution time: 35_447_000 picoseconds. - Weight::from_parts(35_896_000, 15303) + // Estimated: `19263` + // Minimum execution time: 32_987_000 picoseconds. + Weight::from_parts(33_428_000, 19263) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -828,9 +827,9 @@ impl WeightInfo for () { fn burn_from() -> Weight { // Proof Size summary in bytes: // Measured: `505` - // Estimated: `12690` - // Minimum execution time: 39_395_000 picoseconds. - Weight::from_parts(40_119_000, 12690) + // Estimated: `17640` + // Minimum execution time: 38_277_000 picoseconds. + Weight::from_parts(38_983_000, 17640) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -840,11 +839,11 @@ impl WeightInfo for () { fn set_token_property_permissions(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `281` - // Estimated: `19201` - // Minimum execution time: 2_337_000 picoseconds. - Weight::from_parts(2_434_000, 19201) - // Standard Error: 43_425 - .saturating_add(Weight::from_parts(12_286_502, 0).saturating_mul(b.into())) + // Estimated: `20191` + // Minimum execution time: 2_254_000 picoseconds. + Weight::from_parts(2_335_000, 20191) + // Standard Error: 44_906 + .saturating_add(Weight::from_parts(12_118_499, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -855,12 +854,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 64]`. fn set_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `490 + b * (261 ±0)` - // Estimated: `54480` - // Minimum execution time: 11_857_000 picoseconds. - Weight::from_parts(12_007_000, 54480) - // Standard Error: 22_963 - .saturating_add(Weight::from_parts(6_609_180, 0).saturating_mul(b.into())) + // Measured: `458 + b * (261 ±0)` + // Estimated: `56460` + // Minimum execution time: 11_249_000 picoseconds. + Weight::from_parts(11_420_000, 56460) + // Standard Error: 72_033 + .saturating_add(Weight::from_parts(7_008_012, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -871,12 +870,12 @@ impl WeightInfo for () { /// The range of component `b` is `[0, 64]`. fn delete_token_properties(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `527 + b * (33291 ±0)` - // Estimated: `54480` - // Minimum execution time: 12_001_000 picoseconds. - Weight::from_parts(12_197_000, 54480) - // Standard Error: 70_580 - .saturating_add(Weight::from_parts(21_847_004, 0).saturating_mul(b.into())) + // Measured: `463 + b * (33291 ±0)` + // Estimated: `56460` + // Minimum execution time: 11_368_000 picoseconds. + Weight::from_parts(11_546_000, 56460) + // Standard Error: 85_444 + .saturating_add(Weight::from_parts(24_644_980, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -887,9 +886,9 @@ impl WeightInfo for () { fn repartition_item() -> Weight { // Proof Size summary in bytes: // Measured: `321` - // Estimated: `5079` - // Minimum execution time: 14_497_000 picoseconds. - Weight::from_parts(14_825_000, 5079) + // Estimated: `7059` + // Minimum execution time: 13_586_000 picoseconds. + Weight::from_parts(14_489_000, 7059) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -898,9 +897,9 @@ impl WeightInfo for () { fn token_owner() -> Weight { // Proof Size summary in bytes: // Measured: `321` - // Estimated: `5128` - // Minimum execution time: 8_888_000 picoseconds. - Weight::from_parts(9_373_000, 5128) + // Estimated: `6118` + // Minimum execution time: 7_049_000 picoseconds. + Weight::from_parts(7_320_000, 6118) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: Refungible CollectionAllowance (r:0 w:1) @@ -909,8 +908,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(7_245_000, 0) + // Minimum execution time: 6_432_000 picoseconds. + Weight::from_parts(6_642_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Refungible CollectionAllowance (r:1 w:0) @@ -918,9 +917,9 @@ impl WeightInfo for () { fn allowance_for_all() -> Weight { // Proof Size summary in bytes: // Measured: `4` - // Estimated: `2586` - // Minimum execution time: 3_425_000 picoseconds. - Weight::from_parts(3_554_000, 2586) + // Estimated: `3576` + // Minimum execution time: 3_030_000 picoseconds. + Weight::from_parts(3_206_000, 3576) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Refungible TokenProperties (r:1 w:1) @@ -928,9 +927,9 @@ impl WeightInfo for () { fn repair_item() -> Weight { // Proof Size summary in bytes: // Measured: `174` - // Estimated: `35279` - // Minimum execution time: 4_684_000 picoseconds. - Weight::from_parts(4_805_000, 35279) + // Estimated: `36269` + // Minimum execution time: 4_371_000 picoseconds. + Weight::from_parts(4_555_000, 36269) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/structure/src/weights.rs b/pallets/structure/src/weights.rs index d2431c913c..b871bae467 100644 --- a/pallets/structure/src/weights.rs +++ b/pallets/structure/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_structure //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -46,10 +45,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn find_parent() -> Weight { // Proof Size summary in bytes: - // Measured: `698` - // Estimated: `5867` - // Minimum execution time: 9_834_000 picoseconds. - Weight::from_parts(10_073_000, 5867) + // Measured: `634` + // Estimated: `7847` + // Minimum execution time: 10_781_000 picoseconds. + Weight::from_parts(11_675_000, 7847) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -62,10 +61,10 @@ impl WeightInfo for () { /// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen) fn find_parent() -> Weight { // Proof Size summary in bytes: - // Measured: `698` - // Estimated: `5867` - // Minimum execution time: 9_834_000 picoseconds. - Weight::from_parts(10_073_000, 5867) + // Measured: `634` + // Estimated: `7847` + // Minimum execution time: 10_781_000 picoseconds. + Weight::from_parts(11_675_000, 7847) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } diff --git a/pallets/unique/src/weights.rs b/pallets/unique/src/weights.rs index db81ed47ae..f13241f32b 100644 --- a/pallets/unique/src/weights.rs +++ b/pallets/unique/src/weights.rs @@ -3,8 +3,9 @@ //! Autogenerated weights for pallet_unique //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,8 +27,6 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(missing_docs)] -#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; @@ -66,10 +65,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn create_collection() -> Weight { // Proof Size summary in bytes: - // Measured: `277` - // Estimated: `6204` - // Minimum execution time: 37_430_000 picoseconds. - Weight::from_parts(42_154_000, 6204) + // Measured: `245` + // Estimated: `9174` + // Minimum execution time: 31_198_000 picoseconds. + Weight::from_parts(32_046_000, 9174) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -89,10 +88,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionProperties (max_values: None, max_size: Some(40992), added: 43467, mode: MaxEncodedLen) fn destroy_collection() -> Weight { // Proof Size summary in bytes: - // Measured: `1118` - // Estimated: `6366` - // Minimum execution time: 51_399_000 picoseconds. - Weight::from_parts(52_256_000, 6366) + // Measured: `1086` + // Estimated: `9336` + // Minimum execution time: 48_208_000 picoseconds. + Weight::from_parts(49_031_000, 9336) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -102,10 +101,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) fn add_to_allow_list() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 16_355_000 picoseconds. - Weight::from_parts(16_737_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_852_000 picoseconds. + Weight::from_parts(15_268_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -115,10 +114,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) fn remove_from_allow_list() -> Weight { // Proof Size summary in bytes: - // Measured: `1032` - // Estimated: `3335` - // Minimum execution time: 15_812_000 picoseconds. - Weight::from_parts(16_102_000, 3335) + // Measured: `1000` + // Estimated: `4325` + // Minimum execution time: 14_595_000 picoseconds. + Weight::from_parts(14_933_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -126,10 +125,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn change_collection_owner() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_072_000 picoseconds. - Weight::from_parts(15_540_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_132_000 picoseconds. + Weight::from_parts(14_501_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -141,10 +140,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common AdminAmount (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) fn add_collection_admin() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `8379` - // Minimum execution time: 18_268_000 picoseconds. - Weight::from_parts(18_931_000, 8379) + // Measured: `967` + // Estimated: `11349` + // Minimum execution time: 17_229_000 picoseconds. + Weight::from_parts(17_657_000, 11349) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -156,10 +155,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common AdminAmount (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) fn remove_collection_admin() -> Weight { // Proof Size summary in bytes: - // Measured: `1139` - // Estimated: `8379` - // Minimum execution time: 21_786_000 picoseconds. - Weight::from_parts(22_088_000, 8379) + // Measured: `1107` + // Estimated: `11349` + // Minimum execution time: 19_827_000 picoseconds. + Weight::from_parts(20_479_000, 11349) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -167,10 +166,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_collection_sponsor() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_245_000 picoseconds. - Weight::from_parts(15_574_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_049_000 picoseconds. + Weight::from_parts(14_420_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -178,10 +177,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn confirm_sponsorship() -> Weight { // Proof Size summary in bytes: - // Measured: `1031` - // Estimated: `3335` - // Minimum execution time: 15_073_000 picoseconds. - Weight::from_parts(15_407_000, 3335) + // Measured: `999` + // Estimated: `4325` + // Minimum execution time: 13_689_000 picoseconds. + Weight::from_parts(14_044_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -189,10 +188,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn remove_collection_sponsor() -> Weight { // Proof Size summary in bytes: - // Measured: `1031` - // Estimated: `3335` - // Minimum execution time: 14_938_000 picoseconds. - Weight::from_parts(15_262_000, 3335) + // Measured: `999` + // Estimated: `4325` + // Minimum execution time: 13_275_000 picoseconds. + Weight::from_parts(13_598_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -200,10 +199,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_transfers_enabled_flag() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 10_318_000 picoseconds. - Weight::from_parts(10_652_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 9_411_000 picoseconds. + Weight::from_parts(9_706_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -211,10 +210,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_collection_limits() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_535_000 picoseconds. - Weight::from_parts(15_937_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 13_864_000 picoseconds. + Weight::from_parts(14_368_000, 4325) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -223,9 +222,9 @@ impl WeightInfo for SubstrateWeight { fn force_repair_collection() -> Weight { // Proof Size summary in bytes: // Measured: `265` - // Estimated: `43467` - // Minimum execution time: 8_178_000 picoseconds. - Weight::from_parts(8_390_000, 43467) + // Estimated: `44457` + // Minimum execution time: 7_104_000 picoseconds. + Weight::from_parts(7_293_000, 44457) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -247,10 +246,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn create_collection() -> Weight { // Proof Size summary in bytes: - // Measured: `277` - // Estimated: `6204` - // Minimum execution time: 37_430_000 picoseconds. - Weight::from_parts(42_154_000, 6204) + // Measured: `245` + // Estimated: `9174` + // Minimum execution time: 31_198_000 picoseconds. + Weight::from_parts(32_046_000, 9174) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -270,10 +269,10 @@ impl WeightInfo for () { /// Proof: Common CollectionProperties (max_values: None, max_size: Some(40992), added: 43467, mode: MaxEncodedLen) fn destroy_collection() -> Weight { // Proof Size summary in bytes: - // Measured: `1118` - // Estimated: `6366` - // Minimum execution time: 51_399_000 picoseconds. - Weight::from_parts(52_256_000, 6366) + // Measured: `1086` + // Estimated: `9336` + // Minimum execution time: 48_208_000 picoseconds. + Weight::from_parts(49_031_000, 9336) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -283,10 +282,10 @@ impl WeightInfo for () { /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) fn add_to_allow_list() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 16_355_000 picoseconds. - Weight::from_parts(16_737_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_852_000 picoseconds. + Weight::from_parts(15_268_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -296,10 +295,10 @@ impl WeightInfo for () { /// Proof: Common Allowlist (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) fn remove_from_allow_list() -> Weight { // Proof Size summary in bytes: - // Measured: `1032` - // Estimated: `3335` - // Minimum execution time: 15_812_000 picoseconds. - Weight::from_parts(16_102_000, 3335) + // Measured: `1000` + // Estimated: `4325` + // Minimum execution time: 14_595_000 picoseconds. + Weight::from_parts(14_933_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -307,10 +306,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn change_collection_owner() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_072_000 picoseconds. - Weight::from_parts(15_540_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_132_000 picoseconds. + Weight::from_parts(14_501_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -322,10 +321,10 @@ impl WeightInfo for () { /// Proof: Common AdminAmount (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) fn add_collection_admin() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `8379` - // Minimum execution time: 18_268_000 picoseconds. - Weight::from_parts(18_931_000, 8379) + // Measured: `967` + // Estimated: `11349` + // Minimum execution time: 17_229_000 picoseconds. + Weight::from_parts(17_657_000, 11349) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -337,10 +336,10 @@ impl WeightInfo for () { /// Proof: Common AdminAmount (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) fn remove_collection_admin() -> Weight { // Proof Size summary in bytes: - // Measured: `1139` - // Estimated: `8379` - // Minimum execution time: 21_786_000 picoseconds. - Weight::from_parts(22_088_000, 8379) + // Measured: `1107` + // Estimated: `11349` + // Minimum execution time: 19_827_000 picoseconds. + Weight::from_parts(20_479_000, 11349) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -348,10 +347,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_collection_sponsor() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_245_000 picoseconds. - Weight::from_parts(15_574_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 14_049_000 picoseconds. + Weight::from_parts(14_420_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -359,10 +358,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn confirm_sponsorship() -> Weight { // Proof Size summary in bytes: - // Measured: `1031` - // Estimated: `3335` - // Minimum execution time: 15_073_000 picoseconds. - Weight::from_parts(15_407_000, 3335) + // Measured: `999` + // Estimated: `4325` + // Minimum execution time: 13_689_000 picoseconds. + Weight::from_parts(14_044_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -370,10 +369,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn remove_collection_sponsor() -> Weight { // Proof Size summary in bytes: - // Measured: `1031` - // Estimated: `3335` - // Minimum execution time: 14_938_000 picoseconds. - Weight::from_parts(15_262_000, 3335) + // Measured: `999` + // Estimated: `4325` + // Minimum execution time: 13_275_000 picoseconds. + Weight::from_parts(13_598_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -381,10 +380,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_transfers_enabled_flag() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 10_318_000 picoseconds. - Weight::from_parts(10_652_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 9_411_000 picoseconds. + Weight::from_parts(9_706_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -392,10 +391,10 @@ impl WeightInfo for () { /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen) fn set_collection_limits() -> Weight { // Proof Size summary in bytes: - // Measured: `999` - // Estimated: `3335` - // Minimum execution time: 15_535_000 picoseconds. - Weight::from_parts(15_937_000, 3335) + // Measured: `967` + // Estimated: `4325` + // Minimum execution time: 13_864_000 picoseconds. + Weight::from_parts(14_368_000, 4325) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -404,9 +403,9 @@ impl WeightInfo for () { fn force_repair_collection() -> Weight { // Proof Size summary in bytes: // Measured: `265` - // Estimated: `43467` - // Minimum execution time: 8_178_000 picoseconds. - Weight::from_parts(8_390_000, 43467) + // Estimated: `44457` + // Minimum execution time: 7_104_000 picoseconds. + Weight::from_parts(7_293_000, 44457) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/runtime/common/weights/xcm.rs b/runtime/common/weights/xcm.rs index ed3ccafa58..7fa29f533d 100644 --- a/runtime/common/weights/xcm.rs +++ b/runtime/common/weights/xcm.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_xcm //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 @@ -48,9 +48,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn send() -> Weight { // Proof Size summary in bytes: // Measured: `211` - // Estimated: `5510` - // Minimum execution time: 17_608_000 picoseconds. - Weight::from_parts(18_024_000, 5510) + // Estimated: `10460` + // Minimum execution time: 17_089_000 picoseconds. + Weight::from_parts(17_615_000, 10460) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -59,9 +59,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn teleport_assets() -> Weight { // Proof Size summary in bytes: // Measured: `136` - // Estimated: `499` - // Minimum execution time: 17_648_000 picoseconds. - Weight::from_parts(18_103_000, 499) + // Estimated: `1489` + // Minimum execution time: 14_443_000 picoseconds. + Weight::from_parts(14_895_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -69,17 +69,17 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn reserve_transfer_assets() -> Weight { // Proof Size summary in bytes: // Measured: `136` - // Estimated: `499` - // Minimum execution time: 17_529_000 picoseconds. - Weight::from_parts(18_009_000, 499) + // Estimated: `1489` + // Minimum execution time: 14_340_000 picoseconds. + Weight::from_parts(14_748_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn execute() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_314_000 picoseconds. - Weight::from_parts(6_053_000, 0) + // Minimum execution time: 5_266_000 picoseconds. + Weight::from_parts(5_430_000, 0) } /// Storage: PolkadotXcm SupportedVersion (r:0 w:1) /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) @@ -87,8 +87,8 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_577_000 picoseconds. - Weight::from_parts(5_831_000, 0) + // Minimum execution time: 5_621_000 picoseconds. + Weight::from_parts(5_888_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) @@ -97,8 +97,8 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_902_000 picoseconds. - Weight::from_parts(2_018_000, 0) + // Minimum execution time: 2_087_000 picoseconds. + Weight::from_parts(2_218_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -120,9 +120,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn force_subscribe_version_notify() -> Weight { // Proof Size summary in bytes: // Measured: `211` - // Estimated: `9113` - // Minimum execution time: 21_675_000 picoseconds. - Weight::from_parts(22_161_000, 9113) + // Estimated: `16043` + // Minimum execution time: 21_067_000 picoseconds. + Weight::from_parts(21_466_000, 16043) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -143,9 +143,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn force_unsubscribe_version_notify() -> Weight { // Proof Size summary in bytes: // Measured: `394` - // Estimated: `9688` - // Minimum execution time: 24_643_000 picoseconds. - Weight::from_parts(25_027_000, 9688) + // Estimated: `15628` + // Minimum execution time: 23_986_000 picoseconds. + Weight::from_parts(25_328_000, 15628) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -154,9 +154,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn migrate_supported_version() -> Weight { // Proof Size summary in bytes: // Measured: `131` - // Estimated: `10031` - // Minimum execution time: 14_077_000 picoseconds. - Weight::from_parts(14_594_000, 10031) + // Estimated: `11021` + // Minimum execution time: 15_073_000 picoseconds. + Weight::from_parts(15_451_000, 11021) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -165,9 +165,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn migrate_version_notifiers() -> Weight { // Proof Size summary in bytes: // Measured: `135` - // Estimated: `10035` - // Minimum execution time: 14_117_000 picoseconds. - Weight::from_parts(14_590_000, 10035) + // Estimated: `11025` + // Minimum execution time: 14_840_000 picoseconds. + Weight::from_parts(15_347_000, 11025) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -176,9 +176,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn already_notified_target() -> Weight { // Proof Size summary in bytes: // Measured: `142` - // Estimated: `12517` - // Minimum execution time: 16_284_000 picoseconds. - Weight::from_parts(16_817_000, 12517) + // Estimated: `13507` + // Minimum execution time: 16_215_000 picoseconds. + Weight::from_parts(16_461_000, 13507) .saturating_add(T::DbWeight::get().reads(5_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -196,9 +196,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn notify_current_targets() -> Weight { // Proof Size summary in bytes: // Measured: `278` - // Estimated: `11073` - // Minimum execution time: 21_980_000 picoseconds. - Weight::from_parts(22_452_000, 11073) + // Estimated: `17013` + // Minimum execution time: 21_705_000 picoseconds. + Weight::from_parts(22_313_000, 17013) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -207,9 +207,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn notify_target_migration_fail() -> Weight { // Proof Size summary in bytes: // Measured: `172` - // Estimated: `7597` - // Minimum execution time: 6_848_000 picoseconds. - Weight::from_parts(7_077_000, 7597) + // Estimated: `8587` + // Minimum execution time: 7_869_000 picoseconds. + Weight::from_parts(8_052_000, 8587) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) @@ -217,9 +217,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn migrate_version_notify_targets() -> Weight { // Proof Size summary in bytes: // Measured: `142` - // Estimated: `10042` - // Minimum execution time: 14_509_000 picoseconds. - Weight::from_parts(15_012_000, 10042) + // Estimated: `11032` + // Minimum execution time: 15_340_000 picoseconds. + Weight::from_parts(15_738_000, 11032) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -238,9 +238,9 @@ impl pallet_xcm::WeightInfo for SubstrateWeight { fn migrate_and_notify_old_targets() -> Weight { // Proof Size summary in bytes: // Measured: `284` - // Estimated: `16059` - // Minimum execution time: 27_426_000 picoseconds. - Weight::from_parts(27_878_000, 16059) + // Estimated: `21999` + // Minimum execution time: 27_809_000 picoseconds. + Weight::from_parts(28_290_000, 21999) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } From bdedd282afe2d121dc25e56044bba8737cde4893 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 20 Apr 2023 21:26:21 +0200 Subject: [PATCH 60/74] bench collator selection --- pallets/collator-selection/src/weights.rs | 541 +++++++++++++++------- 1 file changed, 377 insertions(+), 164 deletions(-) diff --git a/pallets/collator-selection/src/weights.rs b/pallets/collator-selection/src/weights.rs index f454200ebb..cdaf984c00 100644 --- a/pallets/collator-selection/src/weights.rs +++ b/pallets/collator-selection/src/weights.rs @@ -1,190 +1,403 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +//! Autogenerated weights for pallet_collator_selection +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -// Original license: -// This file is part of Substrate. - -// Copyright (C) 2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Executed Command: +// target/release/unique-collator +// benchmark +// pallet +// --pallet +// pallet-collator-selection +// --wasm-execution +// compiled +// --extrinsic +// * +// --template=.maintain/frame-weight-template.hbs +// --steps=50 +// --repeat=80 +// --heap-pages=4096 +// --output=./pallets/collator-selection/src/weights.rs +#![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{ - traits::Get, - weights::{constants::RocksDbWeight, Weight}, -}; +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -// The weight info trait for `pallet_collator_selection`. +/// Weight functions needed for pallet_collator_selection. pub trait WeightInfo { - fn add_invulnerable(_b: u32) -> Weight; - fn remove_invulnerable(_b: u32) -> Weight; - fn get_license(_c: u32) -> Weight; - fn onboard(_c: u32) -> Weight; - fn offboard(_c: u32) -> Weight; - fn release_license(_c: u32) -> Weight; - fn force_release_license(_c: u32) -> Weight; + fn add_invulnerable(b: u32, ) -> Weight; + fn remove_invulnerable(b: u32, ) -> Weight; + fn get_license(c: u32, ) -> Weight; + fn onboard(c: u32, ) -> Weight; + fn offboard(c: u32, ) -> Weight; + fn release_license(c: u32, ) -> Weight; + fn force_release_license(c: u32, ) -> Weight; fn note_author() -> Weight; - fn new_session(_c: u32, _r: u32) -> Weight; + fn new_session(r: u32, c: u32, ) -> Weight; } /// Weights for pallet_collator_selection using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - fn add_invulnerable(b: u32) -> Weight { - Weight::from_ref_time(18_563_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - fn remove_invulnerable(b: u32) -> Weight { - Weight::from_ref_time(18_563_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - fn get_license(c: u32) -> Weight { - Weight::from_ref_time(71_196_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads(4 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - fn onboard(c: u32) -> Weight { - Weight::from_ref_time(71_196_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads(4 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - fn offboard(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - fn release_license(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - fn force_release_license(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + /// Storage: Session NextKeys (r:1 w:0) + /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) + /// Storage: CollatorSelection Invulnerables (r:1 w:1) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection Candidates (r:1 w:0) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 7]`. + fn add_invulnerable(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `403 + b * (45 ±0)` + // Estimated: `7485 + b * (45 ±0)` + // Minimum execution time: 14_147_000 picoseconds. + Weight::from_parts(15_313_627, 7485) + // Standard Error: 1_744 + .saturating_add(Weight::from_parts(178_890, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 45).saturating_mul(b.into())) + } + /// Storage: CollatorSelection Invulnerables (r:1 w:1) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 7]`. + fn remove_invulnerable(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `96 + b * (32 ±0)` + // Estimated: `1806` + // Minimum execution time: 9_426_000 picoseconds. + Weight::from_parts(9_693_408, 1806) + // Standard Error: 1_638 + .saturating_add(Weight::from_parts(227_917, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Session NextKeys (r:1 w:0) + /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) + /// Storage: Configuration CollatorSelectionLicenseBondOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionLicenseBondOverride (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 9]`. + fn get_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `610 + c * (26 ±0)` + // Estimated: `9099 + c * (28 ±0)` + // Minimum execution time: 22_741_000 picoseconds. + Weight::from_parts(24_210_604, 9099) + // Standard Error: 2_703 + .saturating_add(Weight::from_parts(255_686, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 28).saturating_mul(c.into())) + } + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:0) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection Invulnerables (r:1 w:0) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionDesiredCollatorsOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionKickThresholdOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 7]`. + fn onboard(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `445 + c * (54 ±0)` + // Estimated: `10119` + // Minimum execution time: 20_397_000 picoseconds. + Weight::from_parts(21_415_013, 10119) + // Standard Error: 4_086 + .saturating_add(Weight::from_parts(252_810, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn offboard(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `111 + c * (32 ±0)` + // Estimated: `1806` + // Minimum execution time: 10_543_000 picoseconds. + Weight::from_parts(11_227_541, 1806) + // Standard Error: 1_699 + .saturating_add(Weight::from_parts(181_030, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn release_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `306 + c * (61 ±0)` + // Estimated: `5335` + // Minimum execution time: 22_214_000 picoseconds. + Weight::from_parts(24_373_981, 5335) + // Standard Error: 8_018 + .saturating_add(Weight::from_parts(405_404, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn force_release_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `306 + c * (61 ±0)` + // Estimated: `5335` + // Minimum execution time: 22_159_000 picoseconds. + Weight::from_parts(24_200_796, 5335) + // Standard Error: 8_328 + .saturating_add(Weight::from_parts(312_138, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: System BlockWeight (r:1 w:1) + /// Proof: System BlockWeight (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn note_author() -> Weight { - Weight::from_ref_time(71_461_000 as u64) - .saturating_add(T::DbWeight::get().reads(3 as u64)) - .saturating_add(T::DbWeight::get().writes(4 as u64)) - } - fn new_session(r: u32, c: u32) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_010_000 - .saturating_add(Weight::from_ref_time(109_961_000 as u64).saturating_mul(r as u64)) - // Standard Error: 1_010_000 - .saturating_add(Weight::from_ref_time(151_952_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(r as u64))) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + // Proof Size summary in bytes: + // Measured: `155` + // Estimated: `7729` + // Minimum execution time: 16_520_000 picoseconds. + Weight::from_parts(16_933_000, 7729) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:0) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionKickThresholdOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:10 w:0) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: CollatorSelection Invulnerables (r:1 w:0) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: System BlockWeight (r:1 w:1) + /// Proof: System BlockWeight (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:9 w:9) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: System Account (r:10 w:10) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `r` is `[1, 10]`. + /// The range of component `c` is `[1, 10]`. + fn new_session(r: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `562 + r * (190 ±0) + c * (83 ±0)` + // Estimated: `91818518943723 + c * (2519 ±0) + r * (5142 ±1)` + // Minimum execution time: 16_153_000 picoseconds. + Weight::from_parts(16_601_000, 91818518943723) + // Standard Error: 119_095 + .saturating_add(Weight::from_parts(10_660_813, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 5142).saturating_mul(r.into())) } } // For backwards compatibility and tests impl WeightInfo for () { - fn add_invulnerable(b: u32) -> Weight { - Weight::from_ref_time(18_563_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - fn remove_invulnerable(b: u32) -> Weight { - Weight::from_ref_time(18_563_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(68_000 as u64).saturating_mul(b as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - fn get_license(c: u32) -> Weight { - Weight::from_ref_time(71_196_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads(4 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - fn onboard(c: u32) -> Weight { - Weight::from_ref_time(71_196_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(198_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads(4 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - fn offboard(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - fn release_license(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - fn force_release_license(c: u32) -> Weight { - Weight::from_ref_time(55_336_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(151_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) + /// Storage: Session NextKeys (r:1 w:0) + /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) + /// Storage: CollatorSelection Invulnerables (r:1 w:1) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection Candidates (r:1 w:0) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 7]`. + fn add_invulnerable(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `403 + b * (45 ±0)` + // Estimated: `7485 + b * (45 ±0)` + // Minimum execution time: 14_147_000 picoseconds. + Weight::from_parts(15_313_627, 7485) + // Standard Error: 1_744 + .saturating_add(Weight::from_parts(178_890, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 45).saturating_mul(b.into())) + } + /// Storage: CollatorSelection Invulnerables (r:1 w:1) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// The range of component `b` is `[1, 7]`. + fn remove_invulnerable(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `96 + b * (32 ±0)` + // Estimated: `1806` + // Minimum execution time: 9_426_000 picoseconds. + Weight::from_parts(9_693_408, 1806) + // Standard Error: 1_638 + .saturating_add(Weight::from_parts(227_917, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Session NextKeys (r:1 w:0) + /// Proof Skipped: Session NextKeys (max_values: None, max_size: None, mode: Measured) + /// Storage: Configuration CollatorSelectionLicenseBondOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionLicenseBondOverride (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 9]`. + fn get_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `610 + c * (26 ±0)` + // Estimated: `9099 + c * (28 ±0)` + // Minimum execution time: 22_741_000 picoseconds. + Weight::from_parts(24_210_604, 9099) + // Standard Error: 2_703 + .saturating_add(Weight::from_parts(255_686, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 28).saturating_mul(c.into())) + } + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:0) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection Invulnerables (r:1 w:0) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionDesiredCollatorsOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionDesiredCollatorsOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionKickThresholdOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 7]`. + fn onboard(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `445 + c * (54 ±0)` + // Estimated: `10119` + // Minimum execution time: 20_397_000 picoseconds. + Weight::from_parts(21_415_013, 10119) + // Standard Error: 4_086 + .saturating_add(Weight::from_parts(252_810, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn offboard(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `111 + c * (32 ±0)` + // Estimated: `1806` + // Minimum execution time: 10_543_000 picoseconds. + Weight::from_parts(11_227_541, 1806) + // Standard Error: 1_699 + .saturating_add(Weight::from_parts(181_030, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn release_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `306 + c * (61 ±0)` + // Estimated: `5335` + // Minimum execution time: 22_214_000 picoseconds. + Weight::from_parts(24_373_981, 5335) + // Standard Error: 8_018 + .saturating_add(Weight::from_parts(405_404, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:1) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:1 w:1) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 10]`. + fn force_release_license(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `306 + c * (61 ±0)` + // Estimated: `5335` + // Minimum execution time: 22_159_000 picoseconds. + Weight::from_parts(24_200_796, 5335) + // Standard Error: 8_328 + .saturating_add(Weight::from_parts(312_138, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: System BlockWeight (r:1 w:1) + /// Proof: System BlockWeight (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn note_author() -> Weight { - Weight::from_ref_time(71_461_000 as u64) - .saturating_add(RocksDbWeight::get().reads(3 as u64)) - .saturating_add(RocksDbWeight::get().writes(4 as u64)) - } - fn new_session(r: u32, c: u32) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_010_000 - .saturating_add(Weight::from_ref_time(109_961_000 as u64).saturating_mul(r as u64)) - // Standard Error: 1_010_000 - .saturating_add(Weight::from_ref_time(151_952_000 as u64).saturating_mul(c as u64)) - .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(r as u64))) - .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(c as u64))) - .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(r as u64))) - .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + // Proof Size summary in bytes: + // Measured: `155` + // Estimated: `7729` + // Minimum execution time: 16_520_000 picoseconds. + Weight::from_parts(16_933_000, 7729) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: CollatorSelection Candidates (r:1 w:0) + /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: Configuration CollatorSelectionKickThresholdOverride (r:1 w:0) + /// Proof: Configuration CollatorSelectionKickThresholdOverride (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: CollatorSelection LastAuthoredBlock (r:10 w:0) + /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: CollatorSelection Invulnerables (r:1 w:0) + /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(321), added: 816, mode: MaxEncodedLen) + /// Storage: System BlockWeight (r:1 w:1) + /// Proof: System BlockWeight (max_values: Some(1), max_size: Some(48), added: 543, mode: MaxEncodedLen) + /// Storage: CollatorSelection LicenseDepositOf (r:9 w:9) + /// Proof: CollatorSelection LicenseDepositOf (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: System Account (r:10 w:10) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `r` is `[1, 10]`. + /// The range of component `c` is `[1, 10]`. + fn new_session(r: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `562 + r * (190 ±0) + c * (83 ±0)` + // Estimated: `91818518943723 + c * (2519 ±0) + r * (5142 ±1)` + // Minimum execution time: 16_153_000 picoseconds. + Weight::from_parts(16_601_000, 91818518943723) + // Standard Error: 119_095 + .saturating_add(Weight::from_parts(10_660_813, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(c.into()))) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 5142).saturating_mul(r.into())) } } + From 8613e5ea84e4f97aa3260d5a6608de3cfc86eac9 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 20 Apr 2023 21:51:02 +0200 Subject: [PATCH 61/74] fixup identity --- pallets/identity/src/weights.rs | 1058 ++++++++++++++++++------------- 1 file changed, 613 insertions(+), 445 deletions(-) diff --git a/pallets/identity/src/weights.rs b/pallets/identity/src/weights.rs index 696f657ff9..395b00144d 100644 --- a/pallets/identity/src/weights.rs +++ b/pallets/identity/src/weights.rs @@ -1,59 +1,28 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -// Original license: -// This file is part of Substrate. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-07, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! DATE: 2023-04-20, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: -// ./target/production/substrate +// target/release/unique-collator // benchmark // pallet -// --chain=dev +// --pallet +// pallet-identity +// --wasm-execution +// compiled +// --extrinsic +// * +// --template=.maintain/frame-weight-template.hbs // --steps=50 -// --repeat=20 -// --pallet=pallet_identity -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled +// --repeat=80 // --heap-pages=4096 -// --output=./frame/identity/src/weights.rs -// --header=./HEADER-APACHE2 -// --template=./.maintain/frame-weight-template.hbs +// --output=./pallets/identity/src/weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -88,500 +57,699 @@ pub trait WeightInfo { /// Weights for pallet_identity using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: Identity Registrars (r:1 w:1) + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn add_registrar(r: u32, ) -> Weight { - // Minimum execution time: 20_269 nanoseconds. - Weight::from_ref_time(21_910_543 as u64) - // Standard Error: 4_604 - .saturating_add(Weight::from_ref_time(223_104 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `31 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 9_094_000 picoseconds. + Weight::from_parts(10_431_627, 2626) + // Standard Error: 1_046 + .saturating_add(Weight::from_parts(99_468, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn set_identity(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64).saturating_mul(r as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity SuperOf (r:2 w:2) + // Proof Size summary in bytes: + // Measured: `441 + r * (5 ±0)` + // Estimated: `11003` + // Minimum execution time: 18_662_000 picoseconds. + Weight::from_parts(17_939_760, 11003) + // Standard Error: 2_371 + .saturating_add(Weight::from_parts(22_184, 0).saturating_mul(r.into())) + // Standard Error: 462 + .saturating_add(Weight::from_parts(151_368, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:100 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `s` is `[0, 100]`. fn set_subs_new(s: u32, ) -> Weight { - // Minimum execution time: 12_024 nanoseconds. - Weight::from_ref_time(32_550_819 as u64) - // Standard Error: 5_057 - .saturating_add(Weight::from_ref_time(2_521_245 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:2) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `18716 + s * (2589 ±0)` + // Minimum execution time: 6_921_000 picoseconds. + Weight::from_parts(16_118_195, 18716) + // Standard Error: 1_786 + .saturating_add(Weight::from_parts(1_350_155, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + .saturating_add(Weight::from_parts(0, 2589).saturating_mul(s.into())) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `p` is `[0, 100]`. fn set_subs_old(p: u32, ) -> Weight { - // Minimum execution time: 12_232 nanoseconds. - Weight::from_ref_time(34_009_761 as u64) - // Standard Error: 5_047 - .saturating_add(Weight::from_ref_time(1_113_100 as u64).saturating_mul(p as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) - } - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity IdentityOf (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:100) + // Proof Size summary in bytes: + // Measured: `193 + p * (32 ±0)` + // Estimated: `17726` + // Minimum execution time: 6_858_000 picoseconds. + Weight::from_parts(16_222_054, 17726) + // Standard Error: 1_409 + .saturating_add(Weight::from_parts(593_588, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) + } + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - // Minimum execution time: 57_144 nanoseconds. - Weight::from_ref_time(41_559_247 as u64) - // Standard Error: 9_996 - .saturating_add(Weight::from_ref_time(146_770 as u64).saturating_mul(r as u64)) - // Standard Error: 1_952 - .saturating_add(Weight::from_ref_time(1_086_673 as u64).saturating_mul(s as u64)) - // Standard Error: 1_952 - .saturating_add(Weight::from_ref_time(162_481 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity Registrars (r:1 w:0) - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `468 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `17726` + // Minimum execution time: 27_212_000 picoseconds. + Weight::from_parts(19_030_840, 17726) + // Standard Error: 3_118 + .saturating_add(Weight::from_parts(29_836, 0).saturating_mul(r.into())) + // Standard Error: 608 + .saturating_add(Weight::from_parts(590_661, 0).saturating_mul(s.into())) + // Standard Error: 608 + .saturating_add(Weight::from_parts(110_108, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + } + /// Storage: Identity Registrars (r:1 w:0) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn request_judgement(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 44_726 nanoseconds. - Weight::from_ref_time(41_637_308 as u64) - // Standard Error: 1_907 - .saturating_add(Weight::from_ref_time(219_078 as u64).saturating_mul(r as u64)) - // Standard Error: 372 - .saturating_add(Weight::from_ref_time(309_888 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `366 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `13629` + // Minimum execution time: 19_771_000 picoseconds. + Weight::from_parts(18_917_892, 13629) + // Standard Error: 1_957 + .saturating_add(Weight::from_parts(57_465, 0).saturating_mul(r.into())) + // Standard Error: 381 + .saturating_add(Weight::from_parts(168_586, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn cancel_request(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 39_719 nanoseconds. - Weight::from_ref_time(38_008_751 as u64) - // Standard Error: 2_394 - .saturating_add(Weight::from_ref_time(181_870 as u64).saturating_mul(r as u64)) - // Standard Error: 467 - .saturating_add(Weight::from_ref_time(314_990 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `397 + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 17_411_000 picoseconds. + Weight::from_parts(16_856_331, 11003) + // Standard Error: 7_002 + .saturating_add(Weight::from_parts(34_389, 0).saturating_mul(r.into())) + // Standard Error: 1_366 + .saturating_add(Weight::from_parts(165_686, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_fee(r: u32, ) -> Weight { - // Minimum execution time: 10_634 nanoseconds. - Weight::from_ref_time(11_383_704 as u64) - // Standard Error: 2_250 - .saturating_add(Weight::from_ref_time(193_094 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 7_089_000 picoseconds. + Weight::from_parts(7_750_487, 2626) + // Standard Error: 1_625 + .saturating_add(Weight::from_parts(101_135, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_account_id(r: u32, ) -> Weight { - // Minimum execution time: 10_840 nanoseconds. - Weight::from_ref_time(11_638_740 as u64) - // Standard Error: 1_985 - .saturating_add(Weight::from_ref_time(193_016 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 6_300_000 picoseconds. + Weight::from_parts(6_836_140, 2626) + // Standard Error: 655 + .saturating_add(Weight::from_parts(102_284, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_fields(r: u32, ) -> Weight { - // Minimum execution time: 10_748 nanoseconds. - Weight::from_ref_time(11_346_901 as u64) - // Standard Error: 2_132 - .saturating_add(Weight::from_ref_time(196_630 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:0) - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 6_257_000 picoseconds. + Weight::from_parts(6_917_052, 2626) + // Standard Error: 2_628 + .saturating_add(Weight::from_parts(71_362, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:0) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. /// The range of component `x` is `[0, 100]`. fn provide_judgement(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 33_682 nanoseconds. - Weight::from_ref_time(31_336_603 as u64) - // Standard Error: 3_056 - .saturating_add(Weight::from_ref_time(200_403 as u64).saturating_mul(r as u64)) - // Standard Error: 565 - .saturating_add(Weight::from_ref_time(525_142 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity IdentityOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:100) + // Proof Size summary in bytes: + // Measured: `444 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `13629` + // Minimum execution time: 16_021_000 picoseconds. + Weight::from_parts(15_553_670, 13629) + // Standard Error: 5_797 + .saturating_add(Weight::from_parts(42_423, 0).saturating_mul(r.into())) + // Standard Error: 1_072 + .saturating_add(Weight::from_parts(252_721, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight { - // Minimum execution time: 68_794 nanoseconds. - Weight::from_ref_time(52_114_486 as u64) - // Standard Error: 4_808 - .saturating_add(Weight::from_ref_time(153_462 as u64).saturating_mul(r as u64)) - // Standard Error: 939 - .saturating_add(Weight::from_ref_time(1_084_612 as u64).saturating_mul(s as u64)) - // Standard Error: 939 - .saturating_add(Weight::from_ref_time(170_112 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(3 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `665 + r * (12 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `23922` + // Minimum execution time: 40_801_000 picoseconds. + Weight::from_parts(34_079_397, 23922) + // Standard Error: 3_750 + .saturating_add(Weight::from_parts(31_496, 0).saturating_mul(r.into())) + // Standard Error: 732 + .saturating_add(Weight::from_parts(599_691, 0).saturating_mul(s.into())) + // Standard Error: 732 + .saturating_add(Weight::from_parts(101_683, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + } + /// Storage: Identity IdentityOf (r:0 w:600) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `x` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_insert_identities(x: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + fn force_insert_identities(x: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_412_000 picoseconds. + Weight::from_parts(4_592_000, 0) + // Standard Error: 703_509 + .saturating_add(Weight::from_parts(43_647_925, 0).saturating_mul(x.into())) + // Standard Error: 117_043 + .saturating_add(Weight::from_parts(9_312_431, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + } + /// Storage: Identity SubsOf (r:600 w:0) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:0 w:600) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `x` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_remove_identities(x: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) - // todo:collator + fn force_remove_identities(x: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `41` + // Estimated: `990 + n * (5733 ±0)` + // Minimum execution time: 3_824_000 picoseconds. + Weight::from_parts(3_950_000, 990) + // Standard Error: 2_864 + .saturating_add(Weight::from_parts(55_678, 0).saturating_mul(x.into())) + // Standard Error: 476 + .saturating_add(Weight::from_parts(1_138_349, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 5733).saturating_mul(n.into())) + } + /// Storage: Identity SubsOf (r:600 w:600) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `s` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_set_subs(s: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + fn force_set_subs(s: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `41` + // Estimated: `990 + n * (5733 ±0)` + // Minimum execution time: 4_196_000 picoseconds. + Weight::from_parts(4_340_000, 990) + // Standard Error: 2_081_979 + .saturating_add(Weight::from_parts(130_653_903, 0).saturating_mul(s.into())) + // Standard Error: 346_381 + .saturating_add(Weight::from_parts(23_046_001, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 5733).saturating_mul(n.into())) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[0, 99]`. fn add_sub(s: u32, ) -> Weight { - // Minimum execution time: 37_914 nanoseconds. - Weight::from_ref_time(43_488_083 as u64) - // Standard Error: 1_631 - .saturating_add(Weight::from_ref_time(118_845 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(3 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `474 + s * (36 ±0)` + // Estimated: `21305` + // Minimum execution time: 15_289_000 picoseconds. + Weight::from_parts(21_319_844, 21305) + // Standard Error: 893 + .saturating_add(Weight::from_parts(53_159, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `s` is `[1, 100]`. fn rename_sub(s: u32, ) -> Weight { - // Minimum execution time: 16_124 nanoseconds. - Weight::from_ref_time(18_580_462 as u64) - // Standard Error: 688 - .saturating_add(Weight::from_ref_time(67_220 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `590 + s * (3 ±0)` + // Estimated: `14582` + // Minimum execution time: 9_867_000 picoseconds. + Weight::from_parts(12_546_245, 14582) + // Standard Error: 509 + .saturating_add(Weight::from_parts(10_078, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[1, 100]`. fn remove_sub(s: u32, ) -> Weight { - // Minimum execution time: 41_517 nanoseconds. - Weight::from_ref_time(45_123_530 as u64) - // Standard Error: 1_530 - .saturating_add(Weight::from_ref_time(105_429 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(3 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `637 + s * (35 ±0)` + // Estimated: `21305` + // Minimum execution time: 19_299_000 picoseconds. + Weight::from_parts(24_125_576, 21305) + // Standard Error: 1_479 + .saturating_add(Weight::from_parts(22_611, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[0, 99]`. fn quit_sub(s: u32, ) -> Weight { - // Minimum execution time: 30_171 nanoseconds. - Weight::from_ref_time(33_355_514 as u64) - // Standard Error: 1_286 - .saturating_add(Weight::from_ref_time(114_716 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + // Proof Size summary in bytes: + // Measured: `563 + s * (37 ±0)` + // Estimated: `10302` + // Minimum execution time: 14_183_000 picoseconds. + Weight::from_parts(17_343_547, 10302) + // Standard Error: 454 + .saturating_add(Weight::from_parts(45_925, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Identity Registrars (r:1 w:1) + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn add_registrar(r: u32, ) -> Weight { - // Minimum execution time: 20_269 nanoseconds. - Weight::from_ref_time(21_910_543 as u64) - // Standard Error: 4_604 - .saturating_add(Weight::from_ref_time(223_104 as u64).saturating_mul(r as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `31 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 9_094_000 picoseconds. + Weight::from_parts(10_431_627, 2626) + // Standard Error: 1_046 + .saturating_add(Weight::from_parts(99_468, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn set_identity(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64).saturating_mul(r as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity SuperOf (r:2 w:2) + // Proof Size summary in bytes: + // Measured: `441 + r * (5 ±0)` + // Estimated: `11003` + // Minimum execution time: 18_662_000 picoseconds. + Weight::from_parts(17_939_760, 11003) + // Standard Error: 2_371 + .saturating_add(Weight::from_parts(22_184, 0).saturating_mul(r.into())) + // Standard Error: 462 + .saturating_add(Weight::from_parts(151_368, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:100 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `s` is `[0, 100]`. fn set_subs_new(s: u32, ) -> Weight { - // Minimum execution time: 12_024 nanoseconds. - Weight::from_ref_time(32_550_819 as u64) - // Standard Error: 5_057 - .saturating_add(Weight::from_ref_time(2_521_245 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:2) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `18716 + s * (2589 ±0)` + // Minimum execution time: 6_921_000 picoseconds. + Weight::from_parts(16_118_195, 18716) + // Standard Error: 1_786 + .saturating_add(Weight::from_parts(1_350_155, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) + .saturating_add(Weight::from_parts(0, 2589).saturating_mul(s.into())) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `p` is `[0, 100]`. fn set_subs_old(p: u32, ) -> Weight { - // Minimum execution time: 12_232 nanoseconds. - Weight::from_ref_time(34_009_761 as u64) - // Standard Error: 5_047 - .saturating_add(Weight::from_ref_time(1_113_100 as u64).saturating_mul(p as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(p as u64))) - } - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity IdentityOf (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:100) + // Proof Size summary in bytes: + // Measured: `193 + p * (32 ±0)` + // Estimated: `17726` + // Minimum execution time: 6_858_000 picoseconds. + Weight::from_parts(16_222_054, 17726) + // Standard Error: 1_409 + .saturating_add(Weight::from_parts(593_588, 0).saturating_mul(p.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into()))) + } + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - // Minimum execution time: 57_144 nanoseconds. - Weight::from_ref_time(41_559_247 as u64) - // Standard Error: 9_996 - .saturating_add(Weight::from_ref_time(146_770 as u64).saturating_mul(r as u64)) - // Standard Error: 1_952 - .saturating_add(Weight::from_ref_time(1_086_673 as u64).saturating_mul(s as u64)) - // Standard Error: 1_952 - .saturating_add(Weight::from_ref_time(162_481 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity Registrars (r:1 w:0) - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `468 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `17726` + // Minimum execution time: 27_212_000 picoseconds. + Weight::from_parts(19_030_840, 17726) + // Standard Error: 3_118 + .saturating_add(Weight::from_parts(29_836, 0).saturating_mul(r.into())) + // Standard Error: 608 + .saturating_add(Weight::from_parts(590_661, 0).saturating_mul(s.into())) + // Standard Error: 608 + .saturating_add(Weight::from_parts(110_108, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) + } + /// Storage: Identity Registrars (r:1 w:0) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn request_judgement(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 44_726 nanoseconds. - Weight::from_ref_time(41_637_308 as u64) - // Standard Error: 1_907 - .saturating_add(Weight::from_ref_time(219_078 as u64).saturating_mul(r as u64)) - // Standard Error: 372 - .saturating_add(Weight::from_ref_time(309_888 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `366 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `13629` + // Minimum execution time: 19_771_000 picoseconds. + Weight::from_parts(18_917_892, 13629) + // Standard Error: 1_957 + .saturating_add(Weight::from_parts(57_465, 0).saturating_mul(r.into())) + // Standard Error: 381 + .saturating_add(Weight::from_parts(168_586, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. fn cancel_request(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 39_719 nanoseconds. - Weight::from_ref_time(38_008_751 as u64) - // Standard Error: 2_394 - .saturating_add(Weight::from_ref_time(181_870 as u64).saturating_mul(r as u64)) - // Standard Error: 467 - .saturating_add(Weight::from_ref_time(314_990 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `397 + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 17_411_000 picoseconds. + Weight::from_parts(16_856_331, 11003) + // Standard Error: 7_002 + .saturating_add(Weight::from_parts(34_389, 0).saturating_mul(r.into())) + // Standard Error: 1_366 + .saturating_add(Weight::from_parts(165_686, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_fee(r: u32, ) -> Weight { - // Minimum execution time: 10_634 nanoseconds. - Weight::from_ref_time(11_383_704 as u64) - // Standard Error: 2_250 - .saturating_add(Weight::from_ref_time(193_094 as u64).saturating_mul(r as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 7_089_000 picoseconds. + Weight::from_parts(7_750_487, 2626) + // Standard Error: 1_625 + .saturating_add(Weight::from_parts(101_135, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_account_id(r: u32, ) -> Weight { - // Minimum execution time: 10_840 nanoseconds. - Weight::from_ref_time(11_638_740 as u64) - // Standard Error: 1_985 - .saturating_add(Weight::from_ref_time(193_016 as u64).saturating_mul(r as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 6_300_000 picoseconds. + Weight::from_parts(6_836_140, 2626) + // Standard Error: 655 + .saturating_add(Weight::from_parts(102_284, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:1) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. fn set_fields(r: u32, ) -> Weight { - // Minimum execution time: 10_748 nanoseconds. - Weight::from_ref_time(11_346_901 as u64) - // Standard Error: 2_132 - .saturating_add(Weight::from_ref_time(196_630 as u64).saturating_mul(r as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity Registrars (r:1 w:0) - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `88 + r * (57 ±0)` + // Estimated: `2626` + // Minimum execution time: 6_257_000 picoseconds. + Weight::from_parts(6_917_052, 2626) + // Standard Error: 2_628 + .saturating_add(Weight::from_parts(71_362, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity Registrars (r:1 w:0) + /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(1141), added: 1636, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `r` is `[1, 19]`. /// The range of component `x` is `[0, 100]`. fn provide_judgement(r: u32, x: u32, ) -> Weight { - // Minimum execution time: 33_682 nanoseconds. - Weight::from_ref_time(31_336_603 as u64) - // Standard Error: 3_056 - .saturating_add(Weight::from_ref_time(200_403 as u64).saturating_mul(r as u64)) - // Standard Error: 565 - .saturating_add(Weight::from_ref_time(525_142 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity SubsOf (r:1 w:1) - // Storage: Identity IdentityOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - // Storage: Identity SuperOf (r:0 w:100) + // Proof Size summary in bytes: + // Measured: `444 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `13629` + // Minimum execution time: 16_021_000 picoseconds. + Weight::from_parts(15_553_670, 13629) + // Standard Error: 5_797 + .saturating_add(Weight::from_parts(42_423, 0).saturating_mul(r.into())) + // Standard Error: 1_072 + .saturating_add(Weight::from_parts(252_721, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:1 w:1) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight { - // Minimum execution time: 68_794 nanoseconds. - Weight::from_ref_time(52_114_486 as u64) - // Standard Error: 4_808 - .saturating_add(Weight::from_ref_time(153_462 as u64).saturating_mul(r as u64)) - // Standard Error: 939 - .saturating_add(Weight::from_ref_time(1_084_612 as u64).saturating_mul(s as u64)) - // Standard Error: 939 - .saturating_add(Weight::from_ref_time(170_112 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(3 as u64)) - .saturating_add(RocksDbWeight::get().writes(3 as u64)) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Identity IdentityOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `665 + r * (12 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `23922` + // Minimum execution time: 40_801_000 picoseconds. + Weight::from_parts(34_079_397, 23922) + // Standard Error: 3_750 + .saturating_add(Weight::from_parts(31_496, 0).saturating_mul(r.into())) + // Standard Error: 732 + .saturating_add(Weight::from_parts(599_691, 0).saturating_mul(s.into())) + // Standard Error: 732 + .saturating_add(Weight::from_parts(101_683, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) + } + /// Storage: Identity IdentityOf (r:0 w:600) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `x` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_insert_identities(x: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) + fn force_insert_identities(x: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_412_000 picoseconds. + Weight::from_parts(4_592_000, 0) + // Standard Error: 703_509 + .saturating_add(Weight::from_parts(43_647_925, 0).saturating_mul(x.into())) + // Standard Error: 117_043 + .saturating_add(Weight::from_parts(9_312_431, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + } + /// Storage: Identity SubsOf (r:600 w:0) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity IdentityOf (r:0 w:600) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) /// The range of component `x` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_remove_identities(x: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(x as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:1) - // todo:collator - /// The range of component `xs is `[0, 100]`. + fn force_remove_identities(x: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `41` + // Estimated: `990 + n * (5733 ±0)` + // Minimum execution time: 3_824_000 picoseconds. + Weight::from_parts(3_950_000, 990) + // Standard Error: 2_864 + .saturating_add(Weight::from_parts(55_678, 0).saturating_mul(x.into())) + // Standard Error: 476 + .saturating_add(Weight::from_parts(1_138_349, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 5733).saturating_mul(n.into())) + } + /// Storage: Identity SubsOf (r:600 w:600) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:0 w:100) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// The range of component `s` is `[0, 100]`. /// The range of component `n` is `[0, 600]`. - fn force_set_subs(s: u32, n: u32) -> Weight { - // Minimum execution time: 41_872 nanoseconds. - Weight::from_ref_time(40_230_216 as u64) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(145_168 as u64)) - // Standard Error: 457 - .saturating_add(Weight::from_ref_time(291_732 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(1 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64).saturating_mul(n as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + fn force_set_subs(s: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `41` + // Estimated: `990 + n * (5733 ±0)` + // Minimum execution time: 4_196_000 picoseconds. + Weight::from_parts(4_340_000, 990) + // Standard Error: 2_081_979 + .saturating_add(Weight::from_parts(130_653_903, 0).saturating_mul(s.into())) + // Standard Error: 346_381 + .saturating_add(Weight::from_parts(23_046_001, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(s.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 5733).saturating_mul(n.into())) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[0, 99]`. fn add_sub(s: u32, ) -> Weight { - // Minimum execution time: 37_914 nanoseconds. - Weight::from_ref_time(43_488_083 as u64) - // Standard Error: 1_631 - .saturating_add(Weight::from_ref_time(118_845 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(3 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `474 + s * (36 ±0)` + // Estimated: `21305` + // Minimum execution time: 15_289_000 picoseconds. + Weight::from_parts(21_319_844, 21305) + // Standard Error: 893 + .saturating_add(Weight::from_parts(53_159, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) /// The range of component `s` is `[1, 100]`. fn rename_sub(s: u32, ) -> Weight { - // Minimum execution time: 16_124 nanoseconds. - Weight::from_ref_time(18_580_462 as u64) - // Standard Error: 688 - .saturating_add(Weight::from_ref_time(67_220 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(1 as u64)) - } - // Storage: Identity IdentityOf (r:1 w:0) - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `590 + s * (3 ±0)` + // Estimated: `14582` + // Minimum execution time: 9_867_000 picoseconds. + Weight::from_parts(12_546_245, 14582) + // Standard Error: 509 + .saturating_add(Weight::from_parts(10_078, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Identity IdentityOf (r:1 w:0) + /// Proof: Identity IdentityOf (max_values: None, max_size: Some(7538), added: 10013, mode: MaxEncodedLen) + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[1, 100]`. fn remove_sub(s: u32, ) -> Weight { - // Minimum execution time: 41_517 nanoseconds. - Weight::from_ref_time(45_123_530 as u64) - // Standard Error: 1_530 - .saturating_add(Weight::from_ref_time(105_429 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(3 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } - // Storage: Identity SuperOf (r:1 w:1) - // Storage: Identity SubsOf (r:1 w:1) + // Proof Size summary in bytes: + // Measured: `637 + s * (35 ±0)` + // Estimated: `21305` + // Minimum execution time: 19_299_000 picoseconds. + Weight::from_parts(24_125_576, 21305) + // Standard Error: 1_479 + .saturating_add(Weight::from_parts(22_611, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: Identity SuperOf (r:1 w:1) + /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: Identity SubsOf (r:1 w:1) + /// Proof: Identity SubsOf (max_values: None, max_size: Some(3258), added: 5733, mode: MaxEncodedLen) /// The range of component `s` is `[0, 99]`. fn quit_sub(s: u32, ) -> Weight { - // Minimum execution time: 30_171 nanoseconds. - Weight::from_ref_time(33_355_514 as u64) - // Standard Error: 1_286 - .saturating_add(Weight::from_ref_time(114_716 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) + // Proof Size summary in bytes: + // Measured: `563 + s * (37 ±0)` + // Estimated: `10302` + // Minimum execution time: 14_183_000 picoseconds. + Weight::from_parts(17_343_547, 10302) + // Standard Error: 454 + .saturating_add(Weight::from_parts(45_925, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } } + From 30011e53c39d4414362070db668ea9fae50701a3 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 18:18:26 +0200 Subject: [PATCH 62/74] fix(pallet-collator-selection): benchmarking --- Makefile | 4 +- .../collator-selection/src/benchmarking.rs | 51 +++++++++++-------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index ea5809cc3b..23c400ee96 100644 --- a/Makefile +++ b/Makefile @@ -146,8 +146,8 @@ bench-xcm: make _bench PALLET=xcm OUTPUT=./runtime/common/weights/xcm.rs TEMPLATE="--template=.maintain/external-weight-template.hbs" .PHONY: bench -# Disabled: bench-scheduler, bench-collator-selection, bench-identity -bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm +# Disabled: bench-scheduler, bench-identity +bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection .PHONY: check check: diff --git a/pallets/collator-selection/src/benchmarking.rs b/pallets/collator-selection/src/benchmarking.rs index f26d357846..212ad09a32 100644 --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -77,7 +77,7 @@ fn create_funded_user( balance_factor: u32, ) -> T::AccountId { let user = account(string, n, SEED); - let balance = T::Currency::minimum_balance() * balance_factor.into(); + let balance = balance_unit::() * balance_factor.into(); let _ = T::Currency::make_free_balance_be(&user, balance); user } @@ -158,6 +158,15 @@ fn get_licenses(count: u32) { } } +/// `Currency::minimum_balance` was used originally, but in unique-chain, we have +/// zero existential deposit, thus triggering zero bond assertion. +fn balance_unit() -> >::Balance { + 200u32.into() +} + +/// Our benchmarking environment already has invulnerables registered. +const INITIAL_INVULNERABLES: u32 = 2; + benchmarks! { where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config } @@ -165,14 +174,14 @@ benchmarks! { // Both invulnerables and candidates count together against MaxCollators. // Maybe try putting it in braces? 1 .. (T::MaxCollators::get() - 2) add_invulnerable { - let b in 1 .. T::MaxCollators::get() - 3; + let b in 1 .. T::MaxCollators::get() - INITIAL_INVULNERABLES - 1; register_validators::(b); register_invulnerables::(b); // log::info!("{} {}", >::get().len(), b); let new_invulnerable: T::AccountId = whitelisted_caller(); - let bond: BalanceOf = T::Currency::minimum_balance() * 2u32.into(); + let bond: BalanceOf = balance_unit::() * 2u32.into(); T::Currency::make_free_balance_be(&new_invulnerable, bond.clone()); >::set_keys( @@ -192,7 +201,7 @@ benchmarks! { } remove_invulnerable { - let b in 1 .. T::MaxCollators::get(); + let b in 1 .. T::MaxCollators::get() - INITIAL_INVULNERABLES - 1; register_validators::(b); register_invulnerables::(b); @@ -209,15 +218,15 @@ benchmarks! { } get_license { - let c in 1 .. T::MaxCollators::get(); + let c in 1 .. T::MaxCollators::get() - 1; - >::put(T::Currency::minimum_balance()); + >::put(balance_unit::()); register_validators::(c); get_licenses::(c); let caller: T::AccountId = whitelisted_caller(); - let bond: BalanceOf = T::Currency::minimum_balance() * 2u32.into(); + let bond: BalanceOf = balance_unit::() * 2u32.into(); T::Currency::make_free_balance_be(&caller, bond.clone()); >::set_keys( @@ -234,16 +243,16 @@ benchmarks! { // worst case is when we have all the max-candidate slots filled except one, and we fill that // one. onboard { - let c in 1 .. 5; + let c in 1 .. T::MaxCollators::get() - INITIAL_INVULNERABLES - 1; - >::put(T::Currency::minimum_balance()); - >::put(c + 2); + >::put(balance_unit::()); + >::put(c + INITIAL_INVULNERABLES + 1); register_validators::(c); register_candidates::(c); let caller: T::AccountId = whitelisted_caller(); - let bond: BalanceOf = T::Currency::minimum_balance() * 2u32.into(); + let bond: BalanceOf = balance_unit::() * 2u32.into(); T::Currency::make_free_balance_be(&caller, bond.clone()); let origin = RawOrigin::Signed(caller.clone()); @@ -265,8 +274,8 @@ benchmarks! { // worst case is the last candidate leaving. offboard { let c in 1 .. T::MaxCollators::get(); - >::put(T::Currency::minimum_balance()); - >::put(c + 2); + >::put(balance_unit::()); + >::put(c + INITIAL_INVULNERABLES); register_validators::(c); register_candidates::(c); @@ -281,9 +290,9 @@ benchmarks! { // worst case is the last candidate leaving. release_license { let c in 1 .. T::MaxCollators::get(); - let bond = T::Currency::minimum_balance(); + let bond = balance_unit::(); >::put(bond); - >::put(c); + >::put(c + INITIAL_INVULNERABLES); register_validators::(c); register_candidates::(c); @@ -298,9 +307,9 @@ benchmarks! { // worst case is the last candidate leaving. force_release_license { let c in 1 .. T::MaxCollators::get(); - let bond = T::Currency::minimum_balance(); + let bond = balance_unit::(); >::put(bond); - >::put(c); + >::put(c + INITIAL_INVULNERABLES); register_validators::(c); register_candidates::(c); @@ -319,10 +328,10 @@ benchmarks! { // worst case is paying a non-existing candidate account. note_author { - >::put(T::Currency::minimum_balance()); + >::put(balance_unit::()); T::Currency::make_free_balance_be( &>::account_id(), - T::Currency::minimum_balance() * 4u32.into(), + balance_unit::() * 4u32.into(), ); let author = account("author", 0, SEED); let new_block: T::BlockNumber = 10u32.into(); @@ -341,8 +350,8 @@ benchmarks! { let r in 1 .. T::MaxCollators::get(); let c in 1 .. T::MaxCollators::get(); - >::put(T::Currency::minimum_balance()); - >::put(c); + >::put(balance_unit::()); + >::put(c + INITIAL_INVULNERABLES); frame_system::Pallet::::set_block_number(0u32.into()); register_validators::(c); From 5275b143cca5a85e15a9752b7510d9124ab42174 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 21:12:45 +0200 Subject: [PATCH 63/74] fix(pallet-identity) benchmarking --- Makefile | 4 ++-- pallets/identity/src/benchmarking.rs | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 23c400ee96..1b66f495b9 100644 --- a/Makefile +++ b/Makefile @@ -146,8 +146,8 @@ bench-xcm: make _bench PALLET=xcm OUTPUT=./runtime/common/weights/xcm.rs TEMPLATE="--template=.maintain/external-weight-template.hbs" .PHONY: bench -# Disabled: bench-scheduler, bench-identity -bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection +# Disabled: bench-scheduler +bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection bench-identity .PHONY: check check: diff --git a/pallets/identity/src/benchmarking.rs b/pallets/identity/src/benchmarking.rs index 38602ee10c..d9d79158fd 100644 --- a/pallets/identity/src/benchmarking.rs +++ b/pallets/identity/src/benchmarking.rs @@ -138,6 +138,12 @@ fn create_identity_info(num_fields: u32) -> IdentityInfo() -> >::Balance { + 200u32.into() +} + benchmarks! { add_registrar { let r in 1 .. T::MaxRegistrars::get() - 1 => add_registrars::(r)?; @@ -167,7 +173,7 @@ benchmarks! { for i in 0..r { let registrar: T::AccountId = account("registrar", i, SEED); let registrar_lookup = T::Lookup::unlookup(registrar.clone()); - let balance_to_use = T::Currency::minimum_balance() * 10u32.into(); + let balance_to_use = balance_unit::() * 10u32.into(); let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use); Identity::::request_judgement(caller_origin.clone(), i, 10u32.into())?; @@ -240,7 +246,7 @@ benchmarks! { // User requests judgement from all the registrars, and they approve for i in 0..r { let registrar: T::AccountId = account("registrar", i, SEED); - let balance_to_use = T::Currency::minimum_balance() * 10u32.into(); + let balance_to_use = balance_unit::() * 10u32.into(); let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use); Identity::::request_judgement(caller_origin.clone(), i, 10u32.into())?; @@ -393,7 +399,7 @@ benchmarks! { // User requests judgement from all the registrars, and they approve for i in 0..r { let registrar: T::AccountId = account("registrar", i, SEED); - let balance_to_use = T::Currency::minimum_balance() * 10u32.into(); + let balance_to_use = balance_unit::() * 10u32.into(); let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use); Identity::::request_judgement(target_origin.clone(), i, 10u32.into())?; From c31814176f7c3a8711f8e3cb23f5ef1e46200356 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 21:25:12 +0200 Subject: [PATCH 64/74] style(pallet-inflation): deprecation warnings --- pallets/inflation/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/inflation/src/lib.rs b/pallets/inflation/src/lib.rs index 9c754cacf5..c46e4f3ad5 100644 --- a/pallets/inflation/src/lib.rs +++ b/pallets/inflation/src/lib.rs @@ -118,7 +118,7 @@ pub mod pallet { let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0); let current_relay_block = T::BlockNumberProvider::current_block_number(); let next_inflation: T::BlockNumber = >::get(); - add_weight(1, 0, Weight::from_ref_time(5_000_000)); + add_weight(1, 0, Weight::from_parts(5_000_000, 0)); // Apply inflation every InflationBlockInterval blocks // If next_inflation == 0, this means inflation wasn't yet initialized @@ -130,7 +130,7 @@ pub mod pallet { add_weight(1, 0, Weight::zero()); if current_relay_block >= next_recalculation { Self::recalculate_inflation(next_recalculation); - add_weight(0, 4, Weight::from_ref_time(5_000_000)); + add_weight(0, 4, Weight::from_parts(5_000_000, 0)); } T::Currency::deposit_into_existing( @@ -142,7 +142,7 @@ pub mod pallet { // Update inflation block >::set(next_inflation + block_interval.into()); - add_weight(3, 3, Weight::from_ref_time(10_000_000)); + add_weight(3, 3, Weight::from_parts(10_000_000, 0)); } consumed_weight From 3d5bb6bfa3b4fd6828ec68569df0804c9b56b715 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 21:25:50 +0200 Subject: [PATCH 65/74] style(pallet-scheduler): ignore deprecation warnings --- pallets/scheduler-v2/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/scheduler-v2/src/lib.rs b/pallets/scheduler-v2/src/lib.rs index 3e76666a97..5465dbca80 100644 --- a/pallets/scheduler-v2/src/lib.rs +++ b/pallets/scheduler-v2/src/lib.rs @@ -74,6 +74,8 @@ mod benchmarking; mod mock; #[cfg(test)] mod tests; +// We dont use this pallet right now +#[allow(deprecated)] pub mod weights; use codec::{Codec, Decode, Encode, MaxEncodedLen}; From 16797a42b44fa2a595350ff3d394a1739525cb32 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 21:55:18 +0200 Subject: [PATCH 66/74] build: bump spec_version to 941055 --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 5710e93feb..f7219656d5 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -51,7 +51,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 941054, + spec_version: 941055, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 85a2ce83d1..a28dd99495 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -54,7 +54,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 941054, + spec_version: 941055, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 9452f99d8a..c4f28bf8e2 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -51,7 +51,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 941054, + spec_version: 941055, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, From 1368751edab487b9975a6f5f5fdf273fa4de9143 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Apr 2023 22:04:27 +0200 Subject: [PATCH 67/74] build: run calibration --- primitives/common/src/constants.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index 1bc1afc90c..ca17eaf879 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -52,10 +52,10 @@ pub const MAX_COLLATORS: u32 = 10; pub const SESSION_LENGTH: BlockNumber = HOURS; // Targeting 0.1 UNQ per transfer -pub const WEIGHT_TO_FEE_COEFF: u64 = /**/78_240_337_566_697_829/**/; +pub const WEIGHT_TO_FEE_COEFF: u64 = /**/78_254_739_568_813_617/**/; // Targeting 0.15 UNQ per transfer via ETH -pub const MIN_GAS_PRICE: u64 = /**/1_031_842_664_630/**/; +pub const MIN_GAS_PRICE: u64 = /**/952_266_075_838/**/; /// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. /// This is used to limit the maximal weight of a single extrinsic. From 8a18c995899563e47b538154b592237feaaa4fda Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 21 Apr 2023 09:51:02 +0200 Subject: [PATCH 68/74] refactor: event helpers --- tests/src/scheduler.seqtest.ts | 22 +- tests/src/util/playgrounds/unique.dev.ts | 183 +++++++++++++-- tests/src/xcm/xcmQuartz.test.ts | 281 ++++++++--------------- tests/src/xcm/xcmUnique.test.ts | 281 ++++++++--------------- 4 files changed, 355 insertions(+), 412 deletions(-) diff --git a/tests/src/scheduler.seqtest.ts b/tests/src/scheduler.seqtest.ts index 8d8c397fb1..d786291e65 100644 --- a/tests/src/scheduler.seqtest.ts +++ b/tests/src/scheduler.seqtest.ts @@ -16,7 +16,7 @@ import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; -import {DevUniqueHelper} from './util/playgrounds/unique.dev'; +import {DevUniqueHelper, Event} from './util/playgrounds/unique.dev'; describe('Scheduling token and balance transfers', () => { let superuser: IKeyringPair; @@ -411,19 +411,13 @@ describe('Scheduling token and balance transfers', () => { const priority = 112; await helper.getSudo().scheduler.changePriority(superuser, scheduledId, priority); - const priorityChanged = await helper.wait.event( - waitForBlocks, - 'scheduler', - 'PriorityChanged', - ); - - expect(priorityChanged !== null).to.be.true; + const priorityChanged = await helper.wait.expectEvent(waitForBlocks, Event.Scheduler.PriorityChanged); - const [blockNumber, index] = priorityChanged!.event.data[0].toJSON() as any[]; + const [blockNumber, index] = priorityChanged.task(); expect(blockNumber).to.be.equal(executionBlock); expect(index).to.be.equal(0); - expect(priorityChanged!.event.data[1].toString()).to.be.equal(priority.toString()); + expect(priorityChanged.priority().toString()).to.be.equal(priority.toString()); }); itSub('Prioritized operations execute in valid order', async ({helper}) => { @@ -668,13 +662,7 @@ describe('Negative Test: Scheduling', () => { await expect(helper.scheduler.changePriority(alice, scheduledId, priority)) .to.be.rejectedWith(/BadOrigin/); - const priorityChanged = await helper.wait.event( - waitForBlocks, - 'scheduler', - 'PriorityChanged', - ); - - expect(priorityChanged === null).to.be.true; + await helper.wait.expectEvent(waitForBlocks, Event.Scheduler.PriorityChanged); }); }); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 37568ac992..343284e9d7 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -9,7 +9,7 @@ import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; import {EventRecord} from '@polkadot/types/interfaces'; import {ICrossAccountId, IPovInfo, TSigner} from './types'; -import {FrameSystemEventRecord} from '@polkadot/types/lookup'; +import {FrameSystemEventRecord, XcmV2TraitsError} from '@polkadot/types/lookup'; import {VoidFn} from '@polkadot/api/types'; import {Pallets} from '..'; import {spawnSync} from 'child_process'; @@ -59,6 +59,130 @@ export class SilentConsole { } } +export interface IEventHelper { + section(): string; + + method(): string; + + bindEventRecord(e: FrameSystemEventRecord): void; + + raw(): FrameSystemEventRecord; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention +function EventHelper(section: string, method: string) { + return class implements IEventHelper { + eventRecord: FrameSystemEventRecord | null; + _section: string; + _method: string; + + constructor() { + this.eventRecord = null; + this._section = section; + this._method = method; + } + + section(): string { + return this._section; + } + + method(): string { + return this._method; + } + + bindEventRecord(e: FrameSystemEventRecord) { + this.eventRecord = e; + } + + raw() { + return this.eventRecord!; + } + + eventJsonData(index: number) { + return this.raw().event.data[index].toJSON() as T; + } + + eventData(index: number) { + return this.raw().event.data[index] as T; + } + }; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention +function EventSection(section: string) { + return class Section { + static section = section; + + static Method(name: string) { + return EventHelper(Section.section, name); + } + }; +} + +export class Event { + static Democracy = class extends EventSection('democracy') { + static Started = class extends this.Method('Started') { + referendumIndex() { + return this.eventJsonData(0); + } + + threshold() { + return this.eventJsonData(1); + } + }; + + static Voted = class extends this.Method('Voted') { + voter() { + return this.eventJsonData(0); + } + + referendumIndex() { + return this.eventJsonData(1); + } + + vote() { + return this.eventJsonData(2); + } + }; + + static Passed = class extends this.Method('Passed') { + referendumIndex() { + return this.eventJsonData(0); + } + }; + }; + + static Scheduler = class extends EventSection('scheduler') { + static PriorityChanged = class extends this.Method('PriorityChanged') { + task() { + return this.eventJsonData(0); + } + + priority() { + return this.eventJsonData(1); + } + }; + }; + + static XcmpQueue = class extends EventSection('xcmpQueue') { + static XcmpMessageSent = class extends this.Method('XcmpMessageSent') { + messageHash() { + return this.eventJsonData(0); + } + }; + + static Fail = class extends this.Method('Fail') { + messageHash() { + return this.eventJsonData(0); + } + + outcome() { + return this.eventData(1); + } + }; + }; +} + export class DevUniqueHelper extends UniqueHelper { /** * Arrange methods for tests @@ -634,12 +758,12 @@ class MoonbeamFastDemocracyGroup { console.log('\t* Fast track proposal through technical committee.......DONE'); // <<< Fast track proposal through technical committee <<< - const refIndexField = 0; - const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); + const democracyStarted = await this.helper.wait.expectEvent(3, Event.Democracy.Started); + const referendumIndex = democracyStarted.referendumIndex(); // >>> Referendum voting >>> console.log(`\t* Referendum #${referendumIndex} voting.......`); - await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex!, { + await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex, { balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}, }); @@ -647,7 +771,10 @@ class MoonbeamFastDemocracyGroup { // <<< Referendum voting <<< // Wait the proposal to pass - await this.helper.wait.event(3, 'democracy', 'Passed'); + await this.helper.wait.expectEvent(3, Event.Democracy.Passed, event => { + return event.referendumIndex() == referendumIndex; + }); + await this.helper.wait.newBlocks(1); console.log(`[democracy] executing '${proposalDesciption}' proposal.......DONE`); @@ -794,13 +921,18 @@ class WaitGroup { return promise; } - event(maxBlocksToWait: number, eventSection: string, eventMethod: string) { + event( + maxBlocksToWait: number, + eventHelperType: new () => T, + filter: (_: T) => boolean = () => { return true; }, + ) { // eslint-disable-next-line no-async-promise-executor - const promise = new Promise(async (resolve) => { + const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(async header => { + const eventHelper = new eventHelperType(); const blockNumber = header.number.toHuman(); const blockHash = header.hash; - const eventIdStr = `${eventSection}.${eventMethod}`; + const eventIdStr = `${eventHelper.section()}.${eventHelper.method()}`; const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`; this.helper.logger.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); @@ -809,16 +941,24 @@ class WaitGroup { const eventRecords = (await apiAt.query.system.events()) as any; const neededEvent = eventRecords.toArray().find((r: FrameSystemEventRecord) => { - return r.event.section == eventSection && r.event.method == eventMethod; + if ( + r.event.section == eventHelper.section() + && r.event.method == eventHelper.method() + ) { + eventHelper.bindEventRecord(r); + return filter(eventHelper); + } else { + return false; + } }); if (neededEvent) { unsubscribe(); - resolve(neededEvent); + resolve(eventHelper); } else if (maxBlocksToWait > 0) { maxBlocksToWait--; } else { - this.helper.logger.log(`Event \`${eventIdStr}\` is NOT found`); + this.helper.logger.log(`Eligible event \`${eventIdStr}\` is NOT found`); unsubscribe(); resolve(null); } @@ -827,17 +967,18 @@ class WaitGroup { return promise; } - async eventData(maxBlocksToWait: number, eventSection: string, eventMethod: string, fieldIndex: number) { - const eventRecord = await this.event(maxBlocksToWait, eventSection, eventMethod); - - if (eventRecord == null) { - return null; + async expectEvent( + maxBlocksToWait: number, + eventHelperType: new () => T, + filter: (e: T) => boolean = () => { return true; }, + ) { + const e = await this.event(maxBlocksToWait, eventHelperType, filter); + if (e == null) { + const eventHelper = new eventHelperType(); + throw Error(`The event '${eventHelper.section()}.${eventHelper.method()}' is expected`); + } else { + return e; } - - const event = eventRecord!.event; - const data = event.data[fieldIndex] as EventT; - - return data; } } diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 4e553102b8..e966836960 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -16,9 +16,8 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../config'; -import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds, usingStateminePlaygrounds, usingShidenPlaygrounds} from '../util'; -import {DevUniqueHelper} from '../util/playgrounds/unique.dev'; +import {DevUniqueHelper, Event} from '../util/playgrounds/unique.dev'; const QUARTZ_CHAIN = 2095; const STATEMINE_CHAIN = 1000; @@ -673,30 +672,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { moreThanKaruraHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz await usingKaruraPlaygrounds(karuraUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -765,30 +754,21 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz using full QTZ identification await usingKaruraPlaygrounds(karuraUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramFullId); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -796,24 +776,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { // Try to trick Quartz using shortened QTZ identification await usingKaruraPlaygrounds(karuraUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramHereId); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -834,6 +804,10 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { let quartzAccountMultilocation: any; let quartzCombinedMultilocation: any; + let messageSent: any; + + const maxWaitBlocks = 3; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { alice = await privateKey('//Alice'); @@ -883,26 +857,11 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { }); }); - const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - `[reject ${network} tokens] 'xcmpQueue.FailEvent' event is expected`, - ).to.be.true; - - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + const expectFailedToTransact = async (helper: DevUniqueHelper, messageSent: any) => { + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == messageSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); }; itSub('Quartz rejects KAR tokens from Karura', async ({helper}) => { @@ -912,9 +871,11 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { }; const destination = quartzCombinedMultilocation; await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited'); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('KAR', helper); + await expectFailedToTransact(helper, messageSent); }); itSub('Quartz rejects MOVR tokens from Moonriver', async ({helper}) => { @@ -922,9 +883,11 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { const id = 'SelfReserve'; const destination = quartzCombinedMultilocation; await helper.xTokens.transfer(alith, id, testAmount, destination, 'Unlimited'); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('MOVR', helper); + await expectFailedToTransact(helper, messageSent); }); itSub('Quartz rejects SDN tokens from Shiden', async ({helper}) => { @@ -952,9 +915,11 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { assets, feeAssetItem, ]); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('SDN', helper); + await expectFailedToTransact(helper, messageSent); }); }); @@ -1193,6 +1158,9 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { moreThanMoonriverHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, maliciousXcmProgram]); @@ -1200,27 +1168,14 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to spend more QTZ than Moonriver has', batchCall); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -1293,6 +1248,10 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz using full QTZ identification await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [quartzMultilocation, maliciousXcmProgramFullId]); @@ -1300,27 +1259,14 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to act like a reserve location for QTZ using path asset identification', batchCall); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1332,24 +1278,14 @@ describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to act like a reserve location for QTZ using "here" asset identification', batchCall); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1598,30 +1534,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { moreThanShidenHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz await usingShidenPlaygrounds(shidenUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgram); - }); - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -1690,30 +1616,21 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Quartz using full QTZ identification await usingShidenPlaygrounds(shidenUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramFullId); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1721,24 +1638,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => { // Try to trick Quartz using shortened QTZ identification await usingShidenPlaygrounds(shidenUrl, async (helper) => { await helper.getSudo().xcm.send(alice, quartzMultilocation, maliciousXcmProgramHereId); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'isUntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 54406a18a0..ce66748b91 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -16,9 +16,8 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../config'; -import {XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXCM, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds, usingStatemintPlaygrounds, usingAstarPlaygrounds} from '../util'; -import {DevUniqueHelper} from '../util/playgrounds/unique.dev'; +import {DevUniqueHelper, Event} from '../util/playgrounds/unique.dev'; const UNIQUE_CHAIN = 2037; const STATEMINT_CHAIN = 1000; @@ -675,30 +674,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { moreThanAcalaHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique await usingAcalaPlaygrounds(acalaUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -767,30 +756,21 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique using full UNQ identification await usingAcalaPlaygrounds(acalaUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramFullId); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -798,24 +778,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { // Try to trick Unique using shortened UNQ identification await usingAcalaPlaygrounds(acalaUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramHereId); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -836,6 +806,10 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { let uniqueAccountMultilocation: any; let uniqueCombinedMultilocation: any; + let messageSent: any; + + const maxWaitBlocks = 3; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { alice = await privateKey('//Alice'); @@ -885,26 +859,11 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { }); }); - const expectFailedToTransact = async (network: string, helper: DevUniqueHelper) => { - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - `[reject ${network} tokens] 'xcmpQueue.FailEvent' event is expected`, - ).to.be.true; - - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `[reject ${network} tokens] The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + const expectFailedToTransact = async (helper: DevUniqueHelper, messageSent: any) => { + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == messageSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); }; itSub('Unique rejects ACA tokens from Acala', async ({helper}) => { @@ -914,9 +873,11 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { }; const destination = uniqueCombinedMultilocation; await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited'); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('ACA', helper); + await expectFailedToTransact(helper, messageSent); }); itSub('Unique rejects GLMR tokens from Moonbeam', async ({helper}) => { @@ -924,9 +885,11 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { const id = 'SelfReserve'; const destination = uniqueCombinedMultilocation; await helper.xTokens.transfer(alith, id, testAmount, destination, 'Unlimited'); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('GLMR', helper); + await expectFailedToTransact(helper, messageSent); }); itSub('Unique rejects ASTR tokens from Astar', async ({helper}) => { @@ -954,9 +917,11 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { assets, feeAssetItem, ]); + + messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); }); - await expectFailedToTransact('ASTR', helper); + await expectFailedToTransact(helper, messageSent); }); }); @@ -1196,6 +1161,9 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { moreThanMoonbeamHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, maliciousXcmProgram]); @@ -1203,27 +1171,14 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to spend more UNQ than Moonbeam has', batchCall); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -1296,6 +1251,10 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique using full UNQ identification await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { const xcmSend = helper.constructApiCall('api.tx.polkadotXcm.send', [uniqueMultilocation, maliciousXcmProgramFullId]); @@ -1303,27 +1262,14 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to act like a reserve location for UNQ using path asset identification', batchCall); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1335,24 +1281,14 @@ describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Needed to bypass the call filter. const batchCall = helper.encodeApiCall('api.tx.utility.batch', [[xcmSend]]); await helper.fastDemocracy.executeProposal('try to act like a reserve location for UNQ using "here" asset identification', batchCall); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1600,30 +1536,20 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { moreThanAstarHas, ); + let maliciousXcmProgramSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique await usingAstarPlaygrounds(astarUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgram); - }); - const maxWaitBlocks = 3; - const outcomeField = 1; - - const xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isFailedToTransactAsset, - `The XCM error should be 'FailedToTransactAsset', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramSent.messageHash() + && event.outcome().isFailedToTransactAsset; + }); targetAccountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(targetAccountBalance).to.be.equal(0n); @@ -1692,30 +1618,21 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { testAmount, ); + let maliciousXcmProgramFullIdSent: any; + let maliciousXcmProgramHereIdSent: any; + const maxWaitBlocks = 3; + // Try to trick Unique using full UNQ identification await usingAstarPlaygrounds(astarUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramFullId); - }); - - const maxWaitBlocks = 3; - const outcomeField = 1; - - let xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramFullIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramFullIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); let accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); @@ -1723,24 +1640,14 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => { // Try to trick Unique using shortened UNQ identification await usingAstarPlaygrounds(astarUrl, async (helper) => { await helper.getSudo().xcm.send(alice, uniqueMultilocation, maliciousXcmProgramHereId); - }); - - xcmpQueueFailEvent = await helper.wait.eventData( - maxWaitBlocks, - 'xcmpQueue', - 'Fail', - outcomeField, - ); - expect( - xcmpQueueFailEvent != null, - '\'xcmpQueue.FailEvent\' event is expected', - ).to.be.true; + maliciousXcmProgramHereIdSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent); + }); - expect( - xcmpQueueFailEvent!.isUntrustedReserveLocation, - `The XCM error should be 'UntrustedReserveLocation', got '${xcmpQueueFailEvent!.toHuman()}'`, - ).to.be.true; + await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.Fail, event => { + return event.messageHash() == maliciousXcmProgramHereIdSent.messageHash() + && event.outcome().isUntrustedReserveLocation; + }); accountBalance = await helper.balance.getSubstrate(targetAccount.address); expect(accountBalance).to.be.equal(0n); From a4880da46eca7494e00036d5f40f011a259082ef Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 21 Apr 2023 00:44:10 +0200 Subject: [PATCH 69/74] allow conflicting type names --- .docker/forkless-config/typeNames.jsonnet | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.docker/forkless-config/typeNames.jsonnet b/.docker/forkless-config/typeNames.jsonnet index 82bcccefe5..f7df4ca6a4 100644 --- a/.docker/forkless-config/typeNames.jsonnet +++ b/.docker/forkless-config/typeNames.jsonnet @@ -20,12 +20,13 @@ local // There should be at most one element with this prefix if std.startsWith(field, prefix) }, + makeObject(keyValues) = std.foldl(function(o, kv) if kv[0] in o then o else o + {[kv[0]]: kv[1]}, keyValues, {}), ; -local typesRaw = { - [typeName(id)]: id +local typesRaw = makeObject([ + [typeName(id), id] for id in std.range(0, std.length(chain._meta.types.types)-1) -}; +]); local types = typesRaw + shortenPrefix(typesRaw, 'frame_system::AccountInfo<', 'AccountInfo'); From 01f152b30912152903388916196893c541ced4c8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 3 May 2023 14:46:31 +0200 Subject: [PATCH 70/74] build: upgrade pallet-sponsoring --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7a5f1b108..4185c4d77c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7148,7 +7148,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#65d810e69aa1f5d79e08d0d4e607ffd70c877603" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#4e77985c89e3f36233f3fcb143dc7065111fa3e2" dependencies = [ "frame-benchmarking", "frame-support", @@ -13710,7 +13710,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#65d810e69aa1f5d79e08d0d4e607ffd70c877603" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.41#4e77985c89e3f36233f3fcb143dc7065111fa3e2" dependencies = [ "impl-trait-for-tuples", ] From a20534f88e5d497ce2642858657fbf6eec83aa54 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 3 May 2023 15:21:36 +0200 Subject: [PATCH 71/74] fix: pallet-sponsoring switched to new macros --- runtime/common/construct_runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/construct_runtime.rs b/runtime/common/construct_runtime.rs index fddbd6991b..2fbf085b85 100644 --- a/runtime/common/construct_runtime.rs +++ b/runtime/common/construct_runtime.rs @@ -74,7 +74,7 @@ macro_rules! construct_runtime { Configuration: pallet_configuration = 63, - Charging: pallet_charge_transaction::{Pallet, Call, Storage} = 64, + Charging: pallet_charge_transaction = 64, // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, Common: pallet_common = 66, Fungible: pallet_fungible = 67, From 22a0f2134e927d4a747c91db1ed2fadcce1ad077 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 3 May 2023 23:15:34 +0700 Subject: [PATCH 72/74] chainql in env file --- .docker/Dockerfile-parachain-upgrade-data.j2 | 2 +- .docker/Dockerfile-xcm.j2 | 2 +- .env | 1 + .github/workflows/forkless-update-data.yml | 1 + .github/workflows/xcm.yml | 39 +++++++++++++++++++- 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade-data.j2 b/.docker/Dockerfile-parachain-upgrade-data.j2 index e96c9f40b2..69841355f7 100644 --- a/.docker/Dockerfile-parachain-upgrade-data.j2 +++ b/.docker/Dockerfile-parachain-upgrade-data.j2 @@ -67,7 +67,7 @@ COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/laun COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/fork.jsonnet /polkadot-launch/fork.jsonnet COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/typeNames.jsonnet /polkadot-launch/typeNames.jsonnet -COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ +COPY --from=uniquenetwork/builder-chainql:{{ CHAINQL }} /chainql/target/release/chainql /chainql/target/release/ COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm diff --git a/.docker/Dockerfile-xcm.j2 b/.docker/Dockerfile-xcm.j2 index b09853946c..6c2ee29c8a 100644 --- a/.docker/Dockerfile-xcm.j2 +++ b/.docker/Dockerfile-xcm.j2 @@ -60,7 +60,7 @@ COPY --from=uniquenetwork/builder-moonbeam:{{ MOONBEAM_BUILD_BRANCH }} /unique_p COPY --from=uniquenetwork/builder-cumulus:{{ CUMULUS_BUILD_BRANCH }} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus COPY --from=uniquenetwork/builder-acala:{{ ACALA_BUILD_BRANCH }} /unique_parachain/Acala/target/production/acala /acala/target/release/ COPY --from=uniquenetwork/builder-astar:{{ ASTAR_BUILD_BRANCH }} /unique_parachain/astar/target/release/astar /astar/target/release/ -COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ +COPY --from=uniquenetwork/builder-chainql:{{ CHAINQL }} /chainql/target/release/chainql /chainql/target/release/ EXPOSE 9844 EXPOSE 9933 diff --git a/.env b/.env index f66e8e3a2d..5825ef334a 100644 --- a/.env +++ b/.env @@ -2,6 +2,7 @@ RUST_TOOLCHAIN=nightly-2022-11-15 POLKADOT_BUILD_BRANCH=release-v0.9.37 POLKADOT_LAUNCH_BRANCH=unique-network RELAY_CHAIN_TYPE=westend +CHAINQL=v0.4.0 POLKADOT_MAINNET_BRANCH=release-v0.9.37 STATEMINT_BUILD_BRANCH=release-parachains-v9370 diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 1dc88a7cb6..13b60cd9fc 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -83,6 +83,7 @@ jobs: POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }} POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} REPLICA_FROM=${{ matrix.replica_from_address }} + CHAINQL=${{ env.CHAINQL }} - name: Show build configuration run: cat .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 166d2c9509..97894f25c1 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -251,8 +251,42 @@ jobs: fi shell: bash - - name: Pull chainql docker image - run: docker pull uniquenetwork/builder-chainql:latest + + # Check CHAINQL version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for CHAINQL + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-chainql.j2 + output_file: .docker/Dockerfile-chainql.${{ env.CHAINQL }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + CHAINQL=${{ env.CHAINQL }} + + - name: Check if the dockerhub repository contains the needed CHAINQL version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + CHAINQL_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-chainql/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "CHAINQL TAGS:" + echo $CHAINQL_TAGS + # Check correct version CHAINQL and build it if it doesn't exist in CHAINQL TAGS + if [[ ${CHAINQL_TAGS[*]} =~ (^|[[:space:]])"${{ env.CHAINQL }}"($|[[:space:]]) ]]; then + echo "Repository has needed CHAINQL version"; + docker pull uniquenetwork/builder-chainql:${{ env.CHAINQL }} + else + echo "Repository has not needed CHAINQL version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-chainql.${{ env.CHAINQL }}.yml --tag uniquenetwork/builder-chainql:${{ env.CHAINQL }} . + echo "Push needed CHAINQL version to the repository"; + docker push uniquenetwork/builder-chainql:${{ env.CHAINQL }} + fi + shell: bash + + # - name: Pull chainql docker image + # run: docker pull uniquenetwork/builder-chainql:${{ env.CHAINQL }} - name: Generate ENV related extend launch-config file uses: cuchi/jinja2-action@v1.2.0 @@ -281,6 +315,7 @@ jobs: ASTAR_BUILD_BRANCH=${{ matrix.astar_version }} MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + CHAINQL=${{ env.CHAINQL }} - name: Show build Dockerfile run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml From 24e9f78e0e5c1a11cd9ced120af47488a3586dde Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 May 2023 19:04:21 +0200 Subject: [PATCH 73/74] build: switch to v0.3.1 version of chainql --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 5825ef334a..04eaf7bcc9 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ RUST_TOOLCHAIN=nightly-2022-11-15 POLKADOT_BUILD_BRANCH=release-v0.9.37 POLKADOT_LAUNCH_BRANCH=unique-network RELAY_CHAIN_TYPE=westend -CHAINQL=v0.4.0 +CHAINQL=v0.3.1 POLKADOT_MAINNET_BRANCH=release-v0.9.37 STATEMINT_BUILD_BRANCH=release-parachains-v9370 From 5c543e931499695c30773b0cb208298d3f717cbc Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 5 May 2023 08:47:55 +0700 Subject: [PATCH 74/74] CI. add Dockerfile-chainql.j2 --- .docker/Dockerfile-chainql.j2 | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .docker/Dockerfile-chainql.j2 diff --git a/.docker/Dockerfile-chainql.j2 b/.docker/Dockerfile-chainql.j2 new file mode 100644 index 0000000000..656b3f3aac --- /dev/null +++ b/.docker/Dockerfile-chainql.j2 @@ -0,0 +1,40 @@ +# ===== Rust builder ===== +FROM ubuntu:22.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql-bin + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone -b {{ CHAINQL }} --depth 1 https://github.com/UniqueNetwork/chainql.git . && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:22.04 as builder-chainql + +COPY --from=builder-chainql-bin /chainql/target/release/chainql /chainql/target/release/chainql