diff --git a/.dockerignore b/.dockerignore index 1898461f59..66662fa886 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,6 +12,7 @@ Tiltfile **/*.txt **/*.md ./docker-cargo +./mvr/docker-cargo !/target/release/polkadot-collator !/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm !/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm.md5 @@ -25,8 +26,15 @@ Tiltfile !/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.wasm.md5 !/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm !/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm.md5 +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.compressed.wasm +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.compressed.wasm.md5 +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.wasm +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.wasm.md5 +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.wasm +!/mvr/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.wasm.md5 !/docker-cargo/release/mangata-node +!/mvr/docker-cargo/release/mangata-node !target/release/mangata-node !target/release/wbuild/mangata* diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..3870c47efd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + reviewers: + - "majusko" + - package-ecosystem: "cargo" + directory: "/mvr" + schedule: + interval: "weekly" + reviewers: + - "majusko" + commit-message: + prefix: "[mvr] " \ No newline at end of file diff --git a/.github/workflows/branch-develop.yml b/.github/workflows/branch-develop.yml index 70ce8eb1cc..a01ef72bcc 100644 --- a/.github/workflows/branch-develop.yml +++ b/.github/workflows/branch-develop.yml @@ -82,6 +82,7 @@ jobs: with: env: fungible version: ${{ needs.init.outputs.GLOBAL_VERSION }} + cluster_name: mangata-dev-alpha run-perf-tests-branch: runs-on: ubuntu-latest @@ -128,7 +129,7 @@ jobs: - name: Set up GKE credentials uses: google-github-actions/get-gke-credentials@v0.8.2 with: - cluster_name: mangata-dev + cluster_name: mangata-dev-alpha location: europe-west1 - name: Delete Kubernetes namespace with resources for fungible environment @@ -151,6 +152,7 @@ jobs: with: env: dev version: ${{ needs.init.outputs.GLOBAL_VERSION }} + cluster_name: mangata-dev-alpha run-e2e-test: name: Run e2e tests diff --git a/.github/workflows/branch-main.yml b/.github/workflows/branch-main.yml new file mode 100644 index 0000000000..e1565b1768 --- /dev/null +++ b/.github/workflows/branch-main.yml @@ -0,0 +1,163 @@ +name: Production Release Workflow + +on: + workflow_dispatch: + inputs: + release_version: + description: 'Release version in the format `vX.X.X`' + required: true + pull_request: + branches: [main] + types: [closed] + +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: ${{ github.workflow }} + +jobs: + init: + name: Global init + if: ( github.event.pull_request.merged == true && startsWith(github.head_ref, 'rc/') || github.event_name == 'workflow_dispatch' ) + runs-on: ubuntu-latest + outputs: + RELEASE_VERSION: ${{ steps.set_vars.outputs.RELEASE_VERSION }} + RELEASE_CANDIDATE_VERSION: ${{ steps.set_vars.outputs.RELEASE_CANDIDATE_VERSION }} + steps: + - name: Set release version + id: set_vars + run: | + echo "RELEASE_VERSION=v${GITHUB_HEAD_REF#rc/}" >> $GITHUB_OUTPUT + echo "RELEASE_CANDIDATE_VERSION=v${GITHUB_HEAD_REF#rc/}-rc" >> $GITHUB_OUTPUT + + build-and-test: + needs: [init] + name: Build + uses: ./.github/workflows/reusable-build-and-test.yml + secrets: inherit + with: + version: ${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} + branch: main + + run-e2e-tests: + name: Run e2e tests + needs: [init,build-and-test] + uses: ./.github/workflows/reusable-e2e-tests.yml + secrets: inherit + with: + globalVersion: ${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} + parachainDocker: docker.io/mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} + + create-draft-release-and-publish-docker-images: + name: Create Draft Release and Publish Docker Images + needs: [init,run-e2e-tests,build-and-test] + environment: kusama + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + DOCKER_IMAGE_DIGEST: ${{ steps.export_docker_image.outputs.DOCKER_IMAGE_DIGEST }} + steps: + - uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Export docker image + id: export_docker_image + run: | + docker pull mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} + docker save mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} -o docker-${{ needs.init.outputs.RELEASE_VERSION }}.tar + zip -r docker-${{ needs.init.outputs.RELEASE_VERSION }}.zip docker-${{ needs.init.outputs.RELEASE_VERSION }}.tar + # Save docker image SHA256 digest as an output variable + echo "DOCKER_IMAGE_DIGEST=$(docker inspect mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} --format='{{index .RepoDigests 0}}')" >> $GITHUB_OUTPUT + + - name: Tag and push image rococo and kusama specific images + uses: akhilerm/tag-push-action@v2.0.0 + with: + src: docker.io/mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} + dst: | + docker.io/mangatasolutions/mangata-node:rococo-${{ needs.init.outputs.RELEASE_VERSION }} + docker.io/mangatasolutions/mangata-node:kusama-${{ needs.init.outputs.RELEASE_VERSION }} + + - name: Extract wasms + run: | + docker run --entrypoint="" --rm mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} cat /mangata/mangata_kusama_runtime.compact.compressed.wasm > kusama.wasm + docker run --entrypoint="" --rm mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_CANDIDATE_VERSION }} cat /mangata/mangata_rococo_runtime.compact.compressed.wasm > rococo.wasm + + - name: Calculate Blake2 hashes + working-directory: scripts/blake2-hash + run: | + npm install + echo -n "kusama-${{ needs.init.outputs.RELEASE_VERSION }}.wasm [blake2]: " > hashes.txt + node index.js -i ../../kusama.wasm >> hashes.txt + echo -n "kusama-${{ needs.init.outputs.RELEASE_VERSION }}.wasm [md5sum]: " >> hashes.txt + md5sum ../../kusama.wasm | awk '{ print $1 }' >> hashes.txt + echo -n "kusama-${{ needs.init.outputs.RELEASE_VERSION }} spec version : " >> hashes.txt + grep -oE "spec_version:.*" ../../runtime/mangata-kusama/src/lib.rs | grep -oE "[0-9]+" | sort | tail -1 >> hashes.txt + echo -n "rococo-${{ needs.init.outputs.RELEASE_VERSION }}.wasm [blake2]: " >> hashes.txt + node index.js -i ../../rococo.wasm >> hashes.txt + echo -n "rococo-${{ needs.init.outputs.RELEASE_VERSION }}.wasm [md5sum]: " >> hashes.txt + md5sum ../../rococo.wasm | awk '{ print $1 }' >> hashes.txt + echo -n "rococo-${{ needs.init.outputs.RELEASE_VERSION }} spec version : " >> hashes.txt + grep -oE "spec_version:.*" ../../runtime/mangata-rococo/src/lib.rs | grep -oE "[0-9]+" | sort | tail -1 >> hashes.txt + + + - name: Rename artifacts + run: | + mv kusama.wasm kusama-${{ needs.init.outputs.RELEASE_VERSION }}.wasm + mv rococo.wasm rococo-${{ needs.init.outputs.RELEASE_VERSION }}.wasm + mv ./scripts/blake2-hash/hashes.txt hashes-and-versions-${{ needs.init.outputs.RELEASE_VERSION }}.txt + + - name: Upload wasms to release page + uses: ncipollo/release-action@v1 + with: + tag: ${{ needs.init.outputs.RELEASE_VERSION }} + allowUpdates: false + generateReleaseNotes: true + draft: true + artifacts: "kusama-${{ needs.init.outputs.RELEASE_VERSION }}.wasm,rococo-${{ needs.init.outputs.RELEASE_VERSION }}.wasm,hashes-and-versions-${{ needs.init.outputs.RELEASE_VERSION }}.txt,docker-${{ needs.init.outputs.RELEASE_VERSION }}.zip" + + deploy-rococo: + needs: [init,create-draft-release-and-publish-docker-images] + name: Deploy to Rococo + uses: ./.github/workflows/reusable-deploy-rococo.yml + secrets: inherit + with: + version: rococo-${{ needs.init.outputs.RELEASE_VERSION }} + + deploy-kusama: + needs: [init,deploy-rococo] + name: Deploy to Kusama + uses: ./.github/workflows/reusable-deploy-kusama.yml + secrets: inherit + with: + version: kusama-${{ needs.init.outputs.RELEASE_VERSION }} + + publish-release: + name: Publish release + needs: [init,deploy-kusama,create-draft-release-and-publish-docker-images] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Tag and push image + uses: akhilerm/tag-push-action@v2.0.0 + with: + src: ${{ needs.create-draft-release-and-publish-docker-images.outputs.DOCKER_IMAGE_DIGEST }} + dst: docker.io/mangatasolutions/mangata-node:${{ needs.init.outputs.RELEASE_VERSION }} + + - name: Upload wasms to release page + uses: ncipollo/release-action@v1 + with: + tag: ${{ needs.init.outputs.RELEASE_VERSION }} + allowUpdates: true + omitBodyDuringUpdate: true + updateOnlyUnreleased: true diff --git a/.github/workflows/branch-release.yml b/.github/workflows/branch-release.yml index d4cea01da8..f16f5bab72 100644 --- a/.github/workflows/branch-release.yml +++ b/.github/workflows/branch-release.yml @@ -30,7 +30,7 @@ permissions: checks: write env: - RELEASE_BRANCH_PATTERN: 'release/' + RELEASE_BRANCH_PATTERN: 'rc/' # The following concurrency group cancels in-progress jobs or runs on pull_request events only # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value @@ -56,7 +56,7 @@ jobs: echo "GLOBAL_VERSION=${{ github.sha }}" >> $GITHUB_OUTPUT echo "RELEASE_BRANCH_PATTERN=${{ env.RELEASE_BRANCH_PATTERN }}" >> $GITHUB_OUTPUT echo "GIT_BRANCH=${{ steps.branch-name.outputs.current_branch }}" | sed "s@/@-@g" >> $GITHUB_OUTPUT - echo "RELEASE_TAG=${{ steps.branch-name.outputs.current_branch }}" | sed "release/@@g" >> $GITHUB_OUTPUT + echo "RELEASE_TAG=${{ steps.branch-name.outputs.current_branch }}" | sed "rc/@@g" >> $GITHUB_OUTPUT validate-branch-name: name: Validate release branch name @@ -84,6 +84,7 @@ jobs: with: env: fungible version: ${{ needs.init.outputs.GLOBAL_VERSION }} + cluster_name: mangata-dev-alpha clean-up-fungible: name: Delete fungible environment @@ -99,7 +100,7 @@ jobs: - name: Set up GKE credentials uses: google-github-actions/get-gke-credentials@v0.8.2 with: - cluster_name: mangata-dev + cluster_name: mangata-dev-alpha location: europe-west1 - name: Delete Kubernetes namespace with resources for fungible environment @@ -130,7 +131,7 @@ jobs: startsWith(github.head_ref, needs.init.outputs.RELEASE_BRANCH_PATTERN) && github.event.action == 'closed' && github.event.pull_request.merged == 'true' needs: [ init ] - uses: ./.github/workflows/deploy-rococo.yml + uses: ./.github/workflows/reusable-deploy-rococo.yml secrets: inherit with: version: rococo-${{ needs.init.outputs.RELEASE_TAG }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 621864f58f..ea00ffd745 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ jobs: permissions: contents: write id-token: write - runs-on: [self-hosted, compile] + runs-on: mangata-node-e2e-runners container: image: mangatasolutions/node-builder:multi-nightly-2022-11-21 steps: @@ -28,7 +28,7 @@ jobs: /usr/local/cargo/git /usr/local/cargo/registry ~/.cache/sccache - key: node-docs-cache-0-${{ hashFiles('Cargo.lock') }} + key: node-docs-cache-1-${{ hashFiles('Cargo.lock') }} - name: Build docs run: cargo doc @@ -39,6 +39,8 @@ jobs: path: ./target/doc/ destination: mangata-docs-node parent: false + concurrency: 50 + process_gcloudignore: false - name: Fix permissions on self-hosted runner if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d16aa9e01b..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Release - -on: - release: - types: [published] - -jobs: - - init: - name: Global init - runs-on: ubuntu-latest - outputs: - RELEASE_VERSION: ${{ steps.set_vars.outputs.RELEASE_VERSION }} - steps: - - name: Set global version - id: set_vars - run: | - RELEASE_NAME=${{ github.event.release.name }} - echo "RELEASE_VERSION=${RELEASE_NAME}" >> $GITHUB_OUTPUT - - publish: - needs: [init] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4.1.1 - with: - images: docker.io/mangatasolutions/mangata-node - tags: type=semver,pattern={{ version }} - flavor: | - latest=false - - - name: Tag and push image - uses: akhilerm/tag-push-action@v2.0.0 - with: - src: docker.io/mangatasolutions/mangata-node:release-${{ needs.init.outputs.RELEASE_VERSION }} - dst: ${{ steps.meta.outputs.tags }} - - - name: Export docker image - run: | - docker pull mangatasolutions/mangata-node:release-${{ needs.init.outputs.RELEASE_VERSION }} - docker save mangatasolutions/mangata-node:release-${{ needs.init.outputs.RELEASE_VERSION }} -o docker-${{ github.ref_name }}.tar - zip -r docker-${{ github.ref_name }}.zip docker-${{ github.ref_name }}.tar - - - name: Extract wasms - run: | - docker run --entrypoint="" --rm mangatasolutions/mangata-node:release-${{ needs.init.outputs.RELEASE_VERSION }} cat /mangata/mangata_kusama_runtime.compact.compressed.wasm > kusama.wasm - docker run --entrypoint="" --rm mangatasolutions/mangata-node:release-${{ needs.init.outputs.RELEASE_VERSION }} cat /mangata/mangata_rococo_runtime.compact.compressed.wasm > rococo.wasm - - - name: Calculate Blake2 hashes - working-directory: scripts/blake2-hash - run: | - npm install - echo -n "kusama-${{ github.ref_name }}.wasm [blake2]: " > hashes.txt - node index.js -i ../../kusama.wasm >> hashes.txt - echo -n "kusama-${{ github.ref_name }}.wasm [md5sum]: " >> hashes.txt - md5sum ../../kusama.wasm | awk '{ print $1 }' >> hashes.txt - echo -n "kusama-${{ github.ref_name }} spec version : " >> hashes.txt - grep -oE "spec_version:.*" ../../runtime/mangata-kusama/src/lib.rs | grep -oE "[0-9]+" | sort | tail -1 >> hashes.txt - echo -n "rococo-${{ github.ref_name }}.wasm [blake2]: " >> hashes.txt - node index.js -i ../../rococo.wasm >> hashes.txt - echo -n "rococo-${{ github.ref_name }}.wasm [md5sum]: " >> hashes.txt - md5sum ../../rococo.wasm | awk '{ print $1 }' >> hashes.txt - echo -n "rococo-${{ github.ref_name }} spec version : " >> hashes.txt - grep -oE "spec_version:.*" ../../runtime/mangata-rococo/src/lib.rs | grep -oE "[0-9]+" | sort | tail -1 >> hashes.txt - - - - name: Rename artifacts - run: | - mv kusama.wasm kusama-${{ github.ref_name }}.wasm - mv rococo.wasm rococo-${{ github.ref_name }}.wasm - mv ./scripts/blake2-hash/hashes.txt hashes-and-versions-${{ github.ref_name }}.txt - - - name: Upload wasms to release page - uses: ncipollo/release-action@v1 - with: - tag: ${{ github.ref_name }} - allowUpdates: true - omitBody: true - artifacts: "kusama-${{ github.ref_name }}.wasm,rococo-${{ github.ref_name }}.wasm,hashes-and-versions-${{ github.ref_name }}.txt,docker-${{ github.ref_name }}.zip" - diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index 20250e4334..37c552f73f 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -30,9 +30,13 @@ permissions: jobs: build-node-image: name: Build Docker image - runs-on: [self-hosted, compile] + runs-on: [compile-gke] container: image: ${{ inputs.builder_image }} + env: + DOCKER_HOST: 'unix:///run/docker/docker.sock' + volumes: + - /run/docker:/run/docker steps: - uses: actions/checkout@v3 - name: Authenticate to Google Cloud @@ -62,6 +66,9 @@ jobs: - name: Build and push Docker image run: | + # This is needed to fix an issue when running on self-hosted runners in GKE + git config --global --add safe.directory /__w/mangata-node/mangata-node + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} docker build -f devops/dockerfiles/node/Dockerfile \ --label="git_rev=$(git rev-parse HEAD)" \ @@ -103,10 +110,6 @@ jobs: ./mangata_kusama_runtime-${{ inputs.version }}-fast.compact.compressed.wasm ./mangata_rococo_runtime-${{ inputs.version }}-fast.compact.compressed.wasm - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE - rustfmt-check: name: Formatting check runs-on: ubuntu-latest @@ -143,7 +146,7 @@ jobs: unit-test: name: Unit tests - runs-on: [self-hosted, compile] + runs-on: [compile-gke] container: image: ${{ inputs.builder_image }} steps: @@ -164,9 +167,38 @@ jobs: key: cargo-unit-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} - name: Run unit tests run: cargo test -j2 - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE + + coverage-report: + name: Coverage report + runs-on: [compile-gke] + container: + image: ${{ inputs.builder_image }} + options: --security-opt seccomp=unconfined + steps: + - uses: actions/checkout@v3 + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v1 + with: + workload_identity_provider: '${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}' + service_account: '${{ secrets.GCP_SERVICE_ACCOUNT }}' + - name: Cache the Cargo dependencies + uses: mansagroup/gcs-cache-action@v1.0.3 + with: + bucket: mangata-node-ci-cache + path: | + ${{ github.workspace }}/target + /usr/local/cargo/git + /usr/local/cargo/registry + key: cargo-coverage-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin@0.26.1 + - name: Generate coverage report with cargo-tarpaulin + run: cargo tarpaulin --timeout 120 --workspace -e runtime-integration-test mangata-node common-runtime mangata-kusama-runtime mangata-rococo-runtime --exclude-files **/mock.rs **/weights.rs **/weights/* --out Xml + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.ORG_CODECOV_TOKEN }} + fail_ci_if_error: true run-benchmarks-tests: name: Run benchmark tests @@ -196,7 +228,7 @@ jobs: build-and-run-try-runtime: name: Run try-runtime checks - runs-on: [self-hosted, compile] + runs-on: [compile-gke] container: image: ${{ inputs.builder_image }} steps: @@ -221,15 +253,12 @@ jobs: run: cargo run --release --features=try-runtime,mangata-rococo try-runtime --chain=rococo --runtime=target/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm on-runtime-upgrade live --uri wss://collator-01-ws-rococo.mangata.online:443 - name: Run try-runtime Kusama Mainnet - run: cargo run --release --features=try-runtime try-runtime --chain=kusama --runtime=target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm on-runtime-upgrade live --uri wss://prod-kusama-collator-01.mangatafinance.cloud:443 - - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE + run: cargo run --release --features=try-runtime try-runtime --chain=kusama --runtime=target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm on-runtime-upgrade live --uri wss://kusama-rpc.mangata.online:443 run-benchmarks: name: Run runtime benchmarks - runs-on: [self-hosted, performance] + # `performance` self-hosted runners have 8 cores and 16GB of RAM + runs-on: [performance-gke] env: STEPS: 2 REPEATS: 1 @@ -281,7 +310,7 @@ jobs: run: | target/release/mangata-node benchmark overhead --execution native --chain kusama-local -lblock_builder=debug --max-ext-per-block 50000 --base-path . cp block_weights.rs extrinsic_weights.rs ./benchmarks - + - name: Upload logs and docker images to GitHub if: ${{ contains(github.event.pull_request.labels.*.name, 'full-benchmarks') }} uses: actions/upload-artifact@v3.1.1 @@ -289,6 +318,45 @@ jobs: name: benchmarks path: ./benchmarks - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE + + build-wasms: + name: Export wasm artifacts + runs-on: [compile-gke] + env: + STEPS: 2 + REPEATS: 1 + container: + image: ${{ inputs.builder_image }} + steps: + - uses: actions/checkout@v3 + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v1 + with: + workload_identity_provider: '${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}' + service_account: '${{ secrets.GCP_SERVICE_ACCOUNT }}' + + - name: Cache the Cargo dependencies + uses: mansagroup/gcs-cache-action@v1.0.3 + with: + bucket: mangata-node-ci-cache + path: | + ${{ github.workspace }}/target + /usr/local/cargo/git + /usr/local/cargo/registry + ~/.cache/sccache + key: build-wasms-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + + - name: Compile mangata-node code + run: cargo build --release --no-default-features --features=mangata-rococo,mangata-kusama,runtime-benchmarks + + - name: Export wasms + run: | + /bin/bash -c 'target/release/mangata-node export-genesis-state --chain=kusama -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-wasm --chain=kusama -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-state --chain=kusama-local -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-wasm --chain=kusama-local -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-state --chain=rococo -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-wasm --chain=rococo -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-state --chain=rococo-local -l=info,xyk=error > /dev/null' + /bin/bash -c 'target/release/mangata-node export-genesis-wasm --chain=rococo-local -l=info,xyk=error > /dev/null' + diff --git a/.github/workflows/reusable-deploy-kusama.yml b/.github/workflows/reusable-deploy-kusama.yml new file mode 100644 index 0000000000..f569a3f2b4 --- /dev/null +++ b/.github/workflows/reusable-deploy-kusama.yml @@ -0,0 +1,63 @@ +name: Deploy mangata-node to `kusama` + +on: + workflow_dispatch: + inputs: + version: + description: "Version to be assigned to the built image" + required: true + type: string + workflow_call: + inputs: + version: + description: "Version to be assigned to the built image" + required: true + type: string + +concurrency: kusama_environment + +jobs: + deploy_kusama: + runs-on: ubuntu-latest + environment: kusama + env: + version_file: helmfiles/kusama/.version + GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + steps: + - name: Verify specified version exists + run: docker pull mangatasolutions/mangata-node:${{ inputs.version }} + + - name: Checkout `mangata-finance/gitops` repository + uses: actions/checkout@v3 + with: + repository: mangata-finance/gitops + ref: main + token: ${{ secrets.BOT_GITHUB_TOKEN }} + + - name: Push updated version to `gitops` repository + id: version + run: | + echo -n '${{ inputs.version }}' > ${{ env.version_file }} + git config user.name mangatafinance + git config user.email solutions@mangata.finance + git add . + git commit -m 'chore: deploy ${{ inputs.version }} to kusama environment' || \ + echo "changed=false" >> $GITHUB_OUTPUT + git push + + - name: Watch deployment workflow run + run: | + # Rerun previous workflow if version didn't change + [ -n '${{ steps.version.outputs.changed }}' ] && gh run rerun $(gh run list -w deploy-kusama.yml -L1 --json databaseId --jq '.[].databaseId') + + sleep 5 && gh run list -L10 -w deploy-kusama.yml + export RUN_ID=$(gh run list -w deploy-kusama.yml -L1 --json databaseId --jq '.[].databaseId') + + if [[ ($(gh run view "$RUN_ID" --json headSha --jq '.headSha') != $(git rev-parse HEAD)) && -z '${{ steps.version.outputs.changed }}' ]]; then + echo "Commited git SHA doesn't match with the SHA of the retrieved Run ID" + exit 1 + fi + + echo "Deployed version: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "Deployment workflow URL: $(gh run view "$RUN_ID" --json url --jq '.url')" >> $GITHUB_STEP_SUMMARY + gh run watch "$RUN_ID" --exit-status \ No newline at end of file diff --git a/.github/workflows/deploy-rococo.yml b/.github/workflows/reusable-deploy-rococo.yml similarity index 98% rename from .github/workflows/deploy-rococo.yml rename to .github/workflows/reusable-deploy-rococo.yml index 4000925522..7dd267db58 100644 --- a/.github/workflows/deploy-rococo.yml +++ b/.github/workflows/reusable-deploy-rococo.yml @@ -30,7 +30,7 @@ jobs: - name: Checkout `mangata-finance/gitops` repository uses: actions/checkout@v3 with: - repository: mangata-finance/gitops + repository: mangata-finance/gitops ref: main token: ${{ secrets.BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/reusable-e2e-tests.yml b/.github/workflows/reusable-e2e-tests.yml index 53c91a9bbc..7dbf6e7e70 100644 --- a/.github/workflows/reusable-e2e-tests.yml +++ b/.github/workflows/reusable-e2e-tests.yml @@ -51,11 +51,46 @@ permissions: checks: write jobs: + setup-report: + runs-on: [ubuntu-latest] + outputs: + testmo-run-id: ${{ steps.setTestRun.outputs.testmo-run-id }} + steps: + - name: Install testmo + run: npm install --no-save @testmo/testmo-cli + - name: Add url + run: | + npx testmo automation:resources:add-field --name git --type string \ + --value ${GITHUB_SHA:0:7} --resources resources.json + RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + npx testmo automation:resources:add-link --name build \ + --url $RUN_URL --resources resources.json + + - name: Create test run + run: | + npx testmo automation:run:create \ + --instance https://mangata-finance.testmo.net \ + --project-id 2 \ + --name "BE tests from node-repo" \ + --resources resources.json \ + --source "BE-e2e-regression" > testmo-run-id.txt + ID=$(cat testmo-run-id.txt) + echo "testmo-run-id=$ID" >> $GITHUB_OUTPUT + echo "ID=$ID" >> $GITHUB_ENV + + env: + TESTMO_URL: ${{ secrets.TESTMO_URL }} + TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }} + id: setTestRun + + e2e-test-matrix: + needs: [setup-report] strategy: + fail-fast: false matrix: include: - - command: "yarn test-parallel --max-workers=32" + - command: "yarn test-parallel --max-workers=10" fast: false - command: "yarn test-sequential-no-bootstrap" fast: false @@ -75,8 +110,16 @@ jobs: fast: true - command: "yarn test-governance" fast: true + - command: "yarn test-multiswap" + fast: false + - command: "yarn test-experimentalStaking" + fast: true + - command: "yarn test-crowdloan" + fast: false + - command: "yarn test-sdk" + fast: true - runs-on: [self-hosted, compile] + runs-on: [e2e-gke] timeout-minutes: 180 env: API_URL: "ws://127.0.0.1:9946" @@ -89,16 +132,15 @@ jobs: E2EBRANCHNAME: "main" PARACHAIN_DOCKER_IMAGE: ${{ inputs.parachainDocker || format('mangatasolutions/mangata-node:{0}', inputs.globalVersion) }} steps: - - uses: actions/checkout@v3 ####IDK, but this is neccesary for reports - name: Adapt if fast runtime if: ${{ !contains(env.PARACHAIN_DOCKER_IMAGE, 'fast') && matrix.fast == true }} run: echo "PARACHAIN_DOCKER_IMAGE=${{ env.PARACHAIN_DOCKER_IMAGE }}-fast" >> $GITHUB_ENV - + - name: Adapt if fast runtime if: ${{ !contains(env.PARACHAIN_DOCKER_IMAGE, 'fast') && matrix.fast == true }} run: echo "PARACHAIN_DOCKER_IMAGE=${{ env.PARACHAIN_DOCKER_IMAGE }}-fast" >> $GITHUB_ENV - + - name: Download node Docker image if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-build') && inputs.skipBuild != 'true' }} run: docker pull ${{ env.PARACHAIN_DOCKER_IMAGE }} @@ -133,9 +175,17 @@ jobs: ref: "${{ env.E2EBRANCHNAME }}" path: e2eTests + # Fixing issue with not having yarn installed on self-hosted runners in Kubernetes + - name: Install yarn and docker-compose to fix self-hosted runner issue when running setup-node + #Ref: https://github.com/actions/setup-node/issues/182 + run: |- + curl -fsSL --create-dirs -o $HOME/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js && chmod +x $HOME/bin/yarn + curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 -o $HOME/bin/docker-compose && chmod +x $HOME/bin/docker-compose + echo "$HOME/bin" >> $GITHUB_PATH + - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18.16.1' cache: 'yarn' cache-dependency-path: '**/yarn.lock' @@ -144,28 +194,33 @@ jobs: echo ${{ env.PARACHAIN_DOCKER_IMAGE }} - name: Replace parachain docker image reference in config - working-directory: launch + working-directory: devops/parachain-launch run: sed -i 's+mangatasolutions/mangata-node:.*+${{ env.PARACHAIN_DOCKER_IMAGE }}+g' config.yml - - name: Install parachain launch dependencies - working-directory: launch - run: yarn - - name: Install e2e tests dependencies working-directory: e2eTests - run: yarn + # TODO: remove cache clean later + run: yarn cache clean; yarn + + - name: Run parachain launch + working-directory: devops/parachain-launch + run: npx @open-web3/parachain-launch generate config.yml + + - name: Docker ps + run: docker ps --no-trunc - - name: Generate parachain launch config - working-directory: launch - run: yarn gen + - name: Docker network ls + run: docker network ls - name: Stop previous parachain if running - working-directory: launch - run: yarn down + working-directory: devops/parachain-launch/output + run: | + docker kill $(docker ps -q) 2>/dev/null && echo $? + docker-compose down -v - name: Start mangata-node parachain - working-directory: launch - run: yarn up + working-directory: devops/parachain-launch/output + run: docker-compose up -d --build - name: Docker ps run: docker ps --no-trunc @@ -185,6 +240,20 @@ jobs: name: E2E report ${{ matrix.command }} # Name of the check run which will be created path: e2eTests/reports/junit-*.xml # Path to test results reporter: jest-junit # Format of test results + - name: Install testmo + if: always() + run: npm install --no-save @testmo/testmo-cli + - name: Submit results to the testmo-run + if: always() + run: | + npx testmo automation:run:submit-thread \ + --instance https://mangata-finance.testmo.net \ + --run-id ${{needs.setup-report.outputs.testmo-run-id}} \ + --results e2eTests/reports/*.xml + env: + TESTMO_URL: ${{ secrets.TESTMO_URL }} + TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }} + continue-on-error: true - name: Collect docker logs on failure if: failure() @@ -214,11 +283,42 @@ jobs: /tmp/mangata_bob_1.tar /tmp/mangata_alice_1.tar - - name: Stop mangata-node parachain - if: always() - working-directory: launch - run: yarn down + - name: Stop previous parachain if running + working-directory: devops/parachain-launch/output + run: | + docker kill $(docker ps -q) 2>/dev/null && echo $? + docker-compose down -v + + test-complete: + needs: [setup-report, e2e-test-matrix] + if: always() + runs-on: ubuntu-latest - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE \ No newline at end of file + steps: + - name: Install testmo + run: npm install --no-save @testmo/testmo-cli + + - name: Complete test run + run: | + npx testmo automation:run:complete \ + --instance https://mangata-finance.testmo.net \ + --run-id ${{needs.setup-report.outputs.testmo-run-id}} \ + env: + TESTMO_URL: ${{ secrets.TESTMO_URL }} + TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }} + continue-on-error: true + + slack-notify-nook: + needs: [e2e-test-matrix] + if: failure() + runs-on: ubuntu-latest + + steps: + - name: Slack Notification - Error + uses: bryannice/gitactions-slack-notification@2.0.0 + env: + SLACK_INCOMING_WEBHOOK: ${{ secrets.BNB_E2E_NOTIFICATION_WEBHOOK }} + SLACK_TITLE: 'bnb e2e test execution - NOOK' + SLACK_COLOR: "#ff0011" + SLACK_MESSAGE: 'Test failures [ ${{ env.E2EBRANCHNAME }} - ${{ env.PARACHAIN_DOCKER_IMAGE }} ] testmo report: https://mangata-finance.testmo.net/automation/runs/view/${{needs.setup-report.outputs.testmo-run-id}}' + GITHUB_REF: 'https://mangata-finance.github.io/mangata-node/${{ github.run_number }}' diff --git a/.github/workflows/reusable-perfomance-tests.yml b/.github/workflows/reusable-perfomance-tests.yml index 45aa80e5bd..65bb105fd3 100644 --- a/.github/workflows/reusable-perfomance-tests.yml +++ b/.github/workflows/reusable-perfomance-tests.yml @@ -20,7 +20,7 @@ permissions: jobs: performance-tests: - runs-on: [self-hosted, compile] + runs-on: [compile-gke] timeout-minutes: 180 env: ENV_REF: ${{ inputs.targetEnv || format('pr-{0}', github.event.number) }} @@ -58,7 +58,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" cache: "yarn" cache-dependency-path: "**/yarn.lock" @@ -69,7 +69,7 @@ jobs: - name: Run performance tests working-directory: e2e/performance run: | - npx ts-node index.ts \ + node --experimental-specifier-resolution=node --loader ts-node/esm --experimental-vm-modules index.ts \ transfer \ nodes="wss://node-01-ws-${{ env.ENV_REF }}.mangata.online" \ testCaseName=ConcurrentTest \ @@ -88,7 +88,3 @@ jobs: ./e2e/performance/enqueued.txt ./e2e/performance/executed.txt ./e2e/performance/pending.txt - - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE diff --git a/.gitignore b/.gitignore index ff8933366e..854873f400 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ docker-cargo node_modules output/ devops/parachain/config/state +tarpaulin-report.html +cobertura.xml +build_rs_cov.profraw diff --git a/Cargo.lock b/Cargo.lock index 6707b5ea25..13f334f04a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -554,7 +554,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "hash-db 0.16.0", "log", @@ -1083,6 +1083,93 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "common-runtime" +version = "4.0.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking 4.0.0-dev (git+https://github.com/mangata-finance/substrate?branch=mangata-dev)", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "mangata-support", + "mangata-types", + "orml-asset-registry", + "orml-tokens", + "orml-traits", + "orml-unknown-tokens", + "orml-xcm", + "orml-xcm-support", + "orml-xtokens", + "pallet-aura", + "pallet-authorship", + "pallet-bootstrap", + "pallet-collective-mangata", + "pallet-crowdloan-rewards", + "pallet-fee-lock", + "pallet-identity", + "pallet-issuance", + "pallet-maintenance", + "pallet-multipurpose-liquidity", + "pallet-proof-of-stake", + "pallet-proxy", + "pallet-root-testing", + "pallet-session", + "pallet-sudo-mangata", + "pallet-sudo-origin", + "pallet-timestamp", + "pallet-transaction-payment-mangata", + "pallet-transaction-payment-mangata-rpc-runtime-api", + "pallet-treasury", + "pallet-utility-mangata", + "pallet-vesting-mangata", + "pallet-xcm", + "pallet-xyk", + "parachain-info", + "parachain-staking", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-ver", + "sp-version", + "sp-weights", + "static_assertions", + "substrate-wasm-builder", + "ver-api", + "xcm", + "xcm-builder", + "xcm-executor", + "xyk-runtime-api", +] + [[package]] name = "concurrent-queue" version = "2.2.0" @@ -2525,7 +2612,7 @@ dependencies = [ [[package]] name = "extrinsic-shuffler" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "derive_more", "log", @@ -2694,7 +2781,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", ] @@ -2717,7 +2804,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-support-procedural", @@ -2743,7 +2830,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -2796,7 +2883,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2807,7 +2894,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2824,7 +2911,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "aquamarine", "extrinsic-shuffler", @@ -2858,7 +2945,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "log", @@ -2874,7 +2961,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "bitflags", "environmental", @@ -2908,7 +2995,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "Inflector", "cfg-expr", @@ -2923,7 +3010,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2935,7 +3022,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro2", "quote", @@ -2945,7 +3032,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "extrinsic-shuffler", "frame-support", @@ -2995,7 +3082,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "sp-api", @@ -3004,7 +3091,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "parity-scale-codec", @@ -4799,6 +4886,7 @@ dependencies = [ name = "mangata-kusama-runtime" version = "4.0.0" dependencies = [ + "common-runtime", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -4847,7 +4935,6 @@ dependencies = [ "pallet-treasury", "pallet-utility-mangata", "pallet-vesting-mangata", - "pallet-vesting-mangata-rpc-runtime-api", "pallet-xcm", "pallet-xyk", "parachain-info", @@ -4888,6 +4975,7 @@ version = "0.1.0" dependencies = [ "cfg-if", "clap", + "common-runtime", "cumulus-client-cli", "cumulus-client-consensus-aura", "cumulus-client-consensus-common", @@ -4919,8 +5007,6 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment-mangata", "pallet-transaction-payment-mangata-rpc", - "pallet-vesting-mangata-rpc", - "pallet-vesting-mangata-rpc-runtime-api", "parity-scale-codec", "polkadot-cli", "polkadot-parachain", @@ -4987,6 +5073,7 @@ dependencies = [ name = "mangata-rococo-runtime" version = "4.0.0" dependencies = [ + "common-runtime", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -5036,7 +5123,6 @@ dependencies = [ "pallet-treasury", "pallet-utility-mangata", "pallet-vesting-mangata", - "pallet-vesting-mangata-rpc-runtime-api", "pallet-xcm", "pallet-xyk", "parachain-info", @@ -5094,7 +5180,7 @@ dependencies = [ [[package]] name = "mangata-support" version = "0.1.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "mangata-types", @@ -5107,7 +5193,7 @@ dependencies = [ [[package]] name = "mangata-types" version = "0.1.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -5275,7 +5361,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "log", @@ -5295,7 +5381,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "anyhow", "jsonrpsee", @@ -5933,7 +6019,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -5949,7 +6035,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -5965,7 +6051,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -5979,7 +6065,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6003,7 +6089,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6023,7 +6109,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6038,7 +6124,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6057,7 +6143,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree 4.0.0-dev (git+https://github.com/mangata-finance//substrate?branch=mangata-dev)", @@ -6113,7 +6199,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6131,7 +6217,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6150,7 +6236,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6167,7 +6253,7 @@ dependencies = [ [[package]] name = "pallet-collective-mangata" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6184,7 +6270,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6201,7 +6287,7 @@ dependencies = [ [[package]] name = "pallet-crowdloan-rewards" version = "0.6.0" -source = "git+https://github.com/mangata-finance//crowdloan-rewards?branch=mangata-dev#2cbf2b7fa2db5a220447160dee23be6e93f29afc" +source = "git+https://github.com/mangata-finance//crowdloan-rewards?branch=mangata-dev#93f22908087bf475bf1021bc9c3337fefd00fb39" dependencies = [ "ed25519-dalek", "frame-benchmarking", @@ -6211,6 +6297,7 @@ dependencies = [ "mangata-types", "orml-tokens", "pallet-utility", + "pallet-vesting-mangata", "parity-scale-codec", "scale-info", "serde", @@ -6224,7 +6311,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6242,7 +6329,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6265,7 +6352,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6291,7 +6378,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6309,7 +6396,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6356,7 +6443,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6379,7 +6466,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6395,7 +6482,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6415,7 +6502,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6484,7 +6571,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6501,7 +6588,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6548,7 +6635,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6564,7 +6651,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6580,7 +6667,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6617,7 +6704,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -6628,7 +6715,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6669,7 +6756,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6721,7 +6808,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6736,7 +6823,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6754,7 +6841,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6769,7 +6856,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6803,7 +6890,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6820,7 +6907,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6857,7 +6944,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6871,7 +6958,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6894,7 +6981,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6905,7 +6992,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "log", "sp-arithmetic", @@ -6923,7 +7010,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6940,7 +7027,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6954,7 +7041,7 @@ dependencies = [ [[package]] name = "pallet-sudo-mangata" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -6986,7 +7073,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7004,7 +7091,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7023,7 +7110,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -7039,7 +7126,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-mangata" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-support", "frame-system", @@ -7055,7 +7142,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-mangata-rpc" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "jsonrpsee", "pallet-transaction-payment-mangata-rpc-runtime-api", @@ -7071,7 +7158,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-mangata-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "pallet-transaction-payment-mangata", "parity-scale-codec", @@ -7083,7 +7170,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -7099,7 +7186,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -7111,7 +7198,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7128,7 +7215,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7144,7 +7231,7 @@ dependencies = [ [[package]] name = "pallet-utility-mangata" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7160,7 +7247,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7175,7 +7262,7 @@ dependencies = [ [[package]] name = "pallet-vesting-mangata" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -7183,36 +7270,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-vesting-mangata-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" -dependencies = [ - "jsonrpsee", - "pallet-vesting-mangata-rpc-runtime-api", - "parity-scale-codec", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-vesting-mangata-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" -dependencies = [ - "pallet-vesting-mangata", - "parity-scale-codec", "serde", - "sp-api", "sp-runtime", "sp-std", ] @@ -7220,7 +7278,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-benchmarking", "frame-support", @@ -9723,6 +9781,7 @@ dependencies = [ name = "runtime-integration-test" version = "0.1.0" dependencies = [ + "common-runtime", "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "env_logger 0.9.3", @@ -9917,7 +9976,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "log", "sp-core", @@ -9928,7 +9987,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -9956,7 +10015,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "futures-timer", @@ -9979,7 +10038,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship-ver" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "aquamarine", "futures", @@ -10005,7 +10064,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -10020,7 +10079,7 @@ dependencies = [ [[package]] name = "sc-block-builder-ver" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "aquamarine", "extrinsic-shuffler", @@ -10041,7 +10100,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -10060,7 +10119,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10071,7 +10130,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -10111,7 +10170,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "fnv", "futures", @@ -10137,7 +10196,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -10163,7 +10222,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -10188,7 +10247,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -10217,7 +10276,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "fork-tree", @@ -10258,7 +10317,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "jsonrpsee", @@ -10334,7 +10393,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10347,7 +10406,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ahash 0.8.3", "array-bytes 4.2.0", @@ -10447,7 +10506,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -10472,7 +10531,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "lru 0.8.1", "parity-scale-codec", @@ -10496,7 +10555,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -10509,7 +10568,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "log", "sc-allocator", @@ -10522,7 +10581,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "anyhow", "cfg-if", @@ -10540,7 +10599,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ansi_term", "futures", @@ -10556,7 +10615,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10571,7 +10630,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -10615,7 +10674,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "cid", "futures", @@ -10635,7 +10694,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10663,7 +10722,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ahash 0.8.3", "futures", @@ -10682,7 +10741,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10704,7 +10763,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10738,7 +10797,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10758,7 +10817,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -10789,7 +10848,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "libp2p", @@ -10802,7 +10861,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10811,7 +10870,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "hash-db 0.15.2", @@ -10842,7 +10901,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10862,7 +10921,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "http", @@ -10878,7 +10937,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10904,7 +10963,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "directories", @@ -10976,7 +11035,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "log", "parity-scale-codec", @@ -10987,7 +11046,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "clap", "fs4", @@ -11019,7 +11078,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11038,7 +11097,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "libc", @@ -11057,7 +11116,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "chrono", "futures", @@ -11076,7 +11135,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ansi_term", "atty", @@ -11107,7 +11166,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11118,7 +11177,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -11145,7 +11204,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -11159,7 +11218,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-channel", "futures", @@ -11666,7 +11725,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "hash-db 0.16.0", "log", @@ -11684,7 +11743,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "Inflector", "blake2", @@ -11698,7 +11757,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -11711,7 +11770,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "integer-sqrt", "num-traits", @@ -11725,7 +11784,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -11738,7 +11797,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "sp-api", @@ -11750,7 +11809,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "futures", "log", @@ -11768,7 +11827,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -11783,7 +11842,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "parity-scale-codec", @@ -11801,7 +11860,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "merlin", @@ -11824,7 +11883,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "lazy_static", "parity-scale-codec", @@ -11843,7 +11902,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "finality-grandpa", "log", @@ -11861,7 +11920,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -11875,7 +11934,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -11888,7 +11947,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "base58", @@ -11932,7 +11991,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "blake2b_simd", "byteorder", @@ -11946,7 +12005,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro2", "quote", @@ -11957,7 +12016,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11966,7 +12025,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "proc-macro2", "quote", @@ -11976,7 +12035,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "environmental", "parity-scale-codec", @@ -11987,7 +12046,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -12002,7 +12061,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "bytes", "ed25519", @@ -12027,7 +12086,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "lazy_static", "sp-core", @@ -12038,7 +12097,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures", @@ -12055,7 +12114,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "thiserror", "zstd", @@ -12064,7 +12123,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -12082,7 +12141,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -12096,7 +12155,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "sp-api", "sp-core", @@ -12106,7 +12165,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "backtrace", "lazy_static", @@ -12116,7 +12175,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "rustc-hash", "serde", @@ -12126,7 +12185,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "either", "hash256-std-hasher", @@ -12149,7 +12208,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -12167,7 +12226,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "Inflector", "proc-macro-crate", @@ -12179,7 +12238,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -12193,7 +12252,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -12205,7 +12264,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "hash-db 0.16.0", "log", @@ -12225,12 +12284,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12243,7 +12302,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "futures-timer", @@ -12258,7 +12317,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "sp-std", @@ -12270,7 +12329,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "sp-api", "sp-runtime", @@ -12279,7 +12338,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "log", @@ -12295,7 +12354,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ahash 0.8.3", "hash-db 0.16.0", @@ -12318,7 +12377,7 @@ dependencies = [ [[package]] name = "sp-ver" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "log", @@ -12336,7 +12395,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12353,7 +12412,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -12364,7 +12423,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -12378,7 +12437,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "parity-scale-codec", "scale-info", @@ -12557,7 +12616,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "platforms 2.0.0", ] @@ -12565,7 +12624,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -12584,7 +12643,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "hyper", "log", @@ -12596,7 +12655,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "jsonrpsee", @@ -12609,7 +12668,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "jsonrpsee", "log", @@ -12628,7 +12687,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -12654,7 +12713,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "ansi_term", "build-helper", @@ -13298,7 +13357,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "async-trait", "clap", @@ -13511,7 +13570,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "ver-api" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" dependencies = [ "derive_more", "futures", @@ -14764,6 +14823,7 @@ dependencies = [ "sp-api", "sp-core", "sp-runtime", + "sp-std", ] [[package]] @@ -14842,14 +14902,14 @@ dependencies = [ [[patch.unused]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" [[patch.unused]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" [[patch.unused]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#afd05d5ed525572ed1b6d6a19aeac2465f552e1f" +source = "git+https://github.com/mangata-finance//substrate?branch=mangata-dev#462977d15a851a441fe542f68e06b286f059dbfe" diff --git a/Cargo.toml b/Cargo.toml index 85c53fb9e6..aeae1a639f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,12 @@ lto = true codegen-units = 1 [workspace] +resolver = "2" members = [ 'node', 'pallets/*', 'rpc/nonce', + 'runtime/common', 'runtime/mangata-kusama', 'runtime/mangata-rococo', 'runtime/integration-test', @@ -485,8 +487,6 @@ frame-support = { git = "https://github.com/mangata-finance//substrate", branch frame-support-procedural-tools-derive = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural-tools = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc-runtime-api = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-vesting-mangata = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-curve = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-fn = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } @@ -670,8 +670,6 @@ frame-support = { git = "https://github.com/mangata-finance//substrate", branch frame-support-procedural-tools-derive = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural-tools = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc-runtime-api = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-vesting-mangata = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-curve = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-fn = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } @@ -856,8 +854,6 @@ frame-support = { git = "https://github.com/mangata-finance//substrate", branch frame-support-procedural-tools-derive = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural-tools = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } frame-support-procedural = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc-runtime-api = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } -pallet-vesting-mangata-rpc = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-vesting-mangata = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-curve = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } pallet-staking-reward-fn = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } @@ -923,7 +919,7 @@ sp-npos-elections = { git = "https://github.com/mangata-finance//substrate", bra sp-authorship = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } sp-storage = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } sp-inherents = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } - sc-consensus-grandpa = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } +sc-consensus-grandpa = { git = "https://github.com/mangata-finance//substrate", branch = "mangata-dev" } # # patch generated by ./scripts/dev_manifest.sh @@ -1043,8 +1039,6 @@ sp-inherents = { git = "https://github.com/mangata-finance//substrate", branch = # frame-support-procedural-tools-derive = { path = "../substrate/frame/support/procedural/tools/derive" } # frame-support-procedural-tools = { path = "../substrate/frame/support/procedural/tools" } # frame-support-procedural = { path = "../substrate/frame/support/procedural" } -# pallet-vesting-mangata-rpc-runtime-api = { path = "../substrate/frame/vesting-mangata/rpc/runtime-api" } -# pallet-vesting-mangata-rpc = { path = "../substrate/frame/vesting-mangata/rpc" } # pallet-vesting-mangata = { path = "../substrate/frame/vesting-mangata" } # pallet-staking-reward-curve = { path = "../substrate/frame/staking/reward-curve" } # pallet-staking-reward-fn = { path = "../substrate/frame/staking/reward-fn" } @@ -1226,8 +1220,6 @@ sp-inherents = { git = "https://github.com/mangata-finance//substrate", branch = # frame-support-procedural-tools-derive = { path = "../substrate/frame/support/procedural/tools/derive" } # frame-support-procedural-tools = { path = "../substrate/frame/support/procedural/tools" } # frame-support-procedural = { path = "../substrate/frame/support/procedural" } -# pallet-vesting-mangata-rpc-runtime-api = { path = "../substrate/frame/vesting-mangata/rpc/runtime-api" } -# pallet-vesting-mangata-rpc = { path = "../substrate/frame/vesting-mangata/rpc" } # pallet-vesting-mangata = { path = "../substrate/frame/vesting-mangata" } # pallet-staking-reward-curve = { path = "../substrate/frame/staking/reward-curve" } # pallet-staking-reward-fn = { path = "../substrate/frame/staking/reward-fn" } @@ -1409,8 +1401,6 @@ sp-inherents = { git = "https://github.com/mangata-finance//substrate", branch = # frame-support-procedural-tools-derive = { path = "../substrate/frame/support/procedural/tools/derive" } # frame-support-procedural-tools = { path = "../substrate/frame/support/procedural/tools" } # frame-support-procedural = { path = "../substrate/frame/support/procedural" } -# pallet-vesting-mangata-rpc-runtime-api = { path = "../substrate/frame/vesting-mangata/rpc/runtime-api" } -# pallet-vesting-mangata-rpc = { path = "../substrate/frame/vesting-mangata/rpc" } # pallet-vesting-mangata = { path = "../substrate/frame/vesting-mangata" } # pallet-staking-reward-curve = { path = "../substrate/frame/staking/reward-curve" } # pallet-staking-reward-fn = { path = "../substrate/frame/staking/reward-fn" } diff --git a/README.md b/README.md index 293204f4cb..45d9889ff6 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,7 @@ ## Description -Reliable decentralized exchange (DEX) blockchain - interoperable with other blockchains using Polkadot. The exchange is using a consensus algorithm that solves MEV/frontrunning problems and makes all participants' access to trading opportunities equal. - -The design of the blockchain guarantees fixed-fees that provides greater control of trading costs and higher arbitrage opportunity. -Assets on the exchange will serve multiple purposes- at the first iteration, they are the block producer’s stake and exchange liquidity at the same time, and more comes later. +Mangata operates as a cross-chain liquidity protocol, facilitating seamless transactions between Ethereum and various other blockchains through a Multirollup Interchain Infrastructure. We leverage the power of ZK-rollup, a second-layer (L2) solution, to ensure universal connectivity with first-layer (L1) blockchains. Additionally, our decentralized exchange platform is designed to provide robust protection against Miner Extractable Value (MEV) and frontrunning attempts, thereby safeguarding the interests of our users. ## API @@ -40,6 +37,17 @@ Assets on the exchange will serve multiple purposes- at the first iteration, the build artifacts will be placed in `/docker-cargo/release` +### Run tests and generate code coverage report +Run unit tests only: +```bash +cargo test +``` +Run unit tests and generat code coverage report in html format: +```bash +cargo install cargo-tarpaulin +cargo tarpaulin --timeout 120 --workspace -e runtime-integration-test mangata-node common-runtime mangata-kusama-runtime mangata-rococo-runtime --exclude-files **/mock.rs **/weights.rs **/weights/* --out Html +``` + ### Generate docker image You can use `build-image.sh` script to build & generate docker image diff --git a/devops/dockerfiles/node/Dockerfile b/devops/dockerfiles/node/Dockerfile index 4b4ad4f471..d7bf627d9c 100644 --- a/devops/dockerfiles/node/Dockerfile +++ b/devops/dockerfiles/node/Dockerfile @@ -5,7 +5,7 @@ ARG BUILD_DIR=target/release WORKDIR /mangata COPY $BUILD_DIR/mangata-node /mangata/node -COPY $BUILD_DIR/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.compressed.wasm /mangata/ -COPY $BUILD_DIR/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm /mangata/ +COPY $BUILD_DIR/wbuild/mangata-*-runtime/mangata_*_runtime.compact.compressed.wasm /mangata/ +# COPY $BUILD_DIR/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm /mangata/ -ENTRYPOINT ["/mangata/node"] \ No newline at end of file +ENTRYPOINT ["/mangata/node"] diff --git a/devops/helmfiles/config/default.yaml b/devops/helmfiles/config/default.yaml index 37ac848266..fc282eb45c 100644 --- a/devops/helmfiles/config/default.yaml +++ b/devops/helmfiles/config/default.yaml @@ -1,8 +1,14 @@ -enableLocalRelaychain: false -enableParachainRegisterSidecar: false -storageSize: 100Gi -relaychainStorageSize: 100Gi -storageClass: regional-ssd +enableLocalRelaychain: true +enableParachainRegisterSidecar: true +enableServiceMonitorCollectors: false +storageSize: 5Gi +relaychainImage: parity/polkadot:v0.9.38 +relaychainStorageSize: 5Gi +relaychainBootnodeAddr: /dns/relaychain-alice/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp + +# Correspond to `pd-balanced` storage type in GCP +# Will delete volume on PVC resource deletion +storageClass: node-data-volume node01: isCollator: true @@ -19,7 +25,7 @@ node02: resources: requests: cpu: 200m - memory: 1Gi + memory: 500Mi limits: cpu: 1000m - memory: 2Gi + memory: 4Gi diff --git a/devops/helmfiles/config/dev.yaml b/devops/helmfiles/config/dev.yaml index 348c275192..3c722d16aa 100644 --- a/devops/helmfiles/config/dev.yaml +++ b/devops/helmfiles/config/dev.yaml @@ -1,13 +1,3 @@ -enableLocalRelaychain: true -enableParachainRegisterSidecar: true -storageSize: 200Gi -relaychainStorageSize: 200Gi -relaychainBootnodeAddr: /dns/relaychain-alice/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp - -resources: - requests: - cpu: '2.0' - memory: 8Gi - limits: - cpu: '2.0' - memory: 8Gi \ No newline at end of file +enableServiceMonitorCollectors: true +storageSize: 10Gi +relaychainStorageSize: 10Gi \ No newline at end of file diff --git a/devops/helmfiles/config/fungible.yaml b/devops/helmfiles/config/fungible.yaml index c9bf699fe9..b235d7f68f 100644 --- a/devops/helmfiles/config/fungible.yaml +++ b/devops/helmfiles/config/fungible.yaml @@ -1,6 +1,3 @@ -enableLocalRelaychain: true -enableParachainRegisterSidecar: true -relaychainBootnodeAddr: /dns/relaychain-alice/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp nodeChain: rococo-local node01: @@ -11,8 +8,8 @@ node02: resources: requests: - cpu: '2.0' - memory: 8Gi + cpu: 200m + memory: 500Mi limits: - cpu: '2.0' - memory: 8Gi + cpu: 1000m + memory: 4Gi diff --git a/devops/helmfiles/config/release.yaml b/devops/helmfiles/config/release.yaml index 3e7323aa16..c141631539 100644 --- a/devops/helmfiles/config/release.yaml +++ b/devops/helmfiles/config/release.yaml @@ -1,3 +1 @@ -enableLocalRelaychain: true -enableParachainRegisterSidecar: true -relaychainBootnodeAddr: /dns/relaychain-alice/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp \ No newline at end of file +# storageSize: 5Gi \ No newline at end of file diff --git a/devops/helmfiles/helmfile.yaml b/devops/helmfiles/helmfile.yaml index ba2f1e758a..970d97910a 100644 --- a/devops/helmfiles/helmfile.yaml +++ b/devops/helmfiles/helmfile.yaml @@ -1,9 +1,3 @@ -repositories: - - name: mangata-node - url: git+https://github.com/mangata-finance/helm-charts@charts?ref=node-v0.4.4 - - name: mangata-relaychain - url: git+https://github.com/mangata-finance/helm-charts@charts?ref=relaychain-testnet-v0.3.2 - environments: dev: values: @@ -17,6 +11,13 @@ environments: values: - ./config/default.yaml - ./config/release.yaml +--- +repositories: + - name: mangata-node + url: git+https://github.com/mangata-finance/helm-charts@charts?ref=node-v1.3.0 + - name: mangata-relaychain + url: git+https://github.com/mangata-finance/helm-charts@charts?ref=relaychain-testnet-v1.0.0 + helmDefaults: wait: true @@ -33,7 +34,8 @@ releases: chart: mangata-relaychain/relaychain-testnet values: - env: {{ requiredEnv "ENVIRONMENT" | quote }} - storageClass: regional-ssd + image: {{ .Values.relaychainImage }} + storageClass: node-data-volume storageSize: {{ .Values.relaychainStorageSize }} remoteCluster: true - name: node-01 diff --git a/devops/helmfiles/values.yaml.gotmpl b/devops/helmfiles/values.yaml.gotmpl index dba9005710..1112f539f6 100644 --- a/devops/helmfiles/values.yaml.gotmpl +++ b/devops/helmfiles/values.yaml.gotmpl @@ -1,17 +1,18 @@ +role: collator +remoteCluster: true environment: {{ requiredEnv "ENVIRONMENT" | quote }} image: tag: {{ requiredEnv "IMAGE_TAG" | quote }} -remoteCluster: true customChainspecUrl: {{ .Values | get "nodeCustomChainspecUrl" "" }} chain: {{ .Values | get "nodeChain" "rococo" }} storageClass: {{ .Values.storageClass }} storageSize: {{ .Values.storageSize }} -parachainRegisterSidecar: - enable: false relaychain: + image: {{ .Values.relaychainImage }} forceUseCustomChainspecPath: true storageSize: {{ .Values.relaychainStorageSize }} customChainspecUrl: {{ .Values | get "relaychainCustomChainspecUrl" "" }} bootnodeAddr: {{ .Values | get "relaychainBootnodeAddr" "" }} kubernetesVolumeSnapshot: {{ .Values | get "relaychainKubernetesVolumeSnapshot" "" }} resources: {{ toYaml .Values.resources | nindent 10 }} +enableServiceMonitorCollectors: {{ .Values.enableServiceMonitorCollectors | toYaml }} \ No newline at end of file diff --git a/launch/config.yml b/devops/parachain-launch/config.yml similarity index 94% rename from launch/config.yml rename to devops/parachain-launch/config.yml index 4f7c11bbb9..5f733fcd56 100644 --- a/launch/config.yml +++ b/devops/parachain-launch/config.yml @@ -24,9 +24,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: diff --git a/launch/kusama-fast-oak.yml b/devops/parachain-launch/kusama-fast-oak.yml similarity index 94% rename from launch/kusama-fast-oak.yml rename to devops/parachain-launch/kusama-fast-oak.yml index fff33bed91..f82aaf80a3 100644 --- a/launch/kusama-fast-oak.yml +++ b/devops/parachain-launch/kusama-fast-oak.yml @@ -16,7 +16,7 @@ relaychain: ] env: - RUST_LOG: parachain::candidate-backing=trace,parachain::candidate-selection=trace,parachain::pvf=trace,parachain::collator-protocol=trace,parachain::provisioner=trace + RUST_LOG: parachain::candidate-backing=trace,parachain::candidate-selection=trace,parachain::pvf=trace,parachain::collator-protocol=trace,parachain::provisioner=trace flags: - --rpc-methods=unsafe - --wasm-execution=compiled @@ -33,9 +33,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: diff --git a/launch/kusama-fast.yml b/devops/parachain-launch/kusama-fast.yml similarity index 94% rename from launch/kusama-fast.yml rename to devops/parachain-launch/kusama-fast.yml index 968c513499..75b22e27ad 100644 --- a/launch/kusama-fast.yml +++ b/devops/parachain-launch/kusama-fast.yml @@ -24,9 +24,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: diff --git a/launch/mangata-karura.yml b/devops/parachain-launch/mangata-karura.yml similarity index 96% rename from launch/mangata-karura.yml rename to devops/parachain-launch/mangata-karura.yml index 52e7c1c595..bfdd0dbcfa 100644 --- a/launch/mangata-karura.yml +++ b/devops/parachain-launch/mangata-karura.yml @@ -51,6 +51,7 @@ parachains: - --alice - flags: - --bob + - image: mangatasolutions/mangata-node:dev chain: base: rococo-local @@ -58,9 +59,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: diff --git a/launch/mangata-oak.yml b/devops/parachain-launch/mangata-oak.yml similarity index 93% rename from launch/mangata-oak.yml rename to devops/parachain-launch/mangata-oak.yml index ea6dc0d061..2d179c039a 100644 --- a/launch/mangata-oak.yml +++ b/devops/parachain-launch/mangata-oak.yml @@ -33,9 +33,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: @@ -62,8 +61,7 @@ parachains: - alice - bob sudo: alice - disablePallets: - - collatorSelection + skipCollatorSelection: true id: 2114 parachain: true flags: diff --git a/launch/multichain.yml b/devops/parachain-launch/multichain.yml similarity index 96% rename from launch/multichain.yml rename to devops/parachain-launch/multichain.yml index 7385443386..b8bb4f0e14 100644 --- a/launch/multichain.yml +++ b/devops/parachain-launch/multichain.yml @@ -37,9 +37,8 @@ parachains: - alice - bob sudo: alice - disablePallets: - - balances - - collatorSelection + skipCollatorSelection: true + skipBalances: true id: 2110 parachain: true flags: @@ -72,8 +71,7 @@ parachains: - alice - bob sudo: alice - disablePallets: - - collatorSelection + skipCollatorSelection: true id: 2114 parachain: true flags: diff --git a/devops/parachain-launch/mvr.yml b/devops/parachain-launch/mvr.yml new file mode 100644 index 0000000000..bc7fe5d163 --- /dev/null +++ b/devops/parachain-launch/mvr.yml @@ -0,0 +1,46 @@ +relaychain: + image: mangatasolutions/polkadot:v0.9.42-fast-runtime + chain: polkadot-local + runtimeGenesisConfig: + configuration: + config: + validation_upgrade_cooldown: 10 + validation_upgrade_delay: 10 + env: + RUST_LOG: parachain::candidate-backing=trace,parachain::candidate-selection=trace,parachain::pvf=trace,parachain::collator-protocol=trace,parachain::provisioner=trace + flags: + - --rpc-methods=unsafe + - --wasm-execution=compiled + - --execution=wasm + nodes: + - name: alice + - name: bob + +parachains: +- image: mangatasolutions/mangata-node:polkadot-mvr + chain: + base: polkadot-local + collators: + - alice + - bob + sudo: alice + skipBalances: true + id: 2110 + parachain: true + flags: + - --rpc-methods=unsafe + - --force-authoring + - --wasm-execution=compiled + - --execution=wasm + relaychainFlags: + - --wasm-execution=compiled + - --execution=wasm + env: + # RUST_LOG: info,block_builder=trace,block_shuffler=trace,runtime::ver=trace,txpool=trace,rpc::nonce=trace + RUST_LOG: info,block_builder=trace,rpc=debug,txpool=debug + volumePath: /mangata/data + nodes: + - flags: + - --alice + - flags: + - --bob diff --git a/docker-cargo.sh b/docker-cargo.sh index 4090b1a258..c7639f3936 100755 --- a/docker-cargo.sh +++ b/docker-cargo.sh @@ -1,5 +1,6 @@ #!/bin/bash -x REPO_ROOT=$(readlink -f $(dirname $(readlink -f $0))) +CODE_ROOT=${CODE_ROOT:-${REPO_ROOT}} OUTPUT_DIR=docker-cargo/ CARGO_HOME=${CARGO_HOME:-$HOME/.cargo} @@ -78,7 +79,7 @@ docker run \ --rm \ --name=${DOCKER_JOB_NAME} \ --user $DOCKER_USER \ - -v ${REPO_ROOT}:/code \ + -v ${CODE_ROOT}:/code \ ${DOCKER_MOUNT_CACHE_VOLUMES} \ ${DOCKER_RUN_EXTRA_ARGS} \ -e CARGO_TARGET_DIR="/code/${OUTPUT_DIR}" \ diff --git a/launch/.editorconfig b/launch/.editorconfig deleted file mode 100644 index c5dc963bcd..0000000000 --- a/launch/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -[*] -indent_style=space -indent_size=2 -tab_width=2 -end_of_line=lf -charset=utf-8 -trim_trailing_whitespace=true -max_line_length=120 -insert_final_newline=true -quote_type=single diff --git a/launch/.gitignore b/launch/.gitignore deleted file mode 100644 index 0b8af75b11..0000000000 --- a/launch/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ - -# Created by https://www.toptal.com/developers/gitignore/api/node -# Edit at https://www.toptal.com/developers/gitignore?templates=node - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test -.env*.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Storybook build outputs -.out -.storybook-out -storybook-static - -# rollup.js default build output -dist/ - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# Temporary folders -tmp/ -temp/ - -# End of https://www.toptal.com/developers/gitignore/api/node - -output/ diff --git a/launch/README.md b/launch/README.md deleted file mode 100644 index aa9bd7f97a..0000000000 --- a/launch/README.md +++ /dev/null @@ -1,26 +0,0 @@ -## Description -Provides an easy way to set up a local chain based on .yml configs. -For the Mangata nodes we are currently using the dev Docker image, which needs to be built locally. -We rely on the `@open-web3/parachain-launch` tooling, with slight modifications specific to our chain setup. -In case we need to extend the functionality of the tooling, the code resides in `https://github.com/mangata-finance/parachain-launch`. - -## Run -build the mangata node & create image -```shell -export SKIP_BUILD=1 -./docker-cargo.sh build --release --features=mangata-rococo -scripts/build-image.sh - -# cd/open new terminal in mangata-node/launch -cd launch -# install the deps and compile forked 'parachain-launch' -yarn install -# for relay + mangata -yarn gen -# for relay + mangata + karura or other custom -yarn gen-karura -# start nodes -yarn up -# stop nodes -yarn down -``` \ No newline at end of file diff --git a/launch/package.json b/launch/package.json deleted file mode 100644 index ac9f27740f..0000000000 --- a/launch/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "mangata-launch", - "version": "1.0.1", - "main": "", - "license": "GPL-3.0", - "scripts": { - "rm": "rm -Rf output", - "gen": "yarn rm && parachain-launch generate", - "gen-karura": "yarn rm -Rf output && parachain-launch generate --config=karura-mangata.yml", - "gen-kusama-fast": "yarn rm -Rf output && parachain-launch generate --config=kusama-fast.yml", - "up": "docker-compose -f output/docker-compose.yml up -d --build", - "logs-para": "docker-compose -f output/docker-compose.yml logs parachain-2110-1 parachain-2110-0", - "logs-para0": "docker-compose -f output/docker-compose.yml logs -f parachain-2110-0", - "logs-para1": "docker-compose -f output/docker-compose.yml logs -f parachain-2110-1", - "logs-relay": "docker-compose -f output/docker-compose.yml logs -f relaychain-alice relaychain-bob", - "logs-relay-alice": "docker-compose -f output/docker-compose.yml logs -f relaychain-alice", - "logs-relay-bob": "docker-compose -f output/docker-compose.yml logs -f relaychain-bob", - "stop": "docker-compose -f output/docker-compose.yml stop", - "down": "docker-compose -f output/docker-compose.yml down -v" - }, - "dependencies": { - "parachain-launch": "mangata-finance/parachain-launch#mangata" - } -} diff --git a/launch/yarn.lock b/launch/yarn.lock deleted file mode 100644 index f5b0192d5f..0000000000 --- a/launch/yarn.lock +++ /dev/null @@ -1,926 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/runtime@^7.17.8": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@noble/hashes@1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz" - integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== - -"@noble/secp256k1@1.5.5": - version "1.5.5" - resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz" - integrity sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ== - -"@polkadot/api-augment@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.15.1.tgz" - integrity sha512-7csQLS6zuYuGq7W1EkTBz1ZmxyRvx/Qpz7E7zPSwxmY8Whb7Yn2effU9XF0eCcRpyfSW8LodF8wMmLxGYs1OaQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/api-base" "7.15.1" - "@polkadot/rpc-augment" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-augment" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/util" "^8.7.1" - -"@polkadot/api-base@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.15.1.tgz" - integrity sha512-UlhLdljJPDwGpm5FxOjvJNFTxXMRFaMuVNx6EklbuetbBEJ/Amihhtj0EJRodxQwtZ4ZtPKYKt+g+Dn7OJJh4g== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/rpc-core" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/util" "^8.7.1" - rxjs "^7.5.5" - -"@polkadot/api-derive@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.15.1.tgz" - integrity sha512-CsOQppksQBaa34L1fWRzmfQQpoEBwfH0yTTQxgj3h7rFYGVPxEKGeFjo1+IgI2vXXvOO73Z8E4H/MnbxvKrs1Q== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/api" "7.15.1" - "@polkadot/api-augment" "7.15.1" - "@polkadot/api-base" "7.15.1" - "@polkadot/rpc-core" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/util" "^8.7.1" - "@polkadot/util-crypto" "^8.7.1" - rxjs "^7.5.5" - -"@polkadot/api@7.15.1", "@polkadot/api@^7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/api/-/api-7.15.1.tgz" - integrity sha512-z0z6+k8+R9ixRMWzfsYrNDnqSV5zHKmyhTCL0I7+1I081V18MJTCFUKubrh0t1gD0/FCt3U9Ibvr4IbtukYLrQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/api-augment" "7.15.1" - "@polkadot/api-base" "7.15.1" - "@polkadot/api-derive" "7.15.1" - "@polkadot/keyring" "^8.7.1" - "@polkadot/rpc-augment" "7.15.1" - "@polkadot/rpc-core" "7.15.1" - "@polkadot/rpc-provider" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-augment" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/types-create" "7.15.1" - "@polkadot/types-known" "7.15.1" - "@polkadot/util" "^8.7.1" - "@polkadot/util-crypto" "^8.7.1" - eventemitter3 "^4.0.7" - rxjs "^7.5.5" - -"@polkadot/keyring@^8.4.1", "@polkadot/keyring@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/keyring/-/keyring-8.7.1.tgz" - integrity sha512-t6ZgQVC+nQT7XwbWtEhkDpiAzxKVJw8Xd/gWdww6xIrawHu7jo3SGB4QNdPgkf8TvDHYAAJiupzVQYAlOIq3GA== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/util" "8.7.1" - "@polkadot/util-crypto" "8.7.1" - -"@polkadot/networks@8.7.1", "@polkadot/networks@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/networks/-/networks-8.7.1.tgz" - integrity sha512-8xAmhDW0ry5EKcEjp6VTuwoTm0DdDo/zHsmx88P6sVL87gupuFsL+B6TrsYLl8GcaqxujwrOlKB+CKTUg7qFKg== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/util" "8.7.1" - "@substrate/ss58-registry" "^1.17.0" - -"@polkadot/rpc-augment@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.15.1.tgz" - integrity sha512-sK0+mphN7nGz/eNPsshVi0qd0+N0Pqxuebwc1YkUGP0f9EkDxzSGp6UjGcSwWVaAtk9WZZ1MpK1Jwb/2GrKV7Q== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/rpc-core" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/util" "^8.7.1" - -"@polkadot/rpc-core@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.15.1.tgz" - integrity sha512-4Sb0e0PWmarCOizzxQAE1NQSr5z0n+hdkrq3+aPohGu9Rh4PodG+OWeIBy7Ov/3GgdhNQyBLG+RiVtliXecM3g== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/rpc-augment" "7.15.1" - "@polkadot/rpc-provider" "7.15.1" - "@polkadot/types" "7.15.1" - "@polkadot/util" "^8.7.1" - rxjs "^7.5.5" - -"@polkadot/rpc-provider@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.15.1.tgz" - integrity sha512-n0RWfSaD/r90JXeJkKry1aGZwJeBUUiMpXUQ9Uvp6DYBbYEDs0fKtWLpdT3PdFrMbe5y3kwQmNLxwe6iF4+mzg== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/keyring" "^8.7.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-support" "7.15.1" - "@polkadot/util" "^8.7.1" - "@polkadot/util-crypto" "^8.7.1" - "@polkadot/x-fetch" "^8.7.1" - "@polkadot/x-global" "^8.7.1" - "@polkadot/x-ws" "^8.7.1" - "@substrate/connect" "0.7.0-alpha.0" - eventemitter3 "^4.0.7" - mock-socket "^9.1.2" - nock "^13.2.4" - -"@polkadot/types-augment@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.15.1.tgz" - integrity sha512-aqm7xT/66TCna0I2utpIekoquKo0K5pnkA/7WDzZ6gyD8he2h0IXfe8xWjVmuyhjxrT/C/7X1aUF2Z0xlOCwzQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/types" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/util" "^8.7.1" - -"@polkadot/types-codec@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.15.1.tgz" - integrity sha512-nI11dT7FGaeDd/fKPD8iJRFGhosOJoyjhZ0gLFFDlKCaD3AcGBRTTY8HFJpP/5QXXhZzfZsD93fVKrosnegU0Q== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/util" "^8.7.1" - -"@polkadot/types-create@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.15.1.tgz" - integrity sha512-+HiaHn7XOwP0kv/rVdORlVkNuMoxuvt+jd67A/CeEreJiXqRLu+S61Mdk7wi6719PTaOal1hTDFfyGrtUd8FSQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/types-codec" "7.15.1" - "@polkadot/util" "^8.7.1" - -"@polkadot/types-known@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.15.1.tgz" - integrity sha512-LMcNP0CxT84DqAKV62/qDeeIVIJCR5yzE9b+9AsYhyfhE4apwxjrThqZA7K0CF56bOdQJSexAerYB/jwk2IijA== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/networks" "^8.7.1" - "@polkadot/types" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/types-create" "7.15.1" - "@polkadot/util" "^8.7.1" - -"@polkadot/types-support@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.15.1.tgz" - integrity sha512-FIK251ffVo+NaUXLlaJeB5OvT7idDd3uxaoBM6IwsS87rzt2CcWMyCbu0uX89AHZUhSviVx7xaBxfkGEqMePWA== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/util" "^8.7.1" - -"@polkadot/types@7.15.1": - version "7.15.1" - resolved "https://registry.npmjs.org/@polkadot/types/-/types-7.15.1.tgz" - integrity sha512-KawZVS+eLR1D6O7c/P5cSUwr6biM9Qd2KwKtJIO8l1Mrxp7r+y2tQnXSSXVAd6XPdb3wVMhnIID+NW3W99TAnQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/keyring" "^8.7.1" - "@polkadot/types-augment" "7.15.1" - "@polkadot/types-codec" "7.15.1" - "@polkadot/types-create" "7.15.1" - "@polkadot/util" "^8.7.1" - "@polkadot/util-crypto" "^8.7.1" - rxjs "^7.5.5" - -"@polkadot/util-crypto@8.7.1", "@polkadot/util-crypto@^8.4.1", "@polkadot/util-crypto@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-8.7.1.tgz" - integrity sha512-TaSuJ2aNrB5sYK7YXszkEv24nYJKRFqjF2OrggoMg6uYxUAECvTkldFnhtgeizMweRMxJIBu6bMHlSIutbWgjw== - dependencies: - "@babel/runtime" "^7.17.8" - "@noble/hashes" "1.0.0" - "@noble/secp256k1" "1.5.5" - "@polkadot/networks" "8.7.1" - "@polkadot/util" "8.7.1" - "@polkadot/wasm-crypto" "^5.1.1" - "@polkadot/x-bigint" "8.7.1" - "@polkadot/x-randomvalues" "8.7.1" - "@scure/base" "1.0.0" - ed2curve "^0.3.0" - tweetnacl "^1.0.3" - -"@polkadot/util@8.7.1", "@polkadot/util@^8.4.1", "@polkadot/util@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/util/-/util-8.7.1.tgz" - integrity sha512-XjY1bTo7V6OvOCe4yn8H2vifeuBciCy0gq0k5P1tlGUQLI/Yt0hvDmxcA0FEPtqg8CL+rYRG7WXGPVNjkrNvyQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-bigint" "8.7.1" - "@polkadot/x-global" "8.7.1" - "@polkadot/x-textdecoder" "8.7.1" - "@polkadot/x-textencoder" "8.7.1" - "@types/bn.js" "^5.1.0" - bn.js "^5.2.0" - ip-regex "^4.3.0" - -"@polkadot/wasm-crypto-asmjs@^5.1.1": - version "5.1.1" - resolved "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-5.1.1.tgz" - integrity sha512-1WBwc2G3pZMKW1T01uXzKE30Sg22MXmF3RbbZiWWk3H2d/Er4jZQRpjumxO5YGWan+xOb7HQQdwnrUnrPgbDhg== - dependencies: - "@babel/runtime" "^7.17.8" - -"@polkadot/wasm-crypto-wasm@^5.1.1": - version "5.1.1" - resolved "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-5.1.1.tgz" - integrity sha512-F9PZ30J2S8vUNl2oY7Myow5Xsx5z5uNVpnNlJwlmY8IXBvyucvyQ4HSdhJsrbs4W1BfFc0mHghxgp0FbBCnf/Q== - dependencies: - "@babel/runtime" "^7.17.8" - -"@polkadot/wasm-crypto@^5.1.1": - version "5.1.1" - resolved "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-5.1.1.tgz" - integrity sha512-JCcAVfH8DhYuEyd4oX1ouByxhou0TvpErKn8kHjtzt7+tRoFi0nzWlmK4z49vszsV3JJgXxV81i10C0BYlwTcQ== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/wasm-crypto-asmjs" "^5.1.1" - "@polkadot/wasm-crypto-wasm" "^5.1.1" - -"@polkadot/x-bigint@8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.7.1.tgz" - integrity sha512-ClkhgdB/KqcAKk3zA6Qw8wBL6Wz67pYTPkrAtImpvoPJmR+l4RARauv+MH34JXMUNlNb3aUwqN6lq2Z1zN+mJg== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - -"@polkadot/x-fetch@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-8.7.1.tgz" - integrity sha512-ygNparcalYFGbspXtdtZOHvNXZBkNgmNO+um9C0JYq74K5OY9/be93uyfJKJ8JcRJtOqBfVDsJpbiRkuJ1PRfg== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - "@types/node-fetch" "^2.6.1" - node-fetch "^2.6.7" - -"@polkadot/x-global@8.7.1", "@polkadot/x-global@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.7.1.tgz" - integrity sha512-WOgUor16IihgNVdiTVGAWksYLUAlqjmODmIK1cuWrLOZtV1VBomWcb3obkO9sh5P6iWziAvCB/i+L0vnTN9ZCA== - dependencies: - "@babel/runtime" "^7.17.8" - -"@polkadot/x-randomvalues@8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-8.7.1.tgz" - integrity sha512-njt17MlfN6yNyNEti7fL12lr5qM6A1aSGkWKVuqzc7XwSBesifJuW4km5u6r2gwhXjH2eHDv9SoQ7WXu8vrrkg== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - -"@polkadot/x-textdecoder@8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-8.7.1.tgz" - integrity sha512-ia0Ie2zi4VdQdNVD2GE2FZzBMfX//hEL4w546RMJfZM2LqDS674LofHmcyrsv5zscLnnRyCxZC1+J2dt+6MDIA== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - -"@polkadot/x-textencoder@8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-8.7.1.tgz" - integrity sha512-XDO0A27Xy+eJCKSxENroB8Dcnl+UclGG4ZBei+P/BqZ9rsjskUyd2Vsl6peMXAcsxwOE7g0uTvujoGM8jpKOXw== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - -"@polkadot/x-ws@^8.7.1": - version "8.7.1" - resolved "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-8.7.1.tgz" - integrity sha512-Mt0tcNzGXyKnN3DQ06alkv+JLtTfXWu6zSypFrrKHSQe3u79xMQ1nSicmpT3gWLhIa8YF+8CYJXMrqaXgCnDhw== - dependencies: - "@babel/runtime" "^7.17.8" - "@polkadot/x-global" "8.7.1" - "@types/websocket" "^1.0.5" - websocket "^1.0.34" - -"@scure/base@1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz" - integrity sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA== - -"@substrate/connect-extension-protocol@^1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.0.tgz" - integrity sha512-nFVuKdp71hMd/MGlllAOh+a2hAqt8m6J2G0aSsS/RcALZexxF9jodbFc62ni8RDtJboeOfXAHhenYOANvJKPIg== - -"@substrate/connect@0.7.0-alpha.0": - version "0.7.0-alpha.0" - resolved "https://registry.npmjs.org/@substrate/connect/-/connect-0.7.0-alpha.0.tgz" - integrity sha512-fvO7w++M8R95R/pGJFW9+cWOt8OYnnTfgswxtlPqSgzqX4tta8xcNQ51crC72FcL5agwSGkA1gc2/+eyTj7O8A== - dependencies: - "@substrate/connect-extension-protocol" "^1.0.0" - "@substrate/smoldot-light" "0.6.8" - eventemitter3 "^4.0.7" - -"@substrate/smoldot-light@0.6.8": - version "0.6.8" - resolved "https://registry.npmjs.org/@substrate/smoldot-light/-/smoldot-light-0.6.8.tgz" - integrity sha512-9lVwbG6wrtss0sd6013BJGe4WN4taujsGG49pwyt1Lj36USeL2Sb164TTUxmZF/g2NQEqDPwPROBdekQ2gFmgg== - dependencies: - buffer "^6.0.1" - pako "^2.0.4" - websocket "^1.0.32" - -"@substrate/ss58-registry@^1.17.0": - version "1.23.0" - resolved "https://registry.npmjs.org/@substrate/ss58-registry/-/ss58-registry-1.23.0.tgz" - integrity sha512-LuQje7n48GXSsp1aGI6UEmNVtlh7OzQ6CN1Hd9VGUrshADwMB0lRZ5bxnffmqDR4vVugI7h0NN0AONhIW1eHGg== - -"@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - -"@types/node-fetch@^2.6.1": - version "2.6.2" - resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz" - integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "18.0.0" - resolved "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz" - integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== - -"@types/websocket@^1.0.5": - version "1.0.5" - resolved "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz" - integrity sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ== - dependencies: - "@types/node" "*" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bn.js@^5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer@^6.0.1: - version "6.0.3" - resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -bufferutil@^4.0.1: - version "4.0.6" - resolved "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz" - integrity sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw== - dependencies: - node-gyp-build "^4.3.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -debug@^2.2.0: - version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.1.0: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -ed2curve@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/ed2curve/-/ed2curve-0.3.0.tgz" - integrity sha512-8w2fmmq3hv9rCrcI7g9hms2pMunQr1JINfcjwR9tAyZqhtyaMN991lF/ZfHfr5tzZQ8c7y7aBgZbjfbd0fjFwQ== - dependencies: - tweetnacl "1.x.x" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -es5-ext@^0.10.35, es5-ext@^0.10.50: - version "0.10.61" - resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz" - integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - next-tick "^1.1.0" - -es6-iterator@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz" - integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@^3.1.3: - version "3.1.3" - resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -ext@^1.1.2: - version "1.6.0" - resolved "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.0" - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -glob@^7.0.0: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -ip-regex@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz" - integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== - -is-core-module@^2.9.0: - version "2.9.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== - dependencies: - has "^1.0.3" - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -mock-socket@^9.1.2: - version "9.1.5" - resolved "https://registry.npmjs.org/mock-socket/-/mock-socket-9.1.5.tgz" - integrity sha512-3DeNIcsQixWHHKk6NdoBhWI4t1VMj5/HzfnI1rE/pLl5qKx7+gd4DNA07ehTaZ6MoUU053si6Hd+YtiM/tQZfg== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -next-tick@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" - integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== - -nock@^13.2.4: - version "13.2.7" - resolved "https://registry.npmjs.org/nock/-/nock-13.2.7.tgz" - integrity sha512-R6NUw7RIPtKwgK7jskuKoEi4VFMqIHtV2Uu9K/Uegc4TA5cqe+oNMYslZcUmnVNQCTG6wcSqUBaGTDd7sq5srg== - dependencies: - debug "^4.1.0" - json-stringify-safe "^5.0.1" - lodash "^4.17.21" - propagate "^2.0.0" - -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -node-gyp-build@^4.3.0: - version "4.4.0" - resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz" - integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -pako@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz" - integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== - -parachain-launch@mangata-finance/parachain-launch#mangata: - version "1.2.0" - resolved "git+https://git@github.com/mangata-finance/parachain-launch.git#c02ead90ca484485ee64c9b5cfe6aff47b2cf41b" - dependencies: - "@polkadot/api" "^7.15.1" - "@polkadot/keyring" "^8.4.1" - "@polkadot/util" "^8.4.1" - "@polkadot/util-crypto" "^8.4.1" - lodash "^4.17.21" - readline-sync "^1.4.10" - shelljs "^0.8.5" - yaml "^1.10.2" - yargs "^17.4.0" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -propagate@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz" - integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== - -readline-sync@^1.4.10: - version "1.4.10" - resolved "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz" - integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" - integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== - dependencies: - resolve "^1.1.6" - -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -resolve@^1.1.6: - version "1.22.1" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -rxjs@^7.5.5: - version "7.5.5" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz" - integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== - dependencies: - tslib "^2.1.0" - -shelljs@^0.8.5: - version "0.8.5" - resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" - integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - -tslib@^2.1.0: - version "2.4.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - -tweetnacl@1.x.x, tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.5.0: - version "2.6.0" - resolved "https://registry.npmjs.org/type/-/type-2.6.0.tgz" - integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -utf-8-validate@^5.0.2: - version "5.0.9" - resolved "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz" - integrity sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q== - dependencies: - node-gyp-build "^4.3.0" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -websocket@^1.0.32, websocket@^1.0.34: - version "1.0.34" - resolved "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz" - integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yaeti@^0.0.6: - version "0.0.6" - resolved "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz" - integrity sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug== - -yaml@^1.10.2: - version "1.10.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== - -yargs@^17.4.0: - version "17.5.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz" - integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.0.0" diff --git a/mvr/.dockerignore b/mvr/.dockerignore new file mode 100644 index 0000000000..3d04e62c4d --- /dev/null +++ b/mvr/.dockerignore @@ -0,0 +1,41 @@ +.git +.github +target +devops +!devops/dockerfiles/parachain-registrator/src +launch +scripts +workflows +Makefile +Tiltfile +**/target/ +**/*.txt +**/*.md +./docker-cargo +!/target/release/polkadot-collator +!/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.compressed.wasm +!/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.compressed.wasm.md5 +!/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.wasm +!/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.compact.wasm.md5 +!/docker-cargo/release/wbuild/mangata-polkadot-runtime/mangata_polkadot_runtime.wasm +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm.md5 +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm.md5 +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.wasm +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.wasm.md5 +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm +!/docker-cargo/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm.md5 +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.compressed.wasm +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.compressed.wasm.md5 +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.wasm +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.wasm.md5 +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm +!/docker-cargo/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm.md5 + +!/docker-cargo/release/mangata-node + +!target/release/mangata-node +!target/release/wbuild/mangata* + +# dotfiles in the repo root +/.* diff --git a/mvr/.editorconfig b/mvr/.editorconfig new file mode 100644 index 0000000000..e8ff2027ca --- /dev/null +++ b/mvr/.editorconfig @@ -0,0 +1,29 @@ +root = true +[*] +indent_style=tab +indent_size=tab +tab_width=4 +end_of_line=lf +charset=utf-8 +trim_trailing_whitespace=true +max_line_length=100 +insert_final_newline=true + +[*.yml] +indent_style=space +indent_size=2 +tab_width=8 +end_of_line=lf + +[*.sh] +indent_style=space +indent_size=4 +tab_width=8 +end_of_line=lf + +[*.json] +indent_style=space +indent_size=2 +tab_width=8 +end_of_line=lf + diff --git a/mvr/.github/workflows/test-code.yml b/mvr/.github/workflows/test-code.yml new file mode 100644 index 0000000000..cb641ed462 --- /dev/null +++ b/mvr/.github/workflows/test-code.yml @@ -0,0 +1,49 @@ +name: Test Code + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + test-code: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + + # Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo + - name: Cache cargo registry + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt, clippy + target: wasm32-unknown-unknown + override: true + default: true + + # Enable this for clippy linting. + # - name: Check and Lint Code + # run: cargo +nightly clippy -- -D warnings + + - name: Check Code + run: cargo check + + - name: Test Code + run: cargo test diff --git a/mvr/.gitignore b/mvr/.gitignore new file mode 100644 index 0000000000..9416f4d0b3 --- /dev/null +++ b/mvr/.gitignore @@ -0,0 +1,18 @@ +# Cargo compiled files and executables +**/target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# Local chain databases (default location) +**/chains/ + +# The cache for chain data in container +.local + +# The cache for docker container dependency +/.cargo/config + +.DS_Store +.idea +.vscode diff --git a/mvr/.rustfmt.toml b/mvr/.rustfmt.toml new file mode 100644 index 0000000000..3018614bb1 --- /dev/null +++ b/mvr/.rustfmt.toml @@ -0,0 +1,23 @@ +# Basic +hard_tabs = true +max_width = 100 +use_small_heuristics = "Max" + +# Imports +imports_granularity = "Crate" +reorder_imports = true + +# Consistency +newline_style = "Unix" + +# Misc +binop_separator = "Back" +chain_width = 80 +match_arm_blocks = false +match_arm_leading_pipes = "Preserve" +match_block_trailing_comma = true +reorder_impl_items = false +spaces_around_ranges = false +trailing_comma = "Vertical" +trailing_semicolon = false +use_field_init_shorthand = true diff --git a/mvr/Cargo.lock b/mvr/Cargo.lock new file mode 100644 index 0000000000..c015ff75e7 --- /dev/null +++ b/mvr/Cargo.lock @@ -0,0 +1,13927 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli 0.26.2", +] + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.2", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aes" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +dependencies = [ + "aead 0.5.2", + "aes 0.8.2", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.9", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.9", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "always-assert" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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 = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "array-bytes" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" + +[[package]] +name = "array-bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "asn1-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.20", +] + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.20", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "asn1_der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" + +[[package]] +name = "assert_matches" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.19", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.9", +] + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line 0.19.0", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.6.2", + "object 0.30.3", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "binary-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "hash-db", + "log", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.64.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 1.0.109", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq", +] + +[[package]] +name = "blake2s_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.6", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding 0.2.1", + "cipher 0.2.5", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "bounded-collections" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3888522b497857eb606bf51695988dba7096941822c1bcf676e3a929a9ae7a0" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "bounded-vec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" +dependencies = [ + "thiserror", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bstr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.17", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "ccm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" +dependencies = [ + "aead 0.3.2", + "cipher 0.2.5", + "subtle", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chacha20" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +dependencies = [ + "aead 0.4.3", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cid" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +dependencies = [ + "core2", + "multibase", + "multihash 0.16.3", + "serde", + "unsigned-varint", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "clap_lex" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" + +[[package]] +name = "coarsetime" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +dependencies = [ + "libc", + "once_cell", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color-print" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2a5e6504ed8648554968650feecea00557a3476bc040d0ffc33080e66b646d0" +dependencies = [ + "color-print-proc-macro", +] + +[[package]] +name = "color-print-proc-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51beaa537d73d2d1ff34ee70bc095f170420ab2ec5d687ecd3ec2b0d092514b" +dependencies = [ + "nom", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" +dependencies = [ + "strum", + "strum_macros", + "unicode-width", +] + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" + +[[package]] +name = "constant_time_eq" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpu-time" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +dependencies = [ + "arrayvec 0.7.2", + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "cranelift-isle", + "gimli 0.26.2", + "hashbrown 0.12.3", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" + +[[package]] +name = "cranelift-entity" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" + +[[package]] +name = "cranelift-native" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.8.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "cumulus-client-cli" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "clap", + "parity-scale-codec", + "sc-chain-spec", + "sc-cli", + "sc-service", + "sp-core", + "sp-runtime", + "url", +] + +[[package]] +name = "cumulus-client-collator" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-primitives-core", + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-consensus", + "sp-core", + "sp-runtime", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-aura" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-client-consensus-common", + "cumulus-primitives-core", + "futures", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-common" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "dyn-clone", + "futures", + "log", + "parity-scale-codec", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "schnellru", + "sp-blockchain", + "sp-consensus", + "sp-runtime", + "sp-trie", + "tracing", +] + +[[package]] +name = "cumulus-client-network" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-parachain", + "polkadot-primitives", + "sc-client-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "tracing", +] + +[[package]] +name = "cumulus-client-pov-recovery" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "rand 0.8.5", + "sc-client-api", + "sc-consensus", + "sp-consensus", + "sp-maybe-compressed-blob", + "sp-runtime", + "tracing", +] + +[[package]] +name = "cumulus-client-service" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "cumulus-client-cli", + "cumulus-client-collator", + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-relay-chain-inprocess-interface", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", + "futures", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-transaction-pool", +] + +[[package]] +name = "cumulus-pallet-aura-ext" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "frame-support", + "frame-system", + "pallet-aura", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-dmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "cumulus-pallet-parachain-system" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "bytes", + "cumulus-pallet-parachain-system-proc-macro", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "polkadot-parachain", + "scale-info", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "xcm", +] + +[[package]] +name = "cumulus-pallet-parachain-system-proc-macro" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "cumulus-pallet-session-benchmarking" +version = "3.0.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-xcm" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "cumulus-pallet-xcmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "polkadot-runtime-common", + "rand_chacha 0.3.1", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "cumulus-primitives-core" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-primitives", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", + "sp-trie", + "xcm", +] + +[[package]] +name = "cumulus-primitives-parachain-inherent" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "parity-scale-codec", + "sc-client-api", + "scale-info", + "sp-api", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "tracing", +] + +[[package]] +name = "cumulus-primitives-timestamp" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "cumulus-primitives-core", + "futures", + "parity-scale-codec", + "sp-inherents", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "cumulus-primitives-utility" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "log", + "parity-scale-codec", + "polkadot-runtime-common", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "cumulus-relay-chain-inprocess-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "polkadot-cli", + "polkadot-client", + "polkadot-service", + "sc-cli", + "sc-client-api", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sp-api", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "cumulus-relay-chain-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "futures", + "jsonrpsee-core", + "parity-scale-codec", + "polkadot-overseer", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "cumulus-relay-chain-minimal-node" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "array-bytes 6.1.0", + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-rpc-interface", + "futures", + "lru 0.9.0", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-core-primitives", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-authority-discovery", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-service", + "sc-tracing", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-runtime", + "tokio", + "tracing", +] + +[[package]] +name = "cumulus-relay-chain-rpc-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "jsonrpsee", + "lru 0.9.0", + "parity-scale-codec", + "polkadot-overseer", + "sc-client-api", + "sc-rpc-api", + "sc-service", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-core", + "sp-state-machine", + "sp-storage", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "cumulus-test-relay-sproof-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "cumulus-primitives-core", + "parity-scale-codec", + "polkadot-primitives", + "sp-runtime", + "sp-state-machine", + "sp-std", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +dependencies = [ + "cfg-if", + "fiat-crypto", + "packed_simd_2", + "platforms 3.0.2", + "subtle", + "zeroize", +] + +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.15", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "data-encoding" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" + +[[package]] +name = "data-encoding-macro" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e58dffcdcc8ee7b22f0c1f71a69243d7c2d9ad87b5a14361f2424a1565c219" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +dependencies = [ + "asn1-rs 0.3.1", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dtoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d09067bfacaa79114679b279d7f5885b53295b1e2cfb4e79c8e4bd3d633169" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dyn-clone" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a48e5d537b8a30c0b023116d981b16334be1485af7ca68db3a2b7024cbc957fd" +dependencies = [ + "der 0.7.5", + "digest 0.10.6", + "elliptic-curve 0.13.4", + "rfc6979 0.4.0", + "signature 2.1.0", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.6", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", + "hkdf", + "pem-rfc7468", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c71eaa367f2e5d556414a8eea812bc62985c879748d6403edabd9cb03f16e7" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.2", + "digest 0.10.6", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.2", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enumflags2" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "enumn" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures", +] + +[[package]] +name = "expander" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +dependencies = [ + "blake3", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", +] + +[[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 = "expander" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fatality" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +dependencies = [ + "fatality-proc-macro", + "thiserror", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +dependencies = [ + "expander 0.0.4", + "indexmap", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "fdlimit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +dependencies = [ + "libc", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + +[[package]] +name = "file-per-thread-logger" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +dependencies = [ + "env_logger 0.10.0", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "windows-sys 0.48.0", +] + +[[package]] +name = "finality-grandpa" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" +dependencies = [ + "either", + "futures", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "scale-info", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "libz-sys", + "miniz_oxide 0.7.1", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fork-tree" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "frame-support-procedural", + "frame-system", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "static_assertions", +] + +[[package]] +name = "frame-benchmarking-cli" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "Inflector", + "array-bytes 4.2.0", + "chrono", + "clap", + "comfy-table", + "frame-benchmarking", + "frame-support", + "frame-system", + "gethostname", + "handlebars", + "itertools", + "lazy_static", + "linked-hash-map", + "log", + "parity-scale-codec", + "rand 0.8.5", + "rand_pcg", + "sc-block-builder", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "thiserror", + "thousands", +] + +[[package]] +name = "frame-election-provider-solution-type" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "frame-election-provider-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-executive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "frame-try-runtime", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "frame-metadata" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-remote-externalities" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-recursion", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "substrate-rpc-client", + "tokio", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "bitflags", + "environmental", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "frame-support-procedural-tools", + "itertools", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", + "sp-weights", +] + +[[package]] +name = "frame-system-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-system-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fs4" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f5b6908aecca5812a4569056285e58c666588c9573ee59765bf1d3692699e2" +dependencies = [ + "rustix 0.37.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.9", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls 0.20.8", + "webpki 0.22.0", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite 0.2.9", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.6.0", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +dependencies = [ + "aho-corasick 0.7.20", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "handlebars" +version = "4.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite 0.2.9", +] + +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite 0.2.9", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.20.8", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki-roots", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows 0.48.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "if-watch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "tokio", + "windows 0.34.0", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "interceptor" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand 0.8.5", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + +[[package]] +name = "ipconfig" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +dependencies = [ + "socket2", + "widestring", + "winapi", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix 0.37.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "jsonrpsee-ws-client", + "tracing", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +dependencies = [ + "anyhow", + "arrayvec 0.7.2", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "globset", + "hyper", + "jsonrpsee-types", + "parking_lot 0.12.1", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +dependencies = [ + "futures-channel", + "futures-util", + "http", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if", + "ecdsa 0.16.6", + "elliptic-curve 0.13.4", + "once_cell", + "sha2 0.10.6", +] + +[[package]] +name = "keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "kusama-runtime" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "kusama-runtime-constants", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-multisig", + "pallet-nis", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-recovery", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "kusama-runtime-constants" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "kvdb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" +dependencies = [ + "kvdb", + "num_cpus", + "parking_lot 0.12.1", + "regex", + "rocksdb", + "smallvec", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "libp2p" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "getrandom 0.2.9", + "instant", + "libp2p-core 0.38.0", + "libp2p-dns", + "libp2p-identify", + "libp2p-kad", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-mplex", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-request-response", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-wasm-ext", + "libp2p-webrtc", + "libp2p-websocket", + "libp2p-yamux", + "multiaddr 0.16.0", + "parking_lot 0.12.1", + "pin-project", + "smallvec", +] + +[[package]] +name = "libp2p-core" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +dependencies = [ + "asn1_der", + "bs58", + "ed25519-dalek", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "log", + "multiaddr 0.16.0", + "multihash 0.16.3", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "prost", + "prost-build", + "rand 0.8.5", + "rw-stream-sink", + "sec1 0.3.0", + "sha2 0.10.6", + "smallvec", + "thiserror", + "unsigned-varint", + "void", + "zeroize", +] + +[[package]] +name = "libp2p-core" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "log", + "multiaddr 0.17.1", + "multihash 0.17.0", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-dns" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +dependencies = [ + "futures", + "libp2p-core 0.38.0", + "log", + "parking_lot 0.12.1", + "smallvec", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-identify" +version = "0.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +dependencies = [ + "asynchronous-codec", + "futures", + "futures-timer", + "libp2p-core 0.38.0", + "libp2p-swarm", + "log", + "lru 0.8.1", + "prost", + "prost-build", + "prost-codec", + "smallvec", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-identity" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +dependencies = [ + "bs58", + "ed25519-dalek", + "log", + "multiaddr 0.17.1", + "multihash 0.17.0", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.6", + "thiserror", + "zeroize", +] + +[[package]] +name = "libp2p-kad" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +dependencies = [ + "arrayvec 0.7.2", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.38.0", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.10.6", + "smallvec", + "thiserror", + "uint", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +dependencies = [ + "data-encoding", + "futures", + "if-watch", + "libp2p-core 0.38.0", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "socket2", + "tokio", + "trust-dns-proto", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +dependencies = [ + "libp2p-core 0.38.0", + "libp2p-identify", + "libp2p-kad", + "libp2p-ping", + "libp2p-swarm", + "prometheus-client", +] + +[[package]] +name = "libp2p-mplex" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "libp2p-core 0.38.0", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-noise" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures", + "libp2p-core 0.38.0", + "log", + "once_cell", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.10.6", + "snow", + "static_assertions", + "thiserror", + "x25519-dalek 1.1.1", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +dependencies = [ + "futures", + "futures-timer", + "instant", + "libp2p-core 0.38.0", + "libp2p-swarm", + "log", + "rand 0.8.5", + "void", +] + +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core 0.38.0", + "libp2p-tls", + "log", + "parking_lot 0.12.1", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.8", + "thiserror", + "tokio", +] + +[[package]] +name = "libp2p-request-response" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +dependencies = [ + "async-trait", + "bytes", + "futures", + "instant", + "libp2p-core 0.38.0", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-swarm" +version = "0.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.38.0", + "libp2p-swarm-derive", + "log", + "pin-project", + "rand 0.8.5", + "smallvec", + "thiserror", + "tokio", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +dependencies = [ + "heck", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "libp2p-tcp" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +dependencies = [ + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core 0.38.0", + "log", + "socket2", + "tokio", +] + +[[package]] +name = "libp2p-tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core 0.39.2", + "libp2p-identity", + "rcgen 0.10.0", + "ring", + "rustls 0.20.8", + "thiserror", + "webpki 0.22.0", + "x509-parser 0.14.0", + "yasna", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +dependencies = [ + "futures", + "js-sys", + "libp2p-core 0.38.0", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core 0.38.0", + "libp2p-noise", + "log", + "multihash 0.16.3", + "prost", + "prost-build", + "prost-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + +[[package]] +name = "libp2p-websocket" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +dependencies = [ + "either", + "futures", + "futures-rustls", + "libp2p-core 0.38.0", + "log", + "parking_lot 0.12.1", + "quicksink", + "rw-stream-sink", + "soketto", + "url", + "webpki-roots", +] + +[[package]] +name = "libp2p-yamux" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +dependencies = [ + "futures", + "libp2p-core 0.38.0", + "log", + "parking_lot 0.12.1", + "thiserror", + "yamux", +] + +[[package]] +name = "librocksdb-sys" +version = "0.10.0+7.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libz-sys" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linregress" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "475015a7f8f017edb28d2e69813be23500ad4b32cfe3421c4148efc97324ee52" +dependencies = [ + "nalgebra", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lru" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "mangata-node" +version = "0.1.0" +dependencies = [ + "clap", + "color-print", + "cumulus-client-cli", + "cumulus-client-consensus-aura", + "cumulus-client-consensus-common", + "cumulus-client-service", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", + "frame-benchmarking", + "frame-benchmarking-cli", + "jsonrpsee", + "log", + "mangata-polkadot-runtime", + "pallet-transaction-payment-rpc", + "parity-scale-codec", + "polkadot-cli", + "polkadot-primitives", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-network", + "sc-network-sync", + "sc-rpc", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-timestamp", + "substrate-build-script-utils", + "substrate-frame-rpc-system", + "substrate-prometheus-endpoint", + "try-runtime-cli", + "xcm", +] + +[[package]] +name = "mangata-polkadot-runtime" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "orml-tokens", + "orml-traits", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachain-info", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matrixmultiply" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memfd" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +dependencies = [ + "rustix 0.37.19", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "mick-jaeger" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" +dependencies = [ + "futures", + "rand 0.8.5", + "thrift", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "mmr-gadget" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "futures", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-offchain", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mmr-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "anyhow", + "jsonrpsee", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "multiaddr" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "multibase", + "multihash 0.16.3", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash 0.17.0", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.6", + "multihash-derive", + "sha2 0.10.6", + "sha3", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "multihash-derive", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "nalgebra" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68d47bba83f9e2006d117a9a33af1524e655516b8919caac694427a6fb1e511" +dependencies = [ + "approx", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nalgebra-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "names" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.2", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "crc32fast", + "hashbrown 0.12.3", + "indexmap", + "memchr", +] + +[[package]] +name = "object" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +dependencies = [ + "asn1-rs 0.3.1", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "orchestra" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures", + "futures-timer", + "orchestra-proc-macro", + "pin-project", + "prioritized-metered-channel", + "thiserror", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" +dependencies = [ + "expander 0.0.6", + "itertools", + "petgraph", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits", +] + +[[package]] +name = "orml-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "frame-support", + "frame-system", + "orml-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-traits" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "num-traits", + "orml-utilities", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-utilities" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-xcm" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "frame-support", + "frame-system", + "pallet-xcm", + "parity-scale-codec", + "scale-info", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-xcm-support" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "frame-support", + "orml-traits", + "parity-scale-codec", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "orml-xtokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library.git?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "orml-traits", + "orml-xcm-support", + "pallet-xcm", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.6", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.6", +] + +[[package]] +name = "packed_simd_2" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +dependencies = [ + "cfg-if", + "libm 0.1.4", +] + +[[package]] +name = "pallet-aura" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authorship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-babe" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-bags-list" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "pallet-balances" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-consensus-beefy", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-beefy-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "array-bytes 4.2.0", + "binary-merkle-tree", + "frame-support", + "frame-system", + "log", + "pallet-beefy", + "pallet-mmr", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-consensus-beefy", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-child-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-bounties", + "pallet-treasury", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-collator-selection" +version = "3.0.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#422a22c9258cdd110750b3f63ecb8918581f7e87" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-democracy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "pallet-election-provider-support-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec", + "sp-npos-elections", + "sp-runtime", +] + +[[package]] +name = "pallet-elections-phragmen" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-identity" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-im-online" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-indices" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-membership" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-multisig" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nis" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools" +version = "1.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools-benchmarking" +version = "1.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "pallet-bags-list", + "pallet-nomination-pools", + "pallet-staking", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-runtime-interface", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "pallet-nomination-pools", + "parity-scale-codec", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-offences" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-offences-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-im-online", + "pallet-offences", + "pallet-session", + "pallet-staking", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-preimage" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proxy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ranked-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-recovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-referenda" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-scheduler" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-session-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "pallet-staking", + "rand 0.8.5", + "sp-runtime", + "sp-session", + "sp-std", +] + +[[package]] +name = "pallet-society" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "rand_chacha 0.2.2", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand_chacha 0.2.2", + "scale-info", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-staking-reward-curve" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-staking-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "pallet-state-trie-migration" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-sudo" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "pallet-tips" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-transaction-payment-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "pallet-transaction-payment", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-treasury" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-utility" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-vesting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-whitelist" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-xcm" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bounded-collections", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "parachain-info" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.42#f603a61ff370fc33740c9373833c3c6ba1486846" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "parity-db" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd4572a52711e2ccff02b4973ec7e4a5b5c23387ebbfbd6cd42b34755714cefc" +dependencies = [ + "blake2", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2", + "parking_lot 0.12.1", + "rand 0.8.5", + "siphasher", + "snap", +] + +[[package]] +name = "parity-scale-codec" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +dependencies = [ + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-send-wrapper" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.7", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "pest_meta" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.6", +] + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.5", + "spki 0.7.1", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "platforms" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" + +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + +[[package]] +name = "polkadot-approval-distribution" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "derive_more", + "fatality", + "futures", + "lru 0.9.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "fatality", + "futures", + "lru 0.9.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-cli" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "clap", + "frame-benchmarking-cli", + "futures", + "log", + "polkadot-client", + "polkadot-node-core-pvf-worker", + "polkadot-node-metrics", + "polkadot-performance-test", + "polkadot-service", + "sc-cli", + "sc-executor", + "sc-service", + "sc-storage-monitor", + "sc-sysinfo", + "sc-tracing", + "sp-core", + "sp-io", + "sp-keyring", + "sp-maybe-compressed-blob", + "substrate-build-script-utils", + "thiserror", + "try-runtime-cli", +] + +[[package]] +name = "polkadot-client" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "polkadot-core-primitives", + "polkadot-node-core-parachains-inherent", + "polkadot-primitives", + "polkadot-runtime", + "polkadot-runtime-common", + "rococo-runtime", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-service", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", +] + +[[package]] +name = "polkadot-collator-protocol" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "always-assert", + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-core-primitives" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-dispute-distribution" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "derive_more", + "fatality", + "futures", + "futures-timer", + "indexmap", + "lru 0.9.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-network", + "sp-application-crypto", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-erasure-coding" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-primitives", + "reed-solomon-novelpoly", + "sp-core", + "sp-trie", + "thiserror", +] + +[[package]] +name = "polkadot-gossip-support" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sc-network", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-network-bridge" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-maybe-compressed-blob", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "derive_more", + "futures", + "futures-timer", + "kvdb", + "lru 0.9.0", + "merlin", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-keystore", + "schnorrkel", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-av-store" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-backing" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "fatality", + "futures", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-core-pvf", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-parachain", + "polkadot-primitives", + "sp-maybe-compressed-blob", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-primitives", + "sc-client-api", + "sc-consensus-babe", + "sp-blockchain", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-selection" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-dispute-coordinator" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "fatality", + "futures", + "kvdb", + "lru 0.9.0", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-parachains-inherent" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-provisioner" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "always-assert", + "futures", + "futures-timer", + "libc", + "parity-scale-codec", + "pin-project", + "polkadot-core-primitives", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-parachain", + "polkadot-primitives", + "rand 0.8.5", + "slotmap", + "sp-core", + "sp-maybe-compressed-blob", + "sp-tracing", + "sp-wasm-interface", + "substrate-build-script-utils", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-checker" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-worker" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "assert_matches", + "cpu-time", + "futures", + "libc", + "parity-scale-codec", + "polkadot-node-core-pvf", + "polkadot-parachain", + "polkadot-primitives", + "rayon", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-core", + "sp-externalities", + "sp-io", + "sp-maybe-compressed-blob", + "sp-tracing", + "substrate-build-script-utils", + "tempfile", + "tikv-jemalloc-ctl", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "futures", + "lru 0.9.0", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sp-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-jaeger" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "lazy_static", + "log", + "mick-jaeger", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-primitives", + "sc-network", + "sp-core", + "thiserror", + "tokio", +] + +[[package]] +name = "polkadot-node-metrics" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bs58", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "polkadot-primitives", + "prioritized-metered-channel", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-network-protocol" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures", + "hex", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-authority-discovery", + "sc-network", + "strum", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-primitives" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bounded-vec", + "futures", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "schnorrkel", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-maybe-compressed-blob", + "sp-runtime", + "thiserror", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "polkadot-node-subsystem" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-node-subsystem-types", + "polkadot-overseer", +] + +[[package]] +name = "polkadot-node-subsystem-types" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "derive_more", + "futures", + "orchestra", + "polkadot-node-jaeger", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-network", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "polkadot-node-subsystem-util" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures", + "futures-channel", + "itertools", + "kvdb", + "lru 0.9.0", + "parity-db", + "parity-scale-codec", + "parking_lot 0.11.2", + "pin-project", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel", + "rand 0.8.5", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-overseer" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "lru 0.9.0", + "orchestra", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-core", + "tikv-jemalloc-ctl", + "tracing-gum", +] + +[[package]] +name = "polkadot-parachain" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bounded-collections", + "derive_more", + "frame-support", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-performance-test" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "env_logger 0.9.3", + "kusama-runtime", + "log", + "polkadot-erasure-coding", + "polkadot-node-core-pvf-worker", + "polkadot-node-primitives", + "polkadot-primitives", + "quote", + "sc-executor-common", + "sp-maybe-compressed-blob", + "thiserror", +] + +[[package]] +name = "polkadot-primitives" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "hex-literal", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "polkadot-rpc" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-runtime-api", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "polkadot-runtime-common" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm", +] + +[[package]] +name = "polkadot-runtime-constants" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bs58", + "parity-scale-codec", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitflags", + "bitvec", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rustc-hex", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm", + "xcm-executor", +] + +[[package]] +name = "polkadot-service" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "async-trait", + "frame-benchmarking-cli", + "frame-support", + "frame-system-rpc-runtime-api", + "futures", + "hex-literal", + "kusama-runtime", + "kvdb", + "kvdb-rocksdb", + "log", + "lru 0.9.0", + "mmr-gadget", + "pallet-babe", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-client", + "polkadot-collator-protocol", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "rococo-runtime", + "rococo-runtime-constants", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", + "sc-consensus-slots", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "substrate-prometheus-endpoint", + "thiserror", + "tracing-gum", + "westend-runtime", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "arrayvec 0.5.2", + "fatality", + "futures", + "indexmap", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "sp-staking", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "parity-scale-codec", + "polkadot-primitives", + "sp-core", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite 0.2.9", + "windows-sys 0.48.0", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "primitive-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "thiserror", +] + +[[package]] +name = "prometheus-client" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-text-encode", +] + +[[package]] +name = "prometheus-client-derive-text-encode" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-codec" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" +dependencies = [ + "asynchronous-codec", + "bytes", + "prost", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "quinn-proto" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring", + "rustc-hash", + "rustls 0.20.8", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki 0.22.0", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.9", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring", + "time 0.3.20", + "x509-parser 0.13.2", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring", + "time 0.3.20", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.9", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reed-solomon-novelpoly" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +dependencies = [ + "derive_more", + "fs-err", + "itertools", + "static_init 0.5.2", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "regalloc2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +dependencies = [ + "aho-corasick 1.0.1", + "memchr", + "regex-syntax 0.7.1", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + +[[package]] +name = "region" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +dependencies = [ + "bitflags", + "libc", + "mach", + "winapi", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rocksdb" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rococo-runtime" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "binary-merkle-tree", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-mmr", + "pallet-multisig", + "pallet-nis", + "pallet-offences", + "pallet-preimage", + "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", + "pallet-session", + "pallet-society", + "pallet-staking", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rococo-runtime-constants", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "rococo-runtime-constants" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "rpassword" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +dependencies = [ + "libc", + "rtoolbox", + "winapi", +] + +[[package]] +name = "rtcp" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", +] + +[[package]] +name = "rtoolbox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rtp" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +dependencies = [ + "async-trait", + "bytes", + "rand 0.8.5", + "serde", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "runtime-integration-test" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "env_logger 0.9.3", + "frame-support", + "frame-system", + "log", + "mangata-polkadot-runtime", + "orml-tokens", + "orml-traits", + "orml-xtokens", + "pallet-balances", + "pallet-transaction-payment", + "pallet-xcm", + "parachain-info", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "sc-tracing", + "sp-core", + "sp-io", + "sp-runtime", + "sp-tracing", + "xcm", + "xcm-builder", + "xcm-emulator", + "xcm-executor", + "xtokens-parachain", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.17", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.36.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a38f9520be93aba504e8ca974197f46158de5dcaa9fa04b57c57cd6a679d658" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.7", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct 0.7.0", + "webpki 0.22.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "safe_arch" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794821e4ccb0d9f979512f9c1973480123f9bd62a90d74ab0f9426fcf8f4a529" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "log", + "sp-core", + "sp-wasm-interface", + "thiserror", +] + +[[package]] +name = "sc-authority-discovery" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "log", + "parity-scale-codec", + "prost", + "prost-build", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-inherents", + "sp-runtime", +] + +[[package]] +name = "sc-chain-spec" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "memmap2", + "sc-chain-spec-derive", + "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.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sc-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "chrono", + "clap", + "fdlimit", + "futures", + "libp2p", + "log", + "names", + "parity-scale-codec", + "rand 0.8.5", + "regex", + "rpassword", + "sc-client-api", + "sc-client-db", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-utils", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", + "thiserror", + "tiny-bip39", + "tokio", +] + +[[package]] +name = "sc-client-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-client-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-state-db", + "schnellru", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", +] + +[[package]] +name = "sc-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "libp2p", + "log", + "mockall", + "parking_lot 0.12.1", + "sc-client-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-aura" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "futures", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-keystore", + "sc-telemetry", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +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.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +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.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +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.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +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-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-executor" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "lru 0.8.1", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor-common", + "sc-executor-wasmi", + "sc-executor-wasmtime", + "sp-api", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "tracing", + "wasmi", +] + +[[package]] +name = "sc-executor-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "thiserror", + "wasm-instrument", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmi" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "log", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "log", + "once_cell", + "rustix 0.36.13", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmtime", +] + +[[package]] +name = "sc-informant" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "ansi_term", + "futures", + "futures-timer", + "log", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-keystore" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", +] + +[[package]] +name = "sc-network" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "async-channel", + "async-trait", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "linked_hash_set", + "log", + "lru 0.8.1", + "mockall", + "parity-scale-codec", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-network-common", + "sc-peerset", + "sc-utils", + "serde", + "serde_json", + "smallvec", + "snow", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "unsigned-varint", + "zeroize", +] + +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "cid", + "futures", + "libp2p", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "sc-network-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "bitflags", + "bytes", + "futures", + "futures-timer", + "libp2p", + "parity-scale-codec", + "prost-build", + "sc-consensus", + "sc-peerset", + "sc-utils", + "serde", + "smallvec", + "sp-blockchain", + "sp-consensus", + "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.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "ahash 0.8.3", + "futures", + "futures-timer", + "libp2p", + "log", + "lru 0.8.1", + "sc-network", + "sc-network-common", + "sc-peerset", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "sc-network-light" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "futures", + "libp2p", + "log", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-peerset", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-network-sync" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "fork-tree", + "futures", + "futures-timer", + "libp2p", + "log", + "lru 0.8.1", + "mockall", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "futures", + "libp2p", + "log", + "parity-scale-codec", + "pin-project", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "bytes", + "fnv", + "futures", + "futures-timer", + "hyper", + "hyper-rustls", + "libp2p", + "num_cpus", + "once_cell", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "sp-api", + "sp-core", + "sp-offchain", + "sp-runtime", + "threadpool", + "tracing", +] + +[[package]] +name = "sc-peerset" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "futures", + "libp2p", + "log", + "sc-utils", + "serde_json", + "wasm-timer", +] + +[[package]] +name = "sc-proposer-metrics" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "log", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-rpc-api", + "sc-tracing", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-offchain", + "sp-rpc", + "sp-runtime", + "sp-session", + "sp-version", + "tokio", +] + +[[package]] +name = "sc-rpc-api" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-transaction-pool-api", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-version", + "thiserror", +] + +[[package]] +name = "sc-rpc-server" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "http", + "jsonrpsee", + "log", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "futures", + "futures-util", + "hex", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-chain-spec", + "sc-client-api", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-version", + "thiserror", + "tokio-stream", +] + +[[package]] +name = "sc-service" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "directories", + "exit-future", + "futures", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-network", + "sc-network-bitswap", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-network-transactions", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-rpc-spec-v2", + "sc-storage-monitor", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "static_init 1.0.3", + "substrate-prometheus-endpoint", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "sc-state-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sp-core", +] + +[[package]] +name = "sc-storage-monitor" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "clap", + "fs4", + "futures", + "log", + "sc-client-db", + "sc-utils", + "sp-core", + "thiserror", + "tokio", +] + +[[package]] +name = "sc-sync-state-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-sysinfo" +version = "6.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "futures", + "libc", + "log", + "rand 0.8.5", + "rand_pcg", + "regex", + "sc-telemetry", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sc-telemetry" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "chrono", + "futures", + "libp2p", + "log", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-utils", + "serde", + "serde_json", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "ansi_term", + "atty", + "chrono", + "lazy_static", + "libc", + "log", + "once_cell", + "parking_lot 0.12.1", + "regex", + "rustc-hash", + "sc-client-api", + "sc-rpc-server", + "sc-tracing-proc-macro", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-tracing", + "thiserror", + "tracing", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sc-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "linked-hash-map", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-transaction-pool-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures", + "log", + "serde", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-channel", + "futures", + "futures-timer", + "lazy_static", + "log", + "parking_lot 0.12.1", + "prometheus", + "sp-arithmetic", +] + +[[package]] +name = "scale-info" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfdef77228a4c05dc94211441595746732131ad7f6530c6c18f045da7b7ab937" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sdp" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +dependencies = [ + "rand 0.8.5", + "substring", + "thiserror", + "url", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.5", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha3" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54c2bb1a323307527314a36bfb73f24febb08ce2b8a554bf4ffd6f51ad15198c" +dependencies = [ + "digest 0.10.6", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.6", + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.6", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "slot-range-helper" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "snap" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" + +[[package]] +name = "snow" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0-rc.1", + "rand_core 0.6.4", + "ring", + "rustc_version", + "sha2 0.10.6", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "flate2", + "futures", + "http", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-metadata-ir", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "Inflector", + "blake2", + "expander 1.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sp-application-crypto" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "futures", + "log", + "lru 0.8.1", + "parity-scale-codec", + "parking_lot 0.12.1", + "sp-api", + "sp-consensus", + "sp-database", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures", + "log", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +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.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +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.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-core" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "array-bytes 4.2.0", + "bitflags", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "parity-scale-codec", + "parking_lot 0.12.1", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.6", + "sha2 0.10.6", + "sha3", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn 2.0.15", +] + +[[package]] +name = "sp-database" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "sp-debug-derive" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sp-externalities" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "bytes", + "ed25519", + "ed25519-dalek", + "futures", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "serde", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "thiserror", + "zstd 0.12.3+zstd.1.5.2", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", +] + +[[package]] +name = "sp-mmr-primitives" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "ckb-merkle-mountain-range", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-npos-elections" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-panic-handler" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "rustc-hash", + "serde", + "sp-core", +] + +[[package]] +name = "sp-runtime" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", +] + +[[package]] +name = "sp-runtime-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sp-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", +] + +[[package]] +name = "sp-std" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" + +[[package]] +name = "sp-storage" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "futures-timer", + "log", + "parity-scale-codec", + "sp-inherents", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-tracing" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "async-trait", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "sp-trie" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "ahash 0.8.3", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot 0.12.1", + "scale-info", + "schnellru", + "sp-core", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "sp-wasm-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std", + "wasmi", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a5be806ab6f127c3da44b7378837ebf01dadca8510a0e572460216b228bd0e" +dependencies = [ + "base64ct", + "der 0.7.5", +] + +[[package]] +name = "ss58-registry" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" +dependencies = [ + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro 1.0.2", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-build-script-utils" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "platforms 2.0.0", +] + +[[package]] +name = "substrate-frame-rpc-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "frame-system-rpc-runtime-api", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-rpc-api", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "hyper", + "log", + "prometheus", + "thiserror", + "tokio", +] + +[[package]] +name = "substrate-rpc-client" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "jsonrpsee", + "log", + "sc-rpc-api", + "serde", + "sp-runtime", +] + +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + +[[package]] +name = "substrate-wasm-builder" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "ansi_term", + "build-helper", + "cargo_metadata", + "filetime", + "sp-maybe-compressed-blob", + "strum", + "tempfile", + "toml 0.7.3", + "walkdir", + "wasm-opt", +] + +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.37.19", + "windows-sys 0.45.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "thrift" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" +dependencies = [ + "byteorder", + "integer-encoding", + "log", + "ordered-float", + "threadpool", +] + +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" +dependencies = [ + "libc", + "paste", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.3+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.6", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite 0.2.9", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.8", + "tokio", + "webpki 0.22.0", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.9", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite 0.2.9", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite 0.2.9", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite 0.2.9", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-gum" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "expander 2.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "parking_lot 0.11.2", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +dependencies = [ + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec", + "socket2", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "try-runtime-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#bca8a29dbde0009e80c4c4737be47abff6b3e2c2" +dependencies = [ + "async-trait", + "clap", + "frame-remote-externalities", + "frame-try-runtime", + "hex", + "log", + "parity-scale-codec", + "sc-cli", + "sc-executor", + "sc-service", + "serde", + "serde_json", + "sp-api", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-core", + "sp-debug-derive", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-rpc", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "sp-transaction-storage-proof", + "sp-version", + "sp-weights", + "substrate-rpc-client", + "zstd 0.12.3+zstd.1.5.2", +] + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "turn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" +dependencies = [ + "async-trait", + "base64 0.13.1", + "futures", + "log", + "md-5", + "rand 0.8.5", + "ring", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.6", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "universal-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures-io", + "futures-util", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna 0.3.0", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +dependencies = [ + "getrandom 0.2.9", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waitgroup" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +dependencies = [ + "atomic-waker", +] + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "wasm-instrument" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasm-opt" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +dependencies = [ + "anyhow", + "libc", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", + "regex", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmi" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +dependencies = [ + "parity-wasm", + "wasmi-validation", + "wasmi_core", +] + +[[package]] +name = "wasmi-validation" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm 0.2.6", + "memory_units", + "num-rational", + "num-traits", + "region", +] + +[[package]] +name = "wasmparser" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +dependencies = [ + "indexmap", + "url", +] + +[[package]] +name = "wasmtime" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "indexmap", + "libc", + "log", + "object 0.29.0", + "once_cell", + "paste", + "psm", + "rayon", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +dependencies = [ + "anyhow", + "base64 0.13.1", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.36.13", + "serde", + "sha2 0.10.6", + "toml 0.5.11", + "windows-sys 0.42.0", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "wasmtime-cranelift" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.26.2", + "log", + "object 0.29.0", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.26.2", + "indexmap", + "log", + "object 0.29.0", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +dependencies = [ + "addr2line 0.17.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.26.2", + "log", + "object 0.29.0", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +dependencies = [ + "object 0.29.0", + "once_cell", + "rustix 0.36.13", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-runtime" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "indexmap", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.6.5", + "paste", + "rand 0.8.5", + "rustix 0.36.13", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-types" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki 0.22.0", +] + +[[package]] +name = "webrtc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "hex", + "interceptor", + "lazy_static", + "log", + "rand 0.8.5", + "rcgen 0.9.3", + "regex", + "ring", + "rtcp", + "rtp", + "rustls 0.19.1", + "sdp", + "serde", + "serde_json", + "sha2 0.10.6", + "stun", + "thiserror", + "time 0.3.20", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" +dependencies = [ + "bytes", + "derive_builder", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.1", + "async-trait", + "bincode", + "block-modes", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve 0.12.3", + "hkdf", + "hmac 0.12.1", + "log", + "oid-registry 0.6.1", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.9.3", + "ring", + "rustls 0.19.1", + "sec1 0.3.0", + "serde", + "sha1", + "sha2 0.10.6", + "signature 1.6.4", + "subtle", + "thiserror", + "tokio", + "webpki 0.21.4", + "webrtc-util", + "x25519-dalek 2.0.0-pre.1", + "x509-parser 0.13.2", +] + +[[package]] +name = "webrtc-ice" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand 0.8.5", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +dependencies = [ + "log", + "socket2", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" +dependencies = [ + "byteorder", + "bytes", + "rand 0.8.5", + "rtp", + "thiserror", +] + +[[package]] +name = "webrtc-sctp" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand 0.8.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "aes-gcm 0.9.4", + "async-trait", + "byteorder", + "bytes", + "ctr 0.8.0", + "hmac 0.11.0", + "log", + "rtcp", + "rtp", + "sha-1", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + +[[package]] +name = "westend-runtime" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-collective", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "westend-runtime-constants", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "westend-runtime-constants" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "wide" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +dependencies = [ + "asn1-rs 0.3.1", + "base64 0.13.1", + "data-encoding", + "der-parser 7.0.0", + "lazy_static", + "nom", + "oid-registry 0.4.0", + "ring", + "rusticata-macros", + "thiserror", + "time 0.3.20", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs 0.5.2", + "base64 0.13.1", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time 0.3.20", +] + +[[package]] +name = "xcm" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "bounded-collections", + "derivative", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights", + "xcm-procedural", +] + +[[package]] +name = "xcm-builder" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "xcm-emulator" +version = "0.1.0" +source = "git+https://github.com/mangata-finance/xcm-simulator?branch=polkadot-v0.9.42#55e22484a0092d2804b83ad5e8a128ff77ae1e49" +dependencies = [ + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "frame-support", + "frame-system", + "parachain-info", + "parity-scale-codec", + "paste", + "polkadot-primitives", + "polkadot-runtime-parachains", + "quote", + "sp-arithmetic", + "sp-io", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "xcm-executor" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm", +] + +[[package]] +name = "xcm-procedural" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "xtokens-parachain" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "orml-tokens", + "orml-traits", + "orml-xcm", + "orml-xtokens", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachain-info", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "yamux" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.20", +] + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +dependencies = [ + "zstd-safe 6.0.5+zstd.1.5.4", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.5+zstd.1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] diff --git a/mvr/Cargo.toml b/mvr/Cargo.toml new file mode 100644 index 0000000000..c47ab737b6 --- /dev/null +++ b/mvr/Cargo.toml @@ -0,0 +1,11 @@ +[profile.release] +panic = "unwind" + +[workspace] +resolver = "2" +members = [ + "node", + "runtime/mangata-polkadot", + "runtime/xtokens-parachain", + "runtime/integration-test", +] diff --git a/mvr/node/Cargo.toml b/mvr/node/Cargo.toml new file mode 100644 index 0000000000..dad4215330 --- /dev/null +++ b/mvr/node/Cargo.toml @@ -0,0 +1,77 @@ +[package] +name = "mangata-node" +version = "0.1.0" +authors = ["Mangata Team"] +license = "Unlicense" +edition = "2021" +build = "build.rs" + +[dependencies] +clap = { version = "4.2.3", features = ["derive"] } +log = "0.4.17" +codec = { package = "parity-scale-codec", version = "3.0.0" } +serde = { version = "1.0.160", features = ["derive"] } +jsonrpsee = { version = "0.16.2", features = ["server"] } + +# Local +mangata-polkadot-runtime = { path = "../runtime/mangata-polkadot" } + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.42" } + +# Polkadot +polkadot-cli = { git = "https://github.com/paritytech/polkadot", features = ["rococo-native"] , branch = "release-v0.9.42" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } + +# Cumulus +cumulus-client-cli = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-client-service = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42" } +color-print = "0.3.4" + +[build-dependencies] +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } + +[features] +default = [] +runtime-benchmarks = [ + "try-runtime-cli/try-runtime", + "polkadot-cli/runtime-benchmarks", +] +try-runtime = [ + "try-runtime-cli/try-runtime", +] diff --git a/mvr/node/build.rs b/mvr/node/build.rs new file mode 100644 index 0000000000..e3bfe3116b --- /dev/null +++ b/mvr/node/build.rs @@ -0,0 +1,7 @@ +use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; + +fn main() { + generate_cargo_keys(); + + rerun_if_git_head_changed(); +} diff --git a/mvr/node/src/chain_spec.rs b/mvr/node/src/chain_spec.rs new file mode 100644 index 0000000000..08b6d2f2b7 --- /dev/null +++ b/mvr/node/src/chain_spec.rs @@ -0,0 +1,242 @@ +use cumulus_primitives_core::ParaId; +use mangata_polkadot_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT}; +use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; +use sc_service::ChainType; +use serde::{Deserialize, Serialize}; +use sp_core::{sr25519, Pair, Public}; +use sp_runtime::traits::{IdentifyAccount, Verify}; + +/// Specialized `ChainSpec` for the normal parachain runtime. +pub type ChainSpec = + sc_service::GenericChainSpec; + +/// The default XCM version to set in genesis config. +const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; + +/// Helper function to generate a crypto pair from seed +pub fn get_from_seed(seed: &str) -> ::Public { + TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") + .public() +} + +/// The extensions for the [`ChainSpec`]. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] +#[serde(deny_unknown_fields)] +pub struct Extensions { + /// The relay chain of the Parachain. + pub relay_chain: String, + /// The id of the Parachain. + pub para_id: u32, +} + +impl Extensions { + /// Try to get the extension from the given `ChainSpec`. + pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> { + sc_chain_spec::get_extension(chain_spec.extensions()) + } +} + +type AccountPublic = ::Signer; + +/// Generate collator keys from seed. +/// +/// This function's return type must always match the session keys of the chain in tuple format. +pub fn get_collator_keys_from_seed(seed: &str) -> AuraId { + get_from_seed::(seed) +} + +/// Helper function to generate an account ID from seed +pub fn get_account_id_from_seed(seed: &str) -> AccountId +where + AccountPublic: From<::Public>, +{ + AccountPublic::from(get_from_seed::(seed)).into_account() +} + +/// Generate the session keys from individual elements. +/// +/// The input must be a tuple of individual keys (a single arg for now since we have just one key). +pub fn template_session_keys(keys: AuraId) -> mangata_polkadot_runtime::SessionKeys { + mangata_polkadot_runtime::SessionKeys { aura: keys } +} + +pub fn mainnet_config() -> ChainSpec { + // Give your base currency a unit name and decimal places + let mut properties = sc_chain_spec::Properties::new(); + properties.insert("tokenSymbol".into(), "UNIT".into()); + properties.insert("tokenDecimals".into(), 12.into()); + properties.insert("ss58Format".into(), 42.into()); + + ChainSpec::from_genesis( + // Name + "Mangata Polkadot Mainnet", + // ID + "mangata_polkadot_mainnet", + ChainType::Development, + move || { + mangata_genesis( + // initial collators. + vec![ + ( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed("Alice"), + ), + ( + get_account_id_from_seed::("Bob"), + get_collator_keys_from_seed("Bob"), + ), + ], + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + 2100.into(), + None, + ) + }, + Vec::new(), + None, + None, + None, + None, + Extensions { + relay_chain: "polkadot".into(), // You MUST set this to the correct network! + para_id: 2100, + }, + ) +} + +pub fn local_testnet_config() -> ChainSpec { + // Give your base currency a unit name and decimal places + let mut properties = sc_chain_spec::Properties::new(); + properties.insert("tokenSymbol".into(), "MGA".into()); + properties.insert("tokenDecimals".into(), 18.into()); + properties.insert("ss58Format".into(), 42.into()); + + ChainSpec::from_genesis( + // Name + "Mangata Polkadot Local", + // ID + "mangata_polkadot_local", + ChainType::Local, + move || { + mangata_genesis( + // initial collators. + vec![ + ( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed("Alice"), + ), + ( + get_account_id_from_seed::("Bob"), + get_collator_keys_from_seed("Bob"), + ), + ], + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + 2100.into(), + Some(get_account_id_from_seed::("Alice")), + ) + }, + // Bootnodes + Vec::new(), + // Telemetry + None, + // Protocol ID + Some("mangata-polkadot-testnet"), + // Fork ID + None, + // Properties + Some(properties), + // Extensions + Extensions { + relay_chain: "polkadot-local".into(), // You MUST set this to the correct network! + para_id: 2100, + }, + ) +} + +fn mangata_genesis( + invulnerables: Vec<(AccountId, AuraId)>, + endowed_accounts: Vec, + id: ParaId, + sudo: Option, +) -> mangata_polkadot_runtime::GenesisConfig { + mangata_polkadot_runtime::GenesisConfig { + system: mangata_polkadot_runtime::SystemConfig { + code: mangata_polkadot_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + }, + parachain_info: mangata_polkadot_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: mangata_polkadot_runtime::CollatorSelectionConfig { + invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: EXISTENTIAL_DEPOSIT * 16, + ..Default::default() + }, + tokens: mangata_polkadot_runtime::TokensConfig { + balances: endowed_accounts + .iter() + .cloned() + .map(|account| { + [ + (0_u32, 1_000_000_000__000000000_000000000_u128), + (1_u32, 0_u128), + (2_u32, 0_u128), + (3_u32, 0_u128), + (4_u32, 1_000_000_000__000000000_000000000_u128), + ] + .iter() + .map(|(token, amount)| (account.clone(), *token, *amount)) + .collect::>() + }) + .flatten() + .collect(), + }, + session: mangata_polkadot_runtime::SessionConfig { + keys: invulnerables + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + template_session_keys(aura), // session keys + ) + }) + .collect(), + }, + sudo: mangata_polkadot_runtime::SudoConfig { key: sudo }, + // no need to pass anything to aura, in fact it will panic if we do. Session will take care + // of this. + aura: Default::default(), + aura_ext: Default::default(), + parachain_system: Default::default(), + polkadot_xcm: mangata_polkadot_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + transaction_payment: Default::default(), + } +} diff --git a/mvr/node/src/cli.rs b/mvr/node/src/cli.rs new file mode 100644 index 0000000000..2e64a53e96 --- /dev/null +++ b/mvr/node/src/cli.rs @@ -0,0 +1,111 @@ +use std::path::PathBuf; + +/// Sub-commands supported by the collator. +#[derive(Debug, clap::Subcommand)] +pub enum Subcommand { + /// Build a chain specification. + BuildSpec(sc_cli::BuildSpecCmd), + + /// Validate blocks. + CheckBlock(sc_cli::CheckBlockCmd), + + /// Export blocks. + ExportBlocks(sc_cli::ExportBlocksCmd), + + /// Export the state of a given block into a chain spec. + ExportState(sc_cli::ExportStateCmd), + + /// Import blocks. + ImportBlocks(sc_cli::ImportBlocksCmd), + + /// Revert the chain to a previous state. + Revert(sc_cli::RevertCmd), + + /// Remove the whole chain. + PurgeChain(cumulus_client_cli::PurgeChainCmd), + + /// Export the genesis state of the parachain. + ExportGenesisState(cumulus_client_cli::ExportGenesisStateCommand), + + /// Export the genesis wasm of the parachain. + ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand), + + /// Sub-commands concerned with benchmarking. + /// The pallet benchmarking moved to the `pallet` sub-command. + #[command(subcommand)] + Benchmark(frame_benchmarking_cli::BenchmarkCmd), + + /// Try some testing command against a specified runtime state. + #[cfg(feature = "try-runtime")] + TryRuntime(try_runtime_cli::TryRuntimeCmd), + + /// Errors since the binary was not build with `--features try-runtime`. + #[cfg(not(feature = "try-runtime"))] + TryRuntime, +} + +const AFTER_HELP_EXAMPLE: &str = color_print::cstr!( + r#"Examples: + parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json + Export a chainspec for a local testnet in json format. + parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain rococo-local + Launch a full node with chain specification loaded from plain-parachain-chainspec.json. + parachain-template-node + Launch a full node with default parachain local-testnet and relay chain rococo-local. + parachain-template-node --collator + Launch a collator with default parachain local-testnet and relay chain rococo-local. + "# +); +#[derive(Debug, clap::Parser)] +#[command( + propagate_version = true, + args_conflicts_with_subcommands = true, + subcommand_negates_reqs = true +)] +#[clap(after_help = AFTER_HELP_EXAMPLE)] +pub struct Cli { + #[command(subcommand)] + pub subcommand: Option, + + #[command(flatten)] + pub run: cumulus_client_cli::RunCmd, + + /// Disable automatic hardware benchmarks. + /// + /// By default these benchmarks are automatically ran at startup and measure + /// the CPU speed, the memory bandwidth and the disk speed. + /// + /// The results are then printed out in the logs, and also sent as part of + /// telemetry, if telemetry is enabled. + #[arg(long)] + pub no_hardware_benchmarks: bool, + + /// Relay chain arguments + #[arg(raw = true)] + pub relay_chain_args: Vec, +} + +#[derive(Debug)] +pub struct RelayChainCli { + /// The actual relay chain cli object. + pub base: polkadot_cli::RunCmd, + + /// Optional chain id that should be passed to the relay chain. + pub chain_id: Option, + + /// The base path that should be used by the relay chain. + pub base_path: Option, +} + +impl RelayChainCli { + /// Parse the relay chain CLI parameters using the para chain `Configuration`. + pub fn new<'a>( + para_config: &sc_service::Configuration, + relay_chain_args: impl Iterator, + ) -> Self { + let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec); + let chain_id = extension.map(|e| e.relay_chain.clone()); + let base_path = para_config.base_path.as_ref().map(|x| x.path().join("polkadot")); + Self { base_path, chain_id, base: clap::Parser::parse_from(relay_chain_args) } + } +} diff --git a/mvr/node/src/command.rs b/mvr/node/src/command.rs new file mode 100644 index 0000000000..6dfd01e000 --- /dev/null +++ b/mvr/node/src/command.rs @@ -0,0 +1,457 @@ +use std::net::SocketAddr; + +use codec::Encode; +use cumulus_client_cli::generate_genesis_block; +use cumulus_primitives_core::ParaId; +use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; +use log::{info, warn}; +use mangata_polkadot_runtime::Block; +use sc_cli::{ + ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, + NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli, +}; +use sc_service::config::{BasePath, PrometheusConfig}; +use sp_core::hexdisplay::HexDisplay; +use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; + +use crate::{ + chain_spec, + cli::{Cli, RelayChainCli, Subcommand}, + service::{new_partial, ParachainNativeExecutor}, +}; + +fn load_spec(id: &str) -> std::result::Result, String> { + Ok(match id { + "polkadot" => Box::new(chain_spec::mainnet_config()), + "polkadot-local" => Box::new(chain_spec::local_testnet_config()), + path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), + }) +} + +impl SubstrateCli for Cli { + fn impl_name() -> String { + "Mangata Polkadot Runtime".into() + } + + fn impl_version() -> String { + env!("SUBSTRATE_CLI_IMPL_VERSION").into() + } + + fn description() -> String { + format!( + "Parachain Collator Template\n\nThe command-line arguments provided first will be \ + passed to the parachain node, while the arguments provided after -- will be passed \ + to the relay chain node.\n\n\ + {} -- ", + Self::executable_name() + ) + } + + fn author() -> String { + env!("CARGO_PKG_AUTHORS").into() + } + + fn support_url() -> String { + "https://github.com/paritytech/cumulus/issues/new".into() + } + + fn copyright_start_year() -> i32 { + 2020 + } + + fn load_spec(&self, id: &str) -> std::result::Result, String> { + load_spec(id) + } + + fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { + &mangata_polkadot_runtime::VERSION + } +} + +impl SubstrateCli for RelayChainCli { + fn impl_name() -> String { + "Parachain Collator Template".into() + } + + fn impl_version() -> String { + env!("SUBSTRATE_CLI_IMPL_VERSION").into() + } + + fn description() -> String { + format!( + "Parachain Collator Template\n\nThe command-line arguments provided first will be \ + passed to the parachain node, while the arguments provided after -- will be passed \ + to the relay chain node.\n\n\ + {} -- ", + Self::executable_name() + ) + } + + fn author() -> String { + env!("CARGO_PKG_AUTHORS").into() + } + + fn support_url() -> String { + "https://github.com/paritytech/cumulus/issues/new".into() + } + + fn copyright_start_year() -> i32 { + 2020 + } + + fn load_spec(&self, id: &str) -> std::result::Result, String> { + polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id) + } + + fn native_runtime_version(chain_spec: &Box) -> &'static RuntimeVersion { + polkadot_cli::Cli::native_runtime_version(chain_spec) + } +} + +macro_rules! construct_async_run { + (|$components:ident, $cli:ident, $cmd:ident, $config:ident| $( $code:tt )* ) => {{ + let runner = $cli.create_runner($cmd)?; + runner.async_run(|$config| { + let $components = new_partial(&$config)?; + let task_manager = $components.task_manager; + { $( $code )* }.map(|v| (v, task_manager)) + }) + }} +} + +/// Parse command line arguments into service configuration. +pub fn run() -> Result<()> { + let cli = Cli::from_args(); + + match &cli.subcommand { + Some(Subcommand::BuildSpec(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) + }, + Some(Subcommand::CheckBlock(cmd)) => { + construct_async_run!(|components, cli, cmd, config| { + Ok(cmd.run(components.client, components.import_queue)) + }) + }, + Some(Subcommand::ExportBlocks(cmd)) => { + construct_async_run!(|components, cli, cmd, config| { + Ok(cmd.run(components.client, config.database)) + }) + }, + Some(Subcommand::ExportState(cmd)) => { + construct_async_run!(|components, cli, cmd, config| { + Ok(cmd.run(components.client, config.chain_spec)) + }) + }, + Some(Subcommand::ImportBlocks(cmd)) => { + construct_async_run!(|components, cli, cmd, config| { + Ok(cmd.run(components.client, components.import_queue)) + }) + }, + Some(Subcommand::Revert(cmd)) => { + construct_async_run!(|components, cli, cmd, config| { + Ok(cmd.run(components.client, components.backend, None)) + }) + }, + Some(Subcommand::PurgeChain(cmd)) => { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| { + let polkadot_cli = RelayChainCli::new( + &config, + [RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()), + ); + + let polkadot_config = SubstrateCli::create_configuration( + &polkadot_cli, + &polkadot_cli, + config.tokio_handle.clone(), + ) + .map_err(|err| format!("Relay chain argument error: {}", err))?; + + cmd.run(config, polkadot_config) + }) + }, + Some(Subcommand::ExportGenesisState(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|_config| { + let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?; + let state_version = Cli::native_runtime_version(&spec).state_version(); + cmd.run::(&*spec, state_version) + }) + }, + Some(Subcommand::ExportGenesisWasm(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|_config| { + let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?; + cmd.run(&*spec) + }) + }, + Some(Subcommand::Benchmark(cmd)) => { + let runner = cli.create_runner(cmd)?; + // Switch on the concrete benchmark sub-command- + match cmd { + BenchmarkCmd::Pallet(cmd) => + if cfg!(feature = "runtime-benchmarks") { + runner.sync_run(|config| cmd.run::(config)) + } else { + Err("Benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`." + .into()) + }, + BenchmarkCmd::Block(cmd) => runner.sync_run(|config| { + let partials = new_partial(&config)?; + cmd.run(partials.client) + }), + #[cfg(not(feature = "runtime-benchmarks"))] + BenchmarkCmd::Storage(_) => + return Err(sc_cli::Error::Input( + "Compile with --features=runtime-benchmarks \ + to enable storage benchmarks." + .into(), + ) + .into()), + #[cfg(feature = "runtime-benchmarks")] + BenchmarkCmd::Storage(cmd) => runner.sync_run(|config| { + let partials = new_partial(&config)?; + let db = partials.backend.expose_db(); + let storage = partials.backend.expose_storage(); + cmd.run(config, partials.client.clone(), db, storage) + }), + BenchmarkCmd::Machine(cmd) => + runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())), + // NOTE: this allows the Client to leniently implement + // new benchmark commands without requiring a companion MR. + #[allow(unreachable_patterns)] + _ => Err("Benchmarking sub-command unsupported".into()), + } + }, + #[cfg(feature = "try-runtime")] + Some(Subcommand::TryRuntime(cmd)) => { + use mangata_polkadot_runtime::MILLISECS_PER_BLOCK; + use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; + use try_runtime_cli::block_building_info::timestamp_with_aura_info; + + let runner = cli.create_runner(cmd)?; + + type HostFunctionsOf = ExtendedHostFunctions< + sp_io::SubstrateHostFunctions, + ::ExtendHostFunctions, + >; + + // grab the task manager. + let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry); + let task_manager = + sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry) + .map_err(|e| format!("Error: {:?}", e))?; + + let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK); + + runner.async_run(|_| { + Ok(( + cmd.run::, _>(Some( + info_provider, + )), + task_manager, + )) + }) + }, + #[cfg(not(feature = "try-runtime"))] + Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \ + You can enable it with `--features try-runtime`." + .into()), + None => { + let runner = cli.create_runner(&cli.run.normalize())?; + let collator_options = cli.run.collator_options(); + + runner.run_node_until_exit(|config| async move { + let hwbench = (!cli.no_hardware_benchmarks).then_some( + config.database.path().map(|database_path| { + let _ = std::fs::create_dir_all(&database_path); + sc_sysinfo::gather_hwbench(Some(database_path)) + })).flatten(); + + let para_id = chain_spec::Extensions::try_get(&*config.chain_spec) + .map(|e| e.para_id) + .ok_or_else(|| "Could not find parachain ID in chain-spec.")?; + + let polkadot_cli = RelayChainCli::new( + &config, + [RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()), + ); + + let id = ParaId::from(para_id); + + let parachain_account = + AccountIdConversion::::into_account_truncating(&id); + + let state_version = Cli::native_runtime_version(&config.chain_spec).state_version(); + let block: Block = generate_genesis_block(&*config.chain_spec, state_version) + .map_err(|e| format!("{:?}", e))?; + let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode())); + + let tokio_handle = config.tokio_handle.clone(); + let polkadot_config = + SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle) + .map_err(|err| format!("Relay chain argument error: {}", err))?; + + info!("Parachain id: {:?}", id); + info!("Parachain Account: {}", parachain_account); + info!("Parachain genesis state: {}", genesis_state); + info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); + + if !collator_options.relay_chain_rpc_urls.is_empty() && cli.relay_chain_args.len() > 0 { + warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options."); + } + + crate::service::start_parachain_node( + config, + polkadot_config, + collator_options, + id, + hwbench, + ) + .await + .map(|r| r.0) + .map_err(Into::into) + }) + }, + } +} + +impl DefaultConfigurationValues for RelayChainCli { + fn p2p_listen_port() -> u16 { + 30334 + } + + fn rpc_ws_listen_port() -> u16 { + 9945 + } + + fn rpc_http_listen_port() -> u16 { + 9934 + } + + fn prometheus_listen_port() -> u16 { + 9616 + } +} + +impl CliConfiguration for RelayChainCli { + fn shared_params(&self) -> &SharedParams { + self.base.base.shared_params() + } + + fn import_params(&self) -> Option<&ImportParams> { + self.base.base.import_params() + } + + fn network_params(&self) -> Option<&NetworkParams> { + self.base.base.network_params() + } + + fn keystore_params(&self) -> Option<&KeystoreParams> { + self.base.base.keystore_params() + } + + fn base_path(&self) -> Result> { + Ok(self + .shared_params() + .base_path()? + .or_else(|| self.base_path.clone().map(Into::into))) + } + + fn rpc_http(&self, default_listen_port: u16) -> Result> { + self.base.base.rpc_http(default_listen_port) + } + + fn rpc_ipc(&self) -> Result> { + self.base.base.rpc_ipc() + } + + fn rpc_ws(&self, default_listen_port: u16) -> Result> { + self.base.base.rpc_ws(default_listen_port) + } + + fn prometheus_config( + &self, + default_listen_port: u16, + chain_spec: &Box, + ) -> Result> { + self.base.base.prometheus_config(default_listen_port, chain_spec) + } + + fn init( + &self, + _support_url: &String, + _impl_version: &String, + _logger_hook: F, + _config: &sc_service::Configuration, + ) -> Result<()> + where + F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration), + { + unreachable!("PolkadotCli is never initialized; qed"); + } + + fn chain_id(&self, is_dev: bool) -> Result { + let chain_id = self.base.base.chain_id(is_dev)?; + + Ok(if chain_id.is_empty() { self.chain_id.clone().unwrap_or_default() } else { chain_id }) + } + + fn role(&self, is_dev: bool) -> Result { + self.base.base.role(is_dev) + } + + fn transaction_pool(&self, is_dev: bool) -> Result { + self.base.base.transaction_pool(is_dev) + } + + fn trie_cache_maximum_size(&self) -> Result> { + self.base.base.trie_cache_maximum_size() + } + + fn rpc_methods(&self) -> Result { + self.base.base.rpc_methods() + } + + fn rpc_ws_max_connections(&self) -> Result> { + self.base.base.rpc_ws_max_connections() + } + + fn rpc_cors(&self, is_dev: bool) -> Result>> { + self.base.base.rpc_cors(is_dev) + } + + fn default_heap_pages(&self) -> Result> { + self.base.base.default_heap_pages() + } + + fn force_authoring(&self) -> Result { + self.base.base.force_authoring() + } + + fn disable_grandpa(&self) -> Result { + self.base.base.disable_grandpa() + } + + fn max_runtime_instances(&self) -> Result> { + self.base.base.max_runtime_instances() + } + + fn announce_block(&self) -> Result { + self.base.base.announce_block() + } + + fn telemetry_endpoints( + &self, + chain_spec: &Box, + ) -> Result> { + self.base.base.telemetry_endpoints(chain_spec) + } + + fn node_name(&self) -> Result { + self.base.base.node_name() + } +} diff --git a/mvr/node/src/main.rs b/mvr/node/src/main.rs new file mode 100644 index 0000000000..ba9f28b354 --- /dev/null +++ b/mvr/node/src/main.rs @@ -0,0 +1,14 @@ +//! Substrate Parachain Node Template CLI + +#![warn(missing_docs)] + +mod chain_spec; +#[macro_use] +mod service; +mod cli; +mod command; +mod rpc; + +fn main() -> sc_cli::Result<()> { + command::run() +} diff --git a/mvr/node/src/rpc.rs b/mvr/node/src/rpc.rs new file mode 100644 index 0000000000..b4cf18b252 --- /dev/null +++ b/mvr/node/src/rpc.rs @@ -0,0 +1,58 @@ +//! A collection of node-specific RPC methods. +//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer +//! used by Substrate nodes. This file extends those RPC definitions with +//! capabilities that are specific to this project's runtime configuration. + +#![warn(missing_docs)] + +use std::sync::Arc; + +use mangata_polkadot_runtime::{opaque::Block, AccountId, Balance, Index as Nonce}; + +use sc_client_api::AuxStore; +pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; +use sc_transaction_pool_api::TransactionPool; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; + +/// A type representing all RPC extensions. +pub type RpcExtension = jsonrpsee::RpcModule<()>; + +/// Full client dependencies +pub struct FullDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, +} + +/// Instantiate all RPC extensions. +pub fn create_full( + deps: FullDeps, +) -> Result> +where + C: ProvideRuntimeApi + + HeaderBackend + + AuxStore + + HeaderMetadata + + Send + + Sync + + 'static, + C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, + C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: BlockBuilder, + P: TransactionPool + Sync + Send + 'static, +{ + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; + use substrate_frame_rpc_system::{System, SystemApiServer}; + + let mut module = RpcExtension::new(()); + let FullDeps { client, pool, deny_unsafe } = deps; + + module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?; + module.merge(TransactionPayment::new(client).into_rpc())?; + Ok(module) +} diff --git a/mvr/node/src/service.rs b/mvr/node/src/service.rs new file mode 100644 index 0000000000..1332de1ba1 --- /dev/null +++ b/mvr/node/src/service.rs @@ -0,0 +1,435 @@ +//! Service and ServiceFactory implementation. Specialized wrapper over substrate service. + +// std +use std::{sync::Arc, time::Duration}; + +use cumulus_client_cli::CollatorOptions; +// Local Runtime Types +use mangata_polkadot_runtime::{opaque::Block, RuntimeApi}; + +// Cumulus Imports +use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion}; +use cumulus_client_consensus_common::{ + ParachainBlockImport as TParachainBlockImport, ParachainConsensus, +}; +use cumulus_client_service::{ + build_network, build_relay_chain_interface, prepare_node_config, start_collator, + start_full_node, BuildNetworkParams, StartCollatorParams, StartFullNodeParams, +}; +use cumulus_primitives_core::ParaId; +use cumulus_relay_chain_interface::RelayChainInterface; + +// Substrate Imports +use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; +use sc_consensus::ImportQueue; +use sc_executor::{ + HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, +}; +use sc_network::NetworkBlock; +use sc_network_sync::SyncingService; +use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; +use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; +use sp_keystore::KeystorePtr; +use substrate_prometheus_endpoint::Registry; + +/// Native executor type. +pub struct ParachainNativeExecutor; + +impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { + type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; + + fn dispatch(method: &str, data: &[u8]) -> Option> { + mangata_polkadot_runtime::api::dispatch(method, data) + } + + fn native_version() -> sc_executor::NativeVersion { + mangata_polkadot_runtime::native_version() + } +} + +type ParachainExecutor = NativeElseWasmExecutor; + +type ParachainClient = TFullClient; + +type ParachainBackend = TFullBackend; + +type ParachainBlockImport = TParachainBlockImport, ParachainBackend>; + +/// Starts a `ServiceBuilder` for a full service. +/// +/// Use this macro if you don't actually need the full service, but just the builder in order to +/// be able to perform chain operations. +pub fn new_partial( + config: &Configuration, +) -> Result< + PartialComponents< + ParachainClient, + ParachainBackend, + (), + sc_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + (ParachainBlockImport, Option, Option), + >, + sc_service::Error, +> { + let telemetry = config + .telemetry_endpoints + .clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; + + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + + let wasm = WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size) + .build(); + + let executor = ParachainExecutor::new_with_wasm_executor(wasm); + + let (client, backend, keystore_container, task_manager) = + sc_service::new_full_parts::( + config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + executor, + )?; + let client = Arc::new(client); + + let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle()); + + let telemetry = telemetry.map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); + telemetry + }); + + let transaction_pool = sc_transaction_pool::BasicPool::new_full( + config.transaction_pool.clone(), + config.role.is_authority().into(), + config.prometheus_registry(), + task_manager.spawn_essential_handle(), + client.clone(), + ); + + let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); + + let import_queue = build_import_queue( + client.clone(), + block_import.clone(), + config, + telemetry.as_ref().map(|telemetry| telemetry.handle()), + &task_manager, + )?; + + Ok(PartialComponents { + backend, + client, + import_queue, + keystore_container, + task_manager, + transaction_pool, + select_chain: (), + other: (block_import, telemetry, telemetry_worker_handle), + }) +} + +/// Start a node with the given parachain `Configuration` and relay chain `Configuration`. +/// +/// This is the actual implementation that is abstract over the executor and the runtime api. +#[sc_tracing::logging::prefix_logs_with("Parachain")] +async fn start_node_impl( + parachain_config: Configuration, + polkadot_config: Configuration, + collator_options: CollatorOptions, + para_id: ParaId, + hwbench: Option, +) -> sc_service::error::Result<(TaskManager, Arc)> { + let parachain_config = prepare_node_config(parachain_config); + + let params = new_partial(¶chain_config)?; + let (block_import, mut telemetry, telemetry_worker_handle) = params.other; + + let client = params.client.clone(); + let backend = params.backend.clone(); + let mut task_manager = params.task_manager; + + let (relay_chain_interface, collator_key) = build_relay_chain_interface( + polkadot_config, + ¶chain_config, + telemetry_worker_handle, + &mut task_manager, + collator_options.clone(), + hwbench.clone(), + ) + .await + .map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?; + + let force_authoring = parachain_config.force_authoring; + let validator = parachain_config.role.is_authority(); + let prometheus_registry = parachain_config.prometheus_registry().cloned(); + 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, sync_service) = + build_network(BuildNetworkParams { + parachain_config: ¶chain_config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + para_id, + spawn_handle: task_manager.spawn_handle(), + relay_chain_interface: relay_chain_interface.clone(), + import_queue: params.import_queue, + }) + .await?; + + if parachain_config.offchain_worker.enabled { + sc_service::build_offchain_workers( + ¶chain_config, + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + let rpc_builder = { + let client = client.clone(); + let transaction_pool = transaction_pool.clone(); + + Box::new(move |deny_unsafe, _| { + let deps = crate::rpc::FullDeps { + client: client.clone(), + pool: transaction_pool.clone(), + deny_unsafe, + }; + + crate::rpc::create_full(deps).map_err(Into::into) + }) + }; + + sc_service::spawn_tasks(sc_service::SpawnTasksParams { + rpc_builder, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + task_manager: &mut task_manager, + config: parachain_config, + keystore: params.keystore_container.keystore(), + backend, + network: network.clone(), + sync_service: sync_service.clone(), + system_rpc_tx, + tx_handler_controller, + telemetry: telemetry.as_mut(), + })?; + + if let Some(hwbench) = hwbench { + sc_sysinfo::print_hwbench(&hwbench); + // Here you can check whether the hardware meets your chains' requirements. Putting a link + // in there and swapping out the requirements for your own are probably a good idea. The + // requirements for a para-chain are dictated by its relay-chain. + if !SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) && validator { + log::warn!( + "⚠️ The hardware does not meet the minimal requirements for role 'Authority'." + ); + } + + if let Some(ref mut telemetry) = telemetry { + let telemetry_handle = telemetry.handle(); + task_manager.spawn_handle().spawn( + "telemetry_hwbench", + None, + sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench), + ); + } + } + + let announce_block = { + let sync_service = sync_service.clone(); + Arc::new(move |hash, data| sync_service.announce_block(hash, data)) + }; + + let relay_chain_slot_duration = Duration::from_secs(6); + + let overseer_handle = relay_chain_interface + .overseer_handle() + .map_err(|e| sc_service::Error::Application(Box::new(e)))?; + + if validator { + let parachain_consensus = build_consensus( + client.clone(), + block_import, + prometheus_registry.as_ref(), + telemetry.as_ref().map(|t| t.handle()), + &task_manager, + relay_chain_interface.clone(), + transaction_pool, + sync_service.clone(), + params.keystore_container.keystore(), + force_authoring, + para_id, + )?; + + let spawner = task_manager.spawn_handle(); + let params = StartCollatorParams { + para_id, + block_status: client.clone(), + announce_block, + client: client.clone(), + task_manager: &mut task_manager, + relay_chain_interface, + spawner, + parachain_consensus, + import_queue: import_queue_service, + collator_key: collator_key.expect("Command line arguments do not allow this. qed"), + relay_chain_slot_duration, + recovery_handle: Box::new(overseer_handle), + sync_service, + }; + + start_collator(params).await?; + } else { + let params = StartFullNodeParams { + client: client.clone(), + announce_block, + task_manager: &mut task_manager, + para_id, + relay_chain_interface, + relay_chain_slot_duration, + import_queue: import_queue_service, + recovery_handle: Box::new(overseer_handle), + sync_service, + }; + + start_full_node(params)?; + } + + start_network.start_network(); + + Ok((task_manager, client)) +} + +/// Build the import queue for the parachain runtime. +fn build_import_queue( + client: Arc, + block_import: ParachainBlockImport, + config: &Configuration, + telemetry: Option, + task_manager: &TaskManager, +) -> Result, sc_service::Error> { + let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; + + cumulus_client_consensus_aura::import_queue::< + sp_consensus_aura::sr25519::AuthorityPair, + _, + _, + _, + _, + _, + >(cumulus_client_consensus_aura::ImportQueueParams { + block_import, + client, + create_inherent_data_providers: move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + + Ok((slot, timestamp)) + }, + registry: config.prometheus_registry(), + spawner: &task_manager.spawn_essential_handle(), + telemetry, + }) + .map_err(Into::into) +} + +fn build_consensus( + client: Arc, + block_import: ParachainBlockImport, + prometheus_registry: Option<&Registry>, + telemetry: Option, + task_manager: &TaskManager, + relay_chain_interface: Arc, + transaction_pool: Arc>, + sync_oracle: Arc>, + keystore: KeystorePtr, + force_authoring: bool, + para_id: ParaId, +) -> Result>, sc_service::Error> { + let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; + + let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + task_manager.spawn_handle(), + client.clone(), + transaction_pool, + prometheus_registry, + telemetry.clone(), + ); + + let params = BuildAuraConsensusParams { + proposer_factory, + create_inherent_data_providers: move |_, (relay_parent, validation_data)| { + let relay_chain_interface = relay_chain_interface.clone(); + async move { + let parachain_inherent = + cumulus_primitives_parachain_inherent::ParachainInherentData::create_at( + relay_parent, + &relay_chain_interface, + &validation_data, + para_id, + ) + .await; + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + + let parachain_inherent = parachain_inherent.ok_or_else(|| { + Box::::from( + "Failed to create parachain inherent", + ) + })?; + Ok((slot, timestamp, parachain_inherent)) + } + }, + block_import, + para_client: client, + backoff_authoring_blocks: Option::<()>::None, + sync_oracle, + keystore, + force_authoring, + slot_duration, + // We got around 500ms for proposing + block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), + // And a maximum of 750ms if slots are skipped + max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)), + telemetry, + }; + + Ok(AuraConsensus::build::(params)) +} + +/// Start a parachain node. +pub async fn start_parachain_node( + parachain_config: Configuration, + polkadot_config: Configuration, + collator_options: CollatorOptions, + para_id: ParaId, + hwbench: Option, +) -> sc_service::error::Result<(TaskManager, Arc)> { + start_node_impl(parachain_config, polkadot_config, collator_options, para_id, hwbench).await +} diff --git a/mvr/runtime/integration-test/Cargo.toml b/mvr/runtime/integration-test/Cargo.toml new file mode 100644 index 0000000000..4b19e30854 --- /dev/null +++ b/mvr/runtime/integration-test/Cargo.toml @@ -0,0 +1,56 @@ +[package] +name = "runtime-integration-test" +version = "0.1.0" +edition = "2021" + +[dependencies] +env_logger = "0.9.1" +log = "0.4.17" + +# Substrate +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } + +# Cumulus +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } + +# ORML +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } + +# Local +mangata-polkadot-runtime = { path = "../mangata-polkadot", optional = true } +xtokens-parachain = { path = "../xtokens-parachain", optional = true } + +# Xcm simulator +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.42" } +xcm-emulator = { git = "https://github.com/mangata-finance/xcm-simulator", branch = "polkadot-v0.9.42" } + +[dev-dependencies] + +[features] +default = ["mangata-polkadot"] +mangata-polkadot = [ + "mangata-polkadot-runtime", + "xtokens-parachain", +] diff --git a/mvr/runtime/integration-test/src/lib.rs b/mvr/runtime/integration-test/src/lib.rs new file mode 100644 index 0000000000..1410a6eec7 --- /dev/null +++ b/mvr/runtime/integration-test/src/lib.rs @@ -0,0 +1,228 @@ +#![cfg(test)] +pub mod networks; +use cumulus_primitives_core::{ + AssetId, + Fungibility::Fungible, + Instruction::{BuyExecution, DepositAsset, InitiateReserveWithdraw, WithdrawAsset}, + Junction::{self, Parachain}, + Junctions::{Here, X1, X2}, + MultiAsset, + MultiAssetFilter::Wild, + MultiAssets, MultiLocation, + WeightLimit::Unlimited, + WildMultiAsset::{self, AllCounted}, + Xcm, +}; +use frame_support::{assert_ok, traits::Currency, weights::WeightToFee}; +use orml_traits::currency::MultiCurrency; +use xcm::VersionedXcm; +use xcm_emulator::TestExt; +use orml_tokens::WeightInfo as OrmlWeightInfoT; + +use networks::*; + +pub type RelayChainPalletXcm = pallet_xcm::Pallet; +pub type ParachainPalletXcm = pallet_xcm::Pallet; +pub type XParachainPalletXTokens = orml_xtokens::Pallet; +pub type OrmlWeights = ::WeightInfo; +pub type MangataWeightToFee = ::WeightToFee; + +pub const TRANSFER_AMOUNT: u128 = 50 * unit(12); + +#[test] +fn dmp() { + TestNet::reset(); + + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + assert_eq!(mangata_polkadot_runtime::Tokens::free_balance(RELAY_ASSET_ID, &BOB), 0); + }); + + networks::PolkadotRelay::execute_with(|| { + sp_tracing::try_init_simple(); + + assert_eq!(polkadot_runtime::Balances::free_balance(&child_account_id(2110)), 0); + + assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( + polkadot_runtime::RuntimeOrigin::signed(ALICE), + Box::new(Parachain(2110).into()), + Box::new(Junction::AccountId32 { network: None, id: BOB.into() }.into()), + Box::new((Here, TRANSFER_AMOUNT).into()), + 0, + )); + + assert_eq!( + polkadot_runtime::Balances::free_balance(&child_account_id(2110)), + TRANSFER_AMOUNT + ); + }); + + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + assert!( + mangata_polkadot_runtime::Tokens::free_balance(RELAY_ASSET_ID, &BOB) > + TRANSFER_AMOUNT * 90 / 100 + ); + }); +} + +#[test] +fn ump() { + TestNet::reset(); + + // deposit funds to sovereign account + networks::PolkadotRelay::execute_with(|| { + sp_tracing::try_init_simple(); + assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( + polkadot_runtime::RuntimeOrigin::signed(ALICE), + Box::new(Parachain(2110).into()), + Box::new(Junction::AccountId32 { network: None, id: BOB.into() }.into()), + Box::new((Here, TRANSFER_AMOUNT).into()), + 0, + )); + assert_eq!( + polkadot_runtime::Balances::free_balance(&child_account_id(2110)), + TRANSFER_AMOUNT + ); + }); + + let assets = MultiAssets::from_sorted_and_deduplicated(vec![MultiAsset { + id: AssetId::Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(TRANSFER_AMOUNT), + }]) + .unwrap(); + + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + assert_ok!(ParachainPalletXcm::execute( + mangata_polkadot_runtime::RuntimeOrigin::signed(ALICE), + Box::new(VersionedXcm::from(Xcm(vec![ + WithdrawAsset(assets), + InitiateReserveWithdraw { + assets: Wild(WildMultiAsset::All), + reserve: MultiLocation { parents: 1, interior: Here }, + xcm: (Xcm(vec![ + BuyExecution { + fees: MultiAsset { + id: AssetId::Concrete(MultiLocation { parents: 0, interior: Here }), + fun: Fungible(TRANSFER_AMOUNT) + }, + weight_limit: Unlimited + }, + DepositAsset { + assets: Wild(AllCounted(1)), + beneficiary: MultiLocation { + parents: 0, + interior: X1(Junction::AccountId32 { id: BOB_RAW, network: None }) + } + } + ])), + } + ]))), + frame_support::weights::Weight::from_parts(u64::MAX, u64::MAX) + )); + }); + + networks::PolkadotRelay::execute_with(|| { + sp_tracing::try_init_simple(); + assert!(polkadot_runtime::Balances::free_balance(&BOB) > TRANSFER_AMOUNT * 99 / 100,); + assert_eq!(polkadot_runtime::Balances::free_balance(&child_account_id(2110)), 0); + }); +} + +#[test] +fn xtokens_transfer_triggers_asset_trap() { + TestNet::reset(); + + // arrange + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + let _ = mangata_polkadot_runtime::OrmlCurrencyAdapter::deposit_creating( + &networks::reserve_account(2001), + INITIAL_BALANCE, + ); + + assert_eq!( + mangata_polkadot_runtime::Tokens::free_balance( + RELAY_ASSET_ID, + &networks::reserve_account(2001) + ), + INITIAL_BALANCE + ); + }); + + // act + networks::XParachain::execute_with(|| { + sp_tracing::try_init_simple(); + + XParachainPalletXTokens::transfer_multiasset( + xtokens_parachain::RuntimeOrigin::signed(ALICE), + Box::new( + MultiAsset { + id: AssetId::Concrete(MultiLocation { + parents: 1, + interior: X1(Parachain(2001)), + }), + fun: Fungible(TRANSFER_AMOUNT), + } + .into(), + ), + Box::new( + MultiLocation::new( + 1, + X2(Parachain(2110), Junction::AccountId32 { network: None, id: BOB.into() }), + ) + .into(), + ), + Unlimited, + ) + .unwrap(); + }); + + // asset + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + assert!(mangata_polkadot_runtime::System::events() + .into_iter() + .map(|e| e.event) + .find(|e| matches!( + e, + mangata_polkadot_runtime::RuntimeEvent::PolkadotXcm(pallet_xcm::Event::< + mangata_polkadot_runtime::Runtime, + >::AssetsTrapped(..)) + )) + .is_some()); + + assert!( + mangata_polkadot_runtime::Tokens::free_balance( + RELAY_ASSET_ID, + &networks::reserve_account(2001) + ) > INITIAL_BALANCE * 9 / 10 + ); + }); +} + +#[test] +fn transfer_fee_is_reasonable() { + TestNet::reset(); + + // arrange + networks::Mangata::execute_with(|| { + sp_tracing::try_init_simple(); + + let transfer_weight = ::transfer(); + + let bytes_cost = mangata_polkadot_runtime::TransactionPayment::weight_to_fee(transfer_weight); + let weight_cost = mangata_polkadot_runtime::TransactionPayment::length_to_fee(145); + let cost = bytes_cost + weight_cost; + + assert!( + cost > mangata_polkadot_runtime::dot_currency::CENTS / 10 + ); + assert!( + cost < 10 * mangata_polkadot_runtime::dot_currency::CENTS + ); + + }); + +} diff --git a/mvr/runtime/integration-test/src/networks.rs b/mvr/runtime/integration-test/src/networks.rs new file mode 100644 index 0000000000..b0fc8b66d4 --- /dev/null +++ b/mvr/runtime/integration-test/src/networks.rs @@ -0,0 +1,243 @@ +use cumulus_primitives_core::{Junction, Parachain, Parent}; +use frame_support::{traits::GenesisBuild, weights::Weight}; +use polkadot_primitives::v4::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; +use polkadot_runtime_parachains::configuration::HostConfiguration; +use sp_runtime::traits::AccountIdConversion; +use xcm_executor::traits::Convert; + +pub const ALICE_RAW: [u8; 32] = [4u8; 32]; +pub const BOB_RAW: [u8; 32] = [5u8; 32]; +pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new(ALICE_RAW); +pub const BOB: sp_runtime::AccountId32 = sp_runtime::AccountId32::new(BOB_RAW); + +pub const RELAY_ASSET_ID: u32 = 4_u32; +pub const INITIAL_BALANCE: u128 = 100 * unit(12); + +pub type Balance = u128; + +pub const fn unit(decimals: u32) -> Balance { + 10u128.saturating_pow(decimals) +} + +pub fn cent(decimals: u32) -> Balance { + unit(decimals) / 100 +} + +pub fn millicent(decimals: u32) -> Balance { + cent(decimals) / 1000 +} + +pub fn microcent(decimals: u32) -> Balance { + millicent(decimals) / 1000 +} + +use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; + +decl_test_relay_chain! { + pub struct PolkadotRelay { + Runtime = polkadot_runtime::Runtime, + XcmConfig = polkadot_runtime::xcm_config::XcmConfig, + new_ext = polkadot_ext(), + } +} + +decl_test_parachain! { + pub struct Mangata { + Runtime = mangata_polkadot_runtime::Runtime, + RuntimeOrigin = mangata_polkadot_runtime::RuntimeOrigin, + XcmpMessageHandler = mangata_polkadot_runtime::XcmpQueue, + DmpMessageHandler = mangata_polkadot_runtime::DmpQueue, + new_ext = para_ext(2110), + } +} + +decl_test_parachain! { + pub struct Sibling { + Runtime = mangata_polkadot_runtime::Runtime, + RuntimeOrigin = mangata_polkadot_runtime::RuntimeOrigin, + XcmpMessageHandler = mangata_polkadot_runtime::XcmpQueue, + DmpMessageHandler = mangata_polkadot_runtime::DmpQueue, + new_ext = para_ext(2000), + } +} + +decl_test_parachain! { + // Parachain that uses XTokens + pub struct XParachain { + Runtime = xtokens_parachain::Runtime, + RuntimeOrigin = xtokens_parachain::RuntimeOrigin, + XcmpMessageHandler = xtokens_parachain::XcmpQueue, + DmpMessageHandler = xtokens_parachain::DmpQueue, + new_ext = xpara_ext(2001), + } +} + +decl_test_network! { + pub struct TestNet { + relay_chain = PolkadotRelay, + parachains = vec![ + // (2000, Sibling), + (2001, XParachain), + (2110, Mangata), + ], + } +} + +fn default_parachains_host_configuration() -> HostConfiguration { + HostConfiguration { + minimum_validation_upgrade_delay: 5, + validation_upgrade_cooldown: 5u32, + validation_upgrade_delay: 5, + code_retention_period: 1200, + max_code_size: MAX_CODE_SIZE, + max_pov_size: MAX_POV_SIZE, + max_head_data_size: 32 * 1024, + group_rotation_frequency: 20, + chain_availability_period: 4, + thread_availability_period: 4, + max_upward_queue_count: 8, + max_upward_queue_size: 1024 * 1024, + max_downward_message_size: 1024, + ump_service_total_weight: Weight::from_parts(4 * 1_000_000_000, 0), + max_upward_message_size: 50 * 1024, + max_upward_message_num_per_candidate: 5, + hrmp_sender_deposit: 0, + hrmp_recipient_deposit: 0, + hrmp_channel_max_capacity: 8, + hrmp_channel_max_total_size: 8 * 1024, + hrmp_max_parachain_inbound_channels: 4, + hrmp_max_parathread_inbound_channels: 4, + hrmp_channel_max_message_size: 1024 * 1024, + hrmp_max_parachain_outbound_channels: 4, + hrmp_max_parathread_outbound_channels: 4, + hrmp_max_message_num_per_candidate: 5, + dispute_period: 6, + no_show_slots: 2, + n_delay_tranches: 25, + needed_approvals: 2, + relay_vrf_modulo_samples: 2, + zeroth_delay_tranche_width: 0, + ..Default::default() + } +} + +pub fn parent_account_id() -> mangata_polkadot_runtime::AccountId { + let location = (Parent,); + mangata_polkadot_runtime::xcm_config::LocationToAccountId::convert(location.into()).unwrap() +} + +pub fn child_account_id( + para: u32, +) -> ::AccountId { + let location = (Parachain(para),); + polkadot_runtime::xcm_config::SovereignAccountOf::convert(location.into()).unwrap() +} + +pub fn sibling_account_account_id( + para: u32, + who: sp_runtime::AccountId32, +) -> mangata_polkadot_runtime::AccountId { + let location = + (Parent, Parachain(para), Junction::AccountId32 { network: None, id: who.into() }); + mangata_polkadot_runtime::xcm_config::LocationToAccountId::convert(location.into()).unwrap() +} + +pub fn reserve_account(id: u32) -> mangata_polkadot_runtime::AccountId { + polkadot_parachain::primitives::Sibling::from(id).into_account_truncating() +} + +pub fn polkadot_ext() -> sp_io::TestExternalities { + use polkadot_runtime::{Runtime, System}; + + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + pallet_balances::GenesisConfig:: { + balances: vec![(ALICE, 1_000_000_000_000 * unit(12))], + } + .assimilate_storage(&mut t) + .unwrap(); + + polkadot_runtime_parachains::configuration::GenesisConfig:: { + config: default_parachains_host_configuration(), + } + .assimilate_storage(&mut t) + .unwrap(); + + >::assimilate_storage( + &pallet_xcm::GenesisConfig { safe_xcm_version: Some(3) }, + &mut t, + ) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { + use mangata_polkadot_runtime::{Runtime, System}; + + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + orml_tokens::GenesisConfig:: { + balances: vec![ + (ALICE, 0, 100 * unit(18)), + (ALICE, 1, 0), + (ALICE, 2, 0), + (ALICE, 3, 0), + (ALICE, mangata_polkadot_runtime::DOTTokenId::get(), INITIAL_BALANCE), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + >::assimilate_storage( + ¶chain_info::GenesisConfig { parachain_id: parachain_id.into() }, + &mut t, + ) + .unwrap(); + + >::assimilate_storage( + &pallet_xcm::GenesisConfig { safe_xcm_version: Some(3) }, + &mut t, + ) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn xpara_ext(parachain_id: u32) -> sp_io::TestExternalities { + use xtokens_parachain::{Runtime, System}; + + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + orml_tokens::GenesisConfig:: { + balances: vec![ + (ALICE, xtokens_parachain::CurrencyId::A, 100 * unit(18)), + // (ALICE, 1, 0), + // (ALICE, 2, 0), + // (ALICE, 3, 0), + // (ALICE, xtokens_parachain::DOTTokenId::get(), INITIAL_BALANCE), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + >::assimilate_storage( + ¶chain_info::GenesisConfig { parachain_id: parachain_id.into() }, + &mut t, + ) + .unwrap(); + + >::assimilate_storage( + &pallet_xcm::GenesisConfig { safe_xcm_version: Some(3) }, + &mut t, + ) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} diff --git a/mvr/runtime/mangata-polkadot/Cargo.toml b/mvr/runtime/mangata-polkadot/Cargo.toml new file mode 100644 index 0000000000..c319b7dc4e --- /dev/null +++ b/mvr/runtime/mangata-polkadot/Cargo.toml @@ -0,0 +1,163 @@ +[package] +name = "mangata-polkadot-runtime" +version = "0.1.0" +authors = ["Mangata Team"] +license = "Unlicense" +edition = "2021" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[build-dependencies] +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.42" } + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.4.1", optional = true } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +smallvec = "1.10.0" + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-weights = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.42" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } + +# Cumulus +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-session-benchmarking = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false, version = "3.0.0"} +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +parachain-info = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } + +# ORML +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } + +[features] +default = [ + "std", +] +std = [ + "codec/std", + "log/std", + "scale-info/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-collator-selection/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-xcm/std", + "parachain-info/std", + "polkadot-parachain/std", + "polkadot-runtime-common/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + "substrate-wasm-builder", + "orml-tokens/std", + "orml-traits/std", +] + +runtime-benchmarks = [ + "hex-literal", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "orml-tokens/runtime-benchmarks", +] + +try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", +] diff --git a/mvr/runtime/mangata-polkadot/build.rs b/mvr/runtime/mangata-polkadot/build.rs new file mode 100644 index 0000000000..02d6973f29 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/build.rs @@ -0,0 +1,13 @@ +#[cfg(feature = "std")] +fn main() { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build() +} + +/// The wasm builder is deactivated when compiling +/// this crate for wasm to speed up the compilation. +#[cfg(not(feature = "std"))] +fn main() {} diff --git a/mvr/runtime/mangata-polkadot/src/lib.rs b/mvr/runtime/mangata-polkadot/src/lib.rs new file mode 100644 index 0000000000..2dd223e4e4 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/lib.rs @@ -0,0 +1,777 @@ +#![cfg_attr(not(feature = "std"), no_std)] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. +#![recursion_limit = "256"] + +// Make the WASM binary available. +#[cfg(feature = "std")] +include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); + +mod weights; + +pub mod xcm_config; + +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use smallvec::smallvec; +use sp_api::impl_runtime_apis; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, MultiSignature, +}; + +use sp_std::prelude::*; +#[cfg(feature = "std")] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +use frame_support::{ + construct_runtime, + dispatch::DispatchClass, + parameter_types, + traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, Nothing}, + weights::{ + constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, + }, + PalletId, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; + +use orml_traits::parameter_type_with_key; +use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; +pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; +use xcm_config::{RelayLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; + +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; + +// Polkadot imports +use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; + +use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; + +// XCM Imports +use xcm::latest::prelude::BodyId; +use xcm_executor::XcmExecutor; + +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = MultiSignature; + +/// Some way of identifying an account on the chain. We intentionally make it equivalent +/// to the public key of our transaction signing scheme. +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// An index to a block. +pub type BlockNumber = u32; + +/// The address format for describing accounts. +pub type Address = MultiAddress; + +/// Block header type as expected by this runtime. +pub type Header = generic::Header; + +/// Block type as expected by this runtime. +pub type Block = generic::Block; + +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; + +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; + +/// The SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, +); + +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; + +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +pub mod dot_currency{ + use super::Balance; + pub const UNITS: Balance = 10_000_000_000; + pub const DOLLARS: Balance = UNITS; // 10_000_000_000 + pub const GRAND: Balance = DOLLARS * 1_000; // 10_000_000_000_000 + pub const CENTS: Balance = DOLLARS / 100; // 100_000_000 + pub const MILLICENTS: Balance = CENTS / 1_000; // 100_000 +} + +/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the +/// node's balance type. +/// +/// This should typically create a mapping between the following ranges: +/// - `[0, MAXIMUM_BLOCK_WEIGHT]` +/// - `[Balance::min, Balance::max]` +/// +/// Yet, it can be used for any other sort of change to weight-fee. Some examples being: +/// - Setting it to `0` will essentially disable the weight fee. +/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. +pub struct WeightToFee; +impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in MVR, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 DOT CENT: + let p = dot_currency::CENTS / 10; + let q = 10 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } +} + +// pub const DOT_MGX_SCALE_FACTOR_UNADJUSTED: u128 = 10_000_000_000_u128; // 10_000 as DOT/MGX, with 6 decimals accounted for (12 - DOT, 18 - MGX) +// +// pub fn base_tx_in_mgx() -> Balance { +// UNIT +// } +// +// pub fn mgx_per_second() -> u128 { +// let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time()); +// let base_per_second = (WEIGHT_REF_TIME_PER_SECOND / base_weight as u64) as u128; +// base_per_second * base_tx_in_mgx() +// } +// +// pub fn dot_per_second() -> u128 { +// mgx_per_second() / DOT_MGX_SCALE_FACTOR_UNADJUSTED as u128 +// } + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use sp_runtime::{generic, traits::BlakeTwo256}; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; +} + +impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } +} + +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("mangata-parachain-dot"), + impl_name: create_runtime_str!("mangata-parachain-dot"), + authoring_version: 1, + spec_version: 1, + impl_version: 0, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_version: 1, +}; + +/// This determines the average expected block time that we are targeting. +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. +/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked +/// up by `pallet_aura` to implement `fn slot_duration()`. +/// +/// Change this to adjust the block time. +pub const MILLISECS_PER_BLOCK: u64 = 12000; + +// NOTE: Currently it is not possible to change the slot duration after the chain has started. +// Attempting to do so will brick block production. +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + +// Time is measured by number of blocks. +pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); +pub const HOURS: BlockNumber = MINUTES * 60; +pub const DAYS: BlockNumber = HOURS * 24; + +// Unit = the base number of indivisible units for balances +pub const UNIT: Balance = 1_000_000_000_000_000_000; +pub const MILLIUNIT: Balance = 1_000_000_000_000_000; +pub const MICROUNIT: Balance = 1_000_000_000_000; + +/// The existential deposit. Set to 1/10 of the Connected Relay Chain. +pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; + +/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is +/// used to limit the maximal weight of a single extrinsic. +const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); + +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by +/// `Operational` extrinsics. +const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); + +/// We allow for 0.5 of a second of compute with a 12 second average block time. +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), + cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, +); + +/// The version information used to identify this runtime when compiled natively. +#[cfg(feature = "std")] +pub fn native_version() -> NativeVersion { + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } +} + +parameter_types! { + pub const Version: RuntimeVersion = VERSION; + + // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. + // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the + // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize + // the lazy contract deletion. + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); + pub const SS58Prefix: u16 = 42; +} + +// Configure FRAME pallets to include in runtime. + +impl frame_system::Config for Runtime { + /// The identifier used to distinguish between accounts. + type AccountId = AccountId; + /// The aggregated dispatch type that is available for extrinsics. + type RuntimeCall = RuntimeCall; + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. + type Lookup = AccountIdLookup; + /// The index type for storing how many extrinsics an account has signed. + type Index = Index; + /// The index type for blocks. + type BlockNumber = BlockNumber; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + /// The header type. + type Header = generic::Header; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + /// The ubiquitous origin type. + type RuntimeOrigin = RuntimeOrigin; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + /// Runtime version. + type Version = Version; + /// Converts a module to an index of this module in the runtime. + type PalletInfo = PalletInfo; + /// The data to be stored in an account. + type AccountData = (); + /// What to do if a new account is created. + type OnNewAccount = (); + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// The weight of database operations that the runtime can invoke. + type DbWeight = RocksDbWeight; + /// The basic call filter to use in dispatchable. + type BaseCallFilter = Everything; + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = (); + /// Block & extrinsics weights: base values and limits. + type BlockWeights = RuntimeBlockWeights; + /// The maximum length of a block (in bytes). + type BlockLength = RuntimeBlockLength; + /// This is used as an identifier of the chain. 42 is the generic substrate prefix. + type SS58Prefix = SS58Prefix; + /// The action to take on a Runtime Upgrade + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl pallet_timestamp::Config for Runtime { + /// A timestamp: milliseconds since the unix epoch. + type Moment = u64; + type OnTimestampSet = Aura; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; + type WeightInfo = (); +} + +impl pallet_authorship::Config for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; + type EventHandler = (CollatorSelection,); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; +} + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = 10 * dot_currency::MILLICENTS; + pub const DOTTokenId: u32 = 4; +} +pub type OrmlCurrencyAdapter = orml_tokens::CurrencyAdapter; + +impl pallet_transaction_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = ConstU8<5>; +} + +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + +parameter_types! { + pub const FixedReserveAssetTransferTrapCost : Balance = 10_000_000_000; // 0.01 DOT +} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = + xcm_config::ExecutorWrapper, FixedReserveAssetTransferTrapCost>; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = (); + type PriceForSiblingDelivery = (); +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRoot; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; +} + +impl pallet_session::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ValidatorId = ::AccountId; + // we don't have stash and controller, thus we don't need the convert as well. + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ShouldEndSession = pallet_session::PeriodicSessions; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionManager = CollatorSelection; + // Essentially just Aura, but let's be pedantic. + type SessionHandler = ::KeyTypeIdProviders; + type Keys = SessionKeys; + type WeightInfo = (); +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = ConstU32<100_000>; +} + +parameter_types! { + pub const PotId: PalletId = PalletId(*b"PotStake"); + pub const MaxCandidates: u32 = 1000; + pub const MinCandidates: u32 = 5; + pub const SessionLength: BlockNumber = 6 * HOURS; + pub const MaxInvulnerables: u32 = 100; + // StakingAdmin pluralistic body. + pub const StakingAdminBodyId: BodyId = BodyId::Defense; +} + +/// We allow root and the StakingAdmin to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + +impl pallet_collator_selection::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = OrmlCurrencyAdapter; + type UpdateOrigin = CollatorSelectionUpdateOrigin; + type PotId = PotId; + type MaxCandidates = MaxCandidates; + type MinCandidates = MinCandidates; + type MaxInvulnerables = MaxInvulnerables; + // should be a multiple of session or things will get inconsistent + type KickThreshold = Period; + type ValidatorId = ::AccountId; + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ValidatorRegistration = Session; + type WeightInfo = (); +} + +parameter_type_with_key! { + pub ExistentialDeposits: |_token_id: u32| -> u128 { + 0_u128 + }; +} + +parameter_types! { + pub const MaxLocks:u32 = 50; +} + +impl orml_tokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = u128; + type Amount = i128; + type CurrencyId = u32; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type MaxLocks = MaxLocks; + type DustRemovalWhitelist = Nothing; + type CurrencyHooks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; +} + +impl pallet_sudo::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; +} +// Create the runtime by composing the FRAME pallets that were previously configured. +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = opaque::Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + // System support stuff. + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, + Sudo: pallet_sudo = 4, + + // Monetary stuff. + Tokens: orml_tokens = 10, + TransactionPayment: pallet_transaction_payment = 11, + + // Collator support. The order of these 4 are important and shall not change. + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + DmpQueue: cumulus_pallet_dmp_queue = 33, + } +); + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + frame_benchmarking::define_benchmarks!( + [frame_system, SystemBench::] + [orml_tokens, Tokens] + [pallet_session, SessionBench::] + [pallet_timestamp, Timestamp] + [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] + ); +} + +impl_runtime_apis! { + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + } + + fn authorities() -> Vec { + Aura::authorities().into_inner() + } + } + + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block) + } + + fn initialize_block(header: &::Header) { + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + Executive::finalize_block() + } + + fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { + data.create_extrinsics() + } + + fn check_inherents( + block: Block, + data: sp_inherents::InherentData, + ) -> sp_inherents::CheckInherentsResult { + data.check_extrinsics(&block) + } + } + + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + tx: ::Extrinsic, + block_hash: ::Hash, + ) -> TransactionValidity { + Executive::validate_transaction(source, tx, block_hash) + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + Executive::offchain_worker(header) + } + } + + impl sp_session::SessionKeys for Runtime { + fn generate_session_keys(seed: Option>) -> Vec { + SessionKeys::generate(seed) + } + + fn decode_session_keys( + encoded: Vec, + ) -> Option, KeyTypeId)>> { + SessionKeys::decode_into_raw_public_keys(&encoded) + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Index { + System::account_nonce(account) + } + } + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { + fn query_info( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: RuntimeCall, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + + impl cumulus_primitives_core::CollectCollationInfo for Runtime { + fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { + ParachainSystem::collect_collation_info(header) + } + } + + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + let weight = Executive::try_runtime_upgrade(checks).unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + + fn execute_block( + block: Block, + state_root_check: bool, + signature_check: bool, + select: frame_try_runtime::TryStateSelect, + ) -> Weight { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. + Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() + } + } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn benchmark_metadata(extra: bool) -> ( + Vec, + Vec, + ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; + use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + + let mut list = Vec::::new(); + list_benchmarks!(list, extra); + + let storage_info = AllPalletsWithSystem::storage_info(); + return (list, storage_info) + } + + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + + use frame_system_benchmarking::Pallet as SystemBench; + impl frame_system_benchmarking::Config for Runtime {} + + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + impl cumulus_pallet_session_benchmarking::Config for Runtime {} + + use frame_support::traits::WhitelistedStorageKeys; + let whitelist = AllPalletsWithSystem::whitelisted_storage_keys(); + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + add_benchmarks!(params, batches); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } +} + +struct CheckInherents; + +impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { + fn check_inherents( + block: &Block, + relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, + ) -> sp_inherents::CheckInherentsResult { + let relay_chain_slot = relay_state_proof + .read_slot() + .expect("Could not read the relay chain slot from the proof"); + + let inherent_data = + cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( + relay_chain_slot, + sp_std::time::Duration::from_secs(6), + ) + .create_inherent_data() + .expect("Could not create the timestamp inherent data"); + + inherent_data.check_extrinsics(block) + } +} + +cumulus_pallet_parachain_system::register_validate_block! { + Runtime = Runtime, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, + CheckInherents = CheckInherents, +} diff --git a/mvr/runtime/mangata-polkadot/src/weights/block_weights.rs b/mvr/runtime/mangata-polkadot/src/weights/block_weights.rs new file mode 100644 index 0000000000..4fab426623 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/weights/block_weights.rs @@ -0,0 +1,81 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-04-28 (Y/M/D) +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! +//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development` +//! WARMUPS: `10`, REPEAT: `100` +//! WEIGHT-PATH: `runtime/polkadot/constants/src/weights/` +//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0` + +// Executed Command: +// ./target/production/polkadot +// benchmark +// overhead +// --chain=polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --weight-path=runtime/polkadot/constants/src/weights/ +// --warmup=10 +// --repeat=100 +// --header=./file_header.txt + +use sp_core::parameter_types; +use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight}; + +parameter_types! { + /// Time to execute an empty block. + /// Calculated by multiplying the *Average* with `1.0` and adding `0`. + /// + /// Stats nanoseconds: + /// Min, Max: 3_364_185, 3_544_830 + /// Average: 3_427_584 + /// Median: 3_414_329 + /// Std-Dev: 51775.25 + /// + /// Percentiles nanoseconds: + /// 99th: 3_541_964 + /// 95th: 3_517_661 + /// 75th: 3_471_477 + pub const BlockExecutionWeight: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(3_427_584), 0); +} + +#[cfg(test)] +mod test_weights { + use sp_weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::BlockExecutionWeight::get(); + + // At least 100 µs. + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 100 µs." + ); + // At most 50 ms. + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 50 ms." + ); + } +} diff --git a/mvr/runtime/mangata-polkadot/src/weights/extrinsic_weights.rs b/mvr/runtime/mangata-polkadot/src/weights/extrinsic_weights.rs new file mode 100644 index 0000000000..d64e12c244 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/weights/extrinsic_weights.rs @@ -0,0 +1,81 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-04-28 (Y/M/D) +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! +//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Development` +//! WARMUPS: `10`, REPEAT: `100` +//! WEIGHT-PATH: `runtime/polkadot/constants/src/weights/` +//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0` + +// Executed Command: +// ./target/production/polkadot +// benchmark +// overhead +// --chain=polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --weight-path=runtime/polkadot/constants/src/weights/ +// --warmup=10 +// --repeat=100 +// --header=./file_header.txt + +use sp_core::parameter_types; +use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight}; + +parameter_types! { + /// Time to execute a NO-OP extrinsic, for example `System::remark`. + /// Calculated by multiplying the *Average* with `1.0` and adding `0`. + /// + /// Stats nanoseconds: + /// Min, Max: 108_938, 111_576 + /// Average: 109_763 + /// Median: 109_696 + /// Std-Dev: 418.12 + /// + /// Percentiles nanoseconds: + /// 99th: 111_301 + /// 95th: 110_411 + /// 75th: 109_904 + pub const ExtrinsicBaseWeight: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(109_763), 0); +} + +#[cfg(test)] +mod test_weights { + use sp_weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::ExtrinsicBaseWeight::get(); + + // At least 10 µs. + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 10 µs." + ); + // At most 1 ms. + assert!( + w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 1 ms." + ); + } +} diff --git a/mvr/runtime/mangata-polkadot/src/weights/mod.rs b/mvr/runtime/mangata-polkadot/src/weights/mod.rs new file mode 100644 index 0000000000..3f8bc612c0 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/weights/mod.rs @@ -0,0 +1,28 @@ +// 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. + +//! Expose the auto generated weight files. + +pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; +pub mod rocksdb_weights; + +pub use block_weights::BlockExecutionWeight; +pub use extrinsic_weights::ExtrinsicBaseWeight; +pub use paritydb_weights::constants::ParityDbWeight; +pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/mvr/runtime/mangata-polkadot/src/weights/paritydb_weights.rs b/mvr/runtime/mangata-polkadot/src/weights/paritydb_weights.rs new file mode 100644 index 0000000000..4338d928d8 --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/weights/paritydb_weights.rs @@ -0,0 +1,63 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights + /// are available for brave runtime engineers who may want to try this out as default. + pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::ParityDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/mvr/runtime/mangata-polkadot/src/weights/rocksdb_weights.rs b/mvr/runtime/mangata-polkadot/src/weights/rocksdb_weights.rs new file mode 100644 index 0000000000..1d115d963f --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/weights/rocksdb_weights.rs @@ -0,0 +1,63 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout + /// the runtime. + pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::RocksDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/mvr/runtime/mangata-polkadot/src/xcm_config.rs b/mvr/runtime/mangata-polkadot/src/xcm_config.rs new file mode 100644 index 0000000000..0321c9d69f --- /dev/null +++ b/mvr/runtime/mangata-polkadot/src/xcm_config.rs @@ -0,0 +1,322 @@ +use super::{ + AccountId, AllPalletsWithSystem, OrmlCurrencyAdapter, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue, +}; + +use core::marker::PhantomData; +use frame_support::{ + log, match_types, parameter_types, + traits::{ConstU32, Contains, Everything, Nothing, ProcessMessageError}, + weights::Weight, +}; +use frame_system::EnsureRoot; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; + +use cumulus_primitives_core::MultiLocation; +use xcm::latest::prelude::*; +use xcm_builder::{ + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, + CreateMatcher, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + IsConcrete, MatchXcm, NativeAsset, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, +}; +use xcm_executor::{traits::ShouldExecute, XcmExecutor}; +// use cumulus_primitives_core::Instruction::*; + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: Option = None; + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the parent `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, +); + +/// Means for transacting assets on this chain. +pub type LocalAssetTransactor = CurrencyAdapter< + // Use this currency: + OrmlCurrencyAdapter, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognized. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} + +pub struct AllowSiblingParachainReserveTransferAssetTrap(PhantomData); +impl> ShouldExecute + for AllowSiblingParachainReserveTransferAssetTrap +{ + fn should_execute( + origin: &MultiLocation, + instructions: &mut [Instruction], + max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ProcessMessageError> { + log::trace!( + target: "xcm::barriers", + "AllowSiblingParachainReserveTransferAssetTrap origin: {:?}, instructions: {:?}, max_weight: {:?}, weight_credit: {:?}", + origin, instructions, max_weight, _weight_credit, + ); + frame_support::ensure!(T::contains(origin), ProcessMessageError::Unsupported); + let end = instructions.len().min(4); + instructions[..end] + .matcher() + .match_next_inst(|inst| match inst { + ReserveAssetDeposited(..) => Ok(()), // to be trapped + _ => Err(ProcessMessageError::BadFormat), + })? + .match_next_inst(|inst| match inst { + WithdrawAsset(..) => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + })? + .skip_inst_while(|inst| matches!(inst, ClearOrigin))? + .match_next_inst(|inst| match inst { + BuyExecution { weight_limit, .. } if *weight_limit == Unlimited => Ok(()), + _ => Err(ProcessMessageError::Overweight(max_weight)), + })?; + Ok(()) + } +} + +match_types! { + pub type RelayNetworkOnly: impl Contains = { + MultiLocation { parents: 1, interior: Here } + }; +} + +match_types! { + pub type SibilingParachain: impl Contains = { + MultiLocation { parents: 1, interior: X1(Parachain (_) )} + }; +} + +pub type Barrier = ( + TakeWeightCredit, + AllowUnpaidExecutionFrom, + AllowSiblingParachainReserveTransferAssetTrap, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, +); + +use frame_support::weights::constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}; + +pub fn dot_per_second() -> u128 { + let base_weight = crate::Balance::from(ExtrinsicBaseWeight::get().ref_time()); + let base_per_second = (WEIGHT_REF_TIME_PER_SECOND / base_weight as u64) as u128; + base_per_second * 1_000_000_000_000_u128 / 100 // 0.01 DOT +} + +parameter_types! { + pub DotPerSecondPerByte: (AssetId, u128, u128) = (MultiLocation::parent().into(), dot_per_second(), dot_per_second()); +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = XcmRouter; + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = NativeAsset; + type IsTeleporter = (); // Teleporting is disabled. + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = FixedRateOfFungible; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Nothing; +} + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +pub struct ExecutorWrapper(PhantomData<(Executor, FeeAmount)>); + +impl ExecuteXcm for ExecutorWrapper +where + Executor: ExecuteXcm, + FeeAmount: sp_runtime::traits::Get, +{ + type Prepared = Executor::Prepared; + + fn prepare(message: Xcm) -> core::result::Result> { + Executor::prepare(message) + } + + fn execute( + origin: impl Into, + pre: Self::Prepared, + hash: XcmHash, + weight_credit: Weight, + ) -> Outcome { + Executor::execute(origin, pre, hash, weight_credit) + } + + fn charge_fees(location: impl Into, fees: MultiAssets) -> XcmResult { + Executor::charge_fees(location, fees) + } + + fn execute_xcm( + origin: impl Into, + message: Xcm, + hash: XcmHash, + weight_limit: Weight, + ) -> Outcome { + let mut it = message.0.iter(); + let msg = if let ( + Some(ReserveAssetDeposited(deposited_assets)), + Some(ClearOrigin), + Some(BuyExecution { fees: _, weight_limit: _ }), + Some(DepositAsset { assets: _, beneficiary: _ }), + ) = (it.next(), it.next(), it.next(), it.next()) + { + let amount = FeeAmount::get(); + let location = MultiLocation { parents: 1, interior: Here }; + let fee_asset = MultiAsset { id: AssetId::Concrete(location), fun: Fungible(amount) }; + let mut withdraw_assets = MultiAssets::new(); + withdraw_assets.push(fee_asset.clone()); + + let mut xcm: sp_std::vec::Vec<_> = Default::default(); + xcm.push(ReserveAssetDeposited(deposited_assets.clone())); + xcm.push(WithdrawAsset(withdraw_assets)); + xcm.push(ClearOrigin); + xcm.push(BuyExecution { fees: fee_asset, weight_limit: Unlimited }); + + Xcm(xcm) + } else { + message + }; + + Executor::execute_xcm(origin, msg, hash, weight_limit) + } + + fn execute_xcm_in_credit( + origin: impl Into, + message: Xcm, + hash: XcmHash, + weight_limit: Weight, + weight_credit: Weight, + ) -> Outcome { + Executor::execute_xcm_in_credit(origin, message, hash, weight_limit, weight_credit) + } +} + +/// allow for InitiateReserveWithdraw transfers to relay network +pub struct StrictXcmExecuteFilter; +impl Contains<(MultiLocation, Xcm)> for StrictXcmExecuteFilter { + fn contains(t: &(MultiLocation, Xcm)) -> bool { + match t { + (MultiLocation { parents: 0, interior: X1(AccountId32 { .. }) }, msg) + if msg.len() == 2 => + { + let mut it = msg.inner().iter(); + if let (Some(WithdrawAsset(..)), Some(InitiateReserveWithdraw { .. })) = + (it.next(), it.next()) + { + true + } else { + false + } + }, + _ => false, + } + } +} + +impl pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = StrictXcmExecuteFilter; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Nothing; + type XcmReserveTransferFilter = Nothing; + type Weigher = FixedWeightBounds; + type UniversalLocation = UniversalLocation; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + // ^ Override for AdvertisedXcmVersion default + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = OrmlCurrencyAdapter; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +} diff --git a/mvr/runtime/xtokens-parachain/Cargo.toml b/mvr/runtime/xtokens-parachain/Cargo.toml new file mode 100644 index 0000000000..2e1587efb7 --- /dev/null +++ b/mvr/runtime/xtokens-parachain/Cargo.toml @@ -0,0 +1,167 @@ +[package] +name = "xtokens-parachain" +version = "0.1.0" +authors = ["Mangata Team"] +license = "Unlicense" +edition = "2021" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +# [build-dependencies] +# substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.42" } + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136" } +hex-literal = { version = "0.4.1", optional = true } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +smallvec = "1.10.0" + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.42" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.42" } + +# Cumulus +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-session-benchmarking = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false, version = "3.0.0"} +cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } +parachain-info = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.42", default-features = false } + +# ORML +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.42", default-features = false } + +[features] +default = [ + "std", +] +std = [ + "codec/std", + "log/std", + "scale-info/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-collator-selection/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-xcm/std", + "parachain-info/std", + "polkadot-parachain/std", + "polkadot-runtime-common/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + # "substrate-wasm-builder", + "orml-tokens/std", + "orml-traits/std", + "orml-xcm/std", + "orml-xtokens/std", +] + +runtime-benchmarks = [ + "hex-literal", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "orml-tokens/runtime-benchmarks", +] + +try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-session/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", +] diff --git a/mvr/runtime/xtokens-parachain/src/lib.rs b/mvr/runtime/xtokens-parachain/src/lib.rs new file mode 100644 index 0000000000..9900a27e17 --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/lib.rs @@ -0,0 +1,500 @@ +#![cfg_attr(not(feature = "std"), no_std)] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. +#![recursion_limit = "256"] + +mod weights; +pub mod xcm_config; + +use codec::{Decode, Encode}; +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use frame_support::{BoundedVec, RuntimeDebug}; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; +use smallvec::smallvec; +use sp_runtime::traits::Convert; + +use sp_runtime::{ + generic, + traits::{AccountIdLookup, BlakeTwo256, IdentifyAccount, Verify}, + MultiSignature, +}; + +use sp_std::prelude::*; + +use frame_support::{ + construct_runtime, parameter_types, + traits::{Everything, Nothing}, + weights::{ + constants::WEIGHT_REF_TIME_PER_SECOND, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, + }, +}; +use frame_system::EnsureRoot; + +use orml_traits::parameter_type_with_key; + +use cumulus_primitives_core::{ + Concrete, + Fungibility::Fungible, + GeneralKey, + Junction::{self, Parachain}, + Junctions::{X1, X2}, + MultiAsset, MultiLocation, Parent, +}; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; +use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; + +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; + +// Polkadot imports +use polkadot_runtime_common::BlockHashCount; + +use weights::{ExtrinsicBaseWeight, RocksDbWeight}; + +// XCM Imports + +use xcm_executor::XcmExecutor; + +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = MultiSignature; + +/// Some way of identifying an account on the chain. We intentionally make it equivalent +/// to the public key of our transaction signing scheme. +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// An index to a block. +pub type BlockNumber = u32; + +/// The address format for describing accounts. +pub type Address = MultiAddress; + +/// Block header type as expected by this runtime. +pub type Header = generic::Header; + +/// Block type as expected by this runtime. +pub type Block = generic::Block; + +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; + +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; + +/// The SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, +); + +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; + +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the +/// node's balance type. +/// +/// This should typically create a mapping between the following ranges: +/// - `[0, MAXIMUM_BLOCK_WEIGHT]` +/// - `[Balance::min, Balance::max]` +/// +/// Yet, it can be used for any other sort of change to weight-fee. Some examples being: +/// - Setting it to `0` will essentially disable the weight fee. +/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. +pub struct WeightToFee; +impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: + // in our template, we map to 1/10 of that, or 1/10 MILLIUNIT + let p = UNIT; + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } +} + +pub const DOT_MGX_SCALE_FACTOR_UNADJUSTED: u128 = 10_000_000_000_u128; // 10_000 as DOT/MGX, with 6 decimals accounted for (12 - DOT, 18 - MGX) + +pub fn base_tx_in_mgx() -> Balance { + UNIT +} + +pub fn mgx_per_second() -> u128 { + let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time()); + let base_per_second = (WEIGHT_REF_TIME_PER_SECOND / base_weight as u64) as u128; + base_per_second * base_tx_in_mgx() +} + +pub fn dot_per_second() -> u128 { + mgx_per_second() / DOT_MGX_SCALE_FACTOR_UNADJUSTED as u128 +} + +/// This determines the average expected block time that we are targeting. +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. +/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked +/// up by `pallet_aura` to implement `fn slot_duration()`. +/// +/// Change this to adjust the block time. +pub const MILLISECS_PER_BLOCK: u64 = 12000; + +// NOTE: Currently it is not possible to change the slot duration after the chain has started. +// Attempting to do so will brick block production. +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + +// Time is measured by number of blocks. +pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); +pub const HOURS: BlockNumber = MINUTES * 60; +pub const DAYS: BlockNumber = HOURS * 24; + +// Unit = the base number of indivisible units for balances +pub const UNIT: Balance = 1_000_000_000_000_000_000; +pub const MILLIUNIT: Balance = 1_000_000_000_000_000; +pub const MICROUNIT: Balance = 1_000_000_000_000; + +/// The existential deposit. Set to 1/10 of the Connected Relay Chain. +pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; + +/// We allow for 0.5 of a second of compute with a 12 second average block time. +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), + cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, +); + +impl frame_system::Config for Runtime { + /// The identifier used to distinguish between accounts. + type AccountId = AccountId; + /// The aggregated dispatch type that is available for extrinsics. + type RuntimeCall = RuntimeCall; + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. + type Lookup = AccountIdLookup; + /// The index type for storing how many extrinsics an account has signed. + type Index = Index; + /// The index type for blocks. + type BlockNumber = BlockNumber; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + /// The header type. + type Header = generic::Header; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + /// The ubiquitous origin type. + type RuntimeOrigin = RuntimeOrigin; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + /// Runtime version. + type Version = (); + /// Converts a module to an index of this module in the runtime. + type PalletInfo = PalletInfo; + /// The data to be stored in an account. + type AccountData = (); + /// What to do if a new account is created. + type OnNewAccount = (); + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// The weight of database operations that the runtime can invoke. + type DbWeight = RocksDbWeight; + /// The basic call filter to use in dispatchable. + type BaseCallFilter = Everything; + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = (); + /// Block & extrinsics weights: base values and limits. + type BlockWeights = (); + /// The maximum length of a block (in bytes). + type BlockLength = (); + /// This is used as an identifier of the chain. 42 is the generic substrate prefix. + type SS58Prefix = (); + /// The action to take on a Runtime Upgrade + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = (); + type PriceForSiblingDelivery = (); +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRoot; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |_token_id: CurrencyId| -> u128 { + 0_u128 + }; +} + +parameter_types! { + pub const MaxLocks:u32 = 50; +} + +#[derive( + Encode, + Decode, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + codec::MaxEncodedLen, + TypeInfo, +)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub enum CurrencyId { + /// Relay chain token. + R, + /// Parachain A token. + A, + /// Parachain A A1 token. + A1, + /// Parachain B token. + B, + /// Parachain B B1 token + B1, + /// Parachain B B2 token + B2, + /// Parachain C token + C, + /// Parachain D token + D, +} + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = 10 * MICROUNIT; + pub const ParachainTokenId: CurrencyId = CurrencyId::A; +} + +pub type OrmlCurrencyAdapter = orml_tokens::CurrencyAdapter; + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: CurrencyId) -> Option { + match id { + CurrencyId::R => Some(Parent.into()), + CurrencyId::A => Some( + ( + Parent, + Parachain(1), + Junction::from(BoundedVec::try_from(b"A".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::A1 => Some( + ( + Parent, + Parachain(1), + Junction::from(BoundedVec::try_from(b"A1".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::B => Some( + ( + Parent, + Parachain(2), + Junction::from(BoundedVec::try_from(b"B".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::B1 => Some( + ( + Parent, + Parachain(2), + Junction::from(BoundedVec::try_from(b"B1".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::B2 => Some( + ( + Parent, + Parachain(2), + Junction::from(BoundedVec::try_from(b"B2".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::C => Some( + ( + Parent, + Parachain(3), + Junction::from(BoundedVec::try_from(b"C".to_vec()).unwrap()), + ) + .into(), + ), + CurrencyId::D => Some( + ( + Parent, + Parachain(4), + Junction::from(BoundedVec::try_from(b"D".to_vec()).unwrap()), + ) + .into(), + ), + } + } +} +impl Convert> for CurrencyIdConvert { + fn convert(l: MultiLocation) -> Option { + let mut a: Vec = "A".into(); + a.resize(32, 0); + let mut a1: Vec = "A1".into(); + a1.resize(32, 0); + let mut b: Vec = "B".into(); + b.resize(32, 0); + let mut b1: Vec = "B1".into(); + b1.resize(32, 0); + let mut b2: Vec = "B2".into(); + b2.resize(32, 0); + let mut c: Vec = "C".into(); + c.resize(32, 0); + let mut d: Vec = "D".into(); + d.resize(32, 0); + if l == MultiLocation::parent() { + return Some(CurrencyId::R) + } + match l { + MultiLocation { parents, interior } if parents == 1 => match interior { + X2(Parachain(1), GeneralKey { data, .. }) if data.to_vec() == a => + Some(CurrencyId::A), + X2(Parachain(1), GeneralKey { data, .. }) if data.to_vec() == a1 => + Some(CurrencyId::A1), + X2(Parachain(2), GeneralKey { data, .. }) if data.to_vec() == b => + Some(CurrencyId::B), + X2(Parachain(2), GeneralKey { data, .. }) if data.to_vec() == b1 => + Some(CurrencyId::B1), + X2(Parachain(2), GeneralKey { data, .. }) if data.to_vec() == b2 => + Some(CurrencyId::B2), + X2(Parachain(3), GeneralKey { data, .. }) if data.to_vec() == c => + Some(CurrencyId::C), + X2(Parachain(4), GeneralKey { data, .. }) if data.to_vec() == d => + Some(CurrencyId::D), + _ => None, + }, + MultiLocation { parents, interior } if parents == 0 => match interior { + X1(GeneralKey { data, .. }) if data.to_vec() == a => Some(CurrencyId::A), + X1(GeneralKey { data, .. }) if data.to_vec() == b => Some(CurrencyId::B), + X1(GeneralKey { data, .. }) if data.to_vec() == a1 => Some(CurrencyId::A1), + X1(GeneralKey { data, .. }) if data.to_vec() == b1 => Some(CurrencyId::B1), + X1(GeneralKey { data, .. }) if data.to_vec() == b2 => Some(CurrencyId::B2), + X1(GeneralKey { data, .. }) if data.to_vec() == c => Some(CurrencyId::C), + X1(GeneralKey { data, .. }) if data.to_vec() == d => Some(CurrencyId::D), + _ => None, + }, + _ => None, + } + } +} +impl Convert> for CurrencyIdConvert { + fn convert(a: MultiAsset) -> Option { + if let MultiAsset { fun: Fungible(_), id: Concrete(id) } = a { + Self::convert(id) + } else { + Option::None + } + } +} + +impl orml_tokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type Amount = i128; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type MaxLocks = MaxLocks; + type DustRemovalWhitelist = Nothing; + type CurrencyHooks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; +} + +// Create the runtime by composing the FRAME pallets that were previously configured. +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + // System support stuff. + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + ParachainInfo: parachain_info = 3, + + // Monetary stuff. + Tokens: orml_tokens = 10, + XTokens: orml_xtokens = 11, + + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + DmpQueue: cumulus_pallet_dmp_queue = 33, + OrmlXcm: orml_xcm = 34, + } +); diff --git a/mvr/runtime/xtokens-parachain/src/weights/block_weights.rs b/mvr/runtime/xtokens-parachain/src/weights/block_weights.rs new file mode 100644 index 0000000000..b2092d875c --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/weights/block_weights.rs @@ -0,0 +1,53 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, Weight}, + }; + + parameter_types! { + /// Importing a block with 0 Extrinsics. + pub const BlockExecutionWeight: Weight = + Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000), 0); + } + + #[cfg(test)] + mod test_weights { + use frame_support::weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::constants::BlockExecutionWeight::get(); + + // At least 100 µs. + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 100 µs." + ); + // At most 50 ms. + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 50 ms." + ); + } + } +} diff --git a/mvr/runtime/xtokens-parachain/src/weights/extrinsic_weights.rs b/mvr/runtime/xtokens-parachain/src/weights/extrinsic_weights.rs new file mode 100644 index 0000000000..332c3b324b --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/weights/extrinsic_weights.rs @@ -0,0 +1,53 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, Weight}, + }; + + parameter_types! { + /// Executing a NO-OP `System::remarks` Extrinsic. + pub const ExtrinsicBaseWeight: Weight = + Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); + } + + #[cfg(test)] + mod test_weights { + use frame_support::weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::constants::ExtrinsicBaseWeight::get(); + + // At least 10 µs. + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 10 µs." + ); + // At most 1 ms. + assert!( + w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 1 ms." + ); + } + } +} diff --git a/mvr/runtime/xtokens-parachain/src/weights/mod.rs b/mvr/runtime/xtokens-parachain/src/weights/mod.rs new file mode 100644 index 0000000000..ed0b4dbcd4 --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/weights/mod.rs @@ -0,0 +1,28 @@ +// 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. + +//! Expose the auto generated weight files. + +pub mod block_weights; +pub mod extrinsic_weights; +pub mod paritydb_weights; +pub mod rocksdb_weights; + +pub use block_weights::constants::BlockExecutionWeight; +pub use extrinsic_weights::constants::ExtrinsicBaseWeight; +pub use paritydb_weights::constants::ParityDbWeight; +pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/mvr/runtime/xtokens-parachain/src/weights/paritydb_weights.rs b/mvr/runtime/xtokens-parachain/src/weights/paritydb_weights.rs new file mode 100644 index 0000000000..4338d928d8 --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/weights/paritydb_weights.rs @@ -0,0 +1,63 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights + /// are available for brave runtime engineers who may want to try this out as default. + pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::ParityDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/mvr/runtime/xtokens-parachain/src/weights/rocksdb_weights.rs b/mvr/runtime/xtokens-parachain/src/weights/rocksdb_weights.rs new file mode 100644 index 0000000000..1d115d963f --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/weights/rocksdb_weights.rs @@ -0,0 +1,63 @@ +// 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. + +pub mod constants { + use frame_support::{ + parameter_types, + weights::{constants, RuntimeDbWeight}, + }; + + parameter_types! { + /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout + /// the runtime. + pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { + read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::RocksDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/mvr/runtime/xtokens-parachain/src/xcm_config.rs b/mvr/runtime/xtokens-parachain/src/xcm_config.rs new file mode 100644 index 0000000000..e4c25ff9cc --- /dev/null +++ b/mvr/runtime/xtokens-parachain/src/xcm_config.rs @@ -0,0 +1,359 @@ +use super::{ + AccountId, AllPalletsWithSystem, OrmlCurrencyAdapter, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue, +}; + +use core::{marker::PhantomData, ops::ControlFlow}; +use frame_support::{ + log, match_types, parameter_types, + traits::{ConstU32, Everything, Nothing, ProcessMessageError}, + weights::Weight, +}; +use frame_system::EnsureRoot; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use sp_runtime::traits::Convert; + +use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; +use xcm::latest::prelude::*; +use xcm_builder::{ + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CreateMatcher, CurrencyAdapter, + EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, MatchXcm, NativeAsset, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, +}; +use xcm_executor::{traits::ShouldExecute, XcmExecutor}; +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: Option = None; + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the parent `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, +); + +use xcm_executor::traits::MatchesFungible; +pub struct AllowAll; + +//TODO fix +impl MatchesFungible for AllowAll { + fn matches_fungible(a: &MultiAsset) -> Option { + match a.fun { + Fungible(amount) => Some(amount), + NonFungible(_) => None, + } + } +} + +/// Means for transacting assets on this chain. +pub type LocalAssetTransactor = CurrencyAdapter< + // Use this currency: + OrmlCurrencyAdapter, + // Use this currency when it is a fungible asset matching the given location or name: + AllowAll, // IsConcrete, + // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognized. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + pub const UnitWeightCost: Weight = Weight::from_parts(10, 10); + pub const BaseXcmWeight: Weight = Weight::from_parts(100_000_000, 100_000_000); + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; +} + +//TODO: move DenyThenTry to polkadot's xcm module. +/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) +where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry +where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut [Instruction], + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ProcessMessageError> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +// See issue +pub struct DenyReserveTransferToRelayChain; +impl ShouldExecute for DenyReserveTransferToRelayChain { + fn should_execute( + origin: &MultiLocation, + message: &mut [Instruction], + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ProcessMessageError> { + message.matcher().match_next_inst_while( + |_| true, + |inst| match inst { + InitiateReserveWithdraw { + reserve: MultiLocation { parents: 1, interior: Here }, + .. + } | + DepositReserveAsset { + dest: MultiLocation { parents: 1, interior: Here }, .. + } | + TransferReserveAsset { + dest: MultiLocation { parents: 1, interior: Here }, .. + } => { + Err(ProcessMessageError::Unsupported) // Deny + }, + // An unexpected reserve transfer has arrived from the Relay Chain. Generally, + // `IsReserve` should not allow this, but we just log it here. + ReserveAssetDeposited { .. } + if matches!(origin, MultiLocation { parents: 1, interior: Here }) => + { + log::warn!( + target: "xcm::barrier", + "Unexpected ReserveAssetDeposited from the Relay Chain", + ); + Ok(ControlFlow::Continue(())) + }, + _ => Ok(ControlFlow::Continue(())), + }, + )?; + + // Permit everything else + Ok(()) + } +} + +pub struct AllowAllCalls; +impl ShouldExecute for AllowAllCalls { + fn should_execute( + _origin: &MultiLocation, + message: &mut [Instruction], + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ProcessMessageError> { + if let Some(Instruction::::WithdrawAsset(_)) = message.iter_mut().next() { + todo!() + } + if let Some(Instruction::::WithdrawAsset(_)) = message.iter_mut().next() { + todo!() + } + // let mut msg: Vec> = vec![ + // WithdrawAsset( + // MultiAssets::from_sorted_and_deduplicated( + // vec![MultiAsset { + // id: AssetId::Concrete(MultiLocation { parents: 1, interior: Here }), + // fun: Fungible(1_000_000_000_000), + // }] + // ).unwrap() + // ), + // ]; + // msg.extend_from_slice(message); + // message = []; + // std::mem::drop(msg); + // message = msg.as_mut(); + Ok(()) + } +} + +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowAllCalls, + // ^^^ TODO: just for testing + AllowUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, +); + +parameter_types! { + pub DotPerSecondPerByte: (AssetId, u128, u128) = (Concrete(Parent.into()), 1, 1); +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = XcmRouter; + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = NativeAsset; + type IsTeleporter = (); // Teleporting is disabled. + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + //TODO: fine tune parameter + type Trader = FixedRateOfFungible; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; +} + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} + +impl pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + // TODO: CHANGE ME, enable any xcm execution + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + // disable any reserve transfers from parachain + type XcmReserveTransferFilter = Nothing; + type Weigher = FixedWeightBounds; + type UniversalLocation = UniversalLocation; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + // ^ Override for AdvertisedXcmVersion default + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = OrmlCurrencyAdapter; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = LocationToAccountId; + type MaxLockers = ConstU32<8>; + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +} + +impl orml_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SovereignOrigin = EnsureRoot; +} + +parameter_types! { + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(2001))); + pub const MaxAssetsForTransfer: usize = 3; +} + +match_types! { + pub type ParentOrParachains: impl Contains = { + MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X1(Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X2(Parachain(1), Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X2(Parachain(2), Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X2(Parachain(3), Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X2(Parachain(4), Junction::AccountId32 { .. }) } | + MultiLocation { parents: 1, interior: X2(Parachain(100), Junction::AccountId32 { .. }) } + }; +} + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(Junction::AccountId32 { network: None, id: account.into() }).into() + } +} + +parameter_type_with_key! { + pub ParachainMinFee: |location: MultiLocation| -> Option { + #[allow(clippy::match_ref_pats)] // false positive + match (location.parents, location.first_interior()) { + (1, Some(Parachain(3))) => Some(40), + _ => None, + } + }; +} + +impl orml_xtokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = crate::Balance; + type CurrencyId = crate::CurrencyId; + type CurrencyIdConvert = crate::CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type MultiLocationsFilter = Everything; + type MinXcmFee = ParachainMinFee; + type XcmExecutor = XcmExecutor; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type UniversalLocation = UniversalLocation; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type ReserveProvider = AbsoluteReserveProvider; +} diff --git a/node/Cargo.toml b/node/Cargo.toml index 422d7319ab..000f3df6aa 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -21,18 +21,16 @@ default = ['mangata-kusama', 'mangata-rococo'] mangata-kusama = [ "mangata-kusama-runtime/std", "xyk-rpc/std", - "pallet-vesting-mangata-rpc/std", "polkadot-cli/kusama-native", ] mangata-rococo = [ "mangata-rococo-runtime/std", "xyk-rpc/std", - "pallet-vesting-mangata-rpc/std", "polkadot-cli/rococo-native", ] #disable-execution = ['mangata-kusama-runtime/disable-execution'] runtime-benchmarks = ["mangata-kusama-runtime/runtime-benchmarks", "polkadot-cli/runtime-benchmarks", "polkadot-test-service/runtime-benchmarks"] -fast-runtime = ["mangata-kusama-runtime/fast-runtime", "mangata-kusama-runtime/fast-runtime"] +fast-runtime = ["common-runtime/fast-runtime", "mangata-kusama-runtime/fast-runtime", "mangata-kusama-runtime/fast-runtime"] try-runtime = [ "mangata-kusama-runtime/try-runtime", "mangata-rococo-runtime/try-runtime", @@ -56,6 +54,7 @@ hex = "0.4.0" jsonrpsee = { version = "0.16.2", features = ["server"] } # Local Dependencies +common-runtime = { path = '../runtime/common', default-features = false, version = '4.0.0' } mangata-kusama-runtime = { path = "../runtime/mangata-kusama", optional = true } mangata-rococo-runtime = { path = "../runtime/mangata-rococo", optional = true } @@ -145,9 +144,6 @@ polkadot-test-service = { git = "https://github.com/mangata-finance/polkadot", b xyk-rpc = { default-features = false, version = '2.0.0', path = '../pallets/xyk/rpc' } xyk-runtime-api = { default-features = false, version = '2.0.0', path = '../pallets/xyk/runtime-api' } -pallet-vesting-mangata-rpc = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } -pallet-vesting-mangata-rpc-runtime-api = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } - [dev-dependencies] sub-tokens = { git = "https://github.com/paritytech/substrate-debug-kit", branch = "master" } diff --git a/node/src/chain_spec/mangata_kusama.rs b/node/src/chain_spec/mangata_kusama.rs index ae62e2adb6..8f2184dae1 100644 --- a/node/src/chain_spec/mangata_kusama.rs +++ b/node/src/chain_spec/mangata_kusama.rs @@ -3,10 +3,16 @@ use codec::Encode; use cumulus_primitives_core::ParaId; use hex::FromHex; +use common_runtime::{ + config::orml_asset_registry::AssetMetadataOf, + constants::parachains, + ksm_per_second, + tokens::{KAR_TOKEN_ID, MGX_TOKEN_ID, RELAY_TOKEN_ID, TUR_TOKEN_ID}, + xcm_config::general_key, +}; + use mangata_kusama_runtime::{ - constants::parachains, ksm_per_second, xcm_config::general_key, AccountId, AssetMetadataOf, - AuraId, CustomMetadata, MultiLocation, Parachain, Signature, XcmMetadata, KAR_TOKEN_ID, - KSM_TOKEN_ID, TUR_TOKEN_ID, X1, X2, + AccountId, AuraId, CustomMetadata, MultiLocation, Parachain, Signature, XcmMetadata, X1, X2, }; use sc_service::ChainType; @@ -189,7 +195,7 @@ pub fn mangata_kusama_prod_config() -> ChainSpec { ], vec![ ( - 0, + MGX_TOKEN_ID, AssetMetadataOf { decimals: 18, name: b"Mangata".to_vec(), @@ -211,7 +217,7 @@ pub fn mangata_kusama_prod_config() -> ChainSpec { }, ), ( - KSM_TOKEN_ID, + RELAY_TOKEN_ID, AssetMetadataOf { decimals: 12, name: b"Kusama Native".to_vec(), @@ -338,7 +344,7 @@ pub fn mangata_kusama_local_config() -> ChainSpec { ], vec![ ( - 0, + MGX_TOKEN_ID, AssetMetadataOf { decimals: 18, name: b"Mangata".to_vec(), @@ -360,7 +366,7 @@ pub fn mangata_kusama_local_config() -> ChainSpec { }, ), ( - KSM_TOKEN_ID, + RELAY_TOKEN_ID, AssetMetadataOf { decimals: 12, name: b"Kusama Native".to_vec(), diff --git a/node/src/chain_spec/mangata_rococo.rs b/node/src/chain_spec/mangata_rococo.rs index 647744b83d..abb9b3a68a 100644 --- a/node/src/chain_spec/mangata_rococo.rs +++ b/node/src/chain_spec/mangata_rococo.rs @@ -1,12 +1,18 @@ use crate::chain_spec::Extensions; use codec::Encode; +use common_runtime::{ + config::orml_asset_registry::AssetMetadataOf, + constants::parachains, + ksm_per_second, + tokens::{KAR_TOKEN_ID, MGX_TOKEN_ID, RELAY_TOKEN_ID, TUR_TOKEN_ID}, + xcm_config::general_key, +}; use cumulus_primitives_core::ParaId; use hex::FromHex; use mangata_rococo_runtime::{ - constants::parachains, roc_per_second, xcm_config::general_key, AccountId, AssetMetadataOf, - AuraId, CustomMetadata, MultiLocation, Parachain, Signature, XcmMetadata, KAR_TOKEN_ID, - ROC_TOKEN_ID, TUR_TOKEN_ID, X1, X2, + AccountId, AuraId, CustomMetadata, MultiLocation, Parachain, Signature, XcmMetadata, X1, X2, }; + use sc_service::ChainType; use sp_core::{sr25519, ByteArray, Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; @@ -174,7 +180,7 @@ pub fn mangata_rococo_prod_config() -> ChainSpec { ], vec![ ( - 0, + MGX_TOKEN_ID, AssetMetadataOf { decimals: 18, name: b"Mangata".to_vec(), @@ -196,14 +202,14 @@ pub fn mangata_rococo_prod_config() -> ChainSpec { }, ), ( - ROC_TOKEN_ID, + RELAY_TOKEN_ID, AssetMetadataOf { decimals: 12, name: b"Rococo Native".to_vec(), symbol: b"ROC".to_vec(), additional: CustomMetadata { // 10_000:1 MGR:ROC - xcm: Some(XcmMetadata { fee_per_second: roc_per_second() }), + xcm: Some(XcmMetadata { fee_per_second: ksm_per_second() }), xyk: None, }, existential_deposit: Default::default(), @@ -345,14 +351,14 @@ pub fn mangata_rococo_local_config() -> ChainSpec { }, ), ( - ROC_TOKEN_ID, + RELAY_TOKEN_ID, AssetMetadataOf { decimals: 12, name: b"Rococo Native".to_vec(), symbol: b"ROC".to_vec(), additional: CustomMetadata { // 10_000:1 MGR:ROC - xcm: Some(XcmMetadata { fee_per_second: roc_per_second() }), + xcm: Some(XcmMetadata { fee_per_second: ksm_per_second() }), xyk: None, }, existential_deposit: Default::default(), @@ -379,7 +385,7 @@ pub fn mangata_rococo_local_config() -> ChainSpec { symbol: b"KAR".to_vec(), additional: CustomMetadata { // 100:1 MGR:KAR - xcm: Some(XcmMetadata { fee_per_second: roc_per_second() * 100 }), + xcm: Some(XcmMetadata { fee_per_second: ksm_per_second() * 100 }), xyk: None, }, existential_deposit: Default::default(), @@ -403,7 +409,7 @@ pub fn mangata_rococo_local_config() -> ChainSpec { symbol: b"TUR".to_vec(), additional: CustomMetadata { // 100:1 TUR:ROC, 10/12 decimals - xcm: Some(XcmMetadata { fee_per_second: roc_per_second() }), + xcm: Some(XcmMetadata { fee_per_second: ksm_per_second() }), xyk: None, }, existential_deposit: Default::default(), diff --git a/node/src/client.rs b/node/src/client.rs index 422c902285..3bc1d0b4bd 100644 --- a/node/src/client.rs +++ b/node/src/client.rs @@ -46,13 +46,7 @@ pub trait RuntimeApiCollection: + substrate_frame_rpc_system::AccountNonceApi + ver_api::VerNonceApi + xyk_rpc::XykRuntimeApi - + pallet_vesting_mangata_rpc::VestingMangataRuntimeApi< - Block, - AccountId, - TokenId, - Balance, - BlockNumber, - > + sp_consensus_aura::AuraApi + + sp_consensus_aura::AuraApi where >::StateBackend: sp_api::StateBackend, { @@ -71,13 +65,7 @@ where + substrate_frame_rpc_system::AccountNonceApi + ver_api::VerNonceApi + xyk_rpc::XykRuntimeApi - + pallet_vesting_mangata_rpc::VestingMangataRuntimeApi< - Block, - AccountId, - TokenId, - Balance, - BlockNumber, - > + sp_consensus_aura::AuraApi, + + sp_consensus_aura::AuraApi, >::StateBackend: sp_api::StateBackend, { } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 841a27fdeb..3c8abbe28d 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -46,19 +46,11 @@ where C::Api: pallet_transaction_payment_mangata_rpc::TransactionPaymentRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: xyk_rpc::XykRuntimeApi, - C::Api: pallet_vesting_mangata_rpc::VestingMangataRuntimeApi< - Block, - AccountId, - TokenId, - Balance, - BlockNumber, - >, C::Api: BlockBuilder, C::Api: VerNonceApi, P: TransactionPool + Sync + Send + 'static, { use pallet_transaction_payment_mangata_rpc::{TransactionPayment, TransactionPaymentApiServer}; - use pallet_vesting_mangata_rpc::{VestingMangata, VestingMangataApiServer}; use substrate_frame_rpc_system::{System, SystemApiServer}; use xyk_rpc::{Xyk, XykApiServer}; @@ -68,7 +60,6 @@ where module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; module.merge(TransactionPayment::new(client.clone()).into_rpc())?; module.merge(Xyk::new(client.clone()).into_rpc())?; - module.merge(VestingMangata::new(client.clone()).into_rpc())?; Ok(module) } diff --git a/node/src/service.rs b/node/src/service.rs index 38a7399928..5ebfe00e75 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -309,13 +309,7 @@ where + ver_api::VerApi + ver_api::VerNonceApi + xyk_rpc::XykRuntimeApi - + pallet_vesting_mangata_rpc::VestingMangataRuntimeApi< - Block, - AccountId, - TokenId, - Balance, - BlockNumber, - > + sp_consensus_aura::AuraApi, + + sp_consensus_aura::AuraApi, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, Executor: sc_executor::NativeExecutionDispatch + 'static, RB: Fn( @@ -538,13 +532,7 @@ where + ver_api::VerApi + ver_api::VerNonceApi + xyk_rpc::XykRuntimeApi - + pallet_vesting_mangata_rpc::VestingMangataRuntimeApi< - Block, - AccountId, - TokenId, - Balance, - BlockNumber, - > + sp_consensus_aura::AuraApi, + + sp_consensus_aura::AuraApi, { start_node_impl::( parachain_config, diff --git a/pallets/bootstrap/src/mock.rs b/pallets/bootstrap/src/mock.rs index 2c1f89403b..41e286b08a 100644 --- a/pallets/bootstrap/src/mock.rs +++ b/pallets/bootstrap/src/mock.rs @@ -124,14 +124,6 @@ impl pallet_vesting_mangata::Config for Test { const MAX_VESTING_SCHEDULES: u32 = 28; } -pub struct RewardsMigrateAccountProvider(PhantomData); -impl Get for RewardsMigrateAccountProvider { - fn get() -> T::AccountId { - T::AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes()) - .expect("Infinite input; no dead input space; qed") - } -} - impl pallet_xyk::XykBenchmarkingConfig for Test {} pub struct AssetMetadataMutation; @@ -163,7 +155,6 @@ impl pallet_xyk::Config for Test { type DisabledTokens = Nothing; type VestingProvider = Vesting; type AssetMetadataMutation = AssetMetadataMutation; - type RewardsMigrateAccount = RewardsMigrateAccountProvider; } impl pallet_proof_of_stake::Config for Test { diff --git a/pallets/proof-of-stake/src/lib.rs b/pallets/proof-of-stake/src/lib.rs index 04fea2501c..426009495e 100644 --- a/pallets/proof-of-stake/src/lib.rs +++ b/pallets/proof-of-stake/src/lib.rs @@ -136,7 +136,10 @@ pub mod pallet { >; #[pallet::storage] - /// Stores information about pool weight and accumulated rewards + /// Stores information about pool weight and accumulated rewards. The accumulated + /// rewards amount is the number of rewards that can be claimed per liquidity + /// token. Here is tracked the number of rewards per liquidity token relationship. + /// Expect larger values when the number of liquidity tokens are smaller. pub type PromotedPoolRewards = StorageValue<_, BTreeMap, ValueQuery>; @@ -373,7 +376,9 @@ impl ProofOfStakeRewardsApi for Pallet { fn disable(liquidity_token_id: TokenId) { PromotedPoolRewards::::mutate(|promoted_pools| { - let _ = promoted_pools.remove(&liquidity_token_id); + if let Some(info) = promoted_pools.get_mut(&liquidity_token_id) { + info.weight = 0; + } }); Pallet::::deposit_event(Event::PoolPromotionUpdated(liquidity_token_id, None)); } @@ -387,6 +392,7 @@ impl ProofOfStakeRewardsApi for Pallet { liquidity_asset_id: Self::CurrencyId, ) -> Result { Self::ensure_is_promoted_pool(liquidity_asset_id)?; + let mut rewards_info = RewardsInfo::::try_get(user.clone(), liquidity_asset_id) .or(Err(DispatchError::from(Error::::MissingRewardsInfoError)))?; let pool_rewards_ratio_current = Self::get_pool_rewards(liquidity_asset_id)?; @@ -504,7 +510,7 @@ impl LiquidityMiningApi for Pallet { .into_iter() .filter_map(|(token_id, info)| { let activated_amount = Self::total_activated_amount(token_id); - if activated_amount > 0 { + if activated_amount > 0 && info.weight > 0 { Some((token_id, info.weight, info.rewards, activated_amount)) } else { None diff --git a/pallets/proof-of-stake/src/mock.rs b/pallets/proof-of-stake/src/mock.rs index 0d25c60045..fa95825027 100644 --- a/pallets/proof-of-stake/src/mock.rs +++ b/pallets/proof-of-stake/src/mock.rs @@ -184,19 +184,6 @@ impl Contains<(TokenId, TokenId)> for DummyBlacklistedPool { } } -pub struct RewardsMigrateAccountProvider(PhantomData); - -impl Get for RewardsMigrateAccountProvider { - fn get() -> T::AccountId { - let account32: sp_runtime::AccountId32 = - hex_literal::hex!["0e33df23356eb2e9e3baf0e8a5faae15bc70a6a5cce88f651a9faf6e8e937324"] - .into(); - let mut init_account32 = sp_runtime::AccountId32::as_ref(&account32); - - T::AccountId::decode(&mut init_account32).unwrap() - } -} - pub struct MockAssetRegister; lazy_static::lazy_static! { diff --git a/pallets/proof-of-stake/src/tests.rs b/pallets/proof-of-stake/src/tests.rs index c05d483027..ea311c85d2 100644 --- a/pallets/proof-of-stake/src/tests.rs +++ b/pallets/proof-of-stake/src/tests.rs @@ -1050,3 +1050,43 @@ fn test_migrated_from_pallet_issuance() { ); }); } + +#[test] +fn claim_rewards_from_pool_that_has_been_disabled() { + new_test_ext().execute_with(|| { + let max = std::u128::MAX; + System::set_block_number(1); + let acc_id: u128 = 2; + let amount: u128 = max; + TokensOf::::create(&acc_id, amount).unwrap(); + TokensOf::::create(&acc_id, amount).unwrap(); + TokensOf::::create(&acc_id, amount).unwrap(); + TokensOf::::create(&acc_id, amount).unwrap(); + + TokensOf::::transfer( + 0, + &2, + &::LiquidityMiningIssuanceVault::get(), + 10000000000, + ExistenceRequirement::AllowDeath, + ) + .unwrap(); + + TokensOf::::create(&2, 10000).unwrap(); + ProofOfStake::update_pool_promotion(RuntimeOrigin::root(), 4, 1u8).unwrap(); + + let liquidity_tokens_owned = TokensOf::::free_balance(4, &2); + ProofOfStake::activate_liquidity(RuntimeOrigin::signed(2), 4, liquidity_tokens_owned, None) + .unwrap(); + + forward_to_block(10); + + assert_eq!(ProofOfStake::calculate_rewards_amount(2, 4).unwrap(), 291); + + ProofOfStake::update_pool_promotion(RuntimeOrigin::root(), 4, 0u8).unwrap(); + + ProofOfStake::claim_rewards_all(RuntimeOrigin::signed(2), 4).unwrap(); + + assert_eq!(ProofOfStake::calculate_rewards_amount(2, 4).unwrap(), 0); + }); +} diff --git a/pallets/xyk/rpc/src/lib.rs b/pallets/xyk/rpc/src/lib.rs index 846d41683e..5f96d56cb6 100644 --- a/pallets/xyk/rpc/src/lib.rs +++ b/pallets/xyk/rpc/src/lib.rs @@ -10,67 +10,61 @@ use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_core::U256; use sp_rpc::number::NumberOrHex; -use sp_runtime::traits::{Block as BlockT, MaybeDisplay, MaybeFromStr}; +use sp_runtime::{ + generic::BlockId, + traits::{Block as BlockT, MaybeDisplay, MaybeFromStr}, +}; use sp_std::convert::{TryFrom, TryInto}; use std::sync::Arc; +use xyk_runtime_api::RpcAssetMetadata; pub use xyk_runtime_api::XykApi as XykRuntimeApi; -use xyk_runtime_api::{RpcAmountsResult, XYKRpcResult}; #[rpc(client, server)] -pub trait XykApi< - BlockHash, - Balance, - TokenId, - AccountId, - ResponseTypePrice, - ResponseTypeAmounts, - BalanceOutput, -> -{ +pub trait XykApi { #[method(name = "xyk_calculate_sell_price")] fn calculate_sell_price( &self, - input_reserve: Balance, - output_reserve: Balance, - sell_amount: Balance, + input_reserve: NumberOrHex, + output_reserve: NumberOrHex, + sell_amount: NumberOrHex, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_calculate_buy_price")] fn calculate_buy_price( &self, - input_reserve: Balance, - output_reserve: Balance, - buy_amount: Balance, + input_reserve: NumberOrHex, + output_reserve: NumberOrHex, + buy_amount: NumberOrHex, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_calculate_sell_price_id")] fn calculate_sell_price_id( &self, sold_token_id: TokenId, bought_token_id: TokenId, - sell_amount: Balance, + sell_amount: NumberOrHex, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_calculate_buy_price_id")] fn calculate_buy_price_id( &self, sold_token_id: TokenId, bought_token_id: TokenId, - buy_amount: Balance, + buy_amount: NumberOrHex, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_get_burn_amount")] fn get_burn_amount( &self, first_asset_id: TokenId, second_asset_id: TokenId, - liquidity_asset_amount: Balance, + liquidity_asset_amount: NumberOrHex, at: Option, - ) -> RpcResult; + ) -> RpcResult<(NumberOrHex, NumberOrHex)>; #[method(name = "xyk_get_max_instant_burn_amount")] fn get_max_instant_burn_amount( @@ -78,7 +72,7 @@ pub trait XykApi< user: AccountId, liquidity_asset_id: TokenId, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_get_max_instant_unreserve_amount")] fn get_max_instant_unreserve_amount( @@ -86,7 +80,7 @@ pub trait XykApi< user: AccountId, liquidity_asset_id: TokenId, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_calculate_rewards_amount")] fn calculate_rewards_amount( @@ -94,15 +88,40 @@ pub trait XykApi< user: AccountId, liquidity_asset_id: TokenId, at: Option, - ) -> RpcResult; + ) -> RpcResult; #[method(name = "xyk_calculate_balanced_sell_amount")] fn calculate_balanced_sell_amount( &self, - total_amount: Balance, - reserve_amount: Balance, + total_amount: NumberOrHex, + reserve_amount: NumberOrHex, + at: Option, + ) -> RpcResult; + + #[method(name = "xyk_get_liq_tokens_for_trading")] + fn get_liq_tokens_for_trading(&self, at: Option) -> RpcResult>; + + #[method(name = "xyk_is_buy_asset_lock_free")] + fn is_buy_asset_lock_free( + &self, + path: sp_std::vec::Vec, + input_amount: NumberOrHex, + at: Option, + ) -> RpcResult>; + + #[method(name = "xyk_is_sell_asset_lock_free")] + fn is_sell_asset_lock_free( + &self, + path: sp_std::vec::Vec, + input_amount: NumberOrHex, + at: Option, + ) -> RpcResult>; + + #[method(name = "xyk_get_tradeable_tokens")] + fn get_tradeable_tokens( + &self, at: Option, - ) -> RpcResult; + ) -> RpcResult>>; } pub struct Xyk { @@ -134,22 +153,14 @@ impl> TryIntoBalance for NumberOrHex { #[async_trait] impl - XykApiServer< - ::Hash, - NumberOrHex, - TokenId, - AccountId, - XYKRpcResult, - RpcAmountsResult, - Balance, - > for Xyk + XykApiServer<::Hash, Balance, TokenId, AccountId> for Xyk where Block: BlockT, C: Send + Sync + 'static, C: ProvideRuntimeApi, C: HeaderBackend, C::Api: XykRuntimeApi, - Balance: Codec + MaybeDisplay + MaybeFromStr + TryFrom, + Balance: Codec + MaybeDisplay + MaybeFromStr + TryFrom + Into, TokenId: Codec + MaybeDisplay + MaybeFromStr, AccountId: Codec + MaybeDisplay + MaybeFromStr, { @@ -159,17 +170,18 @@ where output_reserve: NumberOrHex, sell_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.calculate_sell_price( + api.calculate_sell_price( at, input_reserve.try_into_balance()?, output_reserve.try_into_balance()?, sell_amount.try_into_balance()?, - ); - runtime_api_result.map_err(|e| { + ) + .map(Into::::into) + .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, "Unable to serve the request", @@ -184,17 +196,18 @@ where output_reserve: NumberOrHex, buy_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.calculate_buy_price( + api.calculate_buy_price( at, input_reserve.try_into_balance()?, output_reserve.try_into_balance()?, buy_amount.try_into_balance()?, - ); - runtime_api_result.map_err(|e| { + ) + .map(Into::::into) + .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, "Unable to serve the request", @@ -209,17 +222,18 @@ where bought_token_id: TokenId, sell_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.calculate_sell_price_id( + api.calculate_sell_price_id( at, sold_token_id, bought_token_id, sell_amount.try_into_balance()?, - ); - runtime_api_result.map_err(|e| { + ) + .map(Into::::into) + .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, "Unable to serve the request", @@ -234,17 +248,18 @@ where bought_token_id: TokenId, buy_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.calculate_buy_price_id( + api.calculate_buy_price_id( at, sold_token_id, bought_token_id, buy_amount.try_into_balance()?, - ); - runtime_api_result.map_err(|e| { + ) + .map(Into::::into) + .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, "Unable to serve the request", @@ -259,17 +274,18 @@ where second_asset_id: TokenId, liquidity_asset_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult<(NumberOrHex, NumberOrHex)> { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.get_burn_amount( + api.get_burn_amount( at, first_asset_id, second_asset_id, liquidity_asset_amount.try_into_balance()?, - ); - runtime_api_result.map_err(|e| { + ) + .map(|(val1, val2)| (val1.into(), val2.into())) + .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, "Unable to serve the request", @@ -283,17 +299,19 @@ where user: AccountId, liquidity_asset_id: TokenId, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - api.get_max_instant_burn_amount(at, user, liquidity_asset_id).map_err(|e| { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( - 1, - "Unable to serve the request", - Some(format!("{:?}", e)), - ))) - }) + api.get_max_instant_burn_amount(at, user, liquidity_asset_id) + .map(Into::::into) + .map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) } fn get_max_instant_unreserve_amount( @@ -301,17 +319,19 @@ where user: AccountId, liquidity_asset_id: TokenId, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - api.get_max_instant_unreserve_amount(at, user, liquidity_asset_id).map_err(|e| { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( - 1, - "Unable to serve the request", - Some(format!("{:?}", e)), - ))) - }) + api.get_max_instant_unreserve_amount(at, user, liquidity_asset_id) + .map(Into::::into) + .map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) } fn calculate_rewards_amount( @@ -319,19 +339,19 @@ where user: AccountId, liquidity_asset_id: TokenId, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - let runtime_api_result = api.calculate_rewards_amount(at, user, liquidity_asset_id); - - runtime_api_result.map_err(|e| { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( - 1, - "Unable to serve the request", - Some(format!("{:?}", e)), - ))) - }) + api.calculate_rewards_amount(at, user, liquidity_asset_id) + .map(Into::::into) + .map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) } fn calculate_balanced_sell_amount( @@ -339,7 +359,7 @@ where total_amount: NumberOrHex, reserve_amount: NumberOrHex, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult { let api = self.client.runtime_api(); let at = self.client.info().best_hash; @@ -348,6 +368,7 @@ where total_amount.try_into_balance()?, reserve_amount.try_into_balance()?, ) + .map(Into::::into) .map_err(|e| { JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( 1, @@ -356,4 +377,74 @@ where ))) }) } + + fn get_liq_tokens_for_trading( + &self, + at: Option<::Hash>, + ) -> RpcResult> { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.get_liq_tokens_for_trading(at).map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) + } + + fn is_buy_asset_lock_free( + &self, + path: sp_std::vec::Vec, + input_amount: NumberOrHex, + at: Option<::Hash>, + ) -> RpcResult> { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.is_buy_asset_lock_free(at, path, input_amount.try_into_balance()?) + .map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) + } + + fn is_sell_asset_lock_free( + &self, + path: sp_std::vec::Vec, + input_amount: NumberOrHex, + at: Option<::Hash>, + ) -> RpcResult> { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.is_sell_asset_lock_free(at, path, input_amount.try_into_balance()?) + .map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) + } + + fn get_tradeable_tokens( + &self, + at: Option<::Hash>, + ) -> RpcResult>> { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.get_tradeable_tokens(at).map_err(|e| { + JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( + 1, + "Unable to serve the request", + Some(format!("{:?}", e)), + ))) + }) + } } diff --git a/pallets/xyk/runtime-api/Cargo.toml b/pallets/xyk/runtime-api/Cargo.toml index 753a40eb9e..3d4b594cf7 100644 --- a/pallets/xyk/runtime-api/Cargo.toml +++ b/pallets/xyk/runtime-api/Cargo.toml @@ -8,6 +8,7 @@ license = "GPL-3.0-or-later" [dependencies] serde = { version = "1.0.126", optional = true, features = ["derive"] } sp-api = { version = '4.0.0-dev', default-features = false, git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } +sp-std = { default-features = false, version = '5.0.0' , git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } sp-runtime = { default-features = false, version = '7.0.0' , git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } frame-support = { default-features = false, version = '4.0.0-dev' , git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } frame-system = { default-features = false, version = '4.0.0-dev' , git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } @@ -25,5 +26,5 @@ std = [ "codec/std", "sp-runtime/std", "frame-support/std", - 'frame-system/std', + 'frame-system/std' ] diff --git a/pallets/xyk/runtime-api/src/lib.rs b/pallets/xyk/runtime-api/src/lib.rs index 95f5ef9435..2f42b4e2c5 100644 --- a/pallets/xyk/runtime-api/src/lib.rs +++ b/pallets/xyk/runtime-api/src/lib.rs @@ -6,48 +6,16 @@ use codec::{Codec, Decode, Encode}; #[cfg(feature = "std")] use serde::{Deserialize, Deserializer, Serialize, Serializer}; use sp_runtime::traits::{MaybeDisplay, MaybeFromStr}; -// Workaround for substrate/serde issue -#[derive(Eq, PartialEq, Encode, Decode, Default)] -#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -pub struct XYKRpcResult { - #[cfg_attr(feature = "std", serde(bound(serialize = "Balance: std::fmt::Display")))] - #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))] - #[cfg_attr(feature = "std", serde(bound(deserialize = "Balance: std::str::FromStr")))] - #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))] - pub price: Balance, -} +use sp_std::vec::Vec; #[derive(Eq, PartialEq, Encode, Decode, Default)] #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -pub struct RpcAmountsResult { - #[cfg_attr(feature = "std", serde(bound(serialize = "Balance: std::fmt::Display")))] - #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))] - #[cfg_attr(feature = "std", serde(bound(deserialize = "Balance: std::str::FromStr")))] - #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))] - pub first_asset_amount: Balance, - #[cfg_attr(feature = "std", serde(bound(serialize = "Balance: std::fmt::Display")))] - #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))] - #[cfg_attr(feature = "std", serde(bound(deserialize = "Balance: std::str::FromStr")))] - #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))] - pub second_asset_amount: Balance, -} - -#[cfg(feature = "std")] -fn serialize_as_string( - t: &T, - serializer: S, -) -> Result { - serializer.serialize_str(&t.to_string()) -} - -#[cfg(feature = "std")] -fn deserialize_from_string<'de, D: Deserializer<'de>, T: std::str::FromStr>( - deserializer: D, -) -> Result { - let s = String::deserialize(deserializer)?; - s.parse::().map_err(|_| serde::de::Error::custom("Parse from string failed")) +pub struct RpcAssetMetadata { + pub token_id: TokenId, + pub decimals: u32, + pub name: Vec, + pub symbol: Vec, } sp_api::decl_runtime_apis! { @@ -59,42 +27,53 @@ sp_api::decl_runtime_apis! { input_reserve: Balance, output_reserve: Balance, sell_amount: Balance - ) -> XYKRpcResult; + ) -> Balance; fn calculate_buy_price( input_reserve: Balance, output_reserve: Balance, buy_amount: Balance - ) -> XYKRpcResult; + ) -> Balance; fn calculate_sell_price_id( sold_token_id: TokenId, bought_token_id: TokenId, sell_amount: Balance - ) -> XYKRpcResult; + ) -> Balance; fn calculate_buy_price_id( sold_token_id: TokenId, bought_token_id: TokenId, buy_amount: Balance - ) -> XYKRpcResult; + ) -> Balance; fn get_burn_amount( first_asset_id: TokenId, second_asset_id: TokenId, liquidity_asset_amount: Balance, - ) -> RpcAmountsResult; + ) -> (Balance,Balance); fn get_max_instant_burn_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult; + ) -> Balance; fn get_max_instant_unreserve_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult; + ) -> Balance; fn calculate_rewards_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult; + ) -> Balance; fn calculate_balanced_sell_amount( total_amount: Balance, reserve_amount: Balance, - ) -> XYKRpcResult; + ) -> Balance; + fn get_liq_tokens_for_trading( + ) -> Vec; + fn is_buy_asset_lock_free( + path: sp_std::vec::Vec, + input_amount: Balance, + ) -> Option; + fn is_sell_asset_lock_free( + path: sp_std::vec::Vec, + input_amount: Balance, + ) -> Option; + fn get_tradeable_tokens() -> Vec>; } } diff --git a/pallets/xyk/src/benchmarking.rs b/pallets/xyk/src/benchmarking.rs index 4b8d0f4f49..3a4c67ca63 100644 --- a/pallets/xyk/src/benchmarking.rs +++ b/pallets/xyk/src/benchmarking.rs @@ -391,7 +391,8 @@ benchmarks! { }: burn_liquidity(RawOrigin::Signed(caller.clone().into()), non_native_asset_id1.into(), non_native_asset_id2.into(), total_liquidity_after_minting) verify { - assert!(Xyk::::liquidity_pool(liquidity_asset_id).is_none()); + assert_eq!(Xyk::::liquidity_pool(liquidity_asset_id), Some((non_native_asset_id1.into(), non_native_asset_id2.into()))); + assert_eq!(::Currency::total_issuance(liquidity_asset_id.into()).into(), 0); } provide_liquidity_with_conversion { diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index 6250fa7c6e..79db4e5682 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -21,6 +21,7 @@ //! - account_id //! - settle_treasury_buy_and_burn //! - calculate_balanced_sell_amount +//! - get_liq_tokens_for_trading //! //! # fn create_pool //! -Sets the initial ratio/price of both assets to each other depending on amounts of each assets when creating pool. @@ -283,12 +284,14 @@ //! # calculate_balanced_sell_amount //! - Supporting public function accessible through rpc call which calculates how much amount x we need to swap from total_amount, so that after `y = swap(x)`, the resulting balance equals `(total_amount - x) / y = pool_x / pool_y` //! - the resulting amounts can then be used to `mint_liquidity` with minimal leftover after operation +//! # get_liq_tokens_for_trading +//! - Supporting public function accessible through rpc call which lists all of the liquidity pool token ids that are available for trading #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ assert_ok, - dispatch::{DispatchError, DispatchResult}, + dispatch::{DispatchError, DispatchErrorWithPostInfo, DispatchResult, PostDispatchInfo}, ensure, traits::Contains, PalletId, @@ -368,10 +371,16 @@ pub use weights::WeightInfo; type AccountIdOf = ::AccountId; // type LiquidityMiningRewardsOf = ::AccountId; +#[derive(Eq, PartialEq, Encode, Decode)] +pub enum SwapKind { + Sell, + Buy, +} #[frame_support::pallet] pub mod pallet { use super::*; + use frame_support::dispatch::DispatchClass; #[pallet::pallet] pub struct Pallet(PhantomData); @@ -433,8 +442,6 @@ pub mod pallet { type VestingProvider: MultiTokenVestingLocks; type AssetMetadataMutation: AssetMetadataMutationTrait; type WeightInfo: WeightInfo; - #[pallet::constant] - type RewardsMigrateAccount: Get; } #[pallet::error] @@ -498,6 +505,7 @@ pub mod pallet { MultiSwapCantHaveSameTokenConsequetively, /// Trading blocked by maintenance mode TradingBlockedByMaintenanceMode, + PoolIsEmpty, } #[pallet::event] @@ -640,7 +648,7 @@ pub mod pallet { /// - `sold_asset_amount`: The amount of the sold token being sold /// - `min_amount_out` - The minimum amount of bought asset that must be bought in order to not fail on slippage. Slippage failures still charge exchange commission. #[pallet::call_index(1)] - #[pallet::weight(<::WeightInfo>::sell_asset())] + #[pallet::weight((<::WeightInfo>::sell_asset(), DispatchClass::Operational, Pays::No))] #[deprecated(note = "multiswap_sell_asset should be used instead")] pub fn sell_asset( origin: OriginFor, @@ -651,15 +659,22 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; - let _ = >::sell_asset( + >::sell_asset( sender, sold_asset_id, bought_asset_id, sold_asset_amount, min_amount_out, false, - )?; - Ok(().into()) + ) + .map_err(|err| DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(<::WeightInfo>::sell_asset()), + pays_fee: Pays::Yes, + }, + error: err, + })?; + Ok(Pays::No.into()) } /// Executes a multiswap sell asset in a series of sell asset atomic swaps. @@ -677,7 +692,7 @@ pub mod pallet { /// - `sold_asset_amount`: The amount of the first asset sold /// - `min_amount_out` - The minimum amount of last asset that must be bought in order to not fail on slippage. Slippage failures still charge exchange commission. #[pallet::call_index(2)] - #[pallet::weight(<::WeightInfo>::multiswap_sell_asset(swap_token_list.len() as u32))] + #[pallet::weight((<::WeightInfo>::multiswap_sell_asset(swap_token_list.len() as u32), DispatchClass::Operational, Pays::No))] pub fn multiswap_sell_asset( origin: OriginFor, swap_token_list: Vec, @@ -689,25 +704,34 @@ pub mod pallet { if let (Some(sold_asset_id), Some(bought_asset_id), 2) = (swap_token_list.get(0), swap_token_list.get(1), swap_token_list.len()) { - let _ = >::sell_asset( + >::sell_asset( sender, *sold_asset_id, *bought_asset_id, sold_asset_amount, min_amount_out, false, - )?; + ) } else { >::multiswap_sell_asset( sender, - swap_token_list, + swap_token_list.clone(), sold_asset_amount, min_amount_out, false, false, - )?; + ) } - Ok(().into()) + .map_err(|err| DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(<::WeightInfo>::multiswap_sell_asset( + swap_token_list.len() as u32, + )), + pays_fee: Pays::Yes, + }, + error: err, + })?; + Ok(Pays::No.into()) } /// Executes buy_asset swap. @@ -725,7 +749,7 @@ pub mod pallet { /// - `bought_asset_amount`: The amount of the bought token being bought /// - `max_amount_in` - The maximum amount of sold asset that must be sold in order to not fail on slippage. Slippage failures still charge exchange commission. #[pallet::call_index(3)] - #[pallet::weight(<::WeightInfo>::buy_asset())] + #[pallet::weight((<::WeightInfo>::buy_asset(), DispatchClass::Operational, Pays::No))] #[deprecated(note = "multiswap_buy_asset should be used instead")] pub fn buy_asset( origin: OriginFor, @@ -736,15 +760,22 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; - let _ = >::buy_asset( + >::buy_asset( sender, sold_asset_id, bought_asset_id, bought_asset_amount, max_amount_in, false, - )?; - Ok(().into()) + ) + .map_err(|err| DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(<::WeightInfo>::buy_asset()), + pays_fee: Pays::Yes, + }, + error: err, + })?; + Ok(Pays::No.into()) } /// Executes a multiswap buy asset in a series of buy asset atomic swaps. @@ -765,7 +796,7 @@ pub mod pallet { /// - `bought_asset_amount`: The amount of the last asset bought /// - `max_amount_in` - The maximum amount of first asset that can be sold in order to not fail on slippage. Slippage failures still charge exchange commission. #[pallet::call_index(4)] - #[pallet::weight(<::WeightInfo>::multiswap_buy_asset(swap_token_list.len() as u32))] + #[pallet::weight((<::WeightInfo>::multiswap_buy_asset(swap_token_list.len() as u32), DispatchClass::Operational, Pays::No))] pub fn multiswap_buy_asset( origin: OriginFor, swap_token_list: Vec, @@ -777,25 +808,34 @@ pub mod pallet { if let (Some(sold_asset_id), Some(bought_asset_id), 2) = (swap_token_list.get(0), swap_token_list.get(1), swap_token_list.len()) { - let _ = >::buy_asset( + >::buy_asset( sender, *sold_asset_id, *bought_asset_id, bought_asset_amount, max_amount_in, false, - )?; + ) } else { >::multiswap_buy_asset( sender, - swap_token_list, + swap_token_list.clone(), bought_asset_amount, max_amount_in, false, false, - )?; + ) } - Ok(().into()) + .map_err(|err| DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(<::WeightInfo>::multiswap_buy_asset( + swap_token_list.len() as u32, + )), + pays_fee: Pays::Yes, + }, + error: err, + })?; + Ok(Pays::No.into()) } #[pallet::call_index(5)] @@ -1270,6 +1310,15 @@ impl Pallet { Ok(result) } + pub fn get_liq_tokens_for_trading() -> Result, DispatchError> { + let result = LiquidityAssets::::iter_values() + .filter_map(|v| v) + .filter(|v| !::Currency::total_issuance((*v).into()).is_zero()) + .collect(); + + Ok(result) + } + // MAX: 2R pub fn get_liquidity_asset( first_asset_id: TokenId, @@ -1292,6 +1341,8 @@ impl Pallet { let (input_reserve, output_reserve) = Pallet::::get_reserves(sold_token_id, bought_token_id)?; + ensure!(!(Self::is_pool_empty(sold_token_id, bought_token_id)?), Error::::PoolIsEmpty); + Self::calculate_sell_price(input_reserve, output_reserve, sell_amount) } @@ -1303,6 +1354,8 @@ impl Pallet { let (input_reserve, output_reserve) = Pallet::::get_reserves(sold_token_id, bought_token_id)?; + ensure!(!(Self::is_pool_empty(sold_token_id, bought_token_id)?), Error::::PoolIsEmpty); + Self::calculate_buy_price(input_reserve, output_reserve, buy_amount) } @@ -1358,6 +1411,8 @@ impl Pallet { let (first_asset_reserve, second_asset_reserve) = Pallet::::get_reserves(first_asset_id, second_asset_id)?; + ensure!(!(Self::is_pool_empty(first_asset_id, second_asset_id)?), Error::::PoolIsEmpty); + let (first_asset_amount, second_asset_amount) = Self::get_burn_amount_reserves( first_asset_reserve, second_asset_reserve, @@ -1529,6 +1584,34 @@ impl Pallet { fn native_token_id() -> TokenId { ::NativeCurrencyId::get() } + + fn calculate_initial_liquidity( + first_asset_amount: Balance, + second_asset_amount: Balance, + ) -> Result { + let mut initial_liquidity = first_asset_amount + .checked_div(2) + .ok_or_else(|| DispatchError::from(Error::::MathOverflow))? + .checked_add( + second_asset_amount + .checked_div(2) + .ok_or_else(|| DispatchError::from(Error::::MathOverflow))?, + ) + .ok_or_else(|| DispatchError::from(Error::::MathOverflow))?; + + return Ok(if initial_liquidity == 0 { 1 } else { initial_liquidity }) + } + + fn is_pool_empty( + first_asset_id: TokenId, + second_asset_id: TokenId, + ) -> Result { + let liquidity_asset_id = Pallet::::get_liquidity_asset(first_asset_id, second_asset_id)?; + let total_liquidity_assets: Balance = + ::Currency::total_issuance(liquidity_asset_id.into()).into(); + + return Ok(total_liquidity_assets.is_zero()) + } } impl PreValidateSwaps for Pallet { @@ -1562,6 +1645,8 @@ impl PreValidateSwaps for Pallet { Error::::FunctionNotAvailableForThisToken ); + ensure!(!(Self::is_pool_empty(sold_asset_id, bought_asset_id)?), Error::::PoolIsEmpty); + let buy_and_burn_amount = multiply_by_rational_with_rounding( sold_asset_amount, T::BuyAndBurnFeePercentage::get(), @@ -1666,6 +1751,8 @@ impl PreValidateSwaps for Pallet { .collect(); for (x, y) in atomic_pairs.iter() { + ensure!(!(Self::is_pool_empty(*x, *y)?), Error::::PoolIsEmpty); + if x == y { return Err(Error::::MultiSwapCantHaveSameTokenConsequetively.into()) } @@ -1763,6 +1850,8 @@ impl PreValidateSwaps for Pallet { Error::::FunctionNotAvailableForThisToken ); + ensure!(!(Self::is_pool_empty(sold_asset_id, bought_asset_id)?), Error::::PoolIsEmpty); + // Get token reserves let (input_reserve, output_reserve) = Pallet::::get_reserves(sold_asset_id, bought_asset_id)?; @@ -1887,6 +1976,8 @@ impl PreValidateSwaps for Pallet { let mut atomic_pairs_hashset = BTreeSet::new(); for (x, y) in atomic_pairs.iter() { + ensure!(!(Self::is_pool_empty(*x, *y)?), Error::::PoolIsEmpty); + if x == y { return Err(Error::::MultiSwapCantHaveSameTokenConsequetively.into()) } else if x > y { @@ -2024,19 +2115,8 @@ impl XykFunctionsTrait for Pallet { ensure!(first_asset_id != second_asset_id, Error::::SameAsset,); // Liquidity token amount calculation - let mut initial_liquidity = first_asset_amount - .checked_div(2) - .ok_or_else(|| DispatchError::from(Error::::MathOverflow))? - .checked_add( - second_asset_amount - .checked_div(2) - .ok_or_else(|| DispatchError::from(Error::::MathOverflow))?, - ) - .ok_or_else(|| DispatchError::from(Error::::MathOverflow))?; - - if initial_liquidity == 0 { - initial_liquidity = 1 - } + let initial_liquidity = + Pallet::::calculate_initial_liquidity(first_asset_amount, second_asset_amount)?; Pools::::insert( (first_asset_id, second_asset_id), @@ -2784,24 +2864,26 @@ impl XykFunctionsTrait for Pallet { let total_liquidity_assets: Self::Balance = ::Currency::total_issuance(liquidity_asset_id.into()).into(); - // Calculation of required second asset amount and received liquidity token amount - ensure!(!first_asset_reserve.is_zero(), Error::::DivisionByZero); - let second_asset_amount = multiply_by_rational_with_rounding( - first_asset_amount, - second_asset_reserve, - first_asset_reserve, - Rounding::Down, - ) - .ok_or(Error::::UnexpectedFailure)? - .checked_add(1) - .ok_or_else(|| DispatchError::from(Error::::MathOverflow))?; - let liquidity_assets_minted = multiply_by_rational_with_rounding( - first_asset_amount, - total_liquidity_assets, - first_asset_reserve, - Rounding::Down, - ) - .ok_or(Error::::UnexpectedFailure)?; + // The pool is empty and we are basically creating a new pool and reusing the existing one + let second_asset_amount = if !(first_asset_reserve.is_zero() && + second_asset_reserve.is_zero()) && + !total_liquidity_assets.is_zero() + { + // Calculation of required second asset amount and received liquidity token amount + ensure!(!first_asset_reserve.is_zero(), Error::::DivisionByZero); + + multiply_by_rational_with_rounding( + first_asset_amount, + second_asset_reserve, + first_asset_reserve, + Rounding::Down, + ) + .ok_or(Error::::UnexpectedFailure)? + .checked_add(1) + .ok_or_else(|| DispatchError::from(Error::::MathOverflow))? + } else { + expected_second_asset_amount + }; ensure!( second_asset_amount <= expected_second_asset_amount, @@ -2814,6 +2896,19 @@ impl XykFunctionsTrait for Pallet { Error::::ZeroAmount, ); + // We calculate the required liquidity token amount and also validate asset amounts + let liquidity_assets_minted = if total_liquidity_assets.is_zero() { + Pallet::::calculate_initial_liquidity(first_asset_amount, second_asset_amount)? + } else { + multiply_by_rational_with_rounding( + first_asset_amount, + total_liquidity_assets, + first_asset_reserve, + Rounding::Down, + ) + .ok_or(Error::::UnexpectedFailure)? + }; + // Ensure user has enough withdrawable tokens to create pool in amounts required ::Currency::ensure_can_withdraw( @@ -2972,6 +3067,8 @@ impl XykFunctionsTrait for Pallet { // checks ensure!(!provided_asset_amount.is_zero(), Error::::ZeroAmount,); + ensure!(!(Self::is_pool_empty(first_asset_id, second_asset_id)?), Error::::PoolIsEmpty); + let (first_reserve, second_reserve) = Pallet::::get_reserves(first_asset_id, second_asset_id)?; @@ -3155,6 +3252,7 @@ impl XykFunctionsTrait for Pallet { second_asset_amount ); + // Is liquidity asset amount empty? if liquidity_asset_amount == total_liquidity_assets { log!( info, @@ -3164,11 +3262,7 @@ impl XykFunctionsTrait for Pallet { second_asset_id, first_asset_id, ); - Pools::::remove((first_asset_id, second_asset_id)); - Pools::::remove((second_asset_id, first_asset_id)); - LiquidityAssets::::remove((first_asset_id, second_asset_id)); - LiquidityAssets::::remove((second_asset_id, first_asset_id)); - LiquidityPools::::remove(liquidity_asset_id); + Pallet::::set_reserves(first_asset_id, 0, second_asset_id, 0)?; } else { // Apply changes in token pools, removing withdrawn amounts // Cannot underflow due to earlier ensure diff --git a/pallets/xyk/src/mock.rs b/pallets/xyk/src/mock.rs index c71056b06f..cefb152129 100644 --- a/pallets/xyk/src/mock.rs +++ b/pallets/xyk/src/mock.rs @@ -209,19 +209,6 @@ impl Contains<(TokenId, TokenId)> for DummyBlacklistedPool { } } -pub struct RewardsMigrateAccountProvider(PhantomData); - -impl Get for RewardsMigrateAccountProvider { - fn get() -> T::AccountId { - let account32: sp_runtime::AccountId32 = - hex_literal::hex!["0e33df23356eb2e9e3baf0e8a5faae15bc70a6a5cce88f651a9faf6e8e937324"] - .into(); - let mut init_account32 = sp_runtime::AccountId32::as_ref(&account32); - - T::AccountId::decode(&mut init_account32).unwrap() - } -} - pub struct MockAssetRegister; lazy_static::lazy_static! { @@ -310,7 +297,6 @@ impl Config for Test { type VestingProvider = Vesting; type DisallowedPools = DummyBlacklistedPool; type DisabledTokens = Nothing; - type RewardsMigrateAccount = RewardsMigrateAccountProvider; type AssetMetadataMutation = MockAssetRegister; } @@ -331,7 +317,6 @@ impl Config for Test { type VestingProvider = Vesting; type DisallowedPools = Nothing; type DisabledTokens = Nothing; - type RewardsMigrateAccount = RewardsMigrateAccountProvider; type AssetMetadataMutation = MockAssetRegister; } diff --git a/pallets/xyk/src/tests.rs b/pallets/xyk/src/tests.rs index fca992d04f..9ffe728bf7 100644 --- a/pallets/xyk/src/tests.rs +++ b/pallets/xyk/src/tests.rs @@ -4,14 +4,16 @@ use super::{Event, *}; use crate::mock::*; -use frame_support::assert_err; -use mangata_support::traits::LiquidityMiningApi; +use frame_support::{assert_err, assert_err_ignore_postinfo, dispatch::GetDispatchInfo}; +use mangata_support::traits::{ComputeIssuance, GetIssuance, LiquidityMiningApi}; use mangata_types::assets::CustomMetadata; use orml_traits::asset_registry::AssetMetadata; use serial_test::serial; -use sp_runtime::Permill; +use sp_runtime::{traits::Dispatchable, Permill}; use test_case::test_case; +type TokensOf = ::Currency; + const DUMMY_USER_ID: u128 = 2; const TRADER_ID: u128 = 3; @@ -677,7 +679,7 @@ fn sell_N_no_such_pool() { new_test_ext().execute_with(|| { initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_sell_asset(RuntimeOrigin::signed(2), vec![0, 10], 250000, 0), Error::::NoSuchPool, ); // selling 250000 assetId 0 of pool 0 10 (only pool 0 1 exists) @@ -689,7 +691,7 @@ fn sell_N_not_enough_selling_assset() { new_test_ext().execute_with(|| { initialize(); - assert_err!( + assert_err_ignore_postinfo!( // XykStorage::multiswap_sell_asset(RuntimeOrigin::signed(2), vec![1, 4], 1000000000000000000000, 0), XykStorage::sell_asset(RuntimeOrigin::signed(2), 1, 4, 1000000000000000000000, 0), orml_tokens::Error::::BalanceTooLow, @@ -762,7 +764,7 @@ fn sell_N_zero_amount() { new_test_ext().execute_with(|| { initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_sell_asset(RuntimeOrigin::signed(2), vec![1, 4], 0, 500000), Error::::ZeroAmount, ); // selling 0 assetId 0 of pool 0 1 @@ -770,6 +772,7 @@ fn sell_N_zero_amount() { } #[test] +#[serial] fn multiswap_sell_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -904,7 +907,7 @@ fn multiswap_sell_bad_atomic_swap_charges_fee_W() { assert_ok!(XykStorage::multiswap_sell_asset( RuntimeOrigin::signed(TRADER_ID), - vec![1, 2, 3, 6, 5], + vec![1, 2, 3, 4, 5], 20000000000000000000, 20000000000000000000 )); @@ -960,10 +963,10 @@ fn multiswap_sell_not_enough_assets_pay_fees_fails_early_W() { assert_eq!(XykStorage::balance(4, XykStorage::account_id()), 100000000000000000000); assert_eq!(XykStorage::balance(5, XykStorage::account_id()), 60000000000000000000); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_sell_asset( RuntimeOrigin::signed(TRADER_ID), - vec![1, 2, 3, 6, 5], + vec![1, 2, 3, 4, 5], 2000000000000000000000000, 0 ), @@ -1043,6 +1046,7 @@ fn multiswap_sell_just_enough_assets_pay_fee_but_not_to_swap_W() { } #[test] +#[serial] fn multiswap_sell_with_two_hops_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1068,6 +1072,7 @@ fn multiswap_sell_with_two_hops_W() { } #[test] +#[serial] fn multiswap_sell_with_single_hops_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1082,6 +1087,7 @@ fn multiswap_sell_with_single_hops_W() { } #[test] +#[serial] fn multiswap_sell_same_pool_works_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1121,6 +1127,7 @@ fn multiswap_sell_same_pool_works_W() { } #[test] +#[serial] fn multiswap_sell_loop_works_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1172,7 +1179,7 @@ fn multiswap_sell_zero_amount_does_not_work_N() { System::set_block_number(1); multi_initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_sell_asset( RuntimeOrigin::signed(TRADER_ID), vec![1, 2, 3], @@ -1253,7 +1260,7 @@ fn buy_N_no_such_pool() { initialize(); // buying 150000 assetId 1 of pool 0 10 (only pool 0 1 exists) - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset(RuntimeOrigin::signed(2), vec![0, 10], 150000, 5000000), Error::::NoSuchPool, ); @@ -1275,7 +1282,7 @@ fn buy_N_not_enough_reserve() { initialize(); // buying 70000000000000000000 assetId 0 of pool 0 1 , only 60000000000000000000 in reserve - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(2), vec![1, 4], @@ -1294,7 +1301,7 @@ fn buy_N_not_enough_selling_assset() { initialize(); // buying 59000000000000000000 assetId 1 of pool 0 1 should sell 2.36E+21 assetId 0, only 9.6E+20 in acc - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(2), vec![1, 4], @@ -1373,7 +1380,7 @@ fn buy_N_zero_amount() { new_test_ext().execute_with(|| { initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset(RuntimeOrigin::signed(2), vec![1, 4], 0, 0), Error::::ZeroAmount, ); // buying 0 assetId 0 of pool 0 1 @@ -1381,6 +1388,7 @@ fn buy_N_zero_amount() { } #[test] +#[serial] fn multiswap_buy_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1438,6 +1446,7 @@ fn multiswap_buy_W() { } #[test] +#[serial] fn multiswap_buy_bad_slippage_charges_fee_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1492,6 +1501,7 @@ fn multiswap_buy_bad_slippage_charges_fee_W() { } #[test] +#[serial] fn multiswap_buy_bad_atomic_swap_charges_fee_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1515,7 +1525,7 @@ fn multiswap_buy_bad_atomic_swap_charges_fee_W() { assert_ok!(XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), - vec![1, 2, 3, 6, 5], + vec![1, 2, 3, 4, 5], 20000000000000000000, 200000000000000000 )); @@ -1549,6 +1559,7 @@ fn multiswap_buy_bad_atomic_swap_charges_fee_W() { } #[test] +#[serial] fn multiswap_buy_not_enough_assets_pay_fees_fails_early_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1570,10 +1581,10 @@ fn multiswap_buy_not_enough_assets_pay_fees_fails_early_W() { assert_eq!(XykStorage::balance(4, XykStorage::account_id()), 100000000000000000000); assert_eq!(XykStorage::balance(5, XykStorage::account_id()), 60000000000000000000); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), - vec![1, 2, 3, 6, 5], + vec![1, 2, 3, 4, 5], 2000000000000000000000000, 2000000000000000000000000 ), @@ -1599,6 +1610,7 @@ fn multiswap_buy_not_enough_assets_pay_fees_fails_early_W() { } #[test] +#[serial] fn multiswap_buy_just_enough_assets_pay_fee_but_not_to_swap_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1661,6 +1673,7 @@ fn multiswap_buy_just_enough_assets_pay_fee_but_not_to_swap_W() { } #[test] +#[serial] fn multiswap_buy_with_two_hops_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1686,6 +1699,7 @@ fn multiswap_buy_with_two_hops_W() { } #[test] +#[serial] fn multiswap_buy_with_single_hops_W() { new_test_ext().execute_with(|| { System::set_block_number(1); @@ -1700,12 +1714,13 @@ fn multiswap_buy_with_single_hops_W() { } #[test] +#[serial] fn multiswap_buy_same_pool_does_not_work_N() { new_test_ext().execute_with(|| { System::set_block_number(1); multi_initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), vec![1, 2, 1], @@ -1718,12 +1733,13 @@ fn multiswap_buy_same_pool_does_not_work_N() { } #[test] +#[serial] fn multiswap_buy_loop_does_not_work_N() { new_test_ext().execute_with(|| { System::set_block_number(1); multi_initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), vec![1, 2, 3, 2, 1, 2], @@ -1742,7 +1758,7 @@ fn multiswap_buy_zero_amount_does_not_work_N() { System::set_block_number(1); multi_initialize(); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), vec![1, 2, 3], @@ -1751,7 +1767,7 @@ fn multiswap_buy_zero_amount_does_not_work_N() { ), Error::::ZeroAmount ); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(TRADER_ID), vec![1, 2, 3], @@ -1763,6 +1779,145 @@ fn multiswap_buy_zero_amount_does_not_work_N() { }); } +#[test] +#[serial] +fn burn_all_liq_and_mint_it_again() { + new_test_ext().execute_with(|| { + initialize(); + + let (asset_value_1, asset_value_4) = XykStorage::asset_pool((1, 4)); + let liq_token_id = XykStorage::liquidity_asset((1, 4)); + let total_issuance_of_liq_amount: u128 = + ::Currency::total_issuance(liq_token_id.unwrap()).into(); + + //burn half of the liquidity + XykStorage::burn_liquidity( + RuntimeOrigin::signed(2), + 1, + 4, + total_issuance_of_liq_amount / 2, + ) + .unwrap(); + + let (divided_asset_value_1, divided_asset_value_4) = XykStorage::asset_pool((1, 4)); + let divided_total_issuance_of_liq_amount: u128 = + ::Currency::total_issuance(liq_token_id.unwrap()).into(); + + assert_eq!(divided_asset_value_1, asset_value_1 / 2); + assert_eq!(divided_asset_value_4, asset_value_4 / 2); + assert_eq!(divided_total_issuance_of_liq_amount, total_issuance_of_liq_amount / 2); + + //burn second half of liquidity + XykStorage::burn_liquidity( + RuntimeOrigin::signed(2), + 1, + 4, + total_issuance_of_liq_amount / 2, + ) + .unwrap(); + + let (empty_asset_value_1, empty_asset_value_4) = XykStorage::asset_pool((1, 4)); + let empty_total_issuance_of_liq_amount: u128 = + ::Currency::total_issuance(liq_token_id.unwrap()).into(); + + assert_eq!(empty_asset_value_1, 0); + assert_eq!(empty_asset_value_4, 0); + assert_eq!(empty_total_issuance_of_liq_amount, 0); + + // we will try to create a new pool but it needs to fail. + assert_err!( + XykStorage::create_pool(RuntimeOrigin::signed(2), 1, asset_value_1, 4, asset_value_4), + Error::::PoolAlreadyExists, + ); + + // we will try to sell assets but it needs to fail + let user_assets_1_value = XykStorage::balance(1, DUMMY_USER_ID); + let user_assets_4_value = XykStorage::balance(4, DUMMY_USER_ID); + + assert_eq!(user_assets_1_value, 1000000000000000000000); + assert_eq!(user_assets_4_value, 1000000000000000000000); + + // selling the assets should fail due to empty pools + assert_err_ignore_postinfo!( + XykStorage::multiswap_sell_asset( + RuntimeOrigin::signed(DUMMY_USER_ID), + vec![1, 4], + 20000000000000000000, + 1 + ), + Error::::PoolIsEmpty, + ); + + // selling the assets should fail also for multiswap due to empty pools + assert_err_ignore_postinfo!( + XykStorage::multiswap_sell_asset( + RuntimeOrigin::signed(DUMMY_USER_ID), + vec![1, 4, 1, 4], + 20000000000000000000, + 1 + ), + Error::::PoolIsEmpty, + ); + + // buy asset should fail due to empty pools + assert_err_ignore_postinfo!( + XykStorage::multiswap_buy_asset( + RuntimeOrigin::signed(DUMMY_USER_ID), + vec![1, 4], + 20000000000000000000, + 1 + ), + Error::::PoolIsEmpty, + ); + + // buy asset should fail also for multiswap due to empty pools + assert_err_ignore_postinfo!( + XykStorage::multiswap_buy_asset( + RuntimeOrigin::signed(DUMMY_USER_ID), + vec![1, 4, 1, 4], + 20000000000000000000, + 1 + ), + Error::::PoolIsEmpty, + ); + + // calculate_buy_price_id should fail as pool is empty + assert_err!(XykStorage::calculate_buy_price_id(1, 4, 20000), Error::::PoolIsEmpty,); + + // calculate_sell_price_id should fail as pool is empty + assert_err!(XykStorage::calculate_sell_price_id(1, 4, 20000), Error::::PoolIsEmpty,); + + // get_burn_amount should fail as pool is empty + assert_err!(XykStorage::get_burn_amount(1, 4, 20000), Error::::PoolIsEmpty,); + + let user_assets_1_value_after_sell = XykStorage::balance(1, DUMMY_USER_ID); + let user_assets_4_value_after_sell = XykStorage::balance(4, DUMMY_USER_ID); + + //check that no asset sold + assert_eq!(user_assets_1_value_after_sell, 1000000000000000000000); + assert_eq!(user_assets_4_value_after_sell, 1000000000000000000000); + + // minting liq again and checking if the liq. asset is generated + XykStorage::mint_liquidity(RuntimeOrigin::signed(2), 1, 4, asset_value_1, asset_value_4); + + let liq_token_id_after_burn_and_mint = XykStorage::liquidity_asset((1, 4)); + + assert_eq!(liq_token_id, liq_token_id_after_burn_and_mint); + + let total_issuance_after_burn_and_mint: u128 = + ::Currency::total_issuance(liq_token_id_after_burn_and_mint.unwrap()) + .into(); + + assert_eq!(total_issuance_of_liq_amount, total_issuance_after_burn_and_mint); + + let (asset_value_1_after_burn_and_mint, asset_value_4_after_burn_and_mint) = + XykStorage::asset_pool((1, 4)); + + assert_eq!(asset_value_1, asset_value_1_after_burn_and_mint); + assert_eq!(asset_value_4, asset_value_4_after_burn_and_mint); + }); +} + #[test] #[serial] fn mint_W() { @@ -1999,34 +2154,138 @@ fn buy_assets_with_small_expected_amount_does_not_cause_panic() { #[test] #[serial] -#[ignore] -fn successful_buy_assets_does_not_charge_fee() { +fn swaps_are_annotated_as_PaysNo() { + new_test_ext().execute_with(|| { + let calls = [ + mock::RuntimeCall::XykStorage(Call::sell_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + sold_asset_amount: 10u128, + min_amount_out: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::buy_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_buy_asset { + swap_token_list: vec![0, 2], + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_sell_asset { + swap_token_list: vec![0, 2], + sold_asset_amount: 10, + min_amount_out: 0, + }), + ]; + + assert!(calls + .iter() + .map(|call| call.get_dispatch_info()) + .all(|dispatch| dispatch.pays_fee == Pays::No)); + }); +} + +#[test] +#[serial] +fn successful_swaps_are_free() { new_test_ext().execute_with(|| { initialize(); - let first_token_balance = XykStorage::balance(1, DUMMY_USER_ID); - let post_info = XykStorage::multiswap_buy_asset( - RuntimeOrigin::signed(2), - vec![1, 4], - 1000, - first_token_balance, - ) - .unwrap(); - assert_eq!(post_info.pays_fee, Pays::No); + XykStorage::create_pool(RuntimeOrigin::signed(2), 1, 1000, 0, 1000).unwrap(); + + let calls = [ + mock::RuntimeCall::XykStorage(Call::sell_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + sold_asset_amount: 10u128, + min_amount_out: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::buy_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_buy_asset { + swap_token_list: vec![0, 1], + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_sell_asset { + swap_token_list: vec![0, 1], + sold_asset_amount: 10, + min_amount_out: 0, + }), + ]; + + assert!(calls.iter().all(|call| matches!( + call.clone().dispatch(RuntimeOrigin::signed(2)), + Ok(post_info) if post_info.pays_fee == Pays::No + ))); + }); +} + +#[test] +#[serial] +fn unsuccessful_swaps_are_not_free() { + new_test_ext().execute_with(|| { + initialize(); + // XykStorage::create_pool(RuntimeOrigin::signed(2), 1, 1000, 0, 1000).unwrap(); + + let calls = [ + mock::RuntimeCall::XykStorage(Call::sell_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + sold_asset_amount: 10u128, + min_amount_out: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::buy_asset { + sold_asset_id: 0u32, + bought_asset_id: 1u32, + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_buy_asset { + swap_token_list: vec![0, 1], + bought_asset_amount: 10u128, + max_amount_in: 1u128, + }), + mock::RuntimeCall::XykStorage(Call::multiswap_sell_asset { + swap_token_list: vec![0, 1], + sold_asset_amount: 10, + min_amount_out: 0, + }), + ]; + + assert!(calls.iter().all(|call| { + matches!( + call.clone().dispatch(RuntimeOrigin::signed(2)), + Err(err) if err.post_info.pays_fee == Pays::Yes + && err.post_info.actual_weight.unwrap().ref_time() > 0 + ) + })); }); } #[test] #[serial] -#[ignore] fn unsuccessful_buy_assets_charges_fee() { new_test_ext().execute_with(|| { System::set_block_number(1); - //try to sell non owned, non existing tokens + let post_info = XykStorage::multiswap_buy_asset(RuntimeOrigin::signed(2), vec![100, 200], 0, 0) .unwrap_err() .post_info; assert_eq!(post_info.pays_fee, Pays::Yes); + + let post_info = + XykStorage::multiswap_sell_asset(RuntimeOrigin::signed(2), vec![100, 200], 0, 0) + .unwrap_err() + .post_info; + assert_eq!(post_info.pays_fee, Pays::Yes); }); } @@ -2289,7 +2548,7 @@ fn sell_N_maintenance_mode() { MockMaintenanceStatusProvider::set_maintenance(true); - assert_err!( + assert_err_ignore_postinfo!( XykStorage::multiswap_sell_asset(RuntimeOrigin::signed(2), vec![1, 4], 20000000, 0), Error::::TradingBlockedByMaintenanceMode, ); @@ -2324,7 +2583,7 @@ fn buy_W_maintenance_mode() { MockMaintenanceStatusProvider::set_maintenance(true); - assert_err!( + assert_err_ignore_postinfo!( // buying 30000000000000000000 assetId 1 of pool 0 1 XykStorage::multiswap_buy_asset( RuntimeOrigin::signed(2), diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml new file mode 100644 index 0000000000..5a8b43320e --- /dev/null +++ b/runtime/common/Cargo.toml @@ -0,0 +1,279 @@ +[package] +name = "common-runtime" +version = "4.0.0" +authors = ["Mangata Team"] +edition = "2018" +license = "Unlicense" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[build-dependencies] +substrate-wasm-builder = { git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } + +[dependencies] +hex-literal = { version = '0.3.1' } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +serde = { version = "1.0.137", optional = true, features = ["derive"] } +smallvec = "1.6.1" +static_assertions = "1.1.0" + +# Local Dependencies +pallet-xyk = { path = '../../pallets/xyk', default-features = false, version = '0.1.0' } +pallet-proof-of-stake = { path = '../../pallets/proof-of-stake', default-features = false, version = '0.1.0' } +pallet-bootstrap = { path = '../../pallets/bootstrap', default-features = false, version = '0.1.0' } +xyk-runtime-api = { path = '../../pallets/xyk/runtime-api', default-features = false, version = '2.0.0' } +pallet-sudo-origin = { path = '../../pallets/sudo-origin', default-features = false } +pallet-issuance = { path = '../../pallets/issuance', default-features = false } +pallet-multipurpose-liquidity = { path = '../../pallets/multipurpose-liquidity', default-features = false } +pallet-maintenance = { path = '../../pallets/maintenance', default-features = false } +pallet-fee-lock = { path = '../../pallets/fee-lock', default-features = false} +mangata-support = { default-features = false , git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } + +# Substrate Dependencies +## Substrate Primitive Dependencies +mangata-types = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-api = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-block-builder = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-consensus-aura = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-core = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-inherents = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-io = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-offchain = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-runtime = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-session = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-std = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-transaction-pool = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-utility-mangata = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-ver = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-version = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +sp-weights = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } + +## Substrate FRAME Dependencies +frame-benchmarking = { git = "https://github.com/mangata-finance/substrate", default-features = false, optional = true, branch = "mangata-dev" } +frame-executive = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +frame-try-runtime = { git = "https://github.com/mangata-finance/substrate", default-features = false, optional = true, branch = "mangata-dev" } +frame-support = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +frame-system = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +frame-system-benchmarking = { git = "https://github.com/mangata-finance/substrate", default-features = false, optional = true, branch = "mangata-dev" } +frame-system-rpc-runtime-api = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +ver-api = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } + +## Substrate Pallet Dependencies +pallet-aura = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-authorship = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-session = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-sudo-mangata = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-timestamp = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-transaction-payment-mangata = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-transaction-payment-mangata-rpc-runtime-api = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-treasury = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-collective-mangata = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-vesting-mangata = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-proxy = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-identity = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } +pallet-root-testing = { git = "https://github.com/mangata-finance/substrate", default-features = false, branch = "mangata-dev" } + +# Open-Runtime-Module-Library Dependencies +orml-tokens = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-traits = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-xtokens = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-xcm-support = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-unknown-tokens = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-xcm = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } +orml-asset-registry = { default-features = false, version = "0.4.1-dev", git = "https://github.com/mangata-finance/open-runtime-module-library", branch = "mangata-dev" } + +# Cumulus dependencies +cumulus-pallet-aura-ext = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-pallet-dmp-queue = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-pallet-parachain-system = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-pallet-xcm = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-pallet-xcmp-queue = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-primitives-core = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-primitives-timestamp = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-primitives-utility = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +parachain-info = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false } +cumulus-pallet-session-benchmarking = { git = 'https://github.com/mangata-finance/cumulus', branch = "mangata-dev", default-features = false, optional = true } + +# Polkadot Dependencies +polkadot-primitives = { git = "https://github.com/mangata-finance/polkadot", branch = "mangata-dev", default-features = false } +pallet-xcm = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } +polkadot-parachain = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } +polkadot-runtime-common = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } +xcm = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } +xcm-builder = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } +xcm-executor = { git = "https://github.com/mangata-finance/polkadot", default-features = false, branch = "mangata-dev" } + +# Staking dependencies +parachain-staking = { default-features = false, git = "https://github.com/mangata-finance/moonbeam", branch = "mangata-dev" } + +# Crowdloan dependencies +pallet-crowdloan-rewards = { default-features = false, git = "https://github.com/mangata-finance/crowdloan-rewards", branch = "mangata-dev" } + +[features] +default = [ + "std", +] +std = [ + "codec/std", + "serde", + "scale-info/std", + "log/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-ver/std", + "sp-version/std", + "frame-executive/std", + "frame-support/std", + "frame-system/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-proxy/std", + "pallet-session/std", + "pallet-sudo-mangata/std", + "pallet-sudo-origin/std", + "pallet-timestamp/std", + "pallet-transaction-payment-mangata-rpc-runtime-api/std", + "pallet-transaction-payment-mangata/std", + "pallet-utility-mangata/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-session-benchmarking/std", + "frame-benchmarking/std", + "frame-system-benchmarking/std", + "frame-try-runtime/std", + "polkadot-primitives/std", + "sp-weights/std", + "parachain-info/std", + "polkadot-parachain/std", + "polkadot-runtime-common/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + "ver-api/std", + "mangata-types/std", + "orml-traits/std", + "orml-tokens/std", + "pallet-treasury/std", + "pallet-xyk/std", + "pallet-proof-of-stake/std", + "pallet-bootstrap/std", + "xyk-runtime-api/std", + "parachain-staking/std", + "orml-xtokens/std", + "orml-xcm-support/std", + "orml-unknown-tokens/std", + "orml-xcm/std", + "orml-asset-registry/std", + "pallet-issuance/std", + "pallet-vesting-mangata/std", + "pallet-crowdloan-rewards/std", + "frame-system-rpc-runtime-api/std", + "pallet-collective-mangata/std", + "pallet-multipurpose-liquidity/std", + "mangata-support/std", + "pallet-fee-lock/std", + "pallet-identity/std", + "pallet-maintenance/std", +] + + +try-runtime = [ + "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "polkadot-runtime-common/try-runtime", + "pallet-multipurpose-liquidity/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "pallet-timestamp/try-runtime", + "parachain-info/try-runtime", + "orml-tokens/try-runtime", + "pallet-transaction-payment-mangata/try-runtime", + "pallet-xyk/try-runtime", + "pallet-proof-of-stake/try-runtime", + "pallet-vesting-mangata/try-runtime", + "pallet-crowdloan-rewards/try-runtime", + "pallet-issuance/try-runtime", + "pallet-authorship/try-runtime", + "parachain-staking/try-runtime", + "pallet-session/try-runtime", + "pallet-aura/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "pallet-xcm/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "orml-xtokens/try-runtime", + "orml-unknown-tokens/try-runtime", + "orml-xcm/try-runtime", + "orml-asset-registry/try-runtime", + "pallet-treasury/try-runtime", + "pallet-sudo-mangata/try-runtime", + "pallet-sudo-origin/try-runtime", + "pallet-collective-mangata/try-runtime", + "pallet-bootstrap/try-runtime", + "pallet-utility-mangata/try-runtime", + "pallet-proxy/try-runtime", + "pallet-fee-lock/try-runtime", + "pallet-identity/try-runtime", + "pallet-maintenance/try-runtime", + "pallet-root-testing/try-runtime" +] + +fast-runtime = [] + +runtime-benchmarks = [ + "polkadot-primitives/runtime-benchmarks", + "pallet-maintenance/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "orml-tokens/runtime-benchmarks", + "orml-xtokens/runtime-benchmarks", + "orml-asset-registry/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xyk/runtime-benchmarks", + "pallet-proof-of-stake/runtime-benchmarks", + "parachain-staking/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-collective-mangata/runtime-benchmarks", + "pallet-crowdloan-rewards/runtime-benchmarks", + "pallet-utility-mangata/runtime-benchmarks", + "pallet-vesting-mangata/runtime-benchmarks", + "pallet-issuance/runtime-benchmarks", + "pallet-bootstrap/runtime-benchmarks", + "pallet-multipurpose-liquidity/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-fee-lock/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", +] diff --git a/runtime/mangata-kusama/src/constants.rs b/runtime/common/src/constants.rs similarity index 78% rename from runtime/mangata-kusama/src/constants.rs rename to runtime/common/src/constants.rs index 132b7d1b26..dd8daf70ef 100644 --- a/runtime/mangata-kusama/src/constants.rs +++ b/runtime/common/src/constants.rs @@ -1,5 +1,5 @@ pub mod fee { - use crate::{weights::VerExtrinsicBaseWeight, UNIT}; + use crate::{consts::UNIT, weights::VerExtrinsicBaseWeight}; use frame_support::weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -8,12 +8,12 @@ pub mod fee { use smallvec::smallvec; use sp_runtime::Perbill; - pub const KSM_MGX_SCALE_FACTOR_UNADJUSTED: u128 = 10_000_000_000_u128; // 10_000 as KSM/MGX, with 6 decimals accounted for (12 - KSM, 18 - MGX) + pub const RELAY_LOCAL_SCALE_FACTOR_UNADJUSTED: u128 = 10_000_000_000_u128; // 10_000 as KSM/MGX, with 6 decimals accounted for (12 - KSM, 18 - MGR) // on-chain fees are 10x more expensive then ~real rate - pub const KSM_MGX_SCALE_FACTOR: u128 = 1000_000_000_u128; // 1000 as KSM/MGX, with 6 decimals accounted for (12 - KSM, 18 - MGX) - pub const KAR_MGX_SCALE_FACTOR: u128 = KSM_MGX_SCALE_FACTOR / 100; // 100 as KAR/KSM - pub const TUR_MGX_SCALE_FACTOR: u128 = KSM_MGX_SCALE_FACTOR; // 100 as TUR/KSM, with 2 decimals accounted for (10 - TUR, 12 - KSM) + pub const RELAY_MGX_SCALE_FACTOR: u128 = 1000_000_000_u128; // 1000 as KSM/MGR, with 6 decimals accounted for (12 - KSM, 18 - MGR) + pub const KAR_MGR_SCALE_FACTOR: u128 = RELAY_MGX_SCALE_FACTOR / 100; // 100 as KAR/ROC + pub const TUR_MGR_SCALE_FACTOR: u128 = RELAY_MGX_SCALE_FACTOR; // 100 as TUR/ROC, with 2 decimals accounted for (10 - TUR, 12 - ROC) /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the /// node's balance type. @@ -53,7 +53,7 @@ pub mod fee { } pub fn ksm_per_second() -> u128 { - mgx_per_second() / KSM_MGX_SCALE_FACTOR_UNADJUSTED as u128 + mgx_per_second() / RELAY_LOCAL_SCALE_FACTOR_UNADJUSTED as u128 } } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs new file mode 100644 index 0000000000..7eb1bfdb64 --- /dev/null +++ b/runtime/common/src/lib.rs @@ -0,0 +1,1369 @@ +#![cfg_attr(not(feature = "std"), no_std)] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. +#![recursion_limit = "256"] + +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{ + dispatch::{DispatchClass, DispatchResult}, + ensure, parameter_types, + traits::{ + tokens::currency::{MultiTokenCurrency, MultiTokenImbalanceWithZeroTrait}, + Contains, EnsureOrigin, EnsureOriginWithArg, ExistenceRequirement, Get, Imbalance, + OriginTrait, WithdrawReasons, + }, + unsigned::TransactionValidityError, + weights::{constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight}, + PalletId, +}; +#[cfg(any(feature = "std", test))] +pub use frame_system::Call as SystemCall; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; +use log::info; +pub use orml_tokens; +use orml_tokens::MultiTokenCurrencyExtended; +use orml_traits::{ + asset_registry::{AssetMetadata, AssetProcessor}, + parameter_type_with_key, +}; +pub use pallet_sudo_mangata; +use pallet_transaction_payment_mangata::{ConstFeeMultiplier, Multiplier, OnChargeTransaction}; + +// Polkadot Imports +pub use polkadot_runtime_common::BlockHashCount; +use scale_info::TypeInfo; + +pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; + +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; +use sp_runtime::{ + generic, + traits::{ + AccountIdConversion, BlakeTwo256, DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero, + }, + transaction_validity::InvalidTransaction, + DispatchError, FixedPointNumber, Percent, RuntimeDebug, +}; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; +use sp_std::{cmp::Ordering, marker::PhantomData, prelude::*}; + +pub use xcm::{latest::prelude::*, VersionedMultiLocation}; + +pub use constants::{fee::*, parachains::*}; +pub use currency::*; +use mangata_support::traits::{AssetRegistryApi, FeeLockTriggerTrait, PreValidateSwaps}; +pub use mangata_types::{ + assets::{CustomMetadata, XcmMetadata, XykMetadata}, + AccountId, Address, Amount, Balance, BlockNumber, Hash, Index, Signature, TokenId, +}; +pub use pallet_issuance::IssuanceInfo; +pub use pallet_sudo_origin; +pub use pallet_xyk; +// XCM Imports +use pallet_xyk::AssetMetadataMutationTrait; + +pub mod constants; +pub mod migration; +mod weights; +pub mod xcm_config; + +pub mod currency { + use super::Balance; + + pub const MILLICENTS: Balance = CENTS / 1000; + pub const CENTS: Balance = DOLLARS / 100; // assume this is worth about a cent. + pub const DOLLARS: Balance = super::consts::UNIT; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + items as Balance * 5000 * DOLLARS + (bytes as Balance) * 60 * CENTS + } +} + +pub mod tokens { + use super::*; + pub const MGX_TOKEN_ID: TokenId = 0; + pub const RELAY_TOKEN_ID: TokenId = 4; + pub const KAR_TOKEN_ID: TokenId = 6; + pub const TUR_TOKEN_ID: TokenId = 7; + + parameter_types! { + pub const MgxTokenId: TokenId = MGX_TOKEN_ID; + pub const RelayTokenId: TokenId = RELAY_TOKEN_ID; + pub const TurTokenId: TokenId = TUR_TOKEN_ID; + } +} + +pub mod runtime_types { + use super::*; + + pub type SignedExtra = ( + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment_mangata::ChargeTransactionPayment, + ); + + pub type SignedPayload = + generic::SignedPayload>; + pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic>; + pub type CheckedExtrinsic = + generic::CheckedExtrinsic>; + pub type Header = generic::HeaderVer; + pub type Block = + generic::Block>; + pub type SignedBlock = generic::SignedBlock>; + pub type BlockId = generic::BlockId>; + + pub type OpaqueBlock = generic::Block; + pub type OpaqueBlockId = generic::BlockId; +} + +pub mod consts { + use super::*; + /// This determines the average expected block time that we are targeting. + /// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. + /// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked + /// up by `pallet_aura` to implement `fn slot_duration()`. + /// + /// Change this to adjust the block time. + pub const MILLISECS_PER_BLOCK: u64 = 12000; + + // Time is measured by number of blocks. + pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); + pub const HOURS: BlockNumber = MINUTES * 60; + pub const DAYS: BlockNumber = HOURS * 24; + + // Unit = the base number of indivisible units for balance + pub const UNIT: Balance = 1_000_000_000_000_000_000; + pub const MILLIUNIT: Balance = 1_000_000_000_000_000; + pub const MICROUNIT: Balance = 1_000_000_000_000; + + /// We allow for 0.5 of a second of compute with a 12 second average block time. + /// NOTE: reduced by half comparing to origin impl as we want to fill block only up to 50% + /// so there is room for new extrinsics in the next block + pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_div(4), + polkadot_primitives::v2::MAX_POV_SIZE as u64, + ); + + /// The existential deposit. Set to 1/10 of the Connected Relay Chain. + pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; +} + +pub enum CallType { + AtomicSell { + sold_asset_id: TokenId, + sold_asset_amount: Balance, + bought_asset_id: TokenId, + min_amount_out: Balance, + }, + AtomicBuy { + sold_asset_id: TokenId, + bought_asset_amount: Balance, + bought_asset_id: TokenId, + max_amount_in: Balance, + }, + MultiSell { + swap_token_list: Vec, + sold_asset_amount: Balance, + min_amount_out: Balance, + }, + MultiBuy { + swap_token_list: Vec, + bought_asset_amount: Balance, + max_amount_in: Balance, + }, + CompoundRewards, + ProvideLiquidityWithConversion, + UnlockFee, + UtilityInnerCall, + Other, +} + +pub mod config { + use super::*; + + pub type TreasuryPalletIdOf = ::PalletId; + + pub struct TreasuryAccountIdOf(PhantomData); + impl Get for TreasuryAccountIdOf { + fn get() -> AccountId { + TreasuryPalletIdOf::::get().into_account_truncating() + } + } + + pub type ExistentialDepositsOf = ::ExistentialDeposits; + pub type MaxLocksOf = ::MaxLocks; + pub type SessionLenghtOf = ::BlocksPerRound; + + pub mod frame_system { + use super::*; + + /// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is + /// used to limit the maximal weight of a single extrinsic. + pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); + + /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by + /// `Operational` extrinsics. + pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); + + pub type MaxConsumers = frame_support::traits::ConstU32<16>; + + parameter_types! { + + // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. + // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the + // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize + // the lazy contract deletion. + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(weights::VerBlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = weights::VerExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * consts::MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(consts::MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + consts::MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * consts::MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); + pub const SS58Prefix: u16 = 42; + } + } + + pub mod pallet_timestamp { + use super::*; + + // NOTE: Currently it is not possible to change the slot duration after the chain has started. + // Attempting to do so will brick block production. + parameter_types! { + pub const MinimumPeriod: u64 = consts::MILLISECS_PER_BLOCK / 2; + } + } + + pub mod pallet_treasury { + use super::*; + parameter_types! { + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + } + + parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: Balance = 1 * currency::DOLLARS; + pub const ProposalBondMaximum: Option = None; + pub const SpendPeriod: BlockNumber = 1 * consts::DAYS; + pub const Burn: Permill = Permill::from_percent(0); + pub const MaxApprovals: u32 = 100; + } + } + + pub mod orml_tokens { + use super::*; + parameter_types! { + pub const MaxLocks: u32 = 50; + } + + parameter_type_with_key! { + pub ExistentialDeposits: |_currency_id: TokenId| -> Balance { + 0 + }; + } + + pub struct DustRemovalWhitelist>(PhantomData); + impl> Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + *a == T::get() + } + } + + pub type ReserveIdentifier = [u8; 8]; + } + + pub mod pallet_xyk { + + use super::*; + parameter_types! { + pub const BnbTreasurySubAccDerive: [u8; 4] = *b"bnbt"; + } + pub type PoolFeePercentage = frame_support::traits::ConstU128<20>; + pub type TreasuryFeePercentage = frame_support::traits::ConstU128<5>; + pub type BuyAndBurnFeePercentage = frame_support::traits::ConstU128<5>; + + pub struct TestTokensFilter; + impl Contains for TestTokensFilter { + fn contains(token_id: &TokenId) -> bool { + // we dont want to allow doing anything with dummy assets previously + // used for testing + *token_id == 2 || *token_id == 3 + } + } + + pub struct AssetRegisterFilter(PhantomData); + impl Contains for AssetRegisterFilter + where + T: ::orml_asset_registry::Config< + CustomMetadata = CustomMetadata, + AssetId = TokenId, + Balance = Balance, + >, + { + fn contains(t: &TokenId) -> bool { + let meta: Option<_> = ::orml_asset_registry::Metadata::::get(*t); + if let Some(xyk) = meta.and_then(|m| m.additional.xyk) { + return xyk.operations_disabled + } + return false + } + } + + pub struct AssetMetadataMutation(PhantomData); + + impl AssetMetadataMutationTrait for AssetMetadataMutation + where + T: ::orml_asset_registry::Config< + CustomMetadata = CustomMetadata, + AssetId = TokenId, + Balance = Balance, + >, + { + fn set_asset_info( + asset: TokenId, + name: Vec, + symbol: Vec, + decimals: u32, + ) -> DispatchResult { + let metadata = AssetMetadata { + name, + symbol, + decimals, + existential_deposit: Default::default(), + additional: Default::default(), + location: None, + }; + ::orml_asset_registry::Pallet::::do_register_asset_without_asset_processor( + metadata, asset, + )?; + Ok(()) + } + } + } + + pub mod pallet_bootstrap { + use super::*; + + parameter_types! { + pub const BootstrapUpdateBuffer: BlockNumber = 300; + pub const DefaultBootstrapPromotedPoolWeight: u8 = 0u8; + pub const ClearStorageLimit: u32 = 100u32; + } + + pub struct EnableAssetPoolApi(PhantomData); + impl AssetRegistryApi for EnableAssetPoolApi + where + T: ::orml_asset_registry::Config< + CustomMetadata = CustomMetadata, + AssetId = TokenId, + Balance = Balance, + >, + { + fn enable_pool_creation(assets: (TokenId, TokenId)) -> bool { + for &asset in [assets.0, assets.1].iter() { + let meta_maybe: Option<_> = ::orml_asset_registry::Metadata::::get(asset); + if let Some(xyk) = meta_maybe.clone().and_then(|m| m.additional.xyk) { + let mut additional = meta_maybe.unwrap().additional; + if xyk.operations_disabled { + additional.xyk = Some(XykMetadata { operations_disabled: false }); + match ::orml_asset_registry::Pallet::::do_update_asset( + asset, + None, + None, + None, + None, + None, + Some(additional), + ) { + Ok(_) => {}, + Err(e) => { + log::error!(target: "bootstrap", "cannot modify {} asset: {:?}!", asset, e); + return false + }, + } + } + } + } + true + } + } + } + + pub mod pallet_transaction_payment_mangata { + use crate::*; + + parameter_types! { + pub const OperationalFeeMultiplier: u8 = 5; + pub const TransactionByteFee: Balance = 5 * consts::MILLIUNIT; + pub ConstFeeMultiplierValue: Multiplier = Multiplier::saturating_from_rational(1, 1); + } + + pub type LengthToFee = ConstantMultiplier; + pub type FeeMultiplierUpdate = ConstFeeMultiplier; + + pub type ORMLCurrencyAdapterNegativeImbalance = + <::orml_tokens::MultiTokenCurrencyAdapter as MultiTokenCurrency< + ::AccountId, + >>::NegativeImbalance; + + pub trait OnMultiTokenUnbalanced< + TokenIdType, + Imbalance: ::frame_support::traits::TryDrop + MultiTokenImbalanceWithZeroTrait, + > + { + /// Handler for some imbalances. The different imbalances might have different origins or + /// meanings, dependent on the context. Will default to simply calling on_unbalanced for all + /// of them. Infallible. + fn on_unbalanceds(token_id: TokenIdType, amounts: impl Iterator) + where + Imbalance: ::frame_support::traits::Imbalance, + { + Self::on_unbalanced(amounts.fold(Imbalance::from_zero(token_id), |i, x| x.merge(i))) + } + + /// Handler for some imbalance. Infallible. + fn on_unbalanced(amount: Imbalance) { + amount.try_drop().unwrap_or_else(Self::on_nonzero_unbalanced) + } + + /// Actually handle a non-zero imbalance. You probably want to implement this rather than + /// `on_unbalanced`. + fn on_nonzero_unbalanced(amount: Imbalance) { + drop(amount); + } + } + + pub struct ToAuthor(PhantomData); + impl + OnMultiTokenUnbalanced> for ToAuthor + { + fn on_nonzero_unbalanced(amount: ORMLCurrencyAdapterNegativeImbalance) { + if let Some(author) = ::pallet_authorship::Pallet::::author() { + <::orml_tokens::MultiTokenCurrencyAdapter as MultiTokenCurrency< + ::AccountId, + >>::resolve_creating(amount.0, &author, amount); + } + } + } + + #[derive(Encode, Decode, TypeInfo)] + pub enum LiquidityInfoEnum, T: frame_system::Config> { + Imbalance((C::CurrencyId, NegativeImbalanceOf)), + FeeLock, + } + + pub struct FeeHelpers(PhantomData<(T, C, OU, OCA, OFLA)>); + impl FeeHelpers +where + T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, + T::LengthToFee: frame_support::weights::WeightToFee< + Balance = ::AccountId>>::Balance, + >, + C: MultiTokenCurrency<::AccountId>, + C::PositiveImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::NegativeImbalance, + >, + C::NegativeImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::PositiveImbalance, + >, + OU: OnMultiTokenUnbalanced>, + NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, + OCA: OnChargeTransaction< + T, + LiquidityInfo = Option>, + Balance = ::AccountId>>::Balance, + >, + OFLA: FeeLockTriggerTrait<::AccountId>, + // T: frame_system::Config, + T::AccountId: From + Into, + Balance: From<::AccountId>>::Balance>, + sp_runtime::AccountId32: From<::AccountId>, +{ + pub fn handle_sell_asset( + who: &T::AccountId, + fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, + sold_asset_id: u32, + sold_asset_amount: u128, + bought_asset_id: u32, + min_amount_out: u128, + ) -> Result>, TransactionValidityError> { + if fee_lock_metadata.is_whitelisted(sold_asset_id) || + fee_lock_metadata.is_whitelisted(bought_asset_id) + { + let (_, _, _, _, _, bought_asset_amount) = + as PreValidateSwaps>::pre_validate_sell_asset( + &who.clone(), + sold_asset_id, + bought_asset_id, + sold_asset_amount, + min_amount_out, + ) + .map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) + })?; + if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || + Self::is_high_value_swap( + &fee_lock_metadata, + bought_asset_id, + bought_asset_amount, + ) { + let _ = OFLA::unlock_fee(who); + } else { + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + } + } else { + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + } + Ok(Some(LiquidityInfoEnum::FeeLock)) + } + + pub fn is_high_value_swap( + fee_lock_metadata: &pallet_fee_lock::FeeLockMetadataInfo, + asset_id: u32, + asset_amount: u128, + ) -> bool { + if let (true, Some(valuation)) = ( + fee_lock_metadata.is_whitelisted(asset_id), + OFLA::get_swap_valuation_for_token(asset_id, asset_amount), + ) { + valuation >= fee_lock_metadata.swap_value_threshold + } else { + false + } + } + + pub fn handle_buy_asset( + who: &T::AccountId, + fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, + sold_asset_id: u32, + bought_asset_amount: u128, + bought_asset_id: u32, + max_amount_in: u128, + ) -> Result>, TransactionValidityError> { + if fee_lock_metadata.is_whitelisted(sold_asset_id) || + fee_lock_metadata.is_whitelisted(bought_asset_id) + { + let (_, _, _, _, _, sold_asset_amount) = + as PreValidateSwaps>::pre_validate_buy_asset( + &who.clone(), + sold_asset_id, + bought_asset_id, + bought_asset_amount, + max_amount_in, + ) + .map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) + })?; + if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || + Self::is_high_value_swap( + &fee_lock_metadata, + bought_asset_id, + bought_asset_amount, + ) { + let _ = OFLA::unlock_fee(who); + } else { + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + } + } else { + // "swap on non-curated token" branch + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + } + Ok(Some(LiquidityInfoEnum::FeeLock)) + } + + pub fn handle_multiswap_buy_asset( + who: &T::AccountId, + _fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, + swap_token_list: Vec, + bought_asset_amount: u128, + max_amount_in: u128, + ) -> Result>, TransactionValidityError> { + // ensure swap cannot fail + // This is to ensure that xyk swap fee is always charged + // We also ensure that the user has enough funds to transact + let _ = as PreValidateSwaps>::pre_validate_multiswap_buy_asset( + &who.clone(), + swap_token_list, + bought_asset_amount, + max_amount_in, + ) + .map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) + })?; + + // This is the "low value swap on curated token" branch + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + Ok(Some(LiquidityInfoEnum::FeeLock)) + } + + pub fn handle_multiswap_sell_asset( + who: &::AccountId, + _fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, + swap_token_list: Vec, + sold_asset_amount: u128, + min_amount_out: u128, + ) -> Result>, TransactionValidityError> { + // ensure swap cannot fail + // This is to ensure that xyk swap fee is always charged + // We also ensure that the user has enough funds to transact + let _ = as PreValidateSwaps>::pre_validate_multiswap_sell_asset( + &who.clone(), + swap_token_list.clone(), + sold_asset_amount, + min_amount_out, + ) + .map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) + })?; + + // This is the "low value swap on curated token" branch + OFLA::process_fee_lock(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) + })?; + Ok(Some(LiquidityInfoEnum::FeeLock)) + } +} + + const SINGLE_HOP_MULTISWAP: usize = 2; + #[derive(Encode, Decode, Clone, TypeInfo)] + pub struct OnChargeHandler(PhantomData<(C, OU, OCA, OFLA)>); + + /// Default implementation for a Currency and an OnUnbalanced handler. + /// + /// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and + /// then tip. + impl OnChargeTransaction for OnChargeHandler +where + T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, + ::RuntimeCall: Into, + T::LengthToFee: frame_support::weights::WeightToFee< + Balance = ::AccountId>>::Balance, + >, + C: MultiTokenCurrency<::AccountId>, + C::PositiveImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::NegativeImbalance, + >, + C::NegativeImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::PositiveImbalance, + >, + OU: OnMultiTokenUnbalanced>, + NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, + OCA: OnChargeTransaction< + T, + LiquidityInfo = Option>, + Balance = ::AccountId>>::Balance, + >, + OFLA: FeeLockTriggerTrait<::AccountId>, + // T: frame_system::Config, + T::AccountId: From + Into, + Balance: From<::AccountId>>::Balance>, + sp_runtime::AccountId32: From<::AccountId>, +{ + type LiquidityInfo = Option>; + type Balance = ::AccountId>>::Balance; + + /// Withdraw the predicted fee from the transaction origin. + /// + /// Note: The `fee` already includes the `tip`. + fn withdraw_fee( + who: &T::AccountId, + call: &T::RuntimeCall, + info: &DispatchInfoOf, + fee: Self::Balance, + tip: Self::Balance, + ) -> Result { + let call_type: crate::CallType = (*call).clone().into(); + + match call_type{ + crate::CallType::MultiSell{..} | + crate::CallType::MultiBuy{..} | + crate::CallType::AtomicBuy{..} | + crate::CallType::AtomicSell{..} => { + ensure!( + tip.is_zero(), + TransactionValidityError::Invalid( + InvalidTransaction::TippingNotAllowedForSwaps.into(), + ) + ); + } + _ => {} + }; + + // call.is_unlock_fee(); + + // THIS IS NOT PROXY PALLET COMPATIBLE, YET + // Also ugly implementation to keep it maleable for now + match (call_type, pallet_fee_lock::FeeLockMetadata::::get()) { + (crate::CallType::AtomicSell{sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out}, + Some(fee_lock_metadata)) => + { + FeeHelpers::::handle_sell_asset( + who, + fee_lock_metadata, + sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out, + ) + }, + (crate::CallType::AtomicBuy{ + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in}, + Some(fee_lock_metadata)) => + { + FeeHelpers::::handle_buy_asset( + who, + fee_lock_metadata, + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in, + ) + }, + (crate::CallType::MultiBuy{ + swap_token_list, + bought_asset_amount, + max_amount_in}, + Some(fee_lock_metadata)) if swap_token_list.len() == SINGLE_HOP_MULTISWAP => + { + let sold_asset_id = + swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( + InvalidTransaction::SwapPrevalidation.into(), + ))?; + let bought_asset_id = + swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( + InvalidTransaction::SwapPrevalidation.into(), + ))?; + FeeHelpers::::handle_buy_asset( + who, + fee_lock_metadata, + *sold_asset_id, + bought_asset_amount, + *bought_asset_id, + max_amount_in, + ) + }, + (crate::CallType::MultiBuy{ + swap_token_list, + bought_asset_amount, + max_amount_in}, + Some(fee_lock_metadata)) => + { + FeeHelpers::::handle_multiswap_buy_asset( + who, + fee_lock_metadata, + swap_token_list.clone(), + bought_asset_amount, + max_amount_in) + }, + (crate::CallType::MultiSell{ + swap_token_list, + sold_asset_amount, + min_amount_out}, + Some(fee_lock_metadata)) if swap_token_list.len() == SINGLE_HOP_MULTISWAP => { + let sold_asset_id = + swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( + InvalidTransaction::SwapPrevalidation.into(), + ))?; + let bought_asset_id = + swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( + InvalidTransaction::SwapPrevalidation.into(), + ))?; + FeeHelpers::::handle_sell_asset( + who, + fee_lock_metadata, + *sold_asset_id, + sold_asset_amount, + *bought_asset_id, + min_amount_out, + ) + }, + (crate::CallType::MultiSell{ + swap_token_list, + sold_asset_amount, + min_amount_out}, + Some(fee_lock_metadata)) => { + FeeHelpers::::handle_multiswap_sell_asset( + who, + fee_lock_metadata, + swap_token_list.clone(), + sold_asset_amount, + min_amount_out, + ) + }, + (crate::CallType::UnlockFee, _) => { + let imb = C::withdraw( + tokens::MgxTokenId::get().into(), + who, + Balance::from(tip).into(), + WithdrawReasons::TIP, + ExistenceRequirement::KeepAlive, + ) + .map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::Payment.into()) + })?; + + OU::on_unbalanceds(tokens::MgxTokenId::get().into(), Some(imb).into_iter()); + OFLA::can_unlock_fee(who).map_err(|_| { + TransactionValidityError::Invalid(InvalidTransaction::UnlockFee.into()) + })?; + Ok(Some(LiquidityInfoEnum::FeeLock)) + }, + _ => OCA::withdraw_fee(who, call, info, fee, tip), + } + } + + /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. + /// Since the predicted fee might have been too high, parts of the fee may + /// be refunded. + /// + /// Note: The `corrected_fee` already includes the `tip`. + fn correct_and_deposit_fee( + who: &T::AccountId, + dispatch_info: &DispatchInfoOf, + post_info: &PostDispatchInfoOf, + corrected_fee: Self::Balance, + tip: Self::Balance, + already_withdrawn: Self::LiquidityInfo, + ) -> Result<(), TransactionValidityError> { + match already_withdrawn { + Some(LiquidityInfoEnum::Imbalance(_)) => OCA::correct_and_deposit_fee( + who, + dispatch_info, + post_info, + corrected_fee, + tip, + already_withdrawn, + ), + Some(LiquidityInfoEnum::FeeLock) => Ok(()), + None => Ok(()), + } + } +} + + #[derive(Encode, Decode, Clone, TypeInfo)] + pub struct ThreeCurrencyOnChargeAdapter( + PhantomData<(C, OU, T1, T2, T3, SF2, SF3, TE)>, + ); + + type NegativeImbalanceOf = + ::AccountId>>::NegativeImbalance; + + pub trait TriggerEvent { + fn trigger(who: AccountIdT, fee: u128, tip: u128); + } + + /// Default implementation for a Currency and an OnUnbalanced handler. + /// + /// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and + /// then tip. + impl OnChargeTransaction + for ThreeCurrencyOnChargeAdapter +where + T: pallet_transaction_payment_mangata::Config, + // TE: TriggerEvent<::AccountId>, + TE: TriggerEvent<::AccountId>, + // <::OnChargeTransaction as OnChargeTransaction>::Balance : From, + T::LengthToFee: frame_support::weights::WeightToFee< + Balance = ::AccountId>>::Balance, + >, + C: MultiTokenCurrency<::AccountId>, + C::PositiveImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::NegativeImbalance, + >, + C::NegativeImbalance: Imbalance< + ::AccountId>>::Balance, + Opposite = C::PositiveImbalance, + >, + OU: OnMultiTokenUnbalanced>, + NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, + ::AccountId>>::Balance: + scale_info::TypeInfo, + T1: Get, + T2: Get, + T3: Get, + SF2: Get, + SF3: Get, + // Balance: From<::AccountId>>::Balance>, + // Balance: From, + // sp_runtime::AccountId32: From<::AccountId>, +{ + type LiquidityInfo = Option>; + type Balance = ::AccountId>>::Balance; + /// Withdraw the predicted fee from the transaction origin. + /// + /// Note: The `fee` already includes the `tip`. + fn withdraw_fee( + who: &T::AccountId, + _call: &T::RuntimeCall, + _info: &DispatchInfoOf, + fee: Self::Balance, + tip: Self::Balance, + ) -> Result { + if fee.is_zero() { + return Ok(None) + } + + let withdraw_reason = if tip.is_zero() { + WithdrawReasons::TRANSACTION_PAYMENT + } else { + WithdrawReasons::TRANSACTION_PAYMENT | WithdrawReasons::TIP + }; + + match C::withdraw( + T1::get(), + who, + fee, + withdraw_reason, + ExistenceRequirement::KeepAlive, + ) { + Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T1::get(), imbalance)))), + // TODO make sure atleast 1 planck KSM is charged + Err(_) => match C::withdraw( + T2::get(), + who, + fee / SF2::get(), + withdraw_reason, + ExistenceRequirement::KeepAlive, + ) { + Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T2::get(), imbalance)))), + Err(_) => match C::withdraw( + T3::get(), + who, + fee / SF3::get(), + withdraw_reason, + ExistenceRequirement::KeepAlive, + ) { + Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T3::get(), imbalance)))), + Err(_) => Err(InvalidTransaction::Payment.into()), + }, + }, + } + } + + /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. + /// Since the predicted fee might have been too high, parts of the fee may + /// be refunded. + /// + /// Note: The `corrected_fee` already includes the `tip`. + fn correct_and_deposit_fee( + who: &T::AccountId, + _dispatch_info: &DispatchInfoOf, + _post_info: &PostDispatchInfoOf, + corrected_fee: Self::Balance, + tip: Self::Balance, + already_withdrawn: Self::LiquidityInfo, + ) -> Result<(), TransactionValidityError> { + if let Some(LiquidityInfoEnum::Imbalance((token_id, paid))) = already_withdrawn { + let (corrected_fee, tip) = if token_id == T3::get() { + (corrected_fee / SF3::get(), tip / SF3::get()) + } else if token_id == T2::get() { + (corrected_fee / SF2::get(), tip / SF2::get()) + } else { + (corrected_fee, tip) + }; + // Calculate how much refund we should return + let refund_amount = paid.peek().saturating_sub(corrected_fee); + // refund to the the account that paid the fees. If this fails, the + // account might have dropped below the existential balance. In + // that case we don't refund anything. + let refund_imbalance = C::deposit_into_existing(token_id, &who, refund_amount) + .unwrap_or_else(|_| C::PositiveImbalance::from_zero(token_id)); + // merge the imbalance caused by paying the fees and refunding parts of it again. + let adjusted_paid = paid + .offset(refund_imbalance) + .same() + .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; + // Call someone else to handle the imbalance (fee and tip separately) + let (tip_imb, fee) = adjusted_paid.split(tip); + OU::on_unbalanceds(token_id, Some(fee).into_iter().chain(Some(tip_imb))); + + // TODO: get rid of workaround + // workround for nested type issue, ideally below should be used + // TransactionPayment::deposit_event( + // pallet_transaction_payment_mangata::Event::::TransactionFeePaid { + // who, + // actual_fee: fee, + // tip, + // }, + // ); + TE::trigger(who.clone(), corrected_fee.into(), tip.into()); + } + Ok(()) + } +} + } + + pub mod pallet_fee_lock { + use crate::*; + parameter_types! { + pub const MaxCuratedTokens: u32 = 100; + } + } + + pub mod cumulus_pallet_parachain_system { + use crate::*; + parameter_types! { + pub const ReservedXcmpWeight: Weight = consts::MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = consts::MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + } + } + + pub mod pallet_aura { + use crate::*; + parameter_types! { + pub const MaxAuthorities: u32 = 100_000; + } + } + + pub mod pallet_sudo_origin { + use crate::*; + pub type SudoOrigin = + pallet_collective_mangata::EnsureProportionMoreThan; + } + + pub mod pallet_collective_mangata { + use crate::*; + #[cfg(not(feature = "fast-runtime"))] + parameter_types! { + pub const CouncilProposalCloseDelay: BlockNumber = 3 * consts::DAYS; + } + + #[cfg(feature = "fast-runtime")] + parameter_types! { + pub const CouncilProposalCloseDelay: BlockNumber = 6 * consts::MINUTES; + } + + parameter_types! { + pub const CouncilMotionDuration: BlockNumber = 5 * consts::DAYS; + pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; + } + } + + pub mod pallet_maintenance { + use crate::*; + pub struct FoundationAccountsProvider(PhantomData); + impl Get> for FoundationAccountsProvider { + fn get() -> Vec { + let accounts: Vec<_> = [ + hex_literal::hex![ + "c8d02dfbff5ce2fda651c7dd7719bc5b17b9c1043fded805bfc86296c5909871" + ], + hex_literal::hex![ + "c4690c56c36cec7ed5f6ed5d5eebace0c317073a962ebea1d00f1a304974897b" + ], + hex_literal::hex![ + "fc741134c82b81b7ab7efbf334b0c90ff8dbf22c42ad705ea7c04bf27ed4161a" + ], + ] + .iter() + .map(|acc| sp_runtime::AccountId32::from(*acc)) + .collect(); + + accounts + .into_iter() + .map(|acc| { + T::AccountId::decode(&mut acc.as_ref()) + // &mut sp_runtime::AccountId32::as_ref( + // &sp_runtime::AccountId32::from(acc), + // ) + // ) + .unwrap() + }) + .collect() + } + } + } + + pub mod parachain_staking { + use crate::*; + + pub type StakingIssuanceVaultOf = + ::StakingIssuanceVault; + #[cfg(feature = "fast-runtime")] + parameter_types! { + /// Default SessionLenght is every 2 minutes (10 * 12 second block times) + pub const BlocksPerRound: u32 = 2 * consts::MINUTES; + } + + #[cfg(not(feature = "fast-runtime"))] + parameter_types! { + /// Default SessionLenght is every 4 hours (1200 * 12 second block times) + pub const BlocksPerRound: u32 = 4 * consts::HOURS; + } + + parameter_types! { + pub const DefaultPayoutLimit: u32 = 3; + /// Collator candidate exit delay (number of rounds) + pub const LeaveCandidatesDelay: u32 = 2; + /// Collator candidate bond increases/decreases delay (number of rounds) + pub const CandidateBondDelay: u32 = 2; + /// Delegator exit delay (number of rounds) + pub const LeaveDelegatorsDelay: u32 = 2; + /// Delegation revocations delay (number of rounds) + pub const RevokeDelegationDelay: u32 = 2; + /// Delegation bond increases/decreases delay (number of rounds) + pub const DelegationBondDelay: u32 = 2; + /// Reward payments delay (number of rounds) + pub const RewardPaymentDelay: u32 = 2; + /// Minimum collators selected per round, default at genesis and minimum forever after + pub const MinSelectedCandidates: u32 = 25; + /// Maximum collator candidates allowed + pub const MaxCollatorCandidates: u32 = 50; + /// Maximum delegators allowed per candidate + pub const MaxTotalDelegatorsPerCandidate: u32 = 25; + /// Maximum delegators counted per candidate + pub const MaxDelegatorsPerCandidate: u32 = 12; + /// Maximum delegations per delegator + pub const MaxDelegationsPerDelegator: u32 = 30; + /// Default fixed percent a collator takes off the top of due rewards + pub const DefaultCollatorCommission: Perbill = Perbill::from_percent(20); + /// Minimum stake required to become a collator + pub const MinCollatorStk: u128 = 10 * currency::DOLLARS; + /// Minimum stake required to be reserved to be a candidate + pub const MinCandidateStk: u128 = if cfg!(feature = "runtime-benchmarks") { + // For benchmarking + 1 * currency::DOLLARS + } else { + // ACTUAL + 1_500_000 * currency::DOLLARS + }; + /// Minimum stake required to be reserved to be a delegator + pub const MinDelegatorStk: u128 = 1 * currency::CENTS; + } + } + + pub mod pallet_issuance { + use crate::*; + parameter_types! { + pub const HistoryLimit: u32 = 10u32; + + pub const LiquidityMiningIssuanceVaultId: PalletId = PalletId(*b"py/lqmiv"); + pub LiquidityMiningIssuanceVault: AccountId = LiquidityMiningIssuanceVaultId::get().into_account_truncating(); + pub const StakingIssuanceVaultId: PalletId = PalletId(*b"py/stkiv"); + pub StakingIssuanceVault: AccountId = StakingIssuanceVaultId::get().into_account_truncating(); + + pub const TotalCrowdloanAllocation: Balance = 330_000_000 * DOLLARS; + pub const IssuanceCap: Balance = 4_000_000_000 * DOLLARS; + pub const LinearIssuanceBlocks: u32 = 13_140_000u32; // 5 years + pub const LiquidityMiningSplit: Perbill = Perbill::from_parts(555555556); + pub const StakingSplit: Perbill = Perbill::from_parts(444444444); + pub const ImmediateTGEReleasePercent: Percent = Percent::from_percent(20); + pub const TGEReleasePeriod: u32 = 5_256_000u32; // 2 years + pub const TGEReleaseBegin: u32 = 100_800u32; // Two weeks into chain start + } + } + + pub mod orml_asset_registry { + use crate::*; + + pub type AssetMetadataOf = AssetMetadata; + type CurrencyAdapter = orml_tokens::MultiTokenCurrencyAdapter; + + pub struct SequentialIdWithCreation(PhantomData); + impl AssetProcessor for SequentialIdWithCreation + where + T: ::orml_asset_registry::Config, + T: ::orml_tokens::Config, + T: ::pallet_treasury::Config, + { + fn pre_register( + id: Option, + asset_metadata: AssetMetadataOf, + ) -> Result<(TokenId, AssetMetadataOf), DispatchError> { + let next_id = CurrencyAdapter::::get_next_currency_id(); + let asset_id = id.unwrap_or(next_id.into()); + let treasury_account = + config::TreasuryPalletIdOf::::get().into_account_truncating(); + + match asset_id.cmp(&next_id.into()) { + Ordering::Equal => + CurrencyAdapter::::create(&treasury_account, Default::default()) + .and_then(|created_asset_id| { + match created_asset_id.cmp(&asset_id.into()) { + Ordering::Equal => Ok((asset_id, asset_metadata)), + _ => + Err(orml_asset_registry::Error::::InvalidAssetId.into()), + } + }), + Ordering::Less => Ok((asset_id, asset_metadata)), + _ => Err(orml_asset_registry::Error::::InvalidAssetId.into()), + } + } + } + + pub struct AssetAuthority(PhantomData); + impl EnsureOriginWithArg> for AssetAuthority + where + T: frame_system::Config, + { + type Success = (); + + fn try_origin( + origin: T::RuntimeOrigin, + _asset_id: &Option, + ) -> Result { + EnsureRoot::try_origin(origin) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin(_: &Option) -> Result { + Ok(T::RuntimeOrigin::root()) + } + } + } + + pub mod pallet_identity { + use crate::*; + parameter_types! { + // Add item in storage and take 270 bytes, Registry { [], Balance, Info { [], [u8,32] * 7, [u8,20] }} + pub const BasicDeposit: Balance = deposit(1, 270); + // No item in storage, extra field takes 66 bytes, ([u8,32], [u8,32]) + pub const FieldDeposit: Balance = deposit(0, 66); + // Add item in storage, and takes 97 bytes, AccountId + (AccountId, [u8,32]) + pub const SubAccountDeposit: Balance = deposit(1, 97); + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; + } + + pub type IdentityForceOrigin = EnsureRoot; + pub type IdentityRegistrarOrigin = EnsureRoot; + } + + pub mod pallet_utility_mangata { + use super::*; + + #[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, + )] + pub struct DisallowedInBatch(PhantomData); + + impl Contains for DisallowedInBatch + where + T: ::frame_system::Config, + ::RuntimeCall: Into, + { + fn contains(c: &T::RuntimeCall) -> bool { + let call: crate::CallType = (c.clone()).into(); + + match call { + CallType::MultiSell { .. } | + CallType::MultiBuy { .. } | + CallType::AtomicBuy { .. } | + CallType::AtomicSell { .. } | + CallType::CompoundRewards | + CallType::ProvideLiquidityWithConversion => true, + _ => false, + } + } + } + } + + pub mod pallet_vesting_mangata { + use super::*; + parameter_types! { + pub const MinVestedTransfer: Balance = 100 * currency::DOLLARS; + } + } + + pub mod pallet_crowdloan_rewards { + use super::*; + parameter_types! { + pub const Initialized: bool = false; + pub const InitializationPayment: Perbill = Perbill::from_parts(214285700); + pub const MaxInitContributorsBatchSizes: u32 = 100; + pub const MinimumReward: Balance = 0; + pub const RelaySignaturesThreshold: Perbill = Perbill::from_percent(100); + pub const SigantureNetworkIdentifier: &'static [u8] = b"mangata-"; + } + } + + pub mod pallet_proxy { + use super::*; + // Proxy Pallet + /// The type used to represent the kinds of proxying allowed. + #[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, + )] + pub enum ProxyType { + AutoCompound, + } + + impl Default for ProxyType { + fn default() -> Self { + Self::AutoCompound + } + } + + parameter_types! { + pub const ProxyDepositBase: Balance = deposit(1, 16); + pub const ProxyDepositFactor: Balance = deposit(0, 33); + pub const AnnouncementDepositBase: Balance = deposit(1, 16); + pub const AnnouncementDepositFactor: Balance = deposit(0, 68); + } + } +} diff --git a/runtime/common/src/migration.rs b/runtime/common/src/migration.rs new file mode 100644 index 0000000000..2b0f1cf70f --- /dev/null +++ b/runtime/common/src/migration.rs @@ -0,0 +1,83 @@ +use crate::config::orml_asset_registry::AssetMetadataOf; +use frame_support::{ + traits::{Get, OnRuntimeUpgrade}, + weights::Weight, +}; +use log::info; +use mangata_types::{assets::CustomMetadata, Balance, TokenId}; +use sp_runtime::traits::Zero; +use sp_std::marker::PhantomData; + +pub struct AssetRegistryMigration(PhantomData); + +impl OnRuntimeUpgrade for AssetRegistryMigration +where + T: orml_asset_registry::Config< + CustomMetadata = CustomMetadata, + AssetId = TokenId, + Balance = Balance, + > + orml_tokens::Config, +{ + fn on_runtime_upgrade() -> Weight { + info!( + target: "asset_registry", + "on_runtime_upgrade: Attempted to apply AssetRegistry migration" + ); + + let mut weight: Weight = Weight::zero(); + + orml_asset_registry::Metadata::::translate(|token_id, meta: AssetMetadataOf| { + weight + .saturating_accrue(::DbWeight::get().reads_writes(1, 1)); + + let issuance = orml_tokens::Pallet::::total_issuance(token_id); + let name = sp_std::str::from_utf8(&meta.name); + if issuance.is_zero() && name.map_or(false, |n| n.starts_with("Liquidity")) { + // By returning None from f for an element, we’ll remove it from the map. + // Based on the docs of translate method + None + } else { + Some(meta) + } + }); + + weight + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + info!( + target: "asset_registry", + "pre_upgrade: checks" + ); + let mut has_zero_issuance: Vec = vec![]; + orml_asset_registry::Metadata::::iter().for_each(|(token_id, meta)| { + let issuance = orml_tokens::Pallet::::total_issuance(token_id); + let name = sp_std::str::from_utf8(&meta.name); + if issuance.is_zero() && name.map_or(false, |n| n.starts_with("Liquidity")) { + has_zero_issuance.push(token_id); + } + }); + + assert!(!has_zero_issuance.is_empty(), "No migration is required as we have identified only those liquidity assets with non-zero issuance."); + + Ok(Vec::new()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), &'static str> { + info!( + target: "asset_registry", + "post_upgrade: checks" + ); + orml_asset_registry::Metadata::::iter().for_each(|(token_id, meta)| { + let issuance = orml_tokens::Pallet::::total_issuance(token_id); + let name = sp_std::str::from_utf8(&meta.name); + if name.map_or(false, |n| n.starts_with("Liquidity")) { + assert!(!issuance.is_zero()); + } + }); + + Ok(()) + } +} diff --git a/runtime/common/src/weights/block_weights.rs b/runtime/common/src/weights/block_weights.rs new file mode 100644 index 0000000000..1e38e0097a --- /dev/null +++ b/runtime/common/src/weights/block_weights.rs @@ -0,0 +1,67 @@ +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-18 (Y/M/D) +//! HOSTNAME: `995c44fb4e67`, CPU: `AMD EPYC 7B13` +//! +//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Mangata Kusama Local` +//! WARMUPS: `10`, REPEAT: `100` +//! WEIGHT-PATH: `` +//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0` + +// Executed Command: +// target/release/mangata-node +// benchmark +// overhead +// --execution +// native +// --chain +// kusama-local +// -lblock_builder=debug +// --max-ext-per-block +// 50000 +// --base-path +// . + +use sp_core::parameter_types; +use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight}; + +parameter_types! { + /// Time to execute an empty block. + /// Calculated by multiplying the *Average* with `1.0` and adding `0`. + /// + /// Stats nanoseconds: + /// Min, Max: 7_631_910, 8_052_540 + /// Average: 7_692_887 + /// Median: 7_661_290 + /// Std-Dev: 104885.3 + /// + /// Percentiles nanoseconds: + /// 99th: 8_034_380 + /// 95th: 8_023_380 + /// 75th: 7_674_100 + pub const BlockExecutionWeight: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(7_692_887), 0); +} + +#[cfg(test)] +mod test_weights { + use sp_weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::BlockExecutionWeight::get(); + + // At least 100 µs. + assert!( + w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 100 µs." + ); + // At most 50 ms. + assert!( + w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 50 ms." + ); + } +} diff --git a/runtime/common/src/weights/extrinsic_weights.rs b/runtime/common/src/weights/extrinsic_weights.rs new file mode 100644 index 0000000000..92fca50754 --- /dev/null +++ b/runtime/common/src/weights/extrinsic_weights.rs @@ -0,0 +1,67 @@ +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-18 (Y/M/D) +//! HOSTNAME: `995c44fb4e67`, CPU: `AMD EPYC 7B13` +//! +//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Mangata Kusama Local` +//! WARMUPS: `10`, REPEAT: `100` +//! WEIGHT-PATH: `` +//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0` + +// Executed Command: +// target/release/mangata-node +// benchmark +// overhead +// --execution +// native +// --chain +// kusama-local +// -lblock_builder=debug +// --max-ext-per-block +// 50000 +// --base-path +// . + +use sp_core::parameter_types; +use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight}; + +parameter_types! { + /// Time to execute a NO-OP extrinsic, for example `System::remark`. + /// Calculated by multiplying the *Average* with `1.0` and adding `0`. + /// + /// Stats nanoseconds: + /// Min, Max: 114_329, 115_887 + /// Average: 114_756 + /// Median: 114_639 + /// Std-Dev: 309.81 + /// + /// Percentiles nanoseconds: + /// 99th: 115_799 + /// 95th: 115_437 + /// 75th: 114_859 + pub const ExtrinsicBaseWeight: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(114_756), 0); +} + +#[cfg(test)] +mod test_weights { + use sp_weights::constants; + + /// Checks that the weight exists and is sane. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn sane() { + let w = super::ExtrinsicBaseWeight::get(); + + // At least 10 µs. + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, + "Weight should be at least 10 µs." + ); + // At most 1 ms. + assert!( + w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Weight should be at most 1 ms." + ); + } +} diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs new file mode 100644 index 0000000000..245b9e0c0e --- /dev/null +++ b/runtime/common/src/weights/mod.rs @@ -0,0 +1,40 @@ +#![allow(clippy::unnecessary_cast)] + +mod block_weights; +mod extrinsic_weights; + +pub use block_weights::BlockExecutionWeight as VerBlockExecutionWeight; +pub use extrinsic_weights::ExtrinsicBaseWeight as VerExtrinsicBaseWeight; + +// pub mod frame_system; +// pub mod orml_asset_registry; +// pub mod orml_tokens; +// pub mod pallet_bootstrap; +// pub mod pallet_collective_mangata; +// pub mod pallet_crowdloan_rewards; +// pub mod pallet_fee_lock; +// pub mod pallet_issuance; +// pub mod pallet_multipurpose_liquidity; +// pub mod pallet_proof_of_stake; +// pub mod pallet_session; +// pub mod pallet_timestamp; +// pub mod pallet_treasury; +// pub mod pallet_utility_mangata; +// pub mod pallet_vesting_mangata; +// pub mod pallet_xyk; +// pub mod parachain_staking; + +// pub use self::{ +// frame_system as frame_system_weights, orml_asset_registry as orml_asset_registry_weights, +// orml_tokens as orml_tokens_weights, pallet_bootstrap as pallet_bootstrap_weights, +// pallet_collective_mangata as pallet_collective_mangata_weights, +// pallet_crowdloan_rewards as pallet_crowdloan_rewards_weights, +// pallet_fee_lock as pallet_fee_lock_weights, pallet_issuance as pallet_issuance_weights, +// pallet_multipurpose_liquidity as pallet_multipurpose_liquidity_weights, +// pallet_proof_of_stake as pallet_proof_of_stake_weights, +// pallet_session as pallet_session_weights, pallet_timestamp as pallet_timestamp_weights, +// pallet_treasury as pallet_treasury_weights, +// pallet_utility_mangata as pallet_utility_mangata_weights, +// pallet_vesting_mangata as pallet_vesting_mangata_weights, pallet_xyk as pallet_xyk_weights, +// parachain_staking as parachain_staking_weights, +// }; diff --git a/runtime/common/src/xcm_config.rs b/runtime/common/src/xcm_config.rs new file mode 100644 index 0000000000..9df4c29e1b --- /dev/null +++ b/runtime/common/src/xcm_config.rs @@ -0,0 +1,407 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::{Decode, Encode}; +use cumulus_primitives_core::ParaId; +pub use frame_support::{ + match_types, parameter_types, + traits::{Everything, Get, Nothing}, + weights::Weight, +}; + +use orml_asset_registry::{AssetRegistryTrader, FixedRateAssetRegistryTrader}; +use orml_traits::{parameter_type_with_key, FixedConversionRateProvider, GetByKey, MultiCurrency}; +use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; + +use sp_std::{marker::PhantomData, prelude::*}; +use xcm::latest::{prelude::*, Weight as XcmWeight}; +use xcm_builder::{ + Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, FixedRateOfFungible, + FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, +}; +use xcm_executor::{traits::DropAssets, Assets}; + +pub fn general_key(key: &[u8]) -> Junction { + let mut data = [0u8; 32]; + data[..key.len()].copy_from_slice(&key[..]); + GeneralKey { length: key.len() as u8, data } +} + +parameter_types! { + pub KsmLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + // pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + // pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); +} + +pub struct RelayChainOrigin(PhantomData); +impl Get for RelayChainOrigin +where + T: frame_system::Config, + ::RuntimeOrigin: From, +{ + fn get() -> T::RuntimeOrigin { + cumulus_pallet_xcm::Origin::Relay.into() + } +} + +pub struct UniversalLocation(PhantomData); +impl Get for UniversalLocation +where + T: parachain_info::Config, +{ + fn get() -> InteriorMultiLocation { + X2( + GlobalConsensus(RelayNetwork::get()), + Parachain(parachain_info::Pallet::::parachain_id().into()), + ) + } +} + +pub type AccountIdOf = ::AccountId; +pub type RuntimeOriginOf = ::AccountId; +pub type TokensIdOf = ::CurrencyId; + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the default `AccountId`. + ParentIsPreset>, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia>, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases>, + // Create hash of `AccountId32` used for proxy accounts + Account32Hash>, +); + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToCallOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, RuntimeOrigin>, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognized. + RelayChainAsNative, RuntimeOrigin>, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; +} + +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + // Expected responses are OK. + AllowKnownQueryResponses>, + AllowSubscriptionsFrom, +); +type AssetRegistryOf = orml_asset_registry::Pallet; + +use sp_runtime::traits::Convert; + +pub struct TokenToMultiLocation(PhantomData); +impl Convert> for TokenToMultiLocation +where + T: parachain_info::Config, + T: orml_asset_registry::Config, + ::AssetId: From, +{ + fn convert(id: T::AssetId) -> Option { + // allow relay asset + if id == crate::tokens::RelayTokenId::get().into() { + return Some(MultiLocation::parent()) + } + // allow native asset + if id == crate::tokens::MgxTokenId::get().into() { + return Some(MultiLocation::new( + 1, + X2(Parachain(parachain_info::Pallet::::get().into()), general_key(&id.encode())), + )) + } + // allow assets in registry with location set + AssetRegistryOf::::multilocation(&id).unwrap_or(None) + } +} + +pub struct MultiLocationToToken(PhantomData); +impl Convert> for MultiLocationToToken +where + T: parachain_info::Config, + T: orml_asset_registry::Config, + ::AssetId: From, +{ + fn convert(location: MultiLocation) -> Option { + // allow relay asset + if location == MultiLocation::parent() { + return Some(crate::tokens::RelayTokenId::get().into()) + } + + match location { + // allow native asset + MultiLocation { + parents: 1, + interior: X2(Parachain(para_id), GeneralKey { length, data }), + } if ParaId::from(para_id) == parachain_info::Pallet::::get() => { + let token_id = T::AssetId::decode(&mut &data[..(length as usize)]).ok(); + token_id.filter(|tid| *tid == crate::tokens::MGX_TOKEN_ID.into()) + }, + MultiLocation { parents: 0, interior: X1(GeneralKey { length, data }) } => { + let token_id = T::AssetId::decode(&mut &data[..(length as usize)]).ok(); + token_id.filter(|tid| *tid == crate::tokens::MGX_TOKEN_ID.into()) + }, + + // allow assets in registry with location set + _ => AssetRegistryOf::::location_to_asset_id(location.clone()), + } + } +} + +pub struct MultiAssetToToken(PhantomData); +impl Convert> for MultiAssetToToken +where + T: parachain_info::Config, + T: orml_asset_registry::Config, + ::AssetId: From, +{ + fn convert(asset: MultiAsset) -> Option { + if let MultiAsset { id: Concrete(location), .. } = asset { + MultiLocationToToken::::convert(location) + } else { + None + } + } +} + +pub type LocalAssetTransactor = MultiCurrencyAdapter< + orml_tokens::Pallet, + orml_unknown_tokens::Pallet, + IsNativeConcrete, MultiLocationToToken>, + AccountIdOf, + LocationToAccountId, + TokensIdOf, + MultiAssetToToken, + orml_xcm_support::DepositToAlternative< + crate::config::TreasuryAccountIdOf, + orml_tokens::Pallet, + TokensIdOf, + AccountIdOf, + ::Balance, + >, +>; + +pub struct ToTreasury(PhantomData); + +impl TakeRevenue for ToTreasury +where + T: orml_tokens::Config< + AccountId = sp_runtime::AccountId32, + CurrencyId = mangata_types::TokenId, + >, + T: pallet_treasury::Config, + T: parachain_info::Config, + T: orml_asset_registry::Config, +{ + fn take_revenue(revenue: MultiAsset) { + if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = revenue { + if let Some(currency_id) = MultiLocationToToken::::convert(location) { + // Ensure AcalaTreasuryAccount have ed requirement for native asset, but don't need + // ed requirement for cross-chain asset because it's one of whitelist accounts. + // Ignore the result. + let _ = orml_tokens::Pallet::::deposit( + currency_id.into(), + &crate::config::TreasuryAccountIdOf::::get(), + amount.into(), + ); + } + } + } +} + +use crate::constants::fee::{ksm_per_second, mgx_per_second}; + +parameter_types! { + // regular transfer is ~400M weight, xcm transfer weight is ~4*UnitWeightCost + pub UnitWeightCost: XcmWeight = XcmWeight::from_parts(150_000_000, 0); + pub const MaxInstructions: u32 = 100; + + pub KsmPerSecond: (AssetId, u128, u128) = (MultiLocation::parent().into(), ksm_per_second(), ksm_per_second()); + pub MgxPerSecond: (AssetId, u128, u128) = ( + MultiLocation::new( + 0, + X1(general_key(&crate::tokens::MgxTokenId::get().encode())), + ).into(), + mgx_per_second(), + mgx_per_second(), + ); + pub const MaxAssetsIntoHolding: u32 = 64; +} + +pub struct FeePerSecondProvider(PhantomData); +impl FixedConversionRateProvider for FeePerSecondProvider +where + T: orml_asset_registry::Config, +{ + fn get_fee_per_second(location: &MultiLocation) -> Option { + if let Some(asset_id) = AssetRegistryOf::::location_to_asset_id(location) { + if let Some(xcm_meta) = AssetRegistryOf::::metadata(asset_id.clone()) + .and_then(|metadata| metadata.additional.xcm) + { + let fee_per_second: u128 = xcm_meta.fee_per_second; + log::debug!( + target: "xcm::weight", "fee_per_second: asset: {:?}, fps:{:?}", + asset_id, fee_per_second + ); + return Some(fee_per_second) + } + } + None + } +} + +pub type Trader = ( + FixedRateOfFungible>, + AssetRegistryTrader< + FixedRateAssetRegistryTrader>, + ToTreasury, + >, + FixedRateOfFungible>, +); + +pub type Weigher = FixedWeightBounds; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp< + cumulus_pallet_parachain_system::Pallet, + pallet_xcm::Pallet, + (), + >, + // ..and XCMP to communicate with the sibling chains. + cumulus_pallet_xcmp_queue::Pallet, +); + +/// `DropAssets` implementation support asset amount lower thant ED handled by `TakeRevenue`. +/// +/// parameters type: +/// - `NC`: native currency_id type. +/// - `NB`: the ExistentialDeposit amount of native currency_id. +/// - `GK`: the ExistentialDeposit amount of tokens. +pub struct MangataDropAssets(PhantomData<(X, T, C, GK)>); +impl DropAssets for MangataDropAssets +where + X: DropAssets, + T: TakeRevenue, + C: Convert>, + GK: GetByKey, +{ + fn drop_assets( + origin: &MultiLocation, + assets: Assets, + context: &XcmContext, + ) -> sp_weights::Weight { + let multi_assets: Vec = assets.into(); + let mut asset_traps: Vec = Default::default(); + for asset in multi_assets { + if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = asset.clone() { + let currency_id = C::convert(location); + // burn asset(do nothing here) if convert result is None + if let Some(currency_id) = currency_id { + let ed = GK::get(¤cy_id); + if amount < ed { + T::take_revenue(asset); + } else { + asset_traps.push(asset); + } + } + } + } + if !asset_traps.is_empty() { + X::drop_assets(origin, asset_traps.into(), context); + } + XcmWeight::from_parts(0, 0) + } +} + +pub type DropAssetsHandler = MangataDropAssets< + pallet_xcm::Pallet, + ToTreasury, + MultiLocationToToken, + crate::config::ExistentialDepositsOf, +>; + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, RuntimeOrigin>, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognized. + RelayChainAsNative, RuntimeOrigin>, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_type_with_key! { + pub ParachainMinFee: |_location: MultiLocation| -> Option { + None + }; +} + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: mangata_types::AccountId) -> MultiLocation { + X1(AccountId32 { network: None, id: account.into() }).into() + } +} + +parameter_types! { + pub const BaseXcmWeight: XcmWeight = XcmWeight::from_parts(100_000_000, 0); // TODO: recheck this + pub const MaxAssetsForTransfer:usize = 2; +} + +pub struct SelfLocation(PhantomData); +impl Get for SelfLocation +where + T: parachain_info::Config, +{ + fn get() -> MultiLocation { + MultiLocation::new(1, X1(Parachain(parachain_info::Pallet::::get().into()))) + } +} + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = + SignedToAccountId32; diff --git a/runtime/integration-test/Cargo.toml b/runtime/integration-test/Cargo.toml index c25ac40d96..ab4c2158bb 100644 --- a/runtime/integration-test/Cargo.toml +++ b/runtime/integration-test/Cargo.toml @@ -38,6 +38,7 @@ orml-asset-registry = { version = "0.4.1-dev", git = "https://github.com/mangata # Local mangata-kusama-runtime = { path = "../mangata-kusama", optional = true } +common-runtime = { path = "../common"} pallet-xyk = { path = '../../pallets/xyk', version = '0.1.0' } pallet-bootstrap = { path = '../../pallets/bootstrap', version = '0.1.0' } diff --git a/runtime/integration-test/src/setup.rs b/runtime/integration-test/src/setup.rs index 2f4141bfc3..7a0dcf410d 100644 --- a/runtime/integration-test/src/setup.rs +++ b/runtime/integration-test/src/setup.rs @@ -12,16 +12,21 @@ pub use kusama_imports::*; #[cfg(feature = "with-kusama-runtime")] mod kusama_imports { + pub use common_runtime::{ + config::{orml_asset_registry::AssetMetadataOf, pallet_proxy::ProxyType}, + consts::UNIT, + mgx_per_second, + xcm_config::general_key, + }; pub use mangata_kusama_runtime::{ - mgx_per_second, xcm_config::*, AccountId, AssetMetadataOf, AssetRegistry, Balance, - Bootstrap, CustomMetadata, Identity, PolkadotXcm, Proxy, ProxyType, Runtime, RuntimeCall, - RuntimeOrigin, System, TokenId, Tokens, VersionedMultiLocation, XTokens, XcmMetadata, - XcmpQueue, Xyk, XykMetadata, UNIT, + xcm_config::*, AccountId, AssetRegistry, Balance, Bootstrap, CustomMetadata, Identity, + PolkadotXcm, Proxy, Runtime, RuntimeCall, RuntimeOrigin, System, TokenId, Tokens, + VersionedMultiLocation, XTokens, XcmMetadata, XcmpQueue, Xyk, XykMetadata, }; pub use xcm::latest::Weight as XcmWeight; - pub const NATIVE_ASSET_ID: TokenId = mangata_kusama_runtime::MGX_TOKEN_ID; - pub const RELAY_ASSET_ID: TokenId = mangata_kusama_runtime::KSM_TOKEN_ID; + pub const NATIVE_ASSET_ID: TokenId = common_runtime::tokens::MGX_TOKEN_ID; + pub const RELAY_ASSET_ID: TokenId = common_runtime::tokens::RELAY_TOKEN_ID; } /// Accounts diff --git a/runtime/integration-test/src/xcm/mod.rs b/runtime/integration-test/src/xcm/mod.rs index cbf4aac17a..b8a4689d1c 100644 --- a/runtime/integration-test/src/xcm/mod.rs +++ b/runtime/integration-test/src/xcm/mod.rs @@ -22,7 +22,7 @@ mod fee_test { pub fn asset_unit_cost(instruction_count: u32, per_second: u128) -> u128 { #[cfg(feature = "with-kusama-runtime")] - let unit_weight: Weight = mangata_kusama_runtime::xcm_config::UnitWeightCost::get(); + let unit_weight: Weight = common_runtime::xcm_config::UnitWeightCost::get(); #[cfg(feature = "with-kusama-runtime")] assert_eq!(unit_weight, Weight::from_parts(150_000_000, 0)); @@ -31,7 +31,7 @@ mod fee_test { pub fn relay_per_second_as_fee(instruction_count: u32) -> u128 { #[cfg(feature = "with-kusama-runtime")] - let relay_per_second = mangata_kusama_runtime::ksm_per_second(); + let relay_per_second = common_runtime::ksm_per_second(); #[cfg(feature = "with-kusama-runtime")] assert_eq!(8_714 * 10 * millicent(12), relay_per_second); @@ -40,7 +40,7 @@ mod fee_test { pub fn native_per_second_as_fee(instruction_count: u32) -> u128 { #[cfg(feature = "with-kusama-runtime")] - let native_per_second = mangata_kusama_runtime::mgx_per_second(); + let native_per_second = common_runtime::mgx_per_second(); #[cfg(feature = "with-kusama-runtime")] assert_eq!(8_714 * unit(18), native_per_second); @@ -81,12 +81,12 @@ fn weight_to_fee_works() { // Mangata #[cfg(feature = "with-kusama-runtime")] { - use mangata_kusama_runtime::constants::fee::WeightToFee; + use common_runtime::constants::fee::WeightToFee; - let base_weight: Weight = mangata_kusama_runtime::xcm_config::BaseXcmWeight::get(); + let base_weight: Weight = common_runtime::xcm_config::BaseXcmWeight::get(); assert_eq!(base_weight, Weight::from_parts(100_000_000, 0)); - let unit_weight: Weight = mangata_kusama_runtime::xcm_config::UnitWeightCost::get(); + let unit_weight: Weight = common_runtime::xcm_config::UnitWeightCost::get(); assert_eq!(unit_weight, Weight::from_parts(150_000_000, 0)); let weight: Weight = base_weight.saturating_mul(4); diff --git a/runtime/mangata-kusama/Cargo.toml b/runtime/mangata-kusama/Cargo.toml index b7403d73de..9c6ca2cd7d 100644 --- a/runtime/mangata-kusama/Cargo.toml +++ b/runtime/mangata-kusama/Cargo.toml @@ -21,6 +21,7 @@ smallvec = "1.6.1" static_assertions = "1.1.0" # Local Dependencies +common-runtime = { path = '../common', default-features = false, version = '4.0.0' } pallet-xyk = { path = '../../pallets/xyk', default-features = false, version = '0.1.0' } pallet-proof-of-stake = { path = '../../pallets/proof-of-stake', default-features = false, version = '0.1.0' } pallet-bootstrap = { path = '../../pallets/bootstrap', default-features = false, version = '0.1.0' } @@ -112,9 +113,6 @@ parachain-staking = { default-features = false, git = "https://github.com/mangat # Crowdloan dependencies pallet-crowdloan-rewards = { default-features = false, git = "https://github.com/mangata-finance/crowdloan-rewards", branch = "mangata-dev" } -# Custom substrate RPC dependencies -pallet-vesting-mangata-rpc-runtime-api = { default-features = false, git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } - [features] default = [ "std", @@ -186,7 +184,6 @@ std = [ "frame-system-rpc-runtime-api/std", "pallet-multipurpose-liquidity/std", "mangata-support/std", - "pallet-vesting-mangata-rpc-runtime-api/std", "pallet-fee-lock/std", "pallet-identity/std", "pallet-maintenance/std", @@ -235,9 +232,10 @@ try-runtime = [ "sp-runtime/try-runtime" ] -fast-runtime = [] +fast-runtime = ["common-runtime/fast-runtime"] runtime-benchmarks = [ + "common-runtime/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "pallet-maintenance/runtime-benchmarks", "polkadot-parachain/runtime-benchmarks", diff --git a/runtime/mangata-kusama/src/lib.rs b/runtime/mangata-kusama/src/lib.rs index c3324fe773..33aa0ac711 100644 --- a/runtime/mangata-kusama/src/lib.rs +++ b/runtime/mangata-kusama/src/lib.rs @@ -2,58 +2,39 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::Encode; use frame_support::{ - construct_runtime, - dispatch::{DispatchClass, DispatchResult}, - ensure, parameter_types, - traits::{ - tokens::currency::{MultiTokenCurrency, MultiTokenImbalanceWithZeroTrait}, - Contains, EnsureOrigin, EnsureOriginWithArg, Everything, ExistenceRequirement, Get, - Imbalance, InstanceFilter, WithdrawReasons, - }, - unsigned::TransactionValidityError, - weights::{ - constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, - ConstantMultiplier, Weight, - }, - PalletId, + construct_runtime, parameter_types, + traits::{Everything, InstanceFilter}, + weights::{constants::RocksDbWeight, Weight}, }; #[cfg(any(feature = "std", test))] pub use frame_system::Call as SystemCall; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, -}; +use frame_system::EnsureRoot; pub use orml_tokens; -use orml_tokens::MultiTokenCurrencyExtended; -use orml_traits::{ - asset_registry::{AssetMetadata, AssetProcessor}, - parameter_type_with_key, -}; + pub use pallet_sudo_mangata; -use pallet_transaction_payment_mangata::{ConstFeeMultiplier, Multiplier, OnChargeTransaction}; -use pallet_vesting_mangata_rpc_runtime_api::VestingInfosWithLockedAt; + +use pallet_vesting_mangata::VestingInfo; // Polkadot Imports pub use polkadot_runtime_common::BlockHashCount; -use scale_info::TypeInfo; + use sp_api::impl_runtime_apis; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + create_runtime_str, impl_opaque_keys, traits::{ - AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Convert, ConvertInto, - DispatchInfoOf, PostDispatchInfoOf, Saturating, StaticLookup, Zero, + AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, + StaticLookup, }, - transaction_validity::{InvalidTransaction, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, FixedPointNumber, Percent, RuntimeDebug, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, }; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use sp_std::{ - cmp::Ordering, convert::{TryFrom, TryInto}, marker::PhantomData, prelude::*, @@ -64,11 +45,9 @@ use sp_version::RuntimeVersion; use static_assertions::const_assert; pub use xcm::{latest::prelude::*, VersionedMultiLocation}; -pub use constants::{fee::*, parachains::*}; -pub use currency::*; -use mangata_support::traits::{ - AssetRegistryApi, FeeLockTriggerTrait, PreValidateSwaps, ProofOfStakeRewardsApi, -}; +pub use common_runtime::{currency::*, deposit, runtime_types, tokens, CallType}; + +use mangata_support::traits::ProofOfStakeRewardsApi; pub use mangata_types::{ assets::{CustomMetadata, XcmMetadata, XykMetadata}, AccountId, Address, Amount, Balance, BlockNumber, Hash, Index, Signature, TokenId, @@ -77,50 +56,31 @@ pub use pallet_issuance::IssuanceInfo; pub use pallet_sudo_origin; pub use pallet_xyk; // XCM Imports -use pallet_xyk::AssetMetadataMutationTrait; -use xyk_runtime_api::{RpcAmountsResult, XYKRpcResult}; +use xyk_runtime_api::RpcAssetMetadata; // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -pub const MGX_TOKEN_ID: TokenId = 0; -pub const KSM_TOKEN_ID: TokenId = 4; -pub const KAR_TOKEN_ID: TokenId = 6; -pub const TUR_TOKEN_ID: TokenId = 7; - -pub mod constants; -mod migration; mod weights; pub mod xcm_config; /// Block header type as expected by this runtime. -pub type Header = generic::HeaderVer; +pub type Header = runtime_types::Header; /// Block type as expected by this runtime. -pub type Block = generic::Block; +pub type Block = runtime_types::Block; /// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; +pub type SignedBlock = runtime_types::SignedBlock; /// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; +pub type BlockId = runtime_types::BlockId; /// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment_mangata::ChargeTransactionPayment, -); +pub type SignedExtra = runtime_types::SignedExtra; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; - +pub type SignedPayload = runtime_types::SignedPayload; /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; - +pub type UncheckedExtrinsic = runtime_types::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = runtime_types::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -129,8 +89,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (migration::XykRefactorMigration, migration::AssetRegistryMigration), - // () + common_runtime::migration::AssetRegistryMigration, >; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know @@ -138,17 +97,13 @@ pub type Executive = frame_executive::Executive< /// of data like extrinsics, allowing for them to continue syncing the network through upgrades /// to even the core data structures. pub mod opaque { - pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - use sp_runtime::{generic, traits::BlakeTwo256}; - use super::*; - /// Opaque block header type. - pub type Header = generic::HeaderVer; + pub type Header = runtime_types::Header; /// Opaque block type. - pub type Block = generic::Block; + pub type Block = runtime_types::OpaqueBlock; /// Opaque block identifier type. - pub type BlockId = generic::BlockId; + pub type BlockId = runtime_types::OpaqueBlockId; } impl_opaque_keys! { @@ -162,66 +117,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("mangata-parachain"), impl_name: create_runtime_str!("mangata-parachain"), authoring_version: 15, - spec_version: 003000, + spec_version: 003100, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 003000, + transaction_version: 003100, state_version: 0, }; -mod currency { - use super::Balance; - - pub const MILLICENTS: Balance = CENTS / 1000; - pub const CENTS: Balance = DOLLARS / 100; // assume this is worth about a cent. - pub const DOLLARS: Balance = super::UNIT; - - pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 5000 * DOLLARS + (bytes as Balance) * 60 * CENTS - } -} - -/// This determines the average expected block time that we are targeting. -/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. -/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked -/// up by `pallet_aura` to implement `fn slot_duration()`. -/// -/// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 12000; - -// NOTE: Currently it is not possible to change the slot duration after the chain has started. -// Attempting to do so will brick block production. -pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; - -// Time is measured by number of blocks. -pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); -pub const HOURS: BlockNumber = MINUTES * 60; -pub const DAYS: BlockNumber = HOURS * 24; - -// Unit = the base number of indivisible units for balance -pub const UNIT: Balance = 1_000_000_000_000_000_000; -pub const MILLIUNIT: Balance = 1_000_000_000_000_000; -pub const MICROUNIT: Balance = 1_000_000_000_000; - -/// The existential deposit. Set to 1/10 of the Connected Relay Chain. -pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; - -/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is -/// used to limit the maximal weight of a single extrinsic. -const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); - -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by -/// `Operational` extrinsics. -const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); - -/// We allow for 0.5 of a second of compute with a 12 second average block time. -/// NOTE: reduced by half comparing to origin impl as we want to fill block only up to 50% -/// so there is room for new extrinsics in the next block -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( - WEIGHT_REF_TIME_PER_SECOND.saturating_div(4), - polkadot_primitives::v2::MAX_POV_SIZE as u64, -); - /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { @@ -230,49 +132,18 @@ pub fn native_version() -> NativeVersion { parameter_types! { pub const Version: RuntimeVersion = VERSION; - - // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. - // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the - // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize - // the lazy contract deletion. - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(weights::VerBlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = weights::VerExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); - pub const SS58Prefix: u16 = 42; -} - -parameter_types! { - pub const MgxTokenId: TokenId = MGX_TOKEN_ID; - pub const KsmTokenId: TokenId = KSM_TOKEN_ID; - pub const TurTokenId: TokenId = TUR_TOKEN_ID; } // Configure FRAME pallets to include in runtime. +use common_runtime::config as cfg; impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = Everything; /// Block & extrinsics weights: base values and limits. - type BlockWeights = RuntimeBlockWeights; + type BlockWeights = cfg::frame_system::RuntimeBlockWeights; /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; + type BlockLength = cfg::frame_system::RuntimeBlockLength; /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; /// The aggregated dispatch type that is available for extrinsics. @@ -290,7 +161,7 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The header type. - type Header = generic::HeaderVer; + type Header = runtime_types::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -310,84 +181,47 @@ impl frame_system::Config for Runtime { /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = weights::frame_system_weights::ModuleWeight; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; + type SS58Prefix = cfg::frame_system::SS58Prefix; /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; /// The maximum number of consumers allowed on a single account. - type MaxConsumers = frame_support::traits::ConstU32<16>; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; + type MaxConsumers = cfg::frame_system::MaxConsumers; } impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = cfg::pallet_timestamp::MinimumPeriod; type WeightInfo = weights::pallet_timestamp_weights::ModuleWeight; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type EventHandler = ParachainStaking; } -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * DOLLARS; - pub const ProposalBondMaximum: Option = None; - pub const SpendPeriod: BlockNumber = 1 * DAYS; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * DOLLARS; - pub const DataDepositPerByte: Balance = 1 * CENTS; - pub const BountyDepositBase: Balance = 1 * DOLLARS; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); - pub const BnbTreasurySubAccDerive: [u8; 4] = *b"bnbt"; - pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 5 * DOLLARS; - pub const MaxApprovals: u32 = 100; - pub const DefaultPayoutLimit: u32 = 3; -} - impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryPalletId; - type Currency = orml_tokens::CurrencyAdapter; + type PalletId = cfg::pallet_treasury::TreasuryPalletId; + type Currency = orml_tokens::CurrencyAdapter; type ApproveOrigin = EnsureRoot; type RejectOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type ProposalBondMaximum = ProposalBondMaximum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; + type ProposalBond = cfg::pallet_treasury::ProposalBond; + type ProposalBondMinimum = cfg::pallet_treasury::ProposalBondMinimum; + type ProposalBondMaximum = cfg::pallet_treasury::ProposalBondMaximum; + type SpendPeriod = cfg::pallet_treasury::SpendPeriod; + type Burn = cfg::pallet_treasury::Burn; type BurnDestination = (); type SpendFunds = (); type WeightInfo = weights::pallet_treasury_weights::ModuleWeight; - type MaxApprovals = MaxApprovals; + type MaxApprovals = cfg::pallet_treasury::MaxApprovals; type SpendOrigin = frame_support::traits::NeverEnsureOrigin; } -parameter_type_with_key! { - pub ExistentialDeposits: |_currency_id: TokenId| -> Balance { - 0 - }; -} - parameter_types! { - pub TreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); - pub const MaxLocks: u32 = 50; + pub TreasuryAccount: AccountId = cfg::TreasuryPalletIdOf::::get().into_account_truncating(); } // The MaxLocks (on a who-token_id pair) that is allowed by orml_tokens @@ -395,833 +229,176 @@ parameter_types! { // This is because orml_tokens uses BoundedVec for Locks storage item and does not inform on failure // Balances uses WeakBoundedVec and so does not fail const_assert!( - MaxLocks::get() >= ::MAX_VESTING_SCHEDULES + ::MaxLocks::get() >= + ::MAX_VESTING_SCHEDULES ); -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - *a == TreasuryAccount::get() - } -} - impl orml_tokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = TokenId; type WeightInfo = weights::orml_tokens_weights::ModuleWeight; - type ExistentialDeposits = ExistentialDeposits; - type MaxLocks = MaxLocks; - type DustRemovalWhitelist = DustRemovalWhitelist; + type ExistentialDeposits = cfg::orml_tokens::ExistentialDeposits; + type MaxLocks = cfg::orml_tokens::MaxLocks; + type DustRemovalWhitelist = + cfg::orml_tokens::DustRemovalWhitelist>; type CurrencyHooks = (); type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; -} - -pub struct TestTokensFilter; -impl Contains for TestTokensFilter { - fn contains(token_id: &TokenId) -> bool { - // we dont want to allow doing anything with dummy assets previously - // used for testing - *token_id == 2 || *token_id == 3 - } -} - -pub struct RewardsMigrationAccountProvider(PhantomData); -impl Get for RewardsMigrationAccountProvider { - fn get() -> T::AccountId { - let account32: sp_runtime::AccountId32 = - hex_literal::hex!["0e33df23356eb2e9e3baf0e8a5faae15bc70a6a5cce88f651a9faf6e8e937324"] - .into(); - let mut init_account32 = sp_runtime::AccountId32::as_ref(&account32); - let init_account = T::AccountId::decode(&mut init_account32).unwrap(); - init_account - } + type ReserveIdentifier = cfg::orml_tokens::ReserveIdentifier; } -pub struct AssetRegisterFilter; -impl Contains for AssetRegisterFilter { - fn contains(t: &TokenId) -> bool { - let meta: Option = orml_asset_registry::Metadata::::get(t); - if let Some(xyk) = meta.and_then(|m| m.additional.xyk) { - return xyk.operations_disabled - } - return false - } -} - -pub struct AssetMetadataMutation; -impl AssetMetadataMutationTrait for AssetMetadataMutation { - fn set_asset_info( - asset: TokenId, - name: Vec, - symbol: Vec, - decimals: u32, - ) -> DispatchResult { - let metadata = AssetMetadata { - name, - symbol, - decimals, - existential_deposit: Default::default(), - additional: Default::default(), - location: None, - }; - orml_asset_registry::Pallet::::do_register_asset_without_asset_processor( - metadata, asset, - )?; - Ok(()) - } -} - -type SessionLenghtOf = ::BlocksPerRound; - impl pallet_xyk::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type ActivationReservesProvider = MultiPurposeLiquidity; type Currency = orml_tokens::MultiTokenCurrencyAdapter; - type NativeCurrencyId = MgxTokenId; - type TreasuryPalletId = TreasuryPalletId; - type BnbTreasurySubAccDerive = BnbTreasurySubAccDerive; - type PoolFeePercentage = frame_support::traits::ConstU128<20>; - type TreasuryFeePercentage = frame_support::traits::ConstU128<5>; - type BuyAndBurnFeePercentage = frame_support::traits::ConstU128<5>; + type NativeCurrencyId = tokens::MgxTokenId; + type TreasuryPalletId = cfg::TreasuryPalletIdOf; + type BnbTreasurySubAccDerive = cfg::pallet_xyk::BnbTreasurySubAccDerive; + type PoolFeePercentage = cfg::pallet_xyk::PoolFeePercentage; + type TreasuryFeePercentage = cfg::pallet_xyk::TreasuryFeePercentage; + type BuyAndBurnFeePercentage = cfg::pallet_xyk::BuyAndBurnFeePercentage; type LiquidityMiningRewards = ProofOfStake; type VestingProvider = Vesting; type DisallowedPools = Bootstrap; - type DisabledTokens = (TestTokensFilter, AssetRegisterFilter); - type AssetMetadataMutation = AssetMetadataMutation; + type DisabledTokens = + (cfg::pallet_xyk::TestTokensFilter, cfg::pallet_xyk::AssetRegisterFilter); + type AssetMetadataMutation = cfg::pallet_xyk::AssetMetadataMutation; type WeightInfo = weights::pallet_xyk_weights::ModuleWeight; - type RewardsMigrateAccount = RewardsMigrationAccountProvider; } impl pallet_proof_of_stake::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ActivationReservesProvider = MultiPurposeLiquidity; - type NativeCurrencyId = MgxTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type Currency = orml_tokens::MultiTokenCurrencyAdapter; - type LiquidityMiningIssuanceVault = LiquidityMiningIssuanceVault; - type RewardsDistributionPeriod = SessionLenghtOf; + //TODO: fix + type LiquidityMiningIssuanceVault = cfg::pallet_issuance::LiquidityMiningIssuanceVault; + type RewardsDistributionPeriod = cfg::SessionLenghtOf; type WeightInfo = weights::pallet_proof_of_stake_weights::ModuleWeight; } -pub struct EnableAssetPoolApi; -impl AssetRegistryApi for EnableAssetPoolApi { - fn enable_pool_creation(assets: (TokenId, TokenId)) -> bool { - for &asset in [assets.0, assets.1].iter() { - let meta_maybe: Option = - orml_asset_registry::Metadata::::get(asset); - if let Some(xyk) = meta_maybe.clone().and_then(|m| m.additional.xyk) { - let mut additional = meta_maybe.unwrap().additional; - if xyk.operations_disabled { - additional.xyk = Some(XykMetadata { operations_disabled: false }); - match orml_asset_registry::Pallet::::do_update_asset( - asset, - None, - None, - None, - None, - None, - Some(additional), - ) { - Ok(_) => {}, - Err(e) => { - log::error!(target: "bootstrap", "cannot modify {} asset: {:?}!", asset, e); - return false - }, - } - } - } - } - true - } -} - -parameter_types! { - pub const BootstrapUpdateBuffer: BlockNumber = 300; - pub const DefaultBootstrapPromotedPoolWeight: u8 = 0u8; - pub const ClearStorageLimit: u32 = 100u32; -} - impl pallet_bootstrap::BootstrapBenchmarkingConfig for Runtime {} impl pallet_bootstrap::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type PoolCreateApi = Xyk; - type DefaultBootstrapPromotedPoolWeight = DefaultBootstrapPromotedPoolWeight; - type BootstrapUpdateBuffer = BootstrapUpdateBuffer; + type DefaultBootstrapPromotedPoolWeight = + cfg::pallet_bootstrap::DefaultBootstrapPromotedPoolWeight; + type BootstrapUpdateBuffer = cfg::pallet_bootstrap::BootstrapUpdateBuffer; type Currency = orml_tokens::MultiTokenCurrencyAdapter; type VestingProvider = Vesting; - type TreasuryPalletId = TreasuryPalletId; + type TreasuryPalletId = cfg::TreasuryPalletIdOf; type RewardsApi = ProofOfStake; - type ClearStorageLimit = ClearStorageLimit; + type ClearStorageLimit = cfg::pallet_bootstrap::ClearStorageLimit; type WeightInfo = weights::pallet_bootstrap_weights::ModuleWeight; - type AssetRegistryApi = EnableAssetPoolApi; -} - -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, -)] -pub struct DisallowedInBatch; - -impl Contains for DisallowedInBatch { - fn contains(c: &RuntimeCall) -> bool { - match c { - RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::compound_rewards { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::provide_liquidity_with_conversion { .. }) => true, - _ => false, - } - } + type AssetRegistryApi = cfg::pallet_bootstrap::EnableAssetPoolApi; } impl pallet_utility_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type DisallowedInBatch = DisallowedInBatch; + type DisallowedInBatch = cfg::pallet_utility_mangata::DisallowedInBatch; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility_mangata_weights::ModuleWeight; } -type ORMLCurrencyAdapterNegativeImbalance = - as MultiTokenCurrency< - AccountId, - >>::NegativeImbalance; - -pub trait OnMultiTokenUnbalanced< - Imbalance: frame_support::traits::TryDrop + MultiTokenImbalanceWithZeroTrait, -> -{ - /// Handler for some imbalances. The different imbalances might have different origins or - /// meanings, dependent on the context. Will default to simply calling on_unbalanced for all - /// of them. Infallible. - fn on_unbalanceds(token_id: TokenId, amounts: impl Iterator) - where - Imbalance: frame_support::traits::Imbalance, - { - Self::on_unbalanced(amounts.fold(Imbalance::from_zero(token_id), |i, x| x.merge(i))) - } - - /// Handler for some imbalance. Infallible. - fn on_unbalanced(amount: Imbalance) { - amount.try_drop().unwrap_or_else(Self::on_nonzero_unbalanced) - } - - /// Actually handle a non-zero imbalance. You probably want to implement this rather than - /// `on_unbalanced`. - fn on_nonzero_unbalanced(amount: Imbalance) { - drop(amount); - } -} - -pub struct ToAuthor; -impl OnMultiTokenUnbalanced for ToAuthor { - fn on_nonzero_unbalanced(amount: ORMLCurrencyAdapterNegativeImbalance) { - if let Some(author) = Authorship::author() { - as MultiTokenCurrency< - AccountId, - >>::resolve_creating(amount.0, &author, amount); - } - } -} - -#[derive(Encode, Decode, TypeInfo)] -pub enum LiquidityInfoEnum, T: frame_system::Config> { - Imbalance((TokenId, NegativeImbalanceOf)), - FeeLock, -} - -pub struct FeeHelpers(PhantomData<(T, C, OU, OCA, OFLA)>); -impl FeeHelpers -where - T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - OCA: OnChargeTransaction< - T, - LiquidityInfo = Option>, - Balance = ::AccountId>>::Balance, - >, - OFLA: FeeLockTriggerTrait<::AccountId>, - T: frame_system::Config, - T::AccountId: From + Into, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn handle_sell_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - sold_asset_id: u32, - sold_asset_amount: u128, - bought_asset_id: u32, - min_amount_out: u128, - ) -> Result>, TransactionValidityError> { - if fee_lock_metadata.is_whitelisted(sold_asset_id) || - fee_lock_metadata.is_whitelisted(bought_asset_id) - { - let (_, _, _, _, _, bought_asset_amount) = - ::pre_validate_sell_asset( - &who.clone().into(), - sold_asset_id, - bought_asset_id, - sold_asset_amount, - min_amount_out, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || - Self::is_high_value_swap( - &fee_lock_metadata, - bought_asset_id, - bought_asset_amount, - ) { - let _ = OFLA::unlock_fee(who); - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn is_high_value_swap( - fee_lock_metadata: &pallet_fee_lock::FeeLockMetadataInfo, - asset_id: u32, - asset_amount: u128, - ) -> bool { - if let (true, Some(valuation)) = ( - fee_lock_metadata.is_whitelisted(asset_id), - OFLA::get_swap_valuation_for_token(asset_id, asset_amount), - ) { - valuation >= fee_lock_metadata.swap_value_threshold - } else { - false - } - } - - fn handle_buy_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - sold_asset_id: u32, - bought_asset_amount: u128, - bought_asset_id: u32, - max_amount_in: u128, - ) -> Result>, TransactionValidityError> { - if fee_lock_metadata.is_whitelisted(sold_asset_id) || - fee_lock_metadata.is_whitelisted(bought_asset_id) - { - let (_, _, _, _, _, sold_asset_amount) = - ::pre_validate_buy_asset( - &who.clone().into(), - sold_asset_id, - bought_asset_id, - bought_asset_amount, - max_amount_in, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || - Self::is_high_value_swap( - &fee_lock_metadata, - bought_asset_id, - bought_asset_amount, - ) { - let _ = OFLA::unlock_fee(who); - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - } else { - // "swap on non-curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn handle_multiswap_buy_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - swap_token_list: Vec, - bought_asset_amount: u128, - max_amount_in: u128, - ) -> Result>, TransactionValidityError> { - // ensure swap cannot fail - // This is to ensure that xyk swap fee is always charged - // We also ensure that the user has enough funds to transact - let _ = ::pre_validate_multiswap_buy_asset( - &who.clone().into(), - swap_token_list, - bought_asset_amount, - max_amount_in, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - - // This is the "low value swap on curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn handle_multiswap_sell_asset( - who: &::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - swap_token_list: Vec, - sold_asset_amount: u128, - min_amount_out: u128, - ) -> Result>, TransactionValidityError> { - // ensure swap cannot fail - // This is to ensure that xyk swap fee is always charged - // We also ensure that the user has enough funds to transact - let _ = ::pre_validate_multiswap_sell_asset( - &who.clone().into(), - swap_token_list.clone(), - sold_asset_amount, - min_amount_out, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - - // This is the "low value swap on curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - } -} - -const SINGLE_HOP_MULTISWAP: usize = 2; -#[derive(Encode, Decode, Clone, TypeInfo)] -pub struct OnChargeHandler(PhantomData<(C, OU, OCA, OFLA)>); +use cfg::pallet_transaction_payment_mangata::{ + FeeHelpers, OnChargeHandler, ThreeCurrencyOnChargeAdapter, ToAuthor, TriggerEvent, +}; -/// Default implementation for a Currency and an OnUnbalanced handler. -/// -/// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and -/// then tip. -impl OnChargeTransaction for OnChargeHandler +// TODO: renaming foo causes compiler error +pub struct Foo(PhantomData); +impl TriggerEvent for Foo where - T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - OCA: OnChargeTransaction< - T, - LiquidityInfo = Option>, - Balance = ::AccountId>>::Balance, - >, - OFLA: FeeLockTriggerTrait<::AccountId>, - T: frame_system::Config, - T::AccountId: From + Into, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, + T: frame_system::Config, { - type LiquidityInfo = Option>; - type Balance = ::AccountId>>::Balance; - - /// Withdraw the predicted fee from the transaction origin. - /// - /// Note: The `fee` already includes the `tip`. - fn withdraw_fee( - who: &T::AccountId, - call: &T::RuntimeCall, - info: &DispatchInfoOf, - fee: Self::Balance, - tip: Self::Balance, - ) -> Result { - match call { - RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { .. }) => ensure!( - tip.is_zero(), - TransactionValidityError::Invalid( - InvalidTransaction::TippingNotAllowedForSwaps.into(), - ) - ), - _ => {}, - }; - - // THIS IS NOT PROXY PALLET COMPATIBLE, YET - // Also ugly implementation to keep it maleable for now - match (call, pallet_fee_lock::FeeLockMetadata::::get()) { - (RuntimeCall::Xyk(xyk_call), Some(fee_lock_metadata)) => match xyk_call { - pallet_xyk::Call::sell_asset { - sold_asset_id, - sold_asset_amount, - bought_asset_id, - min_amount_out, - .. - } => FeeHelpers::::handle_sell_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *sold_asset_amount, - *bought_asset_id, - *min_amount_out, - ), - - pallet_xyk::Call::buy_asset { - sold_asset_id, - bought_asset_amount, - bought_asset_id, - max_amount_in, - .. - } => FeeHelpers::::handle_buy_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *bought_asset_amount, - *bought_asset_id, - *max_amount_in, - ), - - pallet_xyk::Call::multiswap_buy_asset { - swap_token_list, - bought_asset_amount, - max_amount_in, - .. - } => - if swap_token_list.len() == SINGLE_HOP_MULTISWAP { - let sold_asset_id = - swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - let bought_asset_id = - swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - FeeHelpers::::handle_buy_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *bought_asset_amount, - *bought_asset_id, - *max_amount_in, - ) - } else { - FeeHelpers::::handle_multiswap_buy_asset( - who, - fee_lock_metadata, - swap_token_list.clone(), - *bought_asset_amount, - *max_amount_in, - ) - }, - - pallet_xyk::Call::multiswap_sell_asset { - swap_token_list, - sold_asset_amount, - min_amount_out, - .. - } => - if swap_token_list.len() == SINGLE_HOP_MULTISWAP { - let sold_asset_id = - swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - let bought_asset_id = - swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - FeeHelpers::::handle_sell_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *sold_asset_amount, - *bought_asset_id, - *min_amount_out, - ) - } else { - FeeHelpers::::handle_multiswap_sell_asset( - who, - fee_lock_metadata, - swap_token_list.clone(), - *sold_asset_amount, - *min_amount_out, - ) - }, - _ => OCA::withdraw_fee(who, call, info, fee, tip), - }, - (RuntimeCall::FeeLock(pallet_fee_lock::Call::unlock_fee { .. }), _) => { - let imb = C::withdraw( - MgxTokenId::get().into(), - who, - Balance::from(tip).into(), - WithdrawReasons::TIP, - ExistenceRequirement::KeepAlive, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::Payment.into()) - })?; - - OU::on_unbalanceds(MgxTokenId::get().into(), Some(imb).into_iter()); - TransactionPayment::deposit_event(pallet_transaction_payment_mangata::Event::< - Runtime, - >::TransactionFeePaid { - who: sp_runtime::AccountId32::from(who.clone()), - actual_fee: Balance::zero().into(), - tip: Balance::from(tip), - }); - - OFLA::can_unlock_fee(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::UnlockFee.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - }, - _ => OCA::withdraw_fee(who, call, info, fee, tip), - } - } - - /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. - /// Since the predicted fee might have been too high, parts of the fee may - /// be refunded. - /// - /// Note: The `corrected_fee` already includes the `tip`. - fn correct_and_deposit_fee( - who: &T::AccountId, - dispatch_info: &DispatchInfoOf, - post_info: &PostDispatchInfoOf, - corrected_fee: Self::Balance, - tip: Self::Balance, - already_withdrawn: Self::LiquidityInfo, - ) -> Result<(), TransactionValidityError> { - match already_withdrawn { - Some(LiquidityInfoEnum::Imbalance(_)) => OCA::correct_and_deposit_fee( + fn trigger(who: T::AccountId, fee: u128, tip: u128) { + TransactionPayment::deposit_event( + pallet_transaction_payment_mangata::Event::::TransactionFeePaid { who, - dispatch_info, - post_info, - corrected_fee, + actual_fee: fee, tip, - already_withdrawn, - ), - Some(LiquidityInfoEnum::FeeLock) => Ok(()), - None => Ok(()), - } + }, + ); } } -parameter_types! { - pub const TransactionByteFee: Balance = 5 * MILLIUNIT; - pub const OperationalFeeMultiplier: u8 = 5; -} - -#[derive(Encode, Decode, Clone, TypeInfo)] -pub struct ThreeCurrencyOnChargeAdapter( - PhantomData<(C, OU, T1, T2, T3, SF2, SF3)>, -); - -type NegativeImbalanceOf = - ::AccountId>>::NegativeImbalance; - -/// Default implementation for a Currency and an OnUnbalanced handler. -/// -/// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and -/// then tip. -impl OnChargeTransaction - for ThreeCurrencyOnChargeAdapter -where - T: pallet_transaction_payment_mangata::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - ::AccountId>>::Balance: - scale_info::TypeInfo, - T1: Get, - T2: Get, - T3: Get, - SF2: Get, - SF3: Get, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, -{ - type LiquidityInfo = Option>; - type Balance = ::AccountId>>::Balance; - - /// Withdraw the predicted fee from the transaction origin. - /// - /// Note: The `fee` already includes the `tip`. - fn withdraw_fee( - who: &T::AccountId, - _call: &T::RuntimeCall, - _info: &DispatchInfoOf, - fee: Self::Balance, - tip: Self::Balance, - ) -> Result { - if fee.is_zero() { - return Ok(None) - } - - let withdraw_reason = if tip.is_zero() { - WithdrawReasons::TRANSACTION_PAYMENT - } else { - WithdrawReasons::TRANSACTION_PAYMENT | WithdrawReasons::TIP - }; - - match C::withdraw( - T1::get().into(), - who, - fee, - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T1::get(), imbalance)))), - // TODO make sure atleast 1 planck KSM is charged - Err(_) => match C::withdraw( - T2::get().into(), - who, - fee / SF2::get().into(), - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T2::get(), imbalance)))), - Err(_) => match C::withdraw( - T3::get().into(), - who, - fee / SF3::get().into(), - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T3::get(), imbalance)))), - Err(_) => Err(InvalidTransaction::Payment.into()), - }, +impl Into for RuntimeCall { + fn into(self) -> CallType { + match self { + RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { + sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out, + .. + }) => CallType::AtomicSell { + sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out, }, + RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in, + .. + }) => CallType::AtomicBuy { + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in, + }, + RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { + swap_token_list, + sold_asset_amount, + min_amount_out, + .. + }) => CallType::MultiSell { swap_token_list, sold_asset_amount, min_amount_out }, + RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { + swap_token_list, + bought_asset_amount, + max_amount_in, + .. + }) => CallType::MultiBuy { swap_token_list, bought_asset_amount, max_amount_in }, + RuntimeCall::Xyk(pallet_xyk::Call::compound_rewards { .. }) => + CallType::CompoundRewards, + RuntimeCall::Xyk(pallet_xyk::Call::provide_liquidity_with_conversion { .. }) => + CallType::ProvideLiquidityWithConversion, + RuntimeCall::FeeLock(pallet_fee_lock::Call::unlock_fee { .. }) => CallType::UnlockFee, + _ => CallType::Other, } } - - /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. - /// Since the predicted fee might have been too high, parts of the fee may - /// be refunded. - /// - /// Note: The `corrected_fee` already includes the `tip`. - fn correct_and_deposit_fee( - who: &T::AccountId, - _dispatch_info: &DispatchInfoOf, - _post_info: &PostDispatchInfoOf, - corrected_fee: Self::Balance, - tip: Self::Balance, - already_withdrawn: Self::LiquidityInfo, - ) -> Result<(), TransactionValidityError> { - if let Some(LiquidityInfoEnum::Imbalance((token_id, paid))) = already_withdrawn { - let (corrected_fee, tip) = if token_id == T3::get() { - (corrected_fee / SF3::get().into(), tip / SF3::get().into()) - } else if token_id == T2::get() { - (corrected_fee / SF2::get().into(), tip / SF2::get().into()) - } else { - (corrected_fee, tip) - }; - // Calculate how much refund we should return - let refund_amount = paid.peek().saturating_sub(corrected_fee); - // refund to the the account that paid the fees. If this fails, the - // account might have dropped below the existential balance. In - // that case we don't refund anything. - let refund_imbalance = C::deposit_into_existing(token_id.into(), &who, refund_amount) - .unwrap_or_else(|_| C::PositiveImbalance::from_zero(token_id.into())); - // merge the imbalance caused by paying the fees and refunding parts of it again. - let adjusted_paid = paid - .offset(refund_imbalance) - .same() - .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; - // Call someone else to handle the imbalance (fee and tip separately) - let (tip_imb, fee) = adjusted_paid.split(tip); - OU::on_unbalanceds(token_id, Some(fee).into_iter().chain(Some(tip_imb))); - TransactionPayment::deposit_event( - pallet_transaction_payment_mangata::Event::::TransactionFeePaid { - who: sp_runtime::AccountId32::from(who.clone()), - actual_fee: corrected_fee.into(), - tip: Balance::from(tip), - }, - ); - } - Ok(()) - } } -parameter_types! { - pub ConstFeeMultiplierValue: Multiplier = Multiplier::saturating_from_rational(1, 1); -} +pub type OnChargeTransactionHandler = ThreeCurrencyOnChargeAdapter< + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + tokens::MgxTokenId, + tokens::RelayTokenId, + tokens::TurTokenId, + frame_support::traits::ConstU128<{ common_runtime::constants::fee::RELAY_MGX_SCALE_FACTOR }>, + frame_support::traits::ConstU128<{ common_runtime::constants::fee::TUR_MGR_SCALE_FACTOR }>, + Foo, +>; impl pallet_transaction_payment_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = OnChargeHandler< orml_tokens::MultiTokenCurrencyAdapter, - ToAuthor, - ThreeCurrencyOnChargeAdapter< - orml_tokens::MultiTokenCurrencyAdapter, - ToAuthor, - MgxTokenId, - KsmTokenId, - TurTokenId, - frame_support::traits::ConstU128, - frame_support::traits::ConstU128, - >, + ToAuthor, + OnChargeTransactionHandler, FeeLock, >; - type LengthToFee = ConstantMultiplier; - type WeightToFee = WeightToFee; - type FeeMultiplierUpdate = ConstFeeMultiplier; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type LengthToFee = cfg::pallet_transaction_payment_mangata::LengthToFee; + type WeightToFee = common_runtime::constants::fee::WeightToFee; + type FeeMultiplierUpdate = cfg::pallet_transaction_payment_mangata::FeeMultiplierUpdate; + type OperationalFeeMultiplier = + cfg::pallet_transaction_payment_mangata::OperationalFeeMultiplier; } parameter_types! { @@ -1230,28 +407,23 @@ parameter_types! { impl pallet_fee_lock::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxCuratedTokens = MaxCuratedTokens; + type MaxCuratedTokens = cfg::pallet_fee_lock::MaxCuratedTokens; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type PoolReservesProvider = Xyk; - type NativeTokenId = MgxTokenId; + type NativeTokenId = tokens::MgxTokenId; type WeightInfo = weights::pallet_fee_lock_weights::ModuleWeight; } -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); -} - impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type OnSystemEvent = (); type SelfParaId = ParachainInfo; type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; + type ReservedDmpWeight = cfg::cumulus_pallet_parachain_system::ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; + type ReservedXcmpWeight = cfg::cumulus_pallet_parachain_system::ReservedXcmpWeight; type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::AnyRelayNumber; } @@ -1259,12 +431,6 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -parameter_types! { - pub const Period: u32 = 6 * HOURS; - pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; -} - impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; @@ -1282,7 +448,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = cfg::pallet_aura::MaxAuthorities; } impl pallet_sudo_mangata::Config for Runtime { @@ -1293,24 +459,7 @@ impl pallet_sudo_mangata::Config for Runtime { impl pallet_sudo_origin::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type SudoOrigin = - pallet_collective_mangata::EnsureProportionMoreThan; -} - -#[cfg(not(feature = "fast-runtime"))] -parameter_types! { - pub const CouncilProposalCloseDelay: BlockNumber = 3 * DAYS; -} - -#[cfg(feature = "fast-runtime")] -parameter_types! { - pub const CouncilProposalCloseDelay: BlockNumber = 6 * MINUTES; -} - -parameter_types! { - pub const CouncilMotionDuration: BlockNumber = 5 * DAYS; - pub const CouncilMaxProposals: u32 = 100; - pub const CouncilMaxMembers: u32 = 100; + type SudoOrigin = cfg::pallet_sudo_origin::SudoOrigin; } type CouncilCollective = pallet_collective_mangata::Instance1; @@ -1318,98 +467,47 @@ impl pallet_collective_mangata::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type MotionDuration = CouncilMotionDuration; - type ProposalCloseDelay = CouncilProposalCloseDelay; - type MaxProposals = CouncilMaxProposals; - type MaxMembers = CouncilMaxMembers; - type FoundationAccountsProvider = FoundationAccountsProvider; + type MotionDuration = cfg::pallet_collective_mangata::CouncilMotionDuration; + type ProposalCloseDelay = cfg::pallet_collective_mangata::CouncilProposalCloseDelay; + type MaxProposals = cfg::pallet_collective_mangata::CouncilMaxProposals; + type MaxMembers = cfg::pallet_collective_mangata::CouncilMaxMembers; + type FoundationAccountsProvider = cfg::pallet_maintenance::FoundationAccountsProvider; type DefaultVote = pallet_collective_mangata::PrimeDefaultVote; type WeightInfo = weights::pallet_collective_mangata_weights::ModuleWeight; } -#[cfg(feature = "fast-runtime")] -parameter_types! { - /// Default SessionLenght is every 2 minutes (10 * 12 second block times) - pub const BlocksPerRound: u32 = 2 * MINUTES; -} - -#[cfg(not(feature = "fast-runtime"))] -parameter_types! { - /// Default SessionLenght is every 4 hours (1200 * 12 second block times) - pub const BlocksPerRound: u32 = 4 * HOURS; -} - -parameter_types! { - /// Collator candidate exit delay (number of rounds) - pub const LeaveCandidatesDelay: u32 = 2; - /// Collator candidate bond increases/decreases delay (number of rounds) - pub const CandidateBondDelay: u32 = 2; - /// Delegator exit delay (number of rounds) - pub const LeaveDelegatorsDelay: u32 = 2; - /// Delegation revocations delay (number of rounds) - pub const RevokeDelegationDelay: u32 = 2; - /// Delegation bond increases/decreases delay (number of rounds) - pub const DelegationBondDelay: u32 = 2; - /// Reward payments delay (number of rounds) - pub const RewardPaymentDelay: u32 = 2; - /// Minimum collators selected per round, default at genesis and minimum forever after - pub const MinSelectedCandidates: u32 = 25; - /// Maximum collator candidates allowed - pub const MaxCollatorCandidates: u32 = 50; - /// Maximum delegators allowed per candidate - pub const MaxTotalDelegatorsPerCandidate: u32 = 25; - /// Maximum delegators counted per candidate - pub const MaxDelegatorsPerCandidate: u32 = 12; - /// Maximum delegations per delegator - pub const MaxDelegationsPerDelegator: u32 = 30; - /// Default fixed percent a collator takes off the top of due rewards - pub const DefaultCollatorCommission: Perbill = Perbill::from_percent(20); - /// Minimum stake required to become a collator - pub const MinCollatorStk: u128 = 10 * DOLLARS; - /// Minimum stake required to be reserved to be a candidate - pub const MinCandidateStk: u128 = if cfg!(feature = "runtime-benchmarks") { - // For benchmarking - 1 * DOLLARS - } else { - // ACTUAL - 1_500_000 * DOLLARS - }; - /// Minimum stake required to be reserved to be a delegator - pub const MinDelegatorStk: u128 = 1 * CENTS; -} - // To ensure that BlocksPerRound is not zero, breaking issuance calculations // Also since 1 block is used for session change, atleast 1 block more needed for extrinsics to work -const_assert!(BlocksPerRound::get() >= 2); +const_assert!(::BlocksPerRound::get() >= 2); impl parachain_staking::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StakingReservesProvider = MultiPurposeLiquidity; type Currency = orml_tokens::MultiTokenCurrencyAdapter; type MonetaryGovernanceOrigin = EnsureRoot; - type BlocksPerRound = BlocksPerRound; - type LeaveCandidatesDelay = LeaveCandidatesDelay; - type CandidateBondDelay = CandidateBondDelay; - type LeaveDelegatorsDelay = LeaveDelegatorsDelay; - type RevokeDelegationDelay = RevokeDelegationDelay; - type DelegationBondDelay = DelegationBondDelay; - type RewardPaymentDelay = RewardPaymentDelay; - type MinSelectedCandidates = MinSelectedCandidates; - type MaxCollatorCandidates = MaxCollatorCandidates; - type MaxTotalDelegatorsPerCandidate = MaxTotalDelegatorsPerCandidate; - type MaxDelegatorsPerCandidate = MaxDelegatorsPerCandidate; - type MaxDelegationsPerDelegator = MaxDelegationsPerDelegator; - type DefaultCollatorCommission = DefaultCollatorCommission; - type MinCollatorStk = MinCollatorStk; - type MinCandidateStk = MinCandidateStk; - type MinDelegation = MinDelegatorStk; - type NativeTokenId = MgxTokenId; + type BlocksPerRound = cfg::parachain_staking::BlocksPerRound; + type LeaveCandidatesDelay = cfg::parachain_staking::LeaveCandidatesDelay; + type CandidateBondDelay = cfg::parachain_staking::CandidateBondDelay; + type LeaveDelegatorsDelay = cfg::parachain_staking::LeaveDelegatorsDelay; + type RevokeDelegationDelay = cfg::parachain_staking::RevokeDelegationDelay; + type DelegationBondDelay = cfg::parachain_staking::DelegationBondDelay; + type RewardPaymentDelay = cfg::parachain_staking::RewardPaymentDelay; + type MinSelectedCandidates = cfg::parachain_staking::MinSelectedCandidates; + type MaxCollatorCandidates = cfg::parachain_staking::MaxCollatorCandidates; + type MaxTotalDelegatorsPerCandidate = cfg::parachain_staking::MaxTotalDelegatorsPerCandidate; + type MaxDelegatorsPerCandidate = cfg::parachain_staking::MaxDelegatorsPerCandidate; + type MaxDelegationsPerDelegator = cfg::parachain_staking::MaxDelegationsPerDelegator; + type DefaultCollatorCommission = cfg::parachain_staking::DefaultCollatorCommission; + type MinCollatorStk = cfg::parachain_staking::MinCollatorStk; + type MinCandidateStk = cfg::parachain_staking::MinCandidateStk; + type MinDelegation = cfg::parachain_staking::MinDelegatorStk; + type NativeTokenId = tokens::MgxTokenId; type StakingLiquidityTokenValuator = Xyk; type Issuance = Issuance; - type StakingIssuanceVault = StakingIssuanceVault; + type StakingIssuanceVault = cfg::parachain_staking::StakingIssuanceVaultOf; type FallbackProvider = Council; type WeightInfo = weights::parachain_staking_weights::ModuleWeight; - type DefaultPayoutLimit = DefaultPayoutLimit; + type DefaultPayoutLimit = cfg::parachain_staking::DefaultPayoutLimit; } impl parachain_staking::StakingBenchmarkConfig for Runtime { @@ -1421,95 +519,69 @@ impl parachain_staking::StakingBenchmarkConfig for Runtime { impl pallet_xyk::XykBenchmarkingConfig for Runtime {} -parameter_types! { - pub const HistoryLimit: u32 = 10u32; - - pub const LiquidityMiningIssuanceVaultId: PalletId = PalletId(*b"py/lqmiv"); - pub LiquidityMiningIssuanceVault: AccountId = LiquidityMiningIssuanceVaultId::get().into_account_truncating(); - pub const StakingIssuanceVaultId: PalletId = PalletId(*b"py/stkiv"); - pub StakingIssuanceVault: AccountId = StakingIssuanceVaultId::get().into_account_truncating(); - - pub const TotalCrowdloanAllocation: Balance = 330_000_000 * DOLLARS; - pub const IssuanceCap: Balance = 4_000_000_000 * DOLLARS; - pub const LinearIssuanceBlocks: u32 = 13_140_000u32; // 5 years - pub const LiquidityMiningSplit: Perbill = Perbill::from_parts(555555556); - pub const StakingSplit: Perbill = Perbill::from_parts(444444444); - pub const ImmediateTGEReleasePercent: Percent = Percent::from_percent(20); - pub const TGEReleasePeriod: u32 = 5_256_000u32; // 2 years - pub const TGEReleaseBegin: u32 = 100_800u32; // Two weeks into chain start -} - // Issuance history must be kept for atleast the staking reward delay -const_assert!(RewardPaymentDelay::get() <= HistoryLimit::get()); +const_assert!( + ::RewardPaymentDelay::get() <= + ::HistoryLimit::get() +); impl pallet_issuance::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type NativeCurrencyId = MgxTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type BlocksPerRound = BlocksPerRound; - type HistoryLimit = HistoryLimit; - type LiquidityMiningIssuanceVault = LiquidityMiningIssuanceVault; - type StakingIssuanceVault = StakingIssuanceVault; - type TotalCrowdloanAllocation = TotalCrowdloanAllocation; - type IssuanceCap = IssuanceCap; - type LinearIssuanceBlocks = LinearIssuanceBlocks; - type LiquidityMiningSplit = LiquidityMiningSplit; - type StakingSplit = StakingSplit; - type ImmediateTGEReleasePercent = ImmediateTGEReleasePercent; - type TGEReleasePeriod = TGEReleasePeriod; - type TGEReleaseBegin = TGEReleaseBegin; + //TODO + type BlocksPerRound = cfg::parachain_staking::BlocksPerRound; + type HistoryLimit = cfg::pallet_issuance::HistoryLimit; + type LiquidityMiningIssuanceVault = cfg::pallet_issuance::LiquidityMiningIssuanceVault; + type StakingIssuanceVault = cfg::pallet_issuance::StakingIssuanceVault; + type TotalCrowdloanAllocation = cfg::pallet_issuance::TotalCrowdloanAllocation; + type IssuanceCap = cfg::pallet_issuance::IssuanceCap; + type LinearIssuanceBlocks = cfg::pallet_issuance::LinearIssuanceBlocks; + type LiquidityMiningSplit = cfg::pallet_issuance::LiquidityMiningSplit; + type StakingSplit = cfg::pallet_issuance::StakingSplit; + type ImmediateTGEReleasePercent = cfg::pallet_issuance::ImmediateTGEReleasePercent; + type TGEReleasePeriod = cfg::pallet_issuance::TGEReleasePeriod; + type TGEReleaseBegin = cfg::pallet_issuance::TGEReleaseBegin; type VestingProvider = Vesting; type WeightInfo = weights::pallet_issuance_weights::ModuleWeight; type LiquidityMiningApi = ProofOfStake; } -parameter_types! { - pub const MinVestedTransfer: Balance = 100 * DOLLARS; -} - impl pallet_vesting_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type BlockNumberToBalance = ConvertInto; - type MinVestedTransfer = MinVestedTransfer; + type MinVestedTransfer = cfg::pallet_vesting_mangata::MinVestedTransfer; type WeightInfo = weights::pallet_vesting_mangata_weights::ModuleWeight; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the // highest number of schedules that encodes less than 2^10. const MAX_VESTING_SCHEDULES: u32 = 50; } -parameter_types! { - pub const Initialized: bool = false; - pub const InitializationPayment: Perbill = Perbill::from_parts(214285700); - pub const MaxInitContributorsBatchSizes: u32 = 100; - pub const MinimumReward: Balance = 0; - pub const RelaySignaturesThreshold: Perbill = Perbill::from_percent(100); - pub const SigantureNetworkIdentifier: &'static [u8] = b"mangata-"; -} - impl pallet_crowdloan_rewards::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Initialized = Initialized; - type InitializationPayment = InitializationPayment; - type MaxInitContributors = MaxInitContributorsBatchSizes; - type MinimumReward = MinimumReward; - type RewardAddressRelayVoteThreshold = RelaySignaturesThreshold; - type NativeTokenId = MgxTokenId; + type Initialized = cfg::pallet_crowdloan_rewards::Initialized; + type InitializationPayment = cfg::pallet_crowdloan_rewards::InitializationPayment; + type MaxInitContributors = cfg::pallet_crowdloan_rewards::MaxInitContributorsBatchSizes; + type MinimumReward = cfg::pallet_crowdloan_rewards::MinimumReward; + type RewardAddressRelayVoteThreshold = cfg::pallet_crowdloan_rewards::RelaySignaturesThreshold; + type NativeTokenId = tokens::MgxTokenId; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type RelayChainAccountId = sp_runtime::AccountId32; type RewardAddressChangeOrigin = EnsureRoot; - type SignatureNetworkIdentifier = SigantureNetworkIdentifier; + type SignatureNetworkIdentifier = cfg::pallet_crowdloan_rewards::SigantureNetworkIdentifier; type RewardAddressAssociateOrigin = EnsureRoot; type VestingBlockNumber = BlockNumber; type VestingBlockProvider = System; + type VestingProvider = Vesting; type WeightInfo = weights::pallet_crowdloan_rewards_weights::ModuleWeight; } impl pallet_multipurpose_liquidity::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxRelocks = MaxLocks; + type MaxRelocks = cfg::MaxLocksOf; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type NativeCurrencyId = MgxTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type VestingProvider = Vesting; type Xyk = Xyk; type WeightInfo = weights::pallet_multipurpose_liquidity_weights::ModuleWeight; @@ -1524,89 +596,19 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRoot; } -pub type AssetMetadataOf = AssetMetadata; -type CurrencyAdapter = orml_tokens::MultiTokenCurrencyAdapter; - -pub struct SequentialIdWithCreation(PhantomData); -impl AssetProcessor - for SequentialIdWithCreation -{ - fn pre_register( - id: Option, - asset_metadata: AssetMetadataOf, - ) -> Result<(TokenId, AssetMetadataOf), DispatchError> { - let next_id = CurrencyAdapter::get_next_currency_id(); - let asset_id = id.unwrap_or(next_id); - match asset_id.cmp(&next_id) { - Ordering::Equal => CurrencyAdapter::create(&TreasuryAccount::get(), Default::default()) - .and_then(|created_asset_id| match created_asset_id.cmp(&asset_id) { - Ordering::Equal => Ok((asset_id, asset_metadata)), - _ => Err(orml_asset_registry::Error::::InvalidAssetId.into()), - }), - Ordering::Less => Ok((asset_id, asset_metadata)), - _ => Err(orml_asset_registry::Error::::InvalidAssetId.into()), - } - } -} - -pub struct AssetAuthority; -impl EnsureOriginWithArg> for AssetAuthority { - type Success = (); - - fn try_origin( - origin: RuntimeOrigin, - _asset_id: &Option, - ) -> Result { - EnsureRoot::try_origin(origin) - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_asset_id: &Option) -> Result { - Ok(RuntimeOrigin::root()) - } -} +use common_runtime::config::orml_asset_registry::AssetMetadataOf; impl orml_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type CustomMetadata = CustomMetadata; type AssetId = TokenId; - type AuthorityOrigin = AssetAuthority; - type AssetProcessor = SequentialIdWithCreation; + type AuthorityOrigin = cfg::orml_asset_registry::AssetAuthority; + type AssetProcessor = cfg::orml_asset_registry::SequentialIdWithCreation; type Balance = Balance; type WeightInfo = weights::orml_asset_registry_weights::ModuleWeight; } -// Proxy Pallet -/// The type used to represent the kinds of proxying allowed. -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, -)] -pub enum ProxyType { - AutoCompound, -} - -impl Default for ProxyType { - fn default() -> Self { - Self::AutoCompound - } -} - -parameter_types! { - pub const ProxyDepositBase: Balance = deposit(1, 16); - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const AnnouncementDepositBase: Balance = deposit(1, 16); - pub const AnnouncementDepositFactor: Balance = deposit(0, 68); -} +use cfg::pallet_proxy::ProxyType; impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { @@ -1632,71 +634,36 @@ impl InstanceFilter for ProxyType { impl pallet_proxy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type Currency = orml_tokens::CurrencyAdapter; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; + type Currency = orml_tokens::CurrencyAdapter; + type ProxyType = cfg::pallet_proxy::ProxyType; + type ProxyDepositBase = cfg::pallet_proxy::ProxyDepositBase; + type ProxyDepositFactor = cfg::pallet_proxy::ProxyDepositFactor; type MaxProxies = frame_support::traits::ConstU32<32>; type WeightInfo = pallet_proxy::weights::SubstrateWeight; type MaxPending = frame_support::traits::ConstU32<32>; type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; -} -parameter_types! { - // Add item in storage and take 270 bytes, Registry { [], Balance, Info { [], [u8,32] * 7, [u8,20] }} - pub const BasicDeposit: Balance = deposit(1, 270); - // No item in storage, extra field takes 66 bytes, ([u8,32], [u8,32]) - pub const FieldDeposit: Balance = deposit(0, 66); - // Add item in storage, and takes 97 bytes, AccountId + (AccountId, [u8,32]) - pub const SubAccountDeposit: Balance = deposit(1, 97); - pub const MaxSubAccounts: u32 = 100; - pub const MaxAdditionalFields: u32 = 100; - pub const MaxRegistrars: u32 = 20; + type AnnouncementDepositBase = cfg::pallet_proxy::AnnouncementDepositBase; + type AnnouncementDepositFactor = cfg::pallet_proxy::AnnouncementDepositFactor; } -type IdentityForceOrigin = EnsureRoot; -type IdentityRegistrarOrigin = EnsureRoot; - impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Currency = orml_tokens::CurrencyAdapter; - type BasicDeposit = BasicDeposit; - type FieldDeposit = FieldDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = MaxSubAccounts; - type MaxAdditionalFields = MaxAdditionalFields; - type MaxRegistrars = MaxRegistrars; - type ForceOrigin = IdentityForceOrigin; - type RegistrarOrigin = IdentityRegistrarOrigin; + type Currency = orml_tokens::CurrencyAdapter; + type BasicDeposit = cfg::pallet_identity::BasicDeposit; + type FieldDeposit = cfg::pallet_identity::FieldDeposit; + type SubAccountDeposit = cfg::pallet_identity::SubAccountDeposit; + type MaxSubAccounts = cfg::pallet_identity::MaxSubAccounts; + type MaxAdditionalFields = cfg::pallet_identity::MaxAdditionalFields; + type MaxRegistrars = cfg::pallet_identity::MaxRegistrars; + type ForceOrigin = cfg::pallet_identity::IdentityForceOrigin; + type RegistrarOrigin = cfg::pallet_identity::IdentityRegistrarOrigin; type Slashed = Treasury; type WeightInfo = pallet_identity::weights::SubstrateWeight; } -pub struct FoundationAccountsProvider(PhantomData); -impl Get> for FoundationAccountsProvider { - fn get() -> Vec { - let accounts = vec![ - hex_literal::hex!["c8d02dfbff5ce2fda651c7dd7719bc5b17b9c1043fded805bfc86296c5909871"], - hex_literal::hex!["c4690c56c36cec7ed5f6ed5d5eebace0c317073a962ebea1d00f1a304974897b"], - hex_literal::hex!["fc741134c82b81b7ab7efbf334b0c90ff8dbf22c42ad705ea7c04bf27ed4161a"], - ]; - - accounts - .into_iter() - .map(|acc| { - T::AccountId::decode(&mut sp_runtime::AccountId32::as_ref( - &sp_runtime::AccountId32::from(acc), - )) - .unwrap() - }) - .collect() - } -} - impl pallet_maintenance::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type FoundationAccountsProvider = FoundationAccountsProvider; + type FoundationAccountsProvider = cfg::pallet_maintenance::FoundationAccountsProvider; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -1868,25 +835,22 @@ impl_runtime_apis! { input_reserve: Balance, output_reserve: Balance, sell_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_sell_price(input_reserve, output_reserve, sell_amount) - .map_err(|e| - { - log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price' error: '{:?}', returning default value instead", e); - e - } - ).unwrap_or_default() - } + ) -> Balance { + Xyk::calculate_sell_price(input_reserve, output_reserve, sell_amount) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } fn calculate_buy_price( input_reserve: Balance, output_reserve: Balance, buy_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_buy_price(input_reserve, output_reserve, buy_amount) + ) -> Balance { + Xyk::calculate_buy_price(input_reserve, output_reserve, buy_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price' error: '{:?}', returning default value instead", e); @@ -1894,101 +858,199 @@ impl_runtime_apis! { } ).unwrap_or_default() - } } fn calculate_sell_price_id( sold_token_id: TokenId, bought_token_id: TokenId, sell_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_sell_price_id(sold_token_id, bought_token_id, sell_amount) + ) -> Balance { + Xyk::calculate_sell_price_id(sold_token_id, bought_token_id, sell_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price_id' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() - } } fn calculate_buy_price_id( sold_token_id: TokenId, bought_token_id: TokenId, buy_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_buy_price_id(sold_token_id, bought_token_id, buy_amount) + ) -> Balance { + Xyk::calculate_buy_price_id(sold_token_id, bought_token_id, buy_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() - } } fn get_burn_amount( first_asset_id: TokenId, second_asset_id: TokenId, liquidity_asset_amount: Balance - ) -> RpcAmountsResult { - match Xyk::get_burn_amount(first_asset_id, second_asset_id, liquidity_asset_amount){ - Ok((first_asset_amount, second_asset_amount)) => RpcAmountsResult{ - first_asset_amount, - second_asset_amount - }, - Err(e) => { - log::warn!(target:"xyk", "rpc 'XYK::get_burn_amount' error: '{:?}', returning default value instead", e); - Default::default() - }, - } + ) -> (Balance, Balance) { + Xyk::get_burn_amount(first_asset_id, second_asset_id, liquidity_asset_amount) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } fn get_max_instant_burn_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - XYKRpcResult { price: Xyk::get_max_instant_burn_amount(&user, liquidity_asset_id) } + ) -> Balance { + Xyk::get_max_instant_burn_amount(&user, liquidity_asset_id) } fn get_max_instant_unreserve_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - XYKRpcResult { price: Xyk::get_max_instant_unreserve_amount(&user, liquidity_asset_id) } + ) -> Balance { + Xyk::get_max_instant_unreserve_amount(&user, liquidity_asset_id) } fn calculate_rewards_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - match ProofOfStake::calculate_rewards_amount(user, liquidity_asset_id){ - Ok(claimable_rewards) => XYKRpcResult{ - price:claimable_rewards - }, - Err(e) => { - log::warn!(target:"xyk", "rpc 'XYK::calculate_rewards_amount' error: '{:?}', returning default value instead", e); - Default::default() - }, - } + ) -> Balance { + ProofOfStake::calculate_rewards_amount(user, liquidity_asset_id) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } fn calculate_balanced_sell_amount( total_amount: Balance, reserve_amount: Balance, - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_balanced_sell_amount(total_amount, reserve_amount) + ) -> Balance { + Xyk::calculate_balanced_sell_amount(total_amount, reserve_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_balanced_sell_amount' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() + } + + fn get_liq_tokens_for_trading() -> Vec { + Xyk::get_liq_tokens_for_trading() + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::get_liq_tokens_for_trading' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() + } + + fn is_sell_asset_lock_free( + path: Vec, + input_amount: Balance, + ) -> Option{ + match (path.len(), pallet_fee_lock::FeeLockMetadata::::get()) { + (length, _) if length < 2 => { + None + } + (2, Some(feelock)) => { + let input = path.get(0)?; + let output = path.get(1)?; + let output_amount = Xyk::calculate_sell_price_id(*input, *output, input_amount).ok()?; + Some( + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *input, input_amount) + || + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *output, output_amount) + ) + } + (_, None) => { + Some(false) + } + (_, Some(_)) => { + Some(true) + } } } + + fn is_buy_asset_lock_free( + path: Vec, + input_amount: Balance, + ) -> Option{ + match (path.len(), pallet_fee_lock::FeeLockMetadata::::get()) { + (length, _) if length < 2 => { + None + } + (2, Some(feelock)) => { + let input = path.get(0)?; + let output = path.get(1)?; + let output_amount = Xyk::calculate_buy_price_id(*input, *output, input_amount).ok()?; + Some( + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *input, input_amount) + || + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *output, output_amount) + ) + } + (_, None) => { + Some(false) + } + (_, Some(_)) => { + Some(true) + } + } + } + + fn get_tradeable_tokens() -> Vec> { + orml_asset_registry::Metadata::::iter() + .filter_map(|(token_id, metadata)| { + if !metadata.name.is_empty() + && !metadata.symbol.is_empty() + && metadata.additional.xyk.as_ref().map_or(true, |xyk| !xyk.operations_disabled) + { + let rpc_metadata = RpcAssetMetadata { + token_id: token_id, + decimals: metadata.decimals, + name: metadata.name.clone(), + symbol: metadata.symbol.clone(), + }; + Some(rpc_metadata) + } else { + None + } + }) + .collect::>() + } + } impl sp_consensus_aura::AuraApi for Runtime { @@ -2001,21 +1063,6 @@ impl_runtime_apis! { } } - impl pallet_vesting_mangata_rpc_runtime_api::VestingMangataApi for Runtime { - fn get_vesting_locked_at(who: AccountId, token_id: TokenId, at_block_number: Option) -> VestingInfosWithLockedAt - { - match Vesting::get_vesting_locked_at(&who, token_id, at_block_number){ - Ok(vesting_infos_with_locked_at) => VestingInfosWithLockedAt{ - vesting_infos_with_locked_at: vesting_infos_with_locked_at - }, - Err(e) => { - log::warn!(target:"vesting", "rpc 'Vesting::get_vesting_locked_at' error: '{:?}', returning default value instead", e); - Default::default() - }, - } - } - } - impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION @@ -2115,12 +1162,12 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + fn on_runtime_upgrade(_checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to // have a backtrace here. If any of the pre/post migration checks fail, we shall stop // right here and right now. - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) + let weight = Executive::try_runtime_upgrade(frame_try_runtime::UpgradeCheckSelect::All).unwrap(); + (weight, cfg::frame_system::RuntimeBlockWeights::get().max_block) } fn execute_block( @@ -2222,7 +1269,7 @@ impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { // replace validate block function with its expanded version #[doc(hidden)] mod parachain_validate_block { - use super::*; + use crate::Runtime; #[no_mangle] #[cfg(not(feature = "std"))] @@ -2242,12 +1289,12 @@ mod parachain_validate_block { .expect("Invalid arguments to `validate_block`."); let res = - cumulus_pallet_parachain_system::validate_block::implementation::validate_block::<::RuntimeBlock, - cumulus_pallet_aura_ext::BlockExecutorVer, - Runtime, - CheckInherents>(params); + cumulus_pallet_aura_ext::BlockExecutorVer, + crate::Runtime, + crate::CheckInherents>(params); cumulus_pallet_parachain_system::validate_block::polkadot_parachain::write_result(&res) } } diff --git a/runtime/mangata-kusama/src/migration.rs b/runtime/mangata-kusama/src/migration.rs deleted file mode 100644 index 5847d07187..0000000000 --- a/runtime/mangata-kusama/src/migration.rs +++ /dev/null @@ -1,368 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] -use super::*; -use frame_support::{ - storage::{ - migration::{move_prefix, storage_key_iter}, - storage_prefix, unhashed, - }, - traits::OnRuntimeUpgrade, - StoragePrefixedMap, Twox64Concat, -}; -use xcm::IntoVersion; - -pub fn move_storage_from_pallet_with_rename( - old_storage_name: &[u8], - new_storage_name: &[u8], - old_pallet_name: &[u8], - new_pallet_name: &[u8], -) { - let new_prefix = storage_prefix(new_pallet_name, new_storage_name); - let old_prefix = storage_prefix(old_pallet_name, old_storage_name); - - move_prefix(&old_prefix, &new_prefix); - - if let Some(value) = unhashed::get_raw(&old_prefix) { - unhashed::put_raw(&new_prefix, &value); - unhashed::kill(&old_prefix); - } -} - -pub struct XykRefactorMigration; -impl OnRuntimeUpgrade for XykRefactorMigration { - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "proof_of_stake", - "on_runtime_upgrade: Attempted to apply xyk refactor migration" - ); - - move_storage_from_pallet_with_rename( - b"PromotedPoolsRewardsV2", - b"PromotedPoolRewards", - b"Issuance", - b"ProofOfStake", - ); - move_storage_from_pallet_with_rename( - b"LiquidityMiningActivePoolV2", - b"TotalActivatedLiquidity", - b"ProofOfStake", - b"ProofOfStake", - ); - - ::BlockWeights::get().max_block - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - sp_runtime::runtime_logger::RuntimeLogger::init(); - log::info!( - target: "proof_of_stake", - "pre_upgrade check: proof_of_stake" - ); - - let pos__liquidity_mining_avitvate_pool_v2_count = - frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - |_| Ok(()), - ) - .count(); - - let pos__total_activated_liquidity = frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - |_| Ok(()), - ) - .count(); - - let issuance__promoted_pool_reards_v2_exists = - unhashed::get_raw(&storage_prefix(b"Issuance", b"PromotedPoolsRewardsV2")).is_some(); - let pos__promoted_pool_rewards_exists = - unhashed::get_raw(&storage_prefix(b"ProofOfStake", b"PromotedPoolRewards")).is_some(); - - log::info!(target: "migration", "PRE ProofOfStake::LiquidityMiningActivePoolV2 count :{}", pos__liquidity_mining_avitvate_pool_v2_count); - log::info!(target: "migration", "PRE Issuance::PromotedPoolsRewardsV2 exists :{}", issuance__promoted_pool_reards_v2_exists); - log::info!(target: "migration", "PRE ProofOfStake::RewardsInfo count :{}", pos__total_activated_liquidity); - log::info!(target: "migration", "PRE Issuance::PromotedPoolRewards exists :{}", pos__promoted_pool_rewards_exists); - - assert!(pos__liquidity_mining_avitvate_pool_v2_count > 0); - assert!(issuance__promoted_pool_reards_v2_exists); - assert!(pos__total_activated_liquidity == 0); - assert!(!pos__promoted_pool_rewards_exists); - - Ok(vec![]) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), &'static str> { - sp_runtime::runtime_logger::RuntimeLogger::init(); - log::info!( - target: "proof_of_stake", - "post_upgrade check: proof_of_stake" - ); - - let pos__liquidity_mining_avitvate_pool_v2_count = - frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - |_| Ok(()), - ) - .count(); - - let pos__total_activated_liquidity = frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - |_| Ok(()), - ) - .count(); - - let issuance__promoted_pool_reards_v2_exists = - unhashed::get_raw(&storage_prefix(b"Issuance", b"PromotedPoolsRewardsV2")).is_some(); - let pos__promoted_pool_rewards_exists = - unhashed::get_raw(&storage_prefix(b"ProofOfStake", b"PromotedPoolRewards")).is_some(); - - log::info!(target: "migration", "POST ProofOfStake::LiquidityMiningActivePoolV2 count :{}", pos__liquidity_mining_avitvate_pool_v2_count); - log::info!(target: "migration", "POST Issuance::PromotedPoolsRewardsV2 exists :{}", issuance__promoted_pool_reards_v2_exists); - log::info!(target: "migration", "POST ProofOfStake::RewardsInfo count :{}", pos__total_activated_liquidity); - log::info!(target: "migration", "POST Issuance::PromotedPoolRewards exists :{}", pos__promoted_pool_rewards_exists); - - assert!(pos__liquidity_mining_avitvate_pool_v2_count == 0); - assert!(!issuance__promoted_pool_reards_v2_exists); - assert!(pos__total_activated_liquidity > 0); - assert!(pos__promoted_pool_rewards_exists); - - Ok(()) - } -} - -/// AssetRegistry migrate v2 to v3 -pub struct AssetRegistryMigration; -impl OnRuntimeUpgrade for AssetRegistryMigration { - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "asset_registry", - "on_runtime_upgrade: Attempted to apply AssetRegistry v2 to v3 migration" - ); - - let mut weight: Weight = Weight::zero(); - - // migrate the value type of ForeignAssetLocations - orml_asset_registry::Metadata::::translate( - |_key, mut old_meta: AssetMetadataOf| { - weight.saturating_accrue( - ::DbWeight::get().reads_writes(1, 1), - ); - // let mut new_meta = old_meta.clone(); - let new_location = old_meta.location.and_then(|l| l.into_version(3).ok()); - old_meta.location = new_location; - Some(old_meta) - }, - ); - - // migrate the key type of LocationToCurrencyIds - let module_prefix = orml_asset_registry::LocationToAssetId::::module_prefix(); - let storage_prefix = orml_asset_registry::LocationToAssetId::::storage_prefix(); - let old_data = storage_key_iter::( - module_prefix, - storage_prefix, - ) - .drain() - .collect::>(); - for (old_key, value) in old_data { - weight.saturating_accrue( - ::DbWeight::get().reads_writes(1, 1), - ); - let new_key: MultiLocation = old_key.try_into().expect("Stored xcm::v2::MultiLocation"); - orml_asset_registry::LocationToAssetId::::insert(new_key, value); - } - - weight - } -} - -#[cfg(test)] -mod tests { - - use super::*; - use frame_support::{ - migration::{get_storage_value, put_storage_value}, - StorageHasher, - }; - use mangata_types::TokenId; - use orml_asset_registry::*; - - use crate::AssetMetadataOf; - - #[test] - fn test_v2_to_v3_migration() { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| { - System::set_block_number(1); - - let metadata_module_prefix = Metadata::::module_prefix(); - let metadata_storage_prefix = Metadata::::storage_prefix(); - - let location_to_asset_id_module_prefix = LocationToAssetId::::module_prefix(); - let location_to_asset_id_storage_prefix = - LocationToAssetId::::storage_prefix(); - - let meta: AssetMetadataOf = AssetMetadata { - decimals: 0, - name: b"Asset".to_vec(), - symbol: b"SYM".to_vec(), - existential_deposit: 0, - location: None, - additional: Default::default(), - }; - - let old_multilocation_0 = xcm::v2::MultiLocation::new( - 0, - xcm::v2::Junctions::X1(xcm::v2::Junction::GeneralKey( - vec![0, 0, 0, 0].try_into().unwrap(), - )), - ); - let old_multilocation_1 = xcm::v2::MultiLocation::new( - 1, - xcm::v2::Junctions::X2( - xcm::v2::Junction::Parachain(2121), - xcm::v2::Junction::GeneralKey(vec![0, 96].try_into().unwrap()), - ), - ); - let old_multilocation_2 = xcm::v2::MultiLocation::new( - 1, - xcm::v2::Junctions::X1(xcm::v2::Junction::Parachain(2114)), - ); - - let new_multilocation_0 = MultiLocation::try_from(old_multilocation_0.clone()).unwrap(); - let new_multilocation_1 = MultiLocation::try_from(old_multilocation_1.clone()).unwrap(); - let new_multilocation_2 = MultiLocation::try_from(old_multilocation_2.clone()).unwrap(); - - // assert location without general key is the same when encoded - assert_eq!(old_multilocation_2.encode(), new_multilocation_2.encode()); - - let mut meta_0 = meta.clone(); - meta_0.location = Some(old_multilocation_0.clone().versioned()); - let mut meta_1 = meta.clone(); - meta_1.location = Some(old_multilocation_1.clone().versioned()); - let mut meta_2 = meta.clone(); - meta_2.location = Some(old_multilocation_2.clone().versioned()); - - let asset_id_0: TokenId = 0; - let asset_id_1: TokenId = 11; - let asset_id_2: TokenId = 7; - - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_0.encode()), - &meta_0, - ); - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_1.encode()), - &meta_1, - ); - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_2.encode()), - &meta_2, - ); - - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - asset_id_0, - ); - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - asset_id_1, - ); - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_2.encode()), - asset_id_2, - ); - - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - ), - Some(asset_id_0) - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - ), - Some(asset_id_1) - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_2.encode()), - ), - Some(asset_id_2) - ); - - // Assert v3 multilocation key does not exist in LocationToAssetId - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_0), None); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_1), None); - - // Run migration - assert_eq!( - crate::migration::AssetRegistryMigration::on_runtime_upgrade(), - <::DbWeight as Get< - frame_support::weights::RuntimeDbWeight, - >>::get() - .reads_writes(6, 6) - ); - - // Assert the location been migrated to v3 MultiLocation - assert_eq!( - AssetRegistry::metadata(asset_id_0).unwrap().location.unwrap(), - new_multilocation_0.into_versioned() - ); - assert_eq!( - AssetRegistry::metadata(asset_id_1).unwrap().location.unwrap(), - new_multilocation_1.into_versioned() - ); - assert_eq!( - AssetRegistry::metadata(asset_id_2).unwrap().location.unwrap(), - new_multilocation_2.into_versioned() - ); - - // Assert the key type of LocationToAssetId has been migrated to v3 MultiLocation - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_0), Some(asset_id_0)); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_1), Some(asset_id_1)); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_2), Some(asset_id_2)); - - // Assert the old key does not exist anymore, except location n2 which is the same - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - ), - None - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - ), - None - ); - }); - } -} diff --git a/runtime/mangata-kusama/src/xcm_config.rs b/runtime/mangata-kusama/src/xcm_config.rs index 91247c3ca8..b8cba0eba7 100644 --- a/runtime/mangata-kusama/src/xcm_config.rs +++ b/runtime/mangata-kusama/src/xcm_config.rs @@ -1,187 +1,54 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode}; -use cumulus_primitives_core::ParaId; +use common_runtime::tokens; + pub use frame_support::{ match_types, parameter_types, traits::{Everything, Get, Nothing}, weights::Weight, }; use frame_system::EnsureRoot; -use orml_asset_registry::{AssetRegistryTrader, FixedRateAssetRegistryTrader}; -use orml_traits::{ - location::AbsoluteReserveProvider, parameter_type_with_key, FixedConversionRateProvider, - GetByKey, MultiCurrency, -}; -use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::ConstU32; -use sp_std::{marker::PhantomData, prelude::*}; -use xcm::latest::{prelude::*, Weight as XcmWeight}; -use xcm_builder::{ - Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, -}; -use xcm_executor::{traits::DropAssets, Assets, XcmExecutor}; -use super::{ - constants::fee::*, AccountId, AllPalletsWithSystem, AssetMetadataOf, Balance, Convert, - ExistentialDeposits, Maintenance, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - RuntimeCall, RuntimeEvent, RuntimeOrigin, TokenId, Tokens, TreasuryAccount, UnknownTokens, - XcmpQueue, KSM_TOKEN_ID, MGX_TOKEN_ID, -}; +use orml_traits::location::AbsoluteReserveProvider; -pub fn general_key(key: &[u8]) -> Junction { - let mut data = [0u8; 32]; - data[..key.len()].copy_from_slice(&key[..]); - GeneralKey { length: key.len() as u8, data } -} +use orml_xcm_support::MultiNativeAsset; -parameter_types! { - pub KsmLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); -} - -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, - // Create hash of `AccountId32` used for proxy accounts - Account32Hash, -); - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToCallOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; -} - -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, -); - -pub struct ToTreasury; -impl TakeRevenue for ToTreasury { - fn take_revenue(revenue: MultiAsset) { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = revenue { - if let Some(currency_id) = TokenIdConvert::convert(location) { - // Ensure AcalaTreasuryAccount have ed requirement for native asset, but don't need - // ed requirement for cross-chain asset because it's one of whitelist accounts. - // Ignore the result. - let _ = Tokens::deposit(currency_id, &TreasuryAccount::get(), amount); - } - } - } -} - -parameter_types! { - // regular transfer is ~400M weight, xcm transfer weight is ~4*UnitWeightCost - pub UnitWeightCost: XcmWeight = XcmWeight::from_parts(150_000_000, 0); - pub const MaxInstructions: u32 = 100; - - pub KsmPerSecond: (AssetId, u128, u128) = (MultiLocation::parent().into(), ksm_per_second(), ksm_per_second()); - pub MgxPerSecond: (AssetId, u128, u128) = ( - MultiLocation::new( - 0, - X1(general_key(&MGX_TOKEN_ID.encode())), - ).into(), - mgx_per_second(), - mgx_per_second(), - ); - pub const MaxAssetsIntoHolding: u32 = 64; -} +use sp_runtime::traits::ConstU32; -type AssetRegistryOf = orml_asset_registry::Pallet; +use xcm_builder::EnsureXcmOrigin; +use xcm_executor::XcmExecutor; -pub struct FeePerSecondProvider; -impl FixedConversionRateProvider for FeePerSecondProvider { - fn get_fee_per_second(location: &MultiLocation) -> Option { - if let Some(asset_id) = AssetRegistryOf::::location_to_asset_id(location) { - if let Some(xcm_meta) = AssetRegistryOf::::metadata(asset_id) - .and_then(|metadata: AssetMetadataOf| metadata.additional.xcm) - { - let fee_per_second: u128 = xcm_meta.fee_per_second; - log::debug!( - target: "xcm::weight", "fee_per_second: asset: {:?}, fps:{:?}", - asset_id, fee_per_second - ); - return Some(fee_per_second) - } - } - None - } -} +use super::{ + AccountId, AllPalletsWithSystem, Balance, Maintenance, ParachainSystem, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, TokenId, +}; -pub type Trader = ( - FixedRateOfFungible, - AssetRegistryTrader, ToTreasury>, - FixedRateOfFungible, -); +#[cfg(feature = "runtime-benchmarks")] +use cumulus_primitives_core::{MultiLocation, Parent}; pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; + type XcmSender = common_runtime::xcm_config::XcmRouter; // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToCallOrigin; + type AssetTransactor = common_runtime::xcm_config::LocalAssetTransactor; + type OriginConverter = + common_runtime::xcm_config::XcmOriginToCallOrigin; type IsReserve = MultiNativeAsset; // Teleporting is disabled. type IsTeleporter = (); - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = Trader; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; + type Barrier = common_runtime::xcm_config::Barrier; + type Weigher = common_runtime::xcm_config::Weigher; + type Trader = common_runtime::xcm_config::Trader; type ResponseHandler = PolkadotXcm; - type AssetTrap = - MangataDropAssets; + type AssetTrap = common_runtime::xcm_config::DropAssetsHandler; type AssetClaims = PolkadotXcm; type SubscriptionService = PolkadotXcm; type AssetLocker = (); type AssetExchanger = (); type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type MaxAssetsIntoHolding = common_runtime::xcm_config::MaxAssetsIntoHolding; type FeeManager = (); type MessageExporter = (); type UniversalAliases = (); @@ -189,22 +56,6 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; } -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -parameter_types! { - pub const MgxTokenId: TokenId = MGX_TOKEN_ID; -} - #[cfg(feature = "runtime-benchmarks")] parameter_types! { pub ReachableDest: Option = Some(Parent.into()); @@ -213,22 +64,25 @@ parameter_types! { impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmRouter = common_runtime::xcm_config::XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin< + RuntimeOrigin, + common_runtime::xcm_config::LocalOriginToLocation, + >; type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type UniversalLocation = UniversalLocation; + type Weigher = common_runtime::xcm_config::Weigher; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = orml_tokens::CurrencyAdapter; + type Currency = orml_tokens::CurrencyAdapter; type CurrencyMatcher = (); type TrustedLockers = (); - type SovereignAccountOf = LocationToAccountId; + type SovereignAccountOf = common_runtime::xcm_config::LocationToAccountId; type MaxLockers = ConstU32<8>; type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] @@ -240,27 +94,6 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; @@ -269,7 +102,8 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type VersionWrapper = (); type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type ControllerOriginConverter = + common_runtime::xcm_config::XcmOriginToTransactDispatchOrigin; type WeightInfo = (); type PriceForSiblingDelivery = (); } @@ -281,150 +115,19 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; } -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { network: None, id: account.into() }).into() - } -} - -parameter_types! { - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - pub const BaseXcmWeight: XcmWeight = XcmWeight::from_parts(100_000_000, 0); // TODO: recheck this - pub const MaxAssetsForTransfer:usize = 2; -} - -parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { - None - }; -} - impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = TokenId; - type CurrencyIdConvert = TokenIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type MinXcmFee = ParachainMinFee; + type CurrencyIdConvert = common_runtime::xcm_config::TokenToMultiLocation; + type AccountIdToMultiLocation = common_runtime::xcm_config::AccountIdToMultiLocation; + type SelfLocation = common_runtime::xcm_config::SelfLocation; + type MinXcmFee = common_runtime::xcm_config::ParachainMinFee; type XcmExecutor = XcmExecutor; type MultiLocationsFilter = Everything; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type UniversalLocation = UniversalLocation; - type MaxAssetsForTransfer = MaxAssetsForTransfer; + type Weigher = common_runtime::xcm_config::Weigher; + type BaseXcmWeight = common_runtime::xcm_config::BaseXcmWeight; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; + type MaxAssetsForTransfer = common_runtime::xcm_config::MaxAssetsForTransfer; type ReserveProvider = AbsoluteReserveProvider; } - -pub type LocalAssetTransactor = MultiCurrencyAdapter< - Tokens, - UnknownTokens, - IsNativeConcrete, - AccountId, - LocationToAccountId, - TokenId, - TokenIdConvert, - orml_xcm_support::DepositToAlternative, ->; - -/// `DropAssets` implementation support asset amount lower thant ED handled by `TakeRevenue`. -/// -/// parameters type: -/// - `NC`: native currency_id type. -/// - `NB`: the ExistentialDeposit amount of native currency_id. -/// - `GK`: the ExistentialDeposit amount of tokens. -pub struct MangataDropAssets(PhantomData<(X, T, C, GK)>); -impl DropAssets for MangataDropAssets -where - X: DropAssets, - T: TakeRevenue, - C: Convert>, - GK: GetByKey, -{ - fn drop_assets( - origin: &MultiLocation, - assets: Assets, - context: &XcmContext, - ) -> sp_weights::Weight { - let multi_assets: Vec = assets.into(); - let mut asset_traps: Vec = vec![]; - for asset in multi_assets { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = asset.clone() { - let currency_id = C::convert(location); - // burn asset(do nothing here) if convert result is None - if let Some(currency_id) = currency_id { - let ed = GK::get(¤cy_id); - if amount < ed { - T::take_revenue(asset); - } else { - asset_traps.push(asset); - } - } - } - } - if !asset_traps.is_empty() { - X::drop_assets(origin, asset_traps.into(), context); - } - XcmWeight::from_parts(0, 0) - } -} - -pub struct TokenIdConvert; -impl Convert> for TokenIdConvert { - fn convert(id: TokenId) -> Option { - // allow relay asset - if id == KSM_TOKEN_ID { - return Some(MultiLocation::parent()) - } - // allow native asset - if id == MGX_TOKEN_ID { - return Some(MultiLocation::new( - 1, - X2(Parachain(ParachainInfo::get().into()), general_key(&id.encode())), - )) - } - // allow assets in registry with location set - AssetRegistryOf::::multilocation(&id).unwrap_or(None) - } -} - -impl Convert> for TokenIdConvert { - fn convert(location: MultiLocation) -> Option { - // allow relay asset - if location == MultiLocation::parent() { - return Some(KSM_TOKEN_ID) - } - - match location { - // allow native asset - MultiLocation { - parents: 1, - interior: X2(Parachain(para_id), GeneralKey { length, data }), - } if ParaId::from(para_id) == ParachainInfo::get() => - match TokenId::decode(&mut &data[..(length as usize)]) { - Ok(MGX_TOKEN_ID) => Some(MGX_TOKEN_ID), - _ => None, - }, - - // allow native asset - MultiLocation { parents: 0, interior: X1(GeneralKey { length, data }) } => - match TokenId::decode(&mut &data[..(length as usize)]) { - Ok(MGX_TOKEN_ID) => Some(MGX_TOKEN_ID), - _ => None, - }, - - // allow assets in registry with location set - _ => AssetRegistryOf::::location_to_asset_id(location.clone()), - } - } -} -impl Convert> for TokenIdConvert { - fn convert(asset: MultiAsset) -> Option { - if let MultiAsset { id: Concrete(location), .. } = asset { - Self::convert(location) - } else { - None - } - } -} diff --git a/runtime/mangata-rococo/Cargo.toml b/runtime/mangata-rococo/Cargo.toml index 12dccbd20b..4d78499f5d 100644 --- a/runtime/mangata-rococo/Cargo.toml +++ b/runtime/mangata-rococo/Cargo.toml @@ -21,6 +21,7 @@ smallvec = "1.6.1" static_assertions = "1.1.0" # Local Dependencies +common-runtime = { path = '../common', default-features = false, version = '4.0.0' } pallet-xyk = { path = '../../pallets/xyk', default-features = false, version = '0.1.0' } pallet-proof-of-stake = { path = '../../pallets/proof-of-stake', default-features = false, version = '0.1.0' } pallet-bootstrap = { path = '../../pallets/bootstrap', default-features = false, version = '0.1.0' } @@ -112,9 +113,6 @@ parachain-staking = { default-features = false, git = "https://github.com/mangat # Crowdloan dependencies pallet-crowdloan-rewards = { default-features = false, git = "https://github.com/mangata-finance/crowdloan-rewards", branch = "mangata-dev" } -# Custom substrate RPC dependencies -pallet-vesting-mangata-rpc-runtime-api = { default-features = false, git = "https://github.com/mangata-finance/substrate", branch = "mangata-dev" } - [features] default = [ "std", @@ -192,7 +190,6 @@ std = [ "pallet-collective-mangata/std", "pallet-multipurpose-liquidity/std", "mangata-support/std", - "pallet-vesting-mangata-rpc-runtime-api/std", "pallet-fee-lock/std", "pallet-identity/std", "pallet-maintenance/std", @@ -243,9 +240,10 @@ try-runtime = [ "pallet-root-testing/try-runtime" ] -fast-runtime = [] +fast-runtime = ["common-runtime/fast-runtime"] runtime-benchmarks = [ + "common-runtime/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "pallet-maintenance/runtime-benchmarks", "polkadot-parachain/runtime-benchmarks", diff --git a/runtime/mangata-rococo/src/constants.rs b/runtime/mangata-rococo/src/constants.rs deleted file mode 100644 index f7727f8b13..0000000000 --- a/runtime/mangata-rococo/src/constants.rs +++ /dev/null @@ -1,86 +0,0 @@ -pub mod fee { - use crate::{weights::VerExtrinsicBaseWeight, UNIT}; - use frame_support::weights::{ - constants::WEIGHT_REF_TIME_PER_SECOND, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, - }; - use mangata_types::Balance; - use smallvec::smallvec; - use sp_runtime::Perbill; - - pub const ROC_MGR_SCALE_FACTOR_UNADJUSTED: u128 = 10_000_000_000_u128; // 10_000 as KSM/MGX, with 6 decimals accounted for (12 - KSM, 18 - MGR) - - // on-chain fees are 10x more expensive then ~real rate - pub const ROC_MGR_SCALE_FACTOR: u128 = 1000_000_000_u128; // 1000 as KSM/MGR, with 6 decimals accounted for (12 - KSM, 18 - MGR) - pub const KAR_MGR_SCALE_FACTOR: u128 = ROC_MGR_SCALE_FACTOR / 100; // 100 as KAR/ROC - pub const TUR_MGR_SCALE_FACTOR: u128 = ROC_MGR_SCALE_FACTOR; // 100 as TUR/ROC, with 2 decimals accounted for (10 - TUR, 12 - ROC) - - /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the - /// node's balance type. - /// - /// This should typically create a mapping between the following ranges: - /// - `[0, MAXIMUM_BLOCK_WEIGHT]` - /// - `[Balance::min, Balance::max]` - /// - /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: - /// - Setting it to `0` will essentially disable the weight fee. - /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. - pub struct WeightToFee; - impl WeightToFeePolynomial for WeightToFee { - type Balance = Balance; - fn polynomial() -> WeightToFeeCoefficients { - // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: - // in mangata, we map to 1/10 of that, or 1/10 MILLIUNIT - let p = base_tx_in_mgr(); - let q = Balance::from(VerExtrinsicBaseWeight::get().ref_time()); - smallvec![WeightToFeeCoefficient { - degree: 1, - negative: false, - coeff_frac: Perbill::from_rational(p % q, q), - coeff_integer: p / q, - }] - } - } - - pub fn base_tx_in_mgr() -> Balance { - UNIT - } - - pub fn mgr_per_second() -> u128 { - let base_weight = Balance::from(VerExtrinsicBaseWeight::get().ref_time()); - let base_per_second = (WEIGHT_REF_TIME_PER_SECOND / base_weight as u64) as u128; - base_per_second * base_tx_in_mgr() - } - - pub fn roc_per_second() -> u128 { - mgr_per_second() / ROC_MGR_SCALE_FACTOR_UNADJUSTED as u128 - } -} - -pub mod parachains { - pub mod mangata { - pub const ID: u32 = 2110; - } - pub mod karura { - pub const ID: u32 = 2000; - pub const KAR_KEY: &[u8] = &[0, 128]; - pub const KUSD_KEY: &[u8] = &[0, 129]; - pub const LKSM_KEY: &[u8] = &[0, 131]; - } - pub mod turing { - pub const ID: u32 = 2114; - } - pub mod bifrost { - pub const ID: u32 = 2001; - pub const BNC_KEY: &[u8] = &[0, 1]; - pub const VSKSM_KEY: &[u8] = &[4, 4]; - pub const VKSM_KEY: &[u8] = &[1, 4]; - } - pub mod imbue { - pub const ID: u32 = 2121; - pub const IMBU_KEY: &[u8] = &[0]; - } - pub mod phala { - pub const ID: u32 = 2004; - } -} diff --git a/runtime/mangata-rococo/src/lib.rs b/runtime/mangata-rococo/src/lib.rs index c65cd352da..dd84e1a708 100644 --- a/runtime/mangata-rococo/src/lib.rs +++ b/runtime/mangata-rococo/src/lib.rs @@ -2,58 +2,40 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Decode, Encode}; use frame_support::{ - construct_runtime, - dispatch::{DispatchClass, DispatchResult}, - ensure, parameter_types, - traits::{ - tokens::currency::{MultiTokenCurrency, MultiTokenImbalanceWithZeroTrait}, - Contains, EnsureOrigin, EnsureOriginWithArg, Everything, ExistenceRequirement, Get, - Imbalance, InstanceFilter, WithdrawReasons, - }, - unsigned::TransactionValidityError, - weights::{ - constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, - ConstantMultiplier, Weight, - }, - PalletId, + construct_runtime, parameter_types, + traits::{Everything, Get, InstanceFilter}, + weights::{constants::RocksDbWeight, Weight}, }; #[cfg(any(feature = "std", test))] pub use frame_system::Call as SystemCall; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, -}; +use frame_system::EnsureRoot; pub use orml_tokens; -use orml_tokens::MultiTokenCurrencyExtended; -use orml_traits::{ - asset_registry::{AssetMetadata, AssetProcessor}, - parameter_type_with_key, -}; + pub use pallet_sudo_mangata; -use pallet_transaction_payment_mangata::{ConstFeeMultiplier, Multiplier, OnChargeTransaction}; -use pallet_vesting_mangata_rpc_runtime_api::VestingInfosWithLockedAt; + +use pallet_vesting_mangata::VestingInfo; // Polkadot Imports pub use polkadot_runtime_common::BlockHashCount; -use scale_info::TypeInfo; + +pub use common_runtime::{currency::*, deposit, runtime_types, tokens, CallType}; use sp_api::impl_runtime_apis; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + create_runtime_str, impl_opaque_keys, traits::{ - AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Convert, ConvertInto, - DispatchInfoOf, PostDispatchInfoOf, Saturating, StaticLookup, Zero, + AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, + StaticLookup, }, - transaction_validity::{InvalidTransaction, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, FixedPointNumber, Percent, RuntimeDebug, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, }; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use sp_std::{ - cmp::Ordering, convert::{TryFrom, TryInto}, marker::PhantomData, prelude::*, @@ -63,12 +45,8 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use static_assertions::const_assert; pub use xcm::{latest::prelude::*, VersionedMultiLocation}; - -pub use constants::{fee::*, parachains::*}; -pub use currency::*; -use mangata_support::traits::{ - AssetRegistryApi, FeeLockTriggerTrait, PreValidateSwaps, ProofOfStakeRewardsApi, -}; +// pub use constants::{fee::*, parachains::*}; +use mangata_support::traits::ProofOfStakeRewardsApi; pub use mangata_types::{ assets::{CustomMetadata, XcmMetadata, XykMetadata}, AccountId, Address, Amount, Balance, BlockNumber, Hash, Index, Signature, TokenId, @@ -77,50 +55,31 @@ pub use pallet_issuance::IssuanceInfo; pub use pallet_sudo_origin; pub use pallet_xyk; // XCM Imports -use pallet_xyk::AssetMetadataMutationTrait; -use xyk_runtime_api::{RpcAmountsResult, XYKRpcResult}; +use xyk_runtime_api::RpcAssetMetadata; // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -pub const MGR_TOKEN_ID: TokenId = 0; -pub const ROC_TOKEN_ID: TokenId = 4; -pub const KAR_TOKEN_ID: TokenId = 6; -pub const TUR_TOKEN_ID: TokenId = 7; - -pub mod constants; -mod migration; mod weights; pub mod xcm_config; /// Block header type as expected by this runtime. -pub type Header = generic::HeaderVer; +pub type Header = runtime_types::Header; /// Block type as expected by this runtime. -pub type Block = generic::Block; +pub type Block = runtime_types::Block; /// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; +pub type SignedBlock = runtime_types::SignedBlock; /// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; +pub type BlockId = runtime_types::BlockId; /// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment_mangata::ChargeTransactionPayment, -); +pub type SignedExtra = runtime_types::SignedExtra; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; - +pub type SignedPayload = runtime_types::SignedPayload; /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; - +pub type UncheckedExtrinsic = runtime_types::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = runtime_types::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -129,8 +88,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (migration::XykRefactorMigration, migration::AssetRegistryMigration), - // () + common_runtime::migration::AssetRegistryMigration, >; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know @@ -138,17 +96,13 @@ pub type Executive = frame_executive::Executive< /// of data like extrinsics, allowing for them to continue syncing the network through upgrades /// to even the core data structures. pub mod opaque { - pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - use sp_runtime::{generic, traits::BlakeTwo256}; - use super::*; - /// Opaque block header type. - pub type Header = generic::HeaderVer; + pub type Header = runtime_types::Header; /// Opaque block type. - pub type Block = generic::Block; + pub type Block = runtime_types::OpaqueBlock; /// Opaque block identifier type. - pub type BlockId = generic::BlockId; + pub type BlockId = runtime_types::OpaqueBlockId; } impl_opaque_keys! { @@ -163,65 +117,14 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { impl_name: create_runtime_str!("mangata-parachain"), authoring_version: 14, - spec_version: 003000, + spec_version: 003100, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 003000, + transaction_version: 003100, state_version: 0, }; -mod currency { - use super::Balance; - - pub const MILLICENTS: Balance = CENTS / 1000; - pub const CENTS: Balance = DOLLARS / 100; // assume this is worth about a cent. - pub const DOLLARS: Balance = super::UNIT; - - pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 5000 * DOLLARS + (bytes as Balance) * 60 * CENTS - } -} - -/// This determines the average expected block time that we are targeting. -/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. -/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked -/// up by `pallet_aura` to implement `fn slot_duration()`. -/// -/// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 12000; - -// NOTE: Currently it is not possible to change the slot duration after the chain has started. -// Attempting to do so will brick block production. -pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; - -// Time is measured by number of blocks. -pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); -pub const HOURS: BlockNumber = MINUTES * 60; -pub const DAYS: BlockNumber = HOURS * 24; - -// Unit = the base number of indivisible units for balance -pub const UNIT: Balance = 1_000_000_000_000_000_000; -pub const MILLIUNIT: Balance = 1_000_000_000_000_000; -pub const MICROUNIT: Balance = 1_000_000_000_000; - -/// The existential deposit. Set to 1/10 of the Connected Relay Chain. -pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; - -/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is -/// used to limit the maximal weight of a single extrinsic. -const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); - -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by -/// `Operational` extrinsics. -const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); - -/// We allow for 0.5 of a second of compute with a 12 second average block time. -/// NOTE: reduced by half comparing to origin impl as we want to fill block only up to 50% -/// so there is room for new extrinsics in the next block -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( - WEIGHT_REF_TIME_PER_SECOND.saturating_div(4), - polkadot_primitives::v2::MAX_POV_SIZE as u64, -); +use common_runtime::consts::DAYS; /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] @@ -231,41 +134,9 @@ pub fn native_version() -> NativeVersion { parameter_types! { pub const Version: RuntimeVersion = VERSION; - - // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. - // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the - // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize - // the lazy contract deletion. - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(weights::VerBlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = weights::VerExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); - pub const SS58Prefix: u16 = 42; -} - -parameter_types! { - pub const MgrTokenId: TokenId = MGR_TOKEN_ID; - pub const RocTokenId: TokenId = ROC_TOKEN_ID; - pub const TurTokenId: TokenId = TUR_TOKEN_ID; } -// Configure FRAME pallets to include in runtime. +use common_runtime::config as cfg; impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. @@ -283,7 +154,7 @@ impl frame_system::Config for Runtime { /// The hashing algorithm used. type Hashing = BlakeTwo256; /// The header type. - type Header = generic::HeaderVer; + type Header = runtime_types::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -307,87 +178,51 @@ impl frame_system::Config for Runtime { /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = weights::frame_system_weights::ModuleWeight; /// Block & extrinsics weights: base values and limits. - type BlockWeights = RuntimeBlockWeights; + type BlockWeights = cfg::frame_system::RuntimeBlockWeights; /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; + type BlockLength = cfg::frame_system::RuntimeBlockLength; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; + type SS58Prefix = cfg::frame_system::SS58Prefix; /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; /// The maximum number of consumers allowed on a single account. - type MaxConsumers = frame_support::traits::ConstU32<16>; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; + type MaxConsumers = cfg::frame_system::MaxConsumers; } impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = cfg::pallet_timestamp::MinimumPeriod; type WeightInfo = weights::pallet_timestamp_weights::ModuleWeight; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type EventHandler = ParachainStaking; } -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * DOLLARS; - pub const ProposalBondMaximum: Option = None; - pub const SpendPeriod: BlockNumber = 1 * DAYS; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * DOLLARS; - pub const DataDepositPerByte: Balance = 1 * CENTS; - pub const BountyDepositBase: Balance = 1 * DOLLARS; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); - pub const BnbTreasurySubAccDerive: [u8; 4] = *b"bnbt"; - pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 5 * DOLLARS; - pub const MaxApprovals: u32 = 100; -} - impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryPalletId; - type Currency = orml_tokens::CurrencyAdapter; + type PalletId = cfg::pallet_treasury::TreasuryPalletId; + type Currency = orml_tokens::CurrencyAdapter; type ApproveOrigin = EnsureRoot; type RejectOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type ProposalBondMaximum = ProposalBondMaximum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; + type ProposalBond = cfg::pallet_treasury::ProposalBond; + type ProposalBondMinimum = cfg::pallet_treasury::ProposalBondMinimum; + type ProposalBondMaximum = cfg::pallet_treasury::ProposalBondMaximum; + type SpendPeriod = cfg::pallet_treasury::SpendPeriod; + type Burn = cfg::pallet_treasury::Burn; type BurnDestination = (); type SpendFunds = (); type WeightInfo = weights::pallet_treasury_weights::ModuleWeight; - type MaxApprovals = MaxApprovals; + type MaxApprovals = cfg::pallet_treasury::MaxApprovals; type SpendOrigin = frame_support::traits::NeverEnsureOrigin; } -parameter_type_with_key! { - pub ExistentialDeposits: |_currency_id: TokenId| -> Balance { - 0 - }; -} - parameter_types! { - pub TreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); - pub const MaxLocks: u32 = 50; + pub TreasuryAccount: AccountId = cfg::TreasuryPalletIdOf::::get().into_account_truncating(); } // The MaxLocks (on a who-token_id pair) that is allowed by orml_tokens @@ -395,854 +230,195 @@ parameter_types! { // This is because orml_tokens uses BoundedVec for Locks storage item and does not inform on failure // Balances uses WeakBoundedVec and so does not fail const_assert!( - MaxLocks::get() >= ::MAX_VESTING_SCHEDULES + cfg::orml_tokens::MaxLocks::get() >= + ::MAX_VESTING_SCHEDULES ); -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - *a == TreasuryAccount::get() - } -} - impl orml_tokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = TokenId; type WeightInfo = weights::orml_tokens_weights::ModuleWeight; - type ExistentialDeposits = ExistentialDeposits; - type MaxLocks = MaxLocks; - type DustRemovalWhitelist = DustRemovalWhitelist; + type ExistentialDeposits = cfg::orml_tokens::ExistentialDeposits; + type MaxLocks = cfg::orml_tokens::MaxLocks; + type DustRemovalWhitelist = + cfg::orml_tokens::DustRemovalWhitelist>; type CurrencyHooks = (); type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; -} - -pub struct RewardsMigrateAccountProvider(PhantomData); -impl Get for RewardsMigrateAccountProvider { - fn get() -> T::AccountId { - let account32: sp_runtime::AccountId32 = - hex_literal::hex!["0e33df23356eb2e9e3baf0e8a5faae15bc70a6a5cce88f651a9faf6e8e937324"] - .into(); - let mut init_account32 = sp_runtime::AccountId32::as_ref(&account32); - let init_account = T::AccountId::decode(&mut init_account32).unwrap(); - init_account - } -} - -pub struct AssetRegisterFilter; -impl Contains for AssetRegisterFilter { - fn contains(t: &TokenId) -> bool { - let meta: Option = orml_asset_registry::Metadata::::get(t); - if let Some(xyk) = meta.and_then(|m| m.additional.xyk) { - return xyk.operations_disabled - } - return false - } -} - -pub struct AssetMetadataMutation; -impl AssetMetadataMutationTrait for AssetMetadataMutation { - fn set_asset_info( - asset: TokenId, - name: Vec, - symbol: Vec, - decimals: u32, - ) -> DispatchResult { - let metadata = AssetMetadata { - name, - symbol, - decimals, - existential_deposit: Default::default(), - additional: Default::default(), - location: None, - }; - orml_asset_registry::Pallet::::do_register_asset_without_asset_processor( - metadata, asset, - )?; - Ok(()) - } + type ReserveIdentifier = cfg::orml_tokens::ReserveIdentifier; } -type SessionLenghtOf = ::BlocksPerRound; - impl pallet_xyk::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type ActivationReservesProvider = MultiPurposeLiquidity; type Currency = orml_tokens::MultiTokenCurrencyAdapter; - type NativeCurrencyId = MgrTokenId; - type TreasuryPalletId = TreasuryPalletId; - type BnbTreasurySubAccDerive = BnbTreasurySubAccDerive; - type PoolFeePercentage = frame_support::traits::ConstU128<20>; - type TreasuryFeePercentage = frame_support::traits::ConstU128<5>; - type BuyAndBurnFeePercentage = frame_support::traits::ConstU128<5>; + type NativeCurrencyId = tokens::MgxTokenId; + type TreasuryPalletId = cfg::TreasuryPalletIdOf; + type BnbTreasurySubAccDerive = cfg::pallet_xyk::BnbTreasurySubAccDerive; + type PoolFeePercentage = cfg::pallet_xyk::PoolFeePercentage; + type TreasuryFeePercentage = cfg::pallet_xyk::TreasuryFeePercentage; + type BuyAndBurnFeePercentage = cfg::pallet_xyk::BuyAndBurnFeePercentage; type LiquidityMiningRewards = ProofOfStake; type VestingProvider = Vesting; type DisallowedPools = Bootstrap; - type DisabledTokens = AssetRegisterFilter; - type AssetMetadataMutation = AssetMetadataMutation; + type DisabledTokens = cfg::pallet_xyk::AssetRegisterFilter; + type AssetMetadataMutation = cfg::pallet_xyk::AssetMetadataMutation; type WeightInfo = weights::pallet_xyk_weights::ModuleWeight; - type RewardsMigrateAccount = RewardsMigrateAccountProvider; } impl pallet_proof_of_stake::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ActivationReservesProvider = MultiPurposeLiquidity; - type NativeCurrencyId = MgrTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type Currency = orml_tokens::MultiTokenCurrencyAdapter; - type LiquidityMiningIssuanceVault = LiquidityMiningIssuanceVault; - type RewardsDistributionPeriod = SessionLenghtOf; + type LiquidityMiningIssuanceVault = cfg::pallet_issuance::LiquidityMiningIssuanceVault; + type RewardsDistributionPeriod = cfg::SessionLenghtOf; type WeightInfo = weights::pallet_proof_of_stake_weights::ModuleWeight; } -pub struct EnableAssetPoolApi; -impl AssetRegistryApi for EnableAssetPoolApi { - fn enable_pool_creation(assets: (TokenId, TokenId)) -> bool { - for &asset in [assets.0, assets.1].iter() { - let meta_maybe: Option = - orml_asset_registry::Metadata::::get(asset); - if let Some(xyk) = meta_maybe.clone().and_then(|m| m.additional.xyk) { - let mut additional = meta_maybe.unwrap().additional; - if xyk.operations_disabled { - additional.xyk = Some(XykMetadata { operations_disabled: false }); - match orml_asset_registry::Pallet::::do_update_asset( - asset, - None, - None, - None, - None, - None, - Some(additional), - ) { - Ok(_) => {}, - Err(e) => { - log::error!(target: "bootstrap", "cannot modify {} asset: {:?}!", asset, e); - return false - }, - } - } - } - } - true - } -} - -parameter_types! { - pub const BootstrapUpdateBuffer: BlockNumber = 300; - pub const DefaultBootstrapPromotedPoolWeight: u8 = 0u8; - pub const ClearStorageLimit: u32 = 100u32; -} - impl pallet_bootstrap::BootstrapBenchmarkingConfig for Runtime {} impl pallet_bootstrap::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type PoolCreateApi = Xyk; - type DefaultBootstrapPromotedPoolWeight = DefaultBootstrapPromotedPoolWeight; - type BootstrapUpdateBuffer = BootstrapUpdateBuffer; + type DefaultBootstrapPromotedPoolWeight = + cfg::pallet_bootstrap::DefaultBootstrapPromotedPoolWeight; + type BootstrapUpdateBuffer = cfg::pallet_bootstrap::BootstrapUpdateBuffer; type Currency = orml_tokens::MultiTokenCurrencyAdapter; type VestingProvider = Vesting; - type TreasuryPalletId = TreasuryPalletId; + type TreasuryPalletId = cfg::TreasuryPalletIdOf; type RewardsApi = ProofOfStake; - type ClearStorageLimit = ClearStorageLimit; + type ClearStorageLimit = cfg::pallet_bootstrap::ClearStorageLimit; type WeightInfo = weights::pallet_bootstrap_weights::ModuleWeight; - type AssetRegistryApi = EnableAssetPoolApi; -} - -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, -)] -pub struct DisallowedInBatch; - -impl Contains for DisallowedInBatch { - fn contains(c: &RuntimeCall) -> bool { - match c { - RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::compound_rewards { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::provide_liquidity_with_conversion { .. }) => true, - _ => false, - } - } + type AssetRegistryApi = cfg::pallet_bootstrap::EnableAssetPoolApi; } impl pallet_utility_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type DisallowedInBatch = DisallowedInBatch; + type DisallowedInBatch = cfg::pallet_utility_mangata::DisallowedInBatch; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility_mangata_weights::ModuleWeight; } -type ORMLCurrencyAdapterNegativeImbalance = - as MultiTokenCurrency< - AccountId, - >>::NegativeImbalance; - -pub trait OnMultiTokenUnbalanced< - Imbalance: frame_support::traits::TryDrop + MultiTokenImbalanceWithZeroTrait, -> -{ - /// Handler for some imbalances. The different imbalances might have different origins or - /// meanings, dependent on the context. Will default to simply calling on_unbalanced for all - /// of them. Infallible. - fn on_unbalanceds(token_id: TokenId, amounts: impl Iterator) - where - Imbalance: frame_support::traits::Imbalance, - { - Self::on_unbalanced(amounts.fold(Imbalance::from_zero(token_id), |i, x| x.merge(i))) - } - - /// Handler for some imbalance. Infallible. - fn on_unbalanced(amount: Imbalance) { - amount.try_drop().unwrap_or_else(Self::on_nonzero_unbalanced) - } - - /// Actually handle a non-zero imbalance. You probably want to implement this rather than - /// `on_unbalanced`. - fn on_nonzero_unbalanced(amount: Imbalance) { - drop(amount); - } -} - -pub struct ToAuthor; -impl OnMultiTokenUnbalanced for ToAuthor { - fn on_nonzero_unbalanced(amount: ORMLCurrencyAdapterNegativeImbalance) { - if let Some(author) = Authorship::author() { - as MultiTokenCurrency< - AccountId, - >>::resolve_creating(amount.0, &author, amount); - } - } -} - -#[derive(Encode, Decode, TypeInfo)] -pub enum LiquidityInfoEnum, T: frame_system::Config> { - Imbalance((TokenId, NegativeImbalanceOf)), - FeeLock, -} - -pub struct FeeHelpers(PhantomData<(T, C, OU, OCA, OFLA)>); -impl FeeHelpers -where - T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - OCA: OnChargeTransaction< - T, - LiquidityInfo = Option>, - Balance = ::AccountId>>::Balance, - >, - OFLA: FeeLockTriggerTrait<::AccountId>, - T: frame_system::Config, - T::AccountId: From + Into, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn handle_sell_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - sold_asset_id: u32, - sold_asset_amount: u128, - bought_asset_id: u32, - min_amount_out: u128, - ) -> Result>, TransactionValidityError> { - if fee_lock_metadata.is_whitelisted(sold_asset_id) || - fee_lock_metadata.is_whitelisted(bought_asset_id) - { - let (_, _, _, _, _, bought_asset_amount) = - ::pre_validate_sell_asset( - &who.clone().into(), - sold_asset_id, - bought_asset_id, - sold_asset_amount, - min_amount_out, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || - Self::is_high_value_swap( - &fee_lock_metadata, - bought_asset_id, - bought_asset_amount, - ) { - let _ = OFLA::unlock_fee(who); - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn is_high_value_swap( - fee_lock_metadata: &pallet_fee_lock::FeeLockMetadataInfo, - asset_id: u32, - asset_amount: u128, - ) -> bool { - if let (true, Some(valuation)) = ( - fee_lock_metadata.is_whitelisted(asset_id), - OFLA::get_swap_valuation_for_token(asset_id, asset_amount), - ) { - valuation >= fee_lock_metadata.swap_value_threshold - } else { - false - } - } - - fn handle_buy_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - sold_asset_id: u32, - bought_asset_amount: u128, - bought_asset_id: u32, - max_amount_in: u128, - ) -> Result>, TransactionValidityError> { - if fee_lock_metadata.is_whitelisted(sold_asset_id) || - fee_lock_metadata.is_whitelisted(bought_asset_id) - { - let (_, _, _, _, _, sold_asset_amount) = - ::pre_validate_buy_asset( - &who.clone().into(), - sold_asset_id, - bought_asset_id, - bought_asset_amount, - max_amount_in, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - if Self::is_high_value_swap(&fee_lock_metadata, sold_asset_id, sold_asset_amount) || - Self::is_high_value_swap( - &fee_lock_metadata, - bought_asset_id, - bought_asset_amount, - ) { - let _ = OFLA::unlock_fee(who); - } else { - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - } else { - // "swap on non-curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - } - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn handle_multiswap_buy_asset( - who: &T::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - swap_token_list: Vec, - bought_asset_amount: u128, - max_amount_in: u128, - ) -> Result>, TransactionValidityError> { - // ensure swap cannot fail - // This is to ensure that xyk swap fee is always charged - // We also ensure that the user has enough funds to transact - let _ = ::pre_validate_multiswap_buy_asset( - &who.clone().into(), - swap_token_list, - bought_asset_amount, - max_amount_in, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - - // This is the "low value swap on curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - } - - fn handle_multiswap_sell_asset( - who: &::AccountId, - fee_lock_metadata: pallet_fee_lock::FeeLockMetadataInfo, - swap_token_list: Vec, - sold_asset_amount: u128, - min_amount_out: u128, - ) -> Result>, TransactionValidityError> { - // ensure swap cannot fail - // This is to ensure that xyk swap fee is always charged - // We also ensure that the user has enough funds to transact - let _ = ::pre_validate_multiswap_sell_asset( - &who.clone().into(), - swap_token_list.clone(), - sold_asset_amount, - min_amount_out, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::SwapPrevalidation.into()) - })?; - - // This is the "low value swap on curated token" branch - OFLA::process_fee_lock(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::ProcessFeeLock.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - } -} - -const SINGLE_HOP_MULTISWAP: usize = 2; -#[derive(Encode, Decode, Clone, TypeInfo)] -pub struct OnChargeHandler(PhantomData<(C, OU, OCA, OFLA)>); +use cfg::pallet_transaction_payment_mangata::{ + FeeHelpers, OnChargeHandler, ThreeCurrencyOnChargeAdapter, ToAuthor, TriggerEvent, +}; -/// Default implementation for a Currency and an OnUnbalanced handler. -/// -/// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and -/// then tip. -impl OnChargeTransaction for OnChargeHandler +// TODO: renaming foo causes compiler error +pub struct Foo(PhantomData); +impl TriggerEvent for Foo where - T: pallet_transaction_payment_mangata::Config + pallet_xyk::Config + pallet_fee_lock::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - OCA: OnChargeTransaction< - T, - LiquidityInfo = Option>, - Balance = ::AccountId>>::Balance, - >, - OFLA: FeeLockTriggerTrait<::AccountId>, - T: frame_system::Config, - T::AccountId: From + Into, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, + T: frame_system::Config, { - type LiquidityInfo = Option>; - type Balance = ::AccountId>>::Balance; - - /// Withdraw the predicted fee from the transaction origin. - /// - /// Note: The `fee` already includes the `tip`. - fn withdraw_fee( - who: &T::AccountId, - call: &T::RuntimeCall, - info: &DispatchInfoOf, - fee: Self::Balance, - tip: Self::Balance, - ) -> Result { - match call { - RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { .. }) | - RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { .. }) => ensure!( - tip.is_zero(), - TransactionValidityError::Invalid( - InvalidTransaction::TippingNotAllowedForSwaps.into(), - ) - ), - _ => {}, - }; - - // THIS IS NOT PROXY PALLET COMPATIBLE, YET - // Also ugly implementation to keep it maleable for now - match (call, pallet_fee_lock::FeeLockMetadata::::get()) { - (RuntimeCall::Xyk(xyk_call), Some(fee_lock_metadata)) => match xyk_call { - pallet_xyk::Call::sell_asset { - sold_asset_id, - sold_asset_amount, - bought_asset_id, - min_amount_out, - .. - } => FeeHelpers::::handle_sell_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *sold_asset_amount, - *bought_asset_id, - *min_amount_out, - ), - - pallet_xyk::Call::buy_asset { - sold_asset_id, - bought_asset_amount, - bought_asset_id, - max_amount_in, - .. - } => FeeHelpers::::handle_buy_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *bought_asset_amount, - *bought_asset_id, - *max_amount_in, - ), - - pallet_xyk::Call::multiswap_buy_asset { - swap_token_list, - bought_asset_amount, - max_amount_in, - .. - } => - if swap_token_list.len() == SINGLE_HOP_MULTISWAP { - let sold_asset_id = - swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - let bought_asset_id = - swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - FeeHelpers::::handle_buy_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *bought_asset_amount, - *bought_asset_id, - *max_amount_in, - ) - } else { - FeeHelpers::::handle_multiswap_buy_asset( - who, - fee_lock_metadata, - swap_token_list.clone(), - *bought_asset_amount, - *max_amount_in, - ) - }, - - pallet_xyk::Call::multiswap_sell_asset { - swap_token_list, - sold_asset_amount, - min_amount_out, - .. - } => - if swap_token_list.len() == SINGLE_HOP_MULTISWAP { - let sold_asset_id = - swap_token_list.get(0).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - let bought_asset_id = - swap_token_list.get(1).ok_or(TransactionValidityError::Invalid( - InvalidTransaction::SwapPrevalidation.into(), - ))?; - FeeHelpers::::handle_sell_asset( - who, - fee_lock_metadata, - *sold_asset_id, - *sold_asset_amount, - *bought_asset_id, - *min_amount_out, - ) - } else { - FeeHelpers::::handle_multiswap_sell_asset( - who, - fee_lock_metadata, - swap_token_list.clone(), - *sold_asset_amount, - *min_amount_out, - ) - }, - _ => OCA::withdraw_fee(who, call, info, fee, tip), - }, - (RuntimeCall::FeeLock(pallet_fee_lock::Call::unlock_fee { .. }), _) => { - let imb = C::withdraw( - MgrTokenId::get().into(), - who, - Balance::from(tip).into(), - WithdrawReasons::TIP, - ExistenceRequirement::KeepAlive, - ) - .map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::Payment.into()) - })?; - - OU::on_unbalanceds(MgrTokenId::get().into(), Some(imb).into_iter()); - TransactionPayment::deposit_event(pallet_transaction_payment_mangata::Event::< - Runtime, - >::TransactionFeePaid { - who: sp_runtime::AccountId32::from(who.clone()), - actual_fee: Balance::zero().into(), - tip: Balance::from(tip), - }); - - OFLA::can_unlock_fee(who).map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::UnlockFee.into()) - })?; - Ok(Some(LiquidityInfoEnum::FeeLock)) - }, - _ => OCA::withdraw_fee(who, call, info, fee, tip), - } - } - - /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. - /// Since the predicted fee might have been too high, parts of the fee may - /// be refunded. - /// - /// Note: The `corrected_fee` already includes the `tip`. - fn correct_and_deposit_fee( - who: &T::AccountId, - dispatch_info: &DispatchInfoOf, - post_info: &PostDispatchInfoOf, - corrected_fee: Self::Balance, - tip: Self::Balance, - already_withdrawn: Self::LiquidityInfo, - ) -> Result<(), TransactionValidityError> { - match already_withdrawn { - Some(LiquidityInfoEnum::Imbalance(_)) => OCA::correct_and_deposit_fee( + fn trigger(who: T::AccountId, fee: u128, tip: u128) { + TransactionPayment::deposit_event( + pallet_transaction_payment_mangata::Event::::TransactionFeePaid { who, - dispatch_info, - post_info, - corrected_fee, + actual_fee: fee, tip, - already_withdrawn, - ), - Some(LiquidityInfoEnum::FeeLock) => Ok(()), - None => Ok(()), - } + }, + ); } } -parameter_types! { - pub const TransactionByteFee: Balance = 5 * MILLIUNIT; - pub const OperationalFeeMultiplier: u8 = 5; -} - -#[derive(Encode, Decode, Clone, TypeInfo)] -pub struct ThreeCurrencyOnChargeAdapter( - PhantomData<(C, OU, T1, T2, T3, SF2, SF3)>, -); - -type NegativeImbalanceOf = - ::AccountId>>::NegativeImbalance; - -/// Default implementation for a Currency and an OnUnbalanced handler. -/// -/// The unbalance handler is given 2 unbalanceds in [`OnUnbalanced::on_unbalanceds`]: fee and -/// then tip. -impl OnChargeTransaction - for ThreeCurrencyOnChargeAdapter -where - T: pallet_transaction_payment_mangata::Config, - T::LengthToFee: frame_support::weights::WeightToFee< - Balance = ::AccountId>>::Balance, - >, - C: MultiTokenCurrency<::AccountId>, - C::PositiveImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::NegativeImbalance, - >, - C::NegativeImbalance: Imbalance< - ::AccountId>>::Balance, - Opposite = C::PositiveImbalance, - >, - OU: OnMultiTokenUnbalanced>, - NegativeImbalanceOf: MultiTokenImbalanceWithZeroTrait, - ::AccountId>>::Balance: - scale_info::TypeInfo, - T1: Get, - T2: Get, - T3: Get, - SF2: Get, - SF3: Get, - Balance: From<::AccountId>>::Balance>, - sp_runtime::AccountId32: From<::AccountId>, -{ - type LiquidityInfo = Option>; - type Balance = ::AccountId>>::Balance; - - /// Withdraw the predicted fee from the transaction origin. - /// - /// Note: The `fee` already includes the `tip`. - fn withdraw_fee( - who: &T::AccountId, - _call: &T::RuntimeCall, - _info: &DispatchInfoOf, - fee: Self::Balance, - tip: Self::Balance, - ) -> Result { - if fee.is_zero() { - return Ok(None) - } - - let withdraw_reason = if tip.is_zero() { - WithdrawReasons::TRANSACTION_PAYMENT - } else { - WithdrawReasons::TRANSACTION_PAYMENT | WithdrawReasons::TIP - }; - - match C::withdraw( - T1::get().into(), - who, - fee, - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T1::get(), imbalance)))), - // TODO make sure atleast 1 planck KSM is charged - Err(_) => match C::withdraw( - T2::get().into(), - who, - fee / SF2::get().into(), - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T2::get(), imbalance)))), - Err(_) => match C::withdraw( - T3::get().into(), - who, - fee / SF3::get().into(), - withdraw_reason, - ExistenceRequirement::KeepAlive, - ) { - Ok(imbalance) => Ok(Some(LiquidityInfoEnum::Imbalance((T3::get(), imbalance)))), - Err(_) => Err(InvalidTransaction::Payment.into()), - }, +impl Into for RuntimeCall { + fn into(self) -> CallType { + match self { + RuntimeCall::Xyk(pallet_xyk::Call::sell_asset { + sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out, + .. + }) => CallType::AtomicSell { + sold_asset_id, + sold_asset_amount, + bought_asset_id, + min_amount_out, }, + RuntimeCall::Xyk(pallet_xyk::Call::buy_asset { + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in, + .. + }) => CallType::AtomicBuy { + sold_asset_id, + bought_asset_amount, + bought_asset_id, + max_amount_in, + }, + RuntimeCall::Xyk(pallet_xyk::Call::multiswap_sell_asset { + swap_token_list, + sold_asset_amount, + min_amount_out, + .. + }) => CallType::MultiSell { swap_token_list, sold_asset_amount, min_amount_out }, + RuntimeCall::Xyk(pallet_xyk::Call::multiswap_buy_asset { + swap_token_list, + bought_asset_amount, + max_amount_in, + .. + }) => CallType::MultiBuy { swap_token_list, bought_asset_amount, max_amount_in }, + RuntimeCall::Xyk(pallet_xyk::Call::compound_rewards { .. }) => + CallType::CompoundRewards, + RuntimeCall::Xyk(pallet_xyk::Call::provide_liquidity_with_conversion { .. }) => + CallType::ProvideLiquidityWithConversion, + RuntimeCall::FeeLock(pallet_fee_lock::Call::unlock_fee { .. }) => CallType::UnlockFee, + _ => CallType::Other, } } - - /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. - /// Since the predicted fee might have been too high, parts of the fee may - /// be refunded. - /// - /// Note: The `corrected_fee` already includes the `tip`. - fn correct_and_deposit_fee( - who: &T::AccountId, - _dispatch_info: &DispatchInfoOf, - _post_info: &PostDispatchInfoOf, - corrected_fee: Self::Balance, - tip: Self::Balance, - already_withdrawn: Self::LiquidityInfo, - ) -> Result<(), TransactionValidityError> { - if let Some(LiquidityInfoEnum::Imbalance((token_id, paid))) = already_withdrawn { - let (corrected_fee, tip) = if token_id == T3::get() { - (corrected_fee / SF3::get().into(), tip / SF3::get().into()) - } else if token_id == T2::get() { - (corrected_fee / SF2::get().into(), tip / SF2::get().into()) - } else { - (corrected_fee, tip) - }; - // Calculate how much refund we should return - let refund_amount = paid.peek().saturating_sub(corrected_fee); - // refund to the the account that paid the fees. If this fails, the - // account might have dropped below the existential balance. In - // that case we don't refund anything. - let refund_imbalance = C::deposit_into_existing(token_id.into(), &who, refund_amount) - .unwrap_or_else(|_| C::PositiveImbalance::from_zero(token_id.into())); - // merge the imbalance caused by paying the fees and refunding parts of it again. - let adjusted_paid = paid - .offset(refund_imbalance) - .same() - .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; - // Call someone else to handle the imbalance (fee and tip separately) - let (tip_imb, fee) = adjusted_paid.split(tip); - OU::on_unbalanceds(token_id, Some(fee).into_iter().chain(Some(tip_imb))); - TransactionPayment::deposit_event( - pallet_transaction_payment_mangata::Event::::TransactionFeePaid { - who: sp_runtime::AccountId32::from(who.clone()), - actual_fee: corrected_fee.into(), - tip: Balance::from(tip), - }, - ); - } - Ok(()) - } } -parameter_types! { - pub ConstFeeMultiplierValue: Multiplier = Multiplier::saturating_from_rational(1, 1); -} +pub type OnChargeTransactionHandler = ThreeCurrencyOnChargeAdapter< + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + tokens::MgxTokenId, + tokens::RelayTokenId, + tokens::TurTokenId, + frame_support::traits::ConstU128<{ common_runtime::constants::fee::RELAY_MGX_SCALE_FACTOR }>, + frame_support::traits::ConstU128<{ common_runtime::constants::fee::TUR_MGR_SCALE_FACTOR }>, + Foo, +>; impl pallet_transaction_payment_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = OnChargeHandler< orml_tokens::MultiTokenCurrencyAdapter, - ToAuthor, - ThreeCurrencyOnChargeAdapter< - orml_tokens::MultiTokenCurrencyAdapter, - ToAuthor, - MgrTokenId, - RocTokenId, - TurTokenId, - frame_support::traits::ConstU128, - frame_support::traits::ConstU128, - >, + ToAuthor, + OnChargeTransactionHandler, FeeLock, >; - type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = WeightToFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = ConstFeeMultiplier; -} - -parameter_types! { - pub const MaxCuratedTokens: u32 = 100; + type OperationalFeeMultiplier = + cfg::pallet_transaction_payment_mangata::OperationalFeeMultiplier; + type WeightToFee = common_runtime::constants::fee::WeightToFee; + type LengthToFee = cfg::pallet_transaction_payment_mangata::LengthToFee; + type FeeMultiplierUpdate = cfg::pallet_transaction_payment_mangata::FeeMultiplierUpdate; } impl pallet_fee_lock::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxCuratedTokens = MaxCuratedTokens; + type MaxCuratedTokens = cfg::pallet_fee_lock::MaxCuratedTokens; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type PoolReservesProvider = Xyk; - type NativeTokenId = MgrTokenId; + type NativeTokenId = tokens::MgxTokenId; type WeightInfo = weights::pallet_fee_lock_weights::ModuleWeight; } -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); -} - impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; type OnSystemEvent = (); type SelfParaId = ParachainInfo; type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; + type ReservedDmpWeight = cfg::cumulus_pallet_parachain_system::ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; + type ReservedXcmpWeight = cfg::cumulus_pallet_parachain_system::ReservedXcmpWeight; type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::AnyRelayNumber; } @@ -1250,12 +426,6 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -parameter_types! { - pub const Period: u32 = 6 * HOURS; - pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; -} - impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = ::AccountId; @@ -1273,7 +443,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = cfg::pallet_aura::MaxAuthorities; } impl pallet_sudo_mangata::Config for Runtime { @@ -1284,8 +454,7 @@ impl pallet_sudo_mangata::Config for Runtime { impl pallet_sudo_origin::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type SudoOrigin = - pallet_collective_mangata::EnsureProportionMoreThan; + type SudoOrigin = cfg::pallet_sudo_origin::SudoOrigin; } #[cfg(not(feature = "fast-runtime"))] @@ -1295,7 +464,7 @@ parameter_types! { #[cfg(feature = "fast-runtime")] parameter_types! { - pub const CouncilProposalCloseDelay: BlockNumber = 6 * MINUTES; + pub const CouncilProposalCloseDelay: BlockNumber = 6 * common_runtime::consts::MINUTES; } parameter_types! { @@ -1309,99 +478,47 @@ impl pallet_collective_mangata::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type MotionDuration = CouncilMotionDuration; - type ProposalCloseDelay = CouncilProposalCloseDelay; - type MaxProposals = CouncilMaxProposals; - type MaxMembers = CouncilMaxMembers; - type FoundationAccountsProvider = FoundationAccountsProvider; + type MotionDuration = cfg::pallet_collective_mangata::CouncilMotionDuration; + type ProposalCloseDelay = cfg::pallet_collective_mangata::CouncilProposalCloseDelay; + type MaxProposals = cfg::pallet_collective_mangata::CouncilMaxProposals; + type MaxMembers = cfg::pallet_collective_mangata::CouncilMaxMembers; + type FoundationAccountsProvider = cfg::pallet_maintenance::FoundationAccountsProvider; type DefaultVote = pallet_collective_mangata::PrimeDefaultVote; type WeightInfo = weights::pallet_collective_mangata_weights::ModuleWeight; } -#[cfg(feature = "fast-runtime")] -parameter_types! { - /// Default SessionLenght is every 2 minutes (10 * 12 second block times) - pub const BlocksPerRound: u32 = 2 * MINUTES; -} - -#[cfg(not(feature = "fast-runtime"))] -parameter_types! { - /// Default SessionLenght is every 4 hours (1200 * 12 second block times) - pub const BlocksPerRound: u32 = 4 * HOURS; -} - -parameter_types! { - /// Collator candidate exit delay (number of rounds) - pub const LeaveCandidatesDelay: u32 = 2; - /// Collator candidate bond increases/decreases delay (number of rounds) - pub const CandidateBondDelay: u32 = 2; - /// Delegator exit delay (number of rounds) - pub const LeaveDelegatorsDelay: u32 = 2; - /// Delegation revocations delay (number of rounds) - pub const RevokeDelegationDelay: u32 = 2; - /// Delegation bond increases/decreases delay (number of rounds) - pub const DelegationBondDelay: u32 = 2; - /// Reward payments delay (number of rounds) - pub const RewardPaymentDelay: u32 = 2; - /// Minimum collators selected per round, default at genesis and minimum forever after - pub const MinSelectedCandidates: u32 = 25; - /// Maximum collator candidates allowed - pub const MaxCollatorCandidates: u32 = 50; - /// Maximum delegators allowed per candidate - pub const MaxTotalDelegatorsPerCandidate: u32 = 25; - /// Maximum delegators counted per candidate - pub const MaxDelegatorsPerCandidate: u32 = 12; - /// Maximum delegations per delegator - pub const MaxDelegationsPerDelegator: u32 = 30; - /// Default fixed percent a collator takes off the top of due rewards - pub const DefaultCollatorCommission: Perbill = Perbill::from_percent(20); - /// Minimum stake required to become a collator - pub const MinCollatorStk: u128 = 10 * DOLLARS; - /// Minimum stake required to be reserved to be a candidate - pub const MinCandidateStk: u128 = if cfg!(feature = "runtime-benchmarks") { - // For benchmarking - 1 * DOLLARS - } else { - // ACTUAL - 1_500_000 * DOLLARS - }; - /// Minimum stake required to be reserved to be a delegator - pub const MinDelegatorStk: u128 = 1 * CENTS; - pub const DefaultPayoutLimit: u32 = 3; -} - // To ensure that BlocksPerRound is not zero, breaking issuance calculations // Also since 1 block is used for session change, atleast 1 block more needed for extrinsics to work -const_assert!(BlocksPerRound::get() >= 2); +const_assert!(::BlocksPerRound::get() >= 2); impl parachain_staking::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StakingReservesProvider = MultiPurposeLiquidity; type Currency = orml_tokens::MultiTokenCurrencyAdapter; type MonetaryGovernanceOrigin = EnsureRoot; - type BlocksPerRound = BlocksPerRound; - type LeaveCandidatesDelay = LeaveCandidatesDelay; - type CandidateBondDelay = CandidateBondDelay; - type LeaveDelegatorsDelay = LeaveDelegatorsDelay; - type RevokeDelegationDelay = RevokeDelegationDelay; - type DelegationBondDelay = DelegationBondDelay; - type RewardPaymentDelay = RewardPaymentDelay; - type MinSelectedCandidates = MinSelectedCandidates; - type MaxCollatorCandidates = MaxCollatorCandidates; - type MaxTotalDelegatorsPerCandidate = MaxTotalDelegatorsPerCandidate; - type MaxDelegatorsPerCandidate = MaxDelegatorsPerCandidate; - type MaxDelegationsPerDelegator = MaxDelegationsPerDelegator; - type DefaultCollatorCommission = DefaultCollatorCommission; - type MinCollatorStk = MinCollatorStk; - type MinCandidateStk = MinCandidateStk; - type MinDelegation = MinDelegatorStk; - type NativeTokenId = MgrTokenId; + type BlocksPerRound = cfg::parachain_staking::BlocksPerRound; + type LeaveCandidatesDelay = cfg::parachain_staking::LeaveCandidatesDelay; + type CandidateBondDelay = cfg::parachain_staking::CandidateBondDelay; + type LeaveDelegatorsDelay = cfg::parachain_staking::LeaveDelegatorsDelay; + type RevokeDelegationDelay = cfg::parachain_staking::RevokeDelegationDelay; + type DelegationBondDelay = cfg::parachain_staking::DelegationBondDelay; + type RewardPaymentDelay = cfg::parachain_staking::RewardPaymentDelay; + type MinSelectedCandidates = cfg::parachain_staking::MinSelectedCandidates; + type MaxCollatorCandidates = cfg::parachain_staking::MaxCollatorCandidates; + type MaxTotalDelegatorsPerCandidate = cfg::parachain_staking::MaxTotalDelegatorsPerCandidate; + type MaxDelegatorsPerCandidate = cfg::parachain_staking::MaxDelegatorsPerCandidate; + type MaxDelegationsPerDelegator = cfg::parachain_staking::MaxDelegationsPerDelegator; + type DefaultCollatorCommission = cfg::parachain_staking::DefaultCollatorCommission; + type MinCollatorStk = cfg::parachain_staking::MinCollatorStk; + type MinCandidateStk = cfg::parachain_staking::MinCandidateStk; + type MinDelegation = cfg::parachain_staking::MinDelegatorStk; + type NativeTokenId = tokens::MgxTokenId; type StakingLiquidityTokenValuator = Xyk; type Issuance = Issuance; - type StakingIssuanceVault = StakingIssuanceVault; + type StakingIssuanceVault = cfg::parachain_staking::StakingIssuanceVaultOf; type FallbackProvider = Council; type WeightInfo = weights::parachain_staking_weights::ModuleWeight; - type DefaultPayoutLimit = DefaultPayoutLimit; + type DefaultPayoutLimit = cfg::parachain_staking::DefaultPayoutLimit; } impl pallet_xyk::XykBenchmarkingConfig for Runtime {} @@ -1413,95 +530,68 @@ impl parachain_staking::StakingBenchmarkConfig for Runtime { type Xyk = Xyk; } -parameter_types! { - pub const HistoryLimit: u32 = 10u32; - - pub const LiquidityMiningIssuanceVaultId: PalletId = PalletId(*b"py/lqmiv"); - pub LiquidityMiningIssuanceVault: AccountId = LiquidityMiningIssuanceVaultId::get().into_account_truncating(); - pub const StakingIssuanceVaultId: PalletId = PalletId(*b"py/stkiv"); - pub StakingIssuanceVault: AccountId = StakingIssuanceVaultId::get().into_account_truncating(); - - pub const TotalCrowdloanAllocation: Balance = 330_000_000 * DOLLARS; - pub const IssuanceCap: Balance = 4_000_000_000 * DOLLARS; - pub const LinearIssuanceBlocks: u32 = 13_140_000u32; // 5 years - pub const LiquidityMiningSplit: Perbill = Perbill::from_parts(555555556); - pub const StakingSplit: Perbill = Perbill::from_parts(444444444); - pub const ImmediateTGEReleasePercent: Percent = Percent::from_percent(20); - pub const TGEReleasePeriod: u32 = 5_256_000u32; // 2 years - pub const TGEReleaseBegin: u32 = 100_800u32; // Two weeks into chain start -} - // Issuance history must be kept for atleast the staking reward delay -const_assert!(RewardPaymentDelay::get() <= HistoryLimit::get()); +const_assert!( + ::RewardPaymentDelay::get() <= + ::HistoryLimit::get() +); impl pallet_issuance::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type NativeCurrencyId = MgrTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type BlocksPerRound = BlocksPerRound; - type HistoryLimit = HistoryLimit; - type LiquidityMiningIssuanceVault = LiquidityMiningIssuanceVault; - type StakingIssuanceVault = StakingIssuanceVault; - type TotalCrowdloanAllocation = TotalCrowdloanAllocation; - type IssuanceCap = IssuanceCap; - type LinearIssuanceBlocks = LinearIssuanceBlocks; - type LiquidityMiningSplit = LiquidityMiningSplit; - type StakingSplit = StakingSplit; - type ImmediateTGEReleasePercent = ImmediateTGEReleasePercent; - type TGEReleasePeriod = TGEReleasePeriod; - type TGEReleaseBegin = TGEReleaseBegin; + type BlocksPerRound = cfg::parachain_staking::BlocksPerRound; + type HistoryLimit = cfg::pallet_issuance::HistoryLimit; + type LiquidityMiningIssuanceVault = cfg::pallet_issuance::LiquidityMiningIssuanceVault; + type StakingIssuanceVault = cfg::pallet_issuance::StakingIssuanceVault; + type TotalCrowdloanAllocation = cfg::pallet_issuance::TotalCrowdloanAllocation; + type IssuanceCap = cfg::pallet_issuance::IssuanceCap; + type LinearIssuanceBlocks = cfg::pallet_issuance::LinearIssuanceBlocks; + type LiquidityMiningSplit = cfg::pallet_issuance::LiquidityMiningSplit; + type StakingSplit = cfg::pallet_issuance::StakingSplit; + type ImmediateTGEReleasePercent = cfg::pallet_issuance::ImmediateTGEReleasePercent; + type TGEReleasePeriod = cfg::pallet_issuance::TGEReleasePeriod; + type TGEReleaseBegin = cfg::pallet_issuance::TGEReleaseBegin; type VestingProvider = Vesting; type WeightInfo = weights::pallet_issuance_weights::ModuleWeight; type LiquidityMiningApi = ProofOfStake; } -parameter_types! { - pub const MinVestedTransfer: Balance = 100 * DOLLARS; -} - impl pallet_vesting_mangata::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type BlockNumberToBalance = ConvertInto; - type MinVestedTransfer = MinVestedTransfer; + type MinVestedTransfer = cfg::pallet_vesting_mangata::MinVestedTransfer; type WeightInfo = weights::pallet_vesting_mangata_weights::ModuleWeight; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the // highest number of schedules that encodes less than 2^10. const MAX_VESTING_SCHEDULES: u32 = 50; } -parameter_types! { - pub const Initialized: bool = false; - pub const InitializationPayment: Perbill = Perbill::from_parts(214285700); - pub const MaxInitContributorsBatchSizes: u32 = 100; - pub const MinimumReward: Balance = 0; - pub const RelaySignaturesThreshold: Perbill = Perbill::from_percent(100); - pub const SigantureNetworkIdentifier: &'static [u8] = b"mangata-"; -} - impl pallet_crowdloan_rewards::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Initialized = Initialized; - type InitializationPayment = InitializationPayment; - type MaxInitContributors = MaxInitContributorsBatchSizes; - type MinimumReward = MinimumReward; - type RewardAddressRelayVoteThreshold = RelaySignaturesThreshold; - type NativeTokenId = MgrTokenId; + type Initialized = cfg::pallet_crowdloan_rewards::Initialized; + type InitializationPayment = cfg::pallet_crowdloan_rewards::InitializationPayment; + type MaxInitContributors = cfg::pallet_crowdloan_rewards::MaxInitContributorsBatchSizes; + type MinimumReward = cfg::pallet_crowdloan_rewards::MinimumReward; + type RewardAddressRelayVoteThreshold = cfg::pallet_crowdloan_rewards::RelaySignaturesThreshold; + type NativeTokenId = tokens::MgxTokenId; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; type RelayChainAccountId = sp_runtime::AccountId32; type RewardAddressChangeOrigin = EnsureRoot; - type SignatureNetworkIdentifier = SigantureNetworkIdentifier; + type SignatureNetworkIdentifier = cfg::pallet_crowdloan_rewards::SigantureNetworkIdentifier; type RewardAddressAssociateOrigin = EnsureRoot; type VestingBlockNumber = BlockNumber; type VestingBlockProvider = System; + type VestingProvider = Vesting; type WeightInfo = weights::pallet_crowdloan_rewards_weights::ModuleWeight; } impl pallet_multipurpose_liquidity::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxRelocks = MaxLocks; + type MaxRelocks = cfg::MaxLocksOf; type Tokens = orml_tokens::MultiTokenCurrencyAdapter; - type NativeCurrencyId = MgrTokenId; + type NativeCurrencyId = tokens::MgxTokenId; type VestingProvider = Vesting; type Xyk = Xyk; type WeightInfo = weights::pallet_multipurpose_liquidity_weights::ModuleWeight; @@ -1518,90 +608,20 @@ impl orml_xcm::Config for Runtime { impl pallet_root_testing::Config for Runtime {} -pub type AssetMetadataOf = AssetMetadata; -type CurrencyAdapter = orml_tokens::MultiTokenCurrencyAdapter; - -pub struct SequentialIdWithCreation(PhantomData); -impl AssetProcessor - for SequentialIdWithCreation -{ - fn pre_register( - id: Option, - asset_metadata: AssetMetadataOf, - ) -> Result<(TokenId, AssetMetadataOf), DispatchError> { - let next_id = CurrencyAdapter::get_next_currency_id(); - let asset_id = id.unwrap_or(next_id); - match asset_id.cmp(&next_id) { - Ordering::Equal => CurrencyAdapter::create(&TreasuryAccount::get(), Default::default()) - .and_then(|created_asset_id| match created_asset_id.cmp(&asset_id) { - Ordering::Equal => Ok((asset_id, asset_metadata)), - _ => Err(orml_asset_registry::Error::::InvalidAssetId.into()), - }), - Ordering::Less => Ok((asset_id, asset_metadata)), - _ => Err(orml_asset_registry::Error::::InvalidAssetId.into()), - } - } -} - -pub struct AssetAuthority; -impl EnsureOriginWithArg> for AssetAuthority { - type Success = (); - - fn try_origin( - origin: RuntimeOrigin, - _asset_id: &Option, - ) -> Result { - EnsureRoot::try_origin(origin) - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_asset_id: &Option) -> Result { - Ok(RuntimeOrigin::root()) - } -} +use common_runtime::config::orml_asset_registry::AssetMetadataOf; impl orml_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type CustomMetadata = CustomMetadata; type AssetId = TokenId; - type AuthorityOrigin = AssetAuthority; - type AssetProcessor = SequentialIdWithCreation; + type AuthorityOrigin = cfg::orml_asset_registry::AssetAuthority; + type AssetProcessor = cfg::orml_asset_registry::SequentialIdWithCreation; type Balance = Balance; type WeightInfo = weights::orml_asset_registry_weights::ModuleWeight; } +use cfg::pallet_proxy::ProxyType; -// Proxy Pallet -/// The type used to represent the kinds of proxying allowed. -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, -)] -pub enum ProxyType { - AutoCompound, -} - -impl Default for ProxyType { - fn default() -> Self { - Self::AutoCompound - } -} - -parameter_types! { - pub const ProxyDepositBase: Balance = deposit(1, 16); - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const AnnouncementDepositBase: Balance = deposit(1, 16); - pub const AnnouncementDepositFactor: Balance = deposit(0, 68); -} - +// TODO: ideally should be moved to common runtime impl InstanceFilter for ProxyType { fn filter(&self, c: &RuntimeCall) -> bool { match self { @@ -1626,72 +646,36 @@ impl InstanceFilter for ProxyType { impl pallet_proxy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type Currency = orml_tokens::CurrencyAdapter; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; + type Currency = orml_tokens::CurrencyAdapter; + type ProxyType = cfg::pallet_proxy::ProxyType; + type ProxyDepositBase = cfg::pallet_proxy::ProxyDepositBase; + type ProxyDepositFactor = cfg::pallet_proxy::ProxyDepositFactor; type MaxProxies = frame_support::traits::ConstU32<32>; type WeightInfo = pallet_proxy::weights::SubstrateWeight; type MaxPending = frame_support::traits::ConstU32<32>; type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; + type AnnouncementDepositBase = cfg::pallet_proxy::AnnouncementDepositBase; + type AnnouncementDepositFactor = cfg::pallet_proxy::AnnouncementDepositFactor; } -parameter_types! { - // Add item in storage and take 270 bytes, Registry { [], Balance, Info { [], [u8,32] * 7, [u8,20] }} - pub const BasicDeposit: Balance = deposit(1, 270); - // No item in storage, extra field takes 66 bytes, ([u8,32], [u8,32]) - pub const FieldDeposit: Balance = deposit(0, 66); - // Add item in storage, and takes 97 bytes, AccountId + (AccountId, [u8,32]) - pub const SubAccountDeposit: Balance = deposit(1, 97); - pub const MaxSubAccounts: u32 = 100; - pub const MaxAdditionalFields: u32 = 100; - pub const MaxRegistrars: u32 = 20; -} - -type IdentityForceOrigin = EnsureRoot; -type IdentityRegistrarOrigin = EnsureRoot; - impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Currency = orml_tokens::CurrencyAdapter; - type BasicDeposit = BasicDeposit; - type FieldDeposit = FieldDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = MaxSubAccounts; - type MaxAdditionalFields = MaxAdditionalFields; - type MaxRegistrars = MaxRegistrars; - type ForceOrigin = IdentityForceOrigin; - type RegistrarOrigin = IdentityRegistrarOrigin; + type Currency = orml_tokens::CurrencyAdapter; + type BasicDeposit = cfg::pallet_identity::BasicDeposit; + type FieldDeposit = cfg::pallet_identity::FieldDeposit; + type SubAccountDeposit = cfg::pallet_identity::SubAccountDeposit; + type MaxSubAccounts = cfg::pallet_identity::MaxSubAccounts; + type MaxAdditionalFields = cfg::pallet_identity::MaxAdditionalFields; + type MaxRegistrars = cfg::pallet_identity::MaxRegistrars; + type ForceOrigin = cfg::pallet_identity::IdentityForceOrigin; + type RegistrarOrigin = cfg::pallet_identity::IdentityRegistrarOrigin; type Slashed = Treasury; type WeightInfo = pallet_identity::weights::SubstrateWeight; } -pub struct FoundationAccountsProvider(PhantomData); -impl Get> for FoundationAccountsProvider { - fn get() -> Vec { - let accounts = vec![ - hex_literal::hex!["c8d02dfbff5ce2fda651c7dd7719bc5b17b9c1043fded805bfc86296c5909871"], - hex_literal::hex!["c4690c56c36cec7ed5f6ed5d5eebace0c317073a962ebea1d00f1a304974897b"], - hex_literal::hex!["fc741134c82b81b7ab7efbf334b0c90ff8dbf22c42ad705ea7c04bf27ed4161a"], - ]; - - accounts - .into_iter() - .map(|acc| { - T::AccountId::decode(&mut sp_runtime::AccountId32::as_ref( - &sp_runtime::AccountId32::from(acc), - )) - .unwrap() - }) - .collect() - } -} - impl pallet_maintenance::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type FoundationAccountsProvider = FoundationAccountsProvider; + type FoundationAccountsProvider = cfg::pallet_maintenance::FoundationAccountsProvider; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -1864,25 +848,22 @@ impl_runtime_apis! { input_reserve: Balance, output_reserve: Balance, sell_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_sell_price(input_reserve, output_reserve, sell_amount) - .map_err(|e| - { - log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price' error: '{:?}', returning default value instead", e); - e - } - ).unwrap_or_default() - } + ) -> Balance { + Xyk::calculate_sell_price(input_reserve, output_reserve, sell_amount) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } fn calculate_buy_price( input_reserve: Balance, output_reserve: Balance, buy_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_buy_price(input_reserve, output_reserve, buy_amount) + ) -> Balance { + Xyk::calculate_buy_price(input_reserve, output_reserve, buy_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price' error: '{:?}', returning default value instead", e); @@ -1890,105 +871,198 @@ impl_runtime_apis! { } ).unwrap_or_default() - } } fn calculate_sell_price_id( sold_token_id: TokenId, bought_token_id: TokenId, sell_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_sell_price_id(sold_token_id, bought_token_id, sell_amount) + ) -> Balance { + Xyk::calculate_sell_price_id(sold_token_id, bought_token_id, sell_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_sell_price_id' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() - } } fn calculate_buy_price_id( sold_token_id: TokenId, bought_token_id: TokenId, buy_amount: Balance - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_buy_price_id(sold_token_id, bought_token_id, buy_amount) + ) -> Balance { + Xyk::calculate_buy_price_id(sold_token_id, bought_token_id, buy_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() - } } fn get_burn_amount( first_asset_id: TokenId, second_asset_id: TokenId, liquidity_asset_amount: Balance - ) -> RpcAmountsResult { - match Xyk::get_burn_amount(first_asset_id, second_asset_id, liquidity_asset_amount){ - Ok((first_asset_amount, second_asset_amount)) => RpcAmountsResult{ - first_asset_amount, - second_asset_amount - }, - Err(e) => { - log::warn!(target:"xyk", "rpc 'XYK::get_burn_amount' error: '{:?}', returning default value instead", e); - Default::default() - }, - } + ) -> (Balance, Balance) { + Xyk::get_burn_amount(first_asset_id, second_asset_id, liquidity_asset_amount) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } - fn calculate_rewards_amount( + fn get_max_instant_burn_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - match ProofOfStake::calculate_rewards_amount(user, liquidity_asset_id){ - Ok(claimable_rewards) => XYKRpcResult{ - price:claimable_rewards - }, - Err(e) => { - log::warn!(target:"xyk", "rpc 'XYK::calculate_rewards_amount_v2' error: '{:?}', returning default value instead", e); - Default::default() - }, - } + ) -> Balance { + Xyk::get_max_instant_burn_amount(&user, liquidity_asset_id) } - fn get_max_instant_burn_amount( + fn get_max_instant_unreserve_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::get_max_instant_burn_amount(&user, liquidity_asset_id) - } + ) -> Balance { + Xyk::get_max_instant_unreserve_amount(&user, liquidity_asset_id) } - fn get_max_instant_unreserve_amount( + fn calculate_rewards_amount( user: AccountId, liquidity_asset_id: TokenId, - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::get_max_instant_unreserve_amount(&user, liquidity_asset_id) - } + ) -> Balance { + ProofOfStake::calculate_rewards_amount(user, liquidity_asset_id) + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::calculate_buy_price_id' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() } fn calculate_balanced_sell_amount( total_amount: Balance, reserve_amount: Balance, - ) -> XYKRpcResult { - XYKRpcResult { - price: Xyk::calculate_balanced_sell_amount(total_amount, reserve_amount) + ) -> Balance { + Xyk::calculate_balanced_sell_amount(total_amount, reserve_amount) .map_err(|e| { log::warn!(target:"xyk", "rpc 'XYK::calculate_balanced_sell_amount' error: '{:?}', returning default value instead", e); e } ).unwrap_or_default() + } + + fn get_liq_tokens_for_trading() -> Vec { + Xyk::get_liq_tokens_for_trading() + .map_err(|e| + { + log::warn!(target:"xyk", "rpc 'XYK::get_liq_tokens_for_trading' error: '{:?}', returning default value instead", e); + e + } + ).unwrap_or_default() + } + + fn is_sell_asset_lock_free( + path: Vec, + input_amount: Balance, + ) -> Option{ + match (path.len(), pallet_fee_lock::FeeLockMetadata::::get()) { + (length, _) if length < 2 => { + None + } + (2, Some(feelock)) => { + let input = path.get(0)?; + let output = path.get(1)?; + let output_amount = Xyk::calculate_sell_price_id(*input, *output, input_amount).ok()?; + Some( + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *input, input_amount) + || + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *output, output_amount) + ) + } + (_, None) => { + Some(false) + } + (_, Some(_)) => { + Some(true) + } } } + + fn is_buy_asset_lock_free( + path: Vec, + input_amount: Balance, + ) -> Option{ + match (path.len(), pallet_fee_lock::FeeLockMetadata::::get()) { + (length, _) if length < 2 => { + None + } + (2, Some(feelock)) => { + let input = path.get(0)?; + let output = path.get(1)?; + let output_amount = Xyk::calculate_buy_price_id(*input, *output, input_amount).ok()?; + Some( + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *input, input_amount) + || + FeeHelpers::< + Runtime, + orml_tokens::MultiTokenCurrencyAdapter, + ToAuthor, + OnChargeTransactionHandler, + FeeLock, + >::is_high_value_swap(&feelock, *output, output_amount) + ) + } + (_, None) => { + Some(false) + } + (_, Some(_)) => { + Some(true) + } + } + } + + fn get_tradeable_tokens() -> Vec> { + orml_asset_registry::Metadata::::iter() + .filter_map(|(token_id, metadata)| { + if !metadata.name.is_empty() + && !metadata.symbol.is_empty() + && metadata.additional.xyk.as_ref().map_or(true, |xyk| !xyk.operations_disabled) + { + let rpc_metadata = RpcAssetMetadata { + token_id: token_id, + decimals: metadata.decimals, + name: metadata.name.clone(), + symbol: metadata.symbol.clone(), + }; + Some(rpc_metadata) + } else { + None + } + }) + .collect::>() + } } impl sp_consensus_aura::AuraApi for Runtime { @@ -2001,21 +1075,6 @@ impl_runtime_apis! { } } - impl pallet_vesting_mangata_rpc_runtime_api::VestingMangataApi for Runtime { - fn get_vesting_locked_at(who: AccountId, token_id: TokenId, at_block_number: Option) -> VestingInfosWithLockedAt - { - match Vesting::get_vesting_locked_at(&who, token_id, at_block_number){ - Ok(vesting_infos_with_locked_at) => VestingInfosWithLockedAt{ - vesting_infos_with_locked_at: vesting_infos_with_locked_at - }, - Err(e) => { - log::warn!(target:"vesting", "rpc 'Vesting::get_vesting_locked_at' error: '{:?}', returning default value instead", e); - Default::default() - }, - } - } - } - impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION @@ -2115,12 +1174,12 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + fn on_runtime_upgrade(_checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to // have a backtrace here. If any of the pre/post migration checks fail, we shall stop // right here and right now. - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) + let weight = Executive::try_runtime_upgrade(frame_try_runtime::UpgradeCheckSelect::All).unwrap(); + (weight, cfg::frame_system::RuntimeBlockWeights::get().max_block) } fn execute_block( @@ -2222,7 +1281,7 @@ impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { // replace validate block function with its expanded version #[doc(hidden)] mod parachain_validate_block { - use super::*; + use crate::Runtime; #[no_mangle] #[cfg(not(feature = "std"))] @@ -2242,12 +1301,12 @@ mod parachain_validate_block { .expect("Invalid arguments to `validate_block`."); let res = - cumulus_pallet_parachain_system::validate_block::implementation::validate_block::<::RuntimeBlock, - cumulus_pallet_aura_ext::BlockExecutorVer, - Runtime, - CheckInherents>(params); + cumulus_pallet_aura_ext::BlockExecutorVer, + crate::Runtime, + crate::CheckInherents>(params); cumulus_pallet_parachain_system::validate_block::polkadot_parachain::write_result(&res) } } diff --git a/runtime/mangata-rococo/src/migration.rs b/runtime/mangata-rococo/src/migration.rs deleted file mode 100644 index 5847d07187..0000000000 --- a/runtime/mangata-rococo/src/migration.rs +++ /dev/null @@ -1,368 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] -use super::*; -use frame_support::{ - storage::{ - migration::{move_prefix, storage_key_iter}, - storage_prefix, unhashed, - }, - traits::OnRuntimeUpgrade, - StoragePrefixedMap, Twox64Concat, -}; -use xcm::IntoVersion; - -pub fn move_storage_from_pallet_with_rename( - old_storage_name: &[u8], - new_storage_name: &[u8], - old_pallet_name: &[u8], - new_pallet_name: &[u8], -) { - let new_prefix = storage_prefix(new_pallet_name, new_storage_name); - let old_prefix = storage_prefix(old_pallet_name, old_storage_name); - - move_prefix(&old_prefix, &new_prefix); - - if let Some(value) = unhashed::get_raw(&old_prefix) { - unhashed::put_raw(&new_prefix, &value); - unhashed::kill(&old_prefix); - } -} - -pub struct XykRefactorMigration; -impl OnRuntimeUpgrade for XykRefactorMigration { - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "proof_of_stake", - "on_runtime_upgrade: Attempted to apply xyk refactor migration" - ); - - move_storage_from_pallet_with_rename( - b"PromotedPoolsRewardsV2", - b"PromotedPoolRewards", - b"Issuance", - b"ProofOfStake", - ); - move_storage_from_pallet_with_rename( - b"LiquidityMiningActivePoolV2", - b"TotalActivatedLiquidity", - b"ProofOfStake", - b"ProofOfStake", - ); - - ::BlockWeights::get().max_block - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - sp_runtime::runtime_logger::RuntimeLogger::init(); - log::info!( - target: "proof_of_stake", - "pre_upgrade check: proof_of_stake" - ); - - let pos__liquidity_mining_avitvate_pool_v2_count = - frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - |_| Ok(()), - ) - .count(); - - let pos__total_activated_liquidity = frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - |_| Ok(()), - ) - .count(); - - let issuance__promoted_pool_reards_v2_exists = - unhashed::get_raw(&storage_prefix(b"Issuance", b"PromotedPoolsRewardsV2")).is_some(); - let pos__promoted_pool_rewards_exists = - unhashed::get_raw(&storage_prefix(b"ProofOfStake", b"PromotedPoolRewards")).is_some(); - - log::info!(target: "migration", "PRE ProofOfStake::LiquidityMiningActivePoolV2 count :{}", pos__liquidity_mining_avitvate_pool_v2_count); - log::info!(target: "migration", "PRE Issuance::PromotedPoolsRewardsV2 exists :{}", issuance__promoted_pool_reards_v2_exists); - log::info!(target: "migration", "PRE ProofOfStake::RewardsInfo count :{}", pos__total_activated_liquidity); - log::info!(target: "migration", "PRE Issuance::PromotedPoolRewards exists :{}", pos__promoted_pool_rewards_exists); - - assert!(pos__liquidity_mining_avitvate_pool_v2_count > 0); - assert!(issuance__promoted_pool_reards_v2_exists); - assert!(pos__total_activated_liquidity == 0); - assert!(!pos__promoted_pool_rewards_exists); - - Ok(vec![]) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), &'static str> { - sp_runtime::runtime_logger::RuntimeLogger::init(); - log::info!( - target: "proof_of_stake", - "post_upgrade check: proof_of_stake" - ); - - let pos__liquidity_mining_avitvate_pool_v2_count = - frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - storage_prefix(b"ProofOfStake", b"LiquidityMiningActivePoolV2").to_vec(), - |_| Ok(()), - ) - .count(); - - let pos__total_activated_liquidity = frame_support::storage::KeyPrefixIterator::new( - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - storage_prefix(b"ProofOfStake", b"TotalActivatedLiquidity").to_vec(), - |_| Ok(()), - ) - .count(); - - let issuance__promoted_pool_reards_v2_exists = - unhashed::get_raw(&storage_prefix(b"Issuance", b"PromotedPoolsRewardsV2")).is_some(); - let pos__promoted_pool_rewards_exists = - unhashed::get_raw(&storage_prefix(b"ProofOfStake", b"PromotedPoolRewards")).is_some(); - - log::info!(target: "migration", "POST ProofOfStake::LiquidityMiningActivePoolV2 count :{}", pos__liquidity_mining_avitvate_pool_v2_count); - log::info!(target: "migration", "POST Issuance::PromotedPoolsRewardsV2 exists :{}", issuance__promoted_pool_reards_v2_exists); - log::info!(target: "migration", "POST ProofOfStake::RewardsInfo count :{}", pos__total_activated_liquidity); - log::info!(target: "migration", "POST Issuance::PromotedPoolRewards exists :{}", pos__promoted_pool_rewards_exists); - - assert!(pos__liquidity_mining_avitvate_pool_v2_count == 0); - assert!(!issuance__promoted_pool_reards_v2_exists); - assert!(pos__total_activated_liquidity > 0); - assert!(pos__promoted_pool_rewards_exists); - - Ok(()) - } -} - -/// AssetRegistry migrate v2 to v3 -pub struct AssetRegistryMigration; -impl OnRuntimeUpgrade for AssetRegistryMigration { - fn on_runtime_upgrade() -> Weight { - log::info!( - target: "asset_registry", - "on_runtime_upgrade: Attempted to apply AssetRegistry v2 to v3 migration" - ); - - let mut weight: Weight = Weight::zero(); - - // migrate the value type of ForeignAssetLocations - orml_asset_registry::Metadata::::translate( - |_key, mut old_meta: AssetMetadataOf| { - weight.saturating_accrue( - ::DbWeight::get().reads_writes(1, 1), - ); - // let mut new_meta = old_meta.clone(); - let new_location = old_meta.location.and_then(|l| l.into_version(3).ok()); - old_meta.location = new_location; - Some(old_meta) - }, - ); - - // migrate the key type of LocationToCurrencyIds - let module_prefix = orml_asset_registry::LocationToAssetId::::module_prefix(); - let storage_prefix = orml_asset_registry::LocationToAssetId::::storage_prefix(); - let old_data = storage_key_iter::( - module_prefix, - storage_prefix, - ) - .drain() - .collect::>(); - for (old_key, value) in old_data { - weight.saturating_accrue( - ::DbWeight::get().reads_writes(1, 1), - ); - let new_key: MultiLocation = old_key.try_into().expect("Stored xcm::v2::MultiLocation"); - orml_asset_registry::LocationToAssetId::::insert(new_key, value); - } - - weight - } -} - -#[cfg(test)] -mod tests { - - use super::*; - use frame_support::{ - migration::{get_storage_value, put_storage_value}, - StorageHasher, - }; - use mangata_types::TokenId; - use orml_asset_registry::*; - - use crate::AssetMetadataOf; - - #[test] - fn test_v2_to_v3_migration() { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| { - System::set_block_number(1); - - let metadata_module_prefix = Metadata::::module_prefix(); - let metadata_storage_prefix = Metadata::::storage_prefix(); - - let location_to_asset_id_module_prefix = LocationToAssetId::::module_prefix(); - let location_to_asset_id_storage_prefix = - LocationToAssetId::::storage_prefix(); - - let meta: AssetMetadataOf = AssetMetadata { - decimals: 0, - name: b"Asset".to_vec(), - symbol: b"SYM".to_vec(), - existential_deposit: 0, - location: None, - additional: Default::default(), - }; - - let old_multilocation_0 = xcm::v2::MultiLocation::new( - 0, - xcm::v2::Junctions::X1(xcm::v2::Junction::GeneralKey( - vec![0, 0, 0, 0].try_into().unwrap(), - )), - ); - let old_multilocation_1 = xcm::v2::MultiLocation::new( - 1, - xcm::v2::Junctions::X2( - xcm::v2::Junction::Parachain(2121), - xcm::v2::Junction::GeneralKey(vec![0, 96].try_into().unwrap()), - ), - ); - let old_multilocation_2 = xcm::v2::MultiLocation::new( - 1, - xcm::v2::Junctions::X1(xcm::v2::Junction::Parachain(2114)), - ); - - let new_multilocation_0 = MultiLocation::try_from(old_multilocation_0.clone()).unwrap(); - let new_multilocation_1 = MultiLocation::try_from(old_multilocation_1.clone()).unwrap(); - let new_multilocation_2 = MultiLocation::try_from(old_multilocation_2.clone()).unwrap(); - - // assert location without general key is the same when encoded - assert_eq!(old_multilocation_2.encode(), new_multilocation_2.encode()); - - let mut meta_0 = meta.clone(); - meta_0.location = Some(old_multilocation_0.clone().versioned()); - let mut meta_1 = meta.clone(); - meta_1.location = Some(old_multilocation_1.clone().versioned()); - let mut meta_2 = meta.clone(); - meta_2.location = Some(old_multilocation_2.clone().versioned()); - - let asset_id_0: TokenId = 0; - let asset_id_1: TokenId = 11; - let asset_id_2: TokenId = 7; - - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_0.encode()), - &meta_0, - ); - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_1.encode()), - &meta_1, - ); - put_storage_value( - metadata_module_prefix, - metadata_storage_prefix, - &Twox64Concat::hash(&asset_id_2.encode()), - &meta_2, - ); - - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - asset_id_0, - ); - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - asset_id_1, - ); - put_storage_value( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_2.encode()), - asset_id_2, - ); - - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - ), - Some(asset_id_0) - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - ), - Some(asset_id_1) - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_2.encode()), - ), - Some(asset_id_2) - ); - - // Assert v3 multilocation key does not exist in LocationToAssetId - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_0), None); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_1), None); - - // Run migration - assert_eq!( - crate::migration::AssetRegistryMigration::on_runtime_upgrade(), - <::DbWeight as Get< - frame_support::weights::RuntimeDbWeight, - >>::get() - .reads_writes(6, 6) - ); - - // Assert the location been migrated to v3 MultiLocation - assert_eq!( - AssetRegistry::metadata(asset_id_0).unwrap().location.unwrap(), - new_multilocation_0.into_versioned() - ); - assert_eq!( - AssetRegistry::metadata(asset_id_1).unwrap().location.unwrap(), - new_multilocation_1.into_versioned() - ); - assert_eq!( - AssetRegistry::metadata(asset_id_2).unwrap().location.unwrap(), - new_multilocation_2.into_versioned() - ); - - // Assert the key type of LocationToAssetId has been migrated to v3 MultiLocation - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_0), Some(asset_id_0)); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_1), Some(asset_id_1)); - assert_eq!(AssetRegistry::location_to_asset_id(new_multilocation_2), Some(asset_id_2)); - - // Assert the old key does not exist anymore, except location n2 which is the same - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_0.encode()), - ), - None - ); - assert_eq!( - get_storage_value::( - location_to_asset_id_module_prefix, - location_to_asset_id_storage_prefix, - &Twox64Concat::hash(&old_multilocation_1.encode()), - ), - None - ); - }); - } -} diff --git a/runtime/mangata-rococo/src/xcm_config.rs b/runtime/mangata-rococo/src/xcm_config.rs index 8f0b915ee4..6be6a91183 100644 --- a/runtime/mangata-rococo/src/xcm_config.rs +++ b/runtime/mangata-rococo/src/xcm_config.rs @@ -1,187 +1,51 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode}; -use cumulus_primitives_core::ParaId; +use common_runtime::tokens; + pub use frame_support::{ match_types, parameter_types, traits::{Everything, Get, Nothing}, weights::Weight, }; use frame_system::EnsureRoot; -use orml_asset_registry::{AssetRegistryTrader, FixedRateAssetRegistryTrader}; -use orml_traits::{ - location::AbsoluteReserveProvider, parameter_type_with_key, FixedConversionRateProvider, - GetByKey, MultiCurrency, -}; -use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::ConstU32; -use sp_std::{marker::PhantomData, prelude::*}; -use xcm::latest::{prelude::*, Weight as XcmWeight}; -use xcm_builder::{ - Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible, - FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, -}; -use xcm_executor::{traits::DropAssets, Assets, XcmExecutor}; - -use super::{ - constants::fee::*, AccountId, AllPalletsWithSystem, AssetMetadataOf, Balance, Convert, - ExistentialDeposits, Maintenance, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - RuntimeCall, RuntimeEvent, RuntimeOrigin, TokenId, Tokens, TreasuryAccount, UnknownTokens, - XcmpQueue, MGR_TOKEN_ID, ROC_TOKEN_ID, -}; - -pub fn general_key(key: &[u8]) -> Junction { - let mut data = [0u8; 32]; - data[..key.len()].copy_from_slice(&key[..]); - GeneralKey { length: key.len() as u8, data } -} - -parameter_types! { - pub RocLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); -} -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, - // Create hash of `AccountId32` used for proxy accounts - Account32Hash, -); +use orml_traits::location::AbsoluteReserveProvider; +use orml_xcm_support::MultiNativeAsset; -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToCallOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; -} - -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, -); - -pub struct ToTreasury; -impl TakeRevenue for ToTreasury { - fn take_revenue(revenue: MultiAsset) { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = revenue { - if let Some(currency_id) = TokenIdConvert::convert(location) { - // Ensure AcalaTreasuryAccount have ed requirement for native asset, but don't need - // ed requirement for cross-chain asset because it's one of whitelist accounts. - // Ignore the result. - let _ = Tokens::deposit(currency_id, &TreasuryAccount::get(), amount); - } - } - } -} - -parameter_types! { - // regular transfer is ~400M weight, xcm transfer weight is ~4*UnitWeightCost - pub UnitWeightCost: XcmWeight = XcmWeight::from_parts(150_000_000, 0); - pub const MaxInstructions: u32 = 100; - - pub RocPerSecond: (AssetId, u128, u128) = (MultiLocation::parent().into(), roc_per_second(), roc_per_second()); - pub MgrPerSecond: (AssetId, u128, u128) = ( - MultiLocation::new( - 0, - X1(general_key(&MGR_TOKEN_ID.encode())), - ).into(), - mgr_per_second(), - mgr_per_second(), - ); - pub const MaxAssetsIntoHolding: u32 = 64; -} - -type AssetRegistryOf = orml_asset_registry::Pallet; +use sp_runtime::traits::ConstU32; -pub struct FeePerSecondProvider; -impl FixedConversionRateProvider for FeePerSecondProvider { - fn get_fee_per_second(location: &MultiLocation) -> Option { - if let Some(asset_id) = AssetRegistryOf::::location_to_asset_id(location) { - if let Some(xcm_meta) = AssetRegistryOf::::metadata(asset_id) - .and_then(|metadata: AssetMetadataOf| metadata.additional.xcm) - { - let fee_per_second: u128 = xcm_meta.fee_per_second; - log::debug!( - target: "xcm::weight", "fee_per_second: asset: {:?}, fps:{:?}", - asset_id, fee_per_second - ); - return Some(fee_per_second) - } - } - None - } -} +use xcm_builder::EnsureXcmOrigin; +use xcm_executor::XcmExecutor; -pub type Trader = ( - FixedRateOfFungible, - AssetRegistryTrader, ToTreasury>, - FixedRateOfFungible, -); +use super::{ + AccountId, AllPalletsWithSystem, Balance, Maintenance, ParachainSystem, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, TokenId, +}; +use cumulus_primitives_core::{MultiLocation, Parent}; pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; + type XcmSender = common_runtime::xcm_config::XcmRouter; // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToCallOrigin; + type AssetTransactor = common_runtime::xcm_config::LocalAssetTransactor; + type OriginConverter = + common_runtime::xcm_config::XcmOriginToCallOrigin; type IsReserve = MultiNativeAsset; // Teleporting is disabled. type IsTeleporter = (); - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = Trader; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; + type Barrier = common_runtime::xcm_config::Barrier; + type Weigher = common_runtime::xcm_config::Weigher; + type Trader = common_runtime::xcm_config::Trader; type ResponseHandler = PolkadotXcm; - type AssetTrap = - MangataDropAssets; + type AssetTrap = common_runtime::xcm_config::DropAssetsHandler; type AssetClaims = PolkadotXcm; type SubscriptionService = PolkadotXcm; type AssetLocker = (); type AssetExchanger = (); type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type MaxAssetsIntoHolding = common_runtime::xcm_config::MaxAssetsIntoHolding; type FeeManager = (); type MessageExporter = (); type UniversalAliases = (); @@ -189,22 +53,6 @@ impl xcm_executor::Config for XcmConfig { type SafeCallFilter = Everything; } -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -parameter_types! { - pub const MgrTokenId: TokenId = MGR_TOKEN_ID; -} - #[cfg(feature = "runtime-benchmarks")] parameter_types! { pub ReachableDest: Option = Some(Parent.into()); @@ -213,22 +61,25 @@ parameter_types! { impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmRouter = common_runtime::xcm_config::XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin< + RuntimeOrigin, + common_runtime::xcm_config::LocalOriginToLocation, + >; type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type UniversalLocation = UniversalLocation; + type Weigher = common_runtime::xcm_config::Weigher; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = orml_tokens::CurrencyAdapter; + type Currency = orml_tokens::CurrencyAdapter; type CurrencyMatcher = (); type TrustedLockers = (); - type SovereignAccountOf = LocationToAccountId; + type SovereignAccountOf = common_runtime::xcm_config::LocationToAccountId; type MaxLockers = ConstU32<8>; type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] @@ -240,27 +91,6 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MaintenanceStatusProvider = Maintenance; @@ -269,7 +99,8 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type VersionWrapper = (); type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type ControllerOriginConverter = + common_runtime::xcm_config::XcmOriginToTransactDispatchOrigin; type WeightInfo = (); type PriceForSiblingDelivery = (); } @@ -281,148 +112,19 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; } -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { network: None, id: account.into() }).into() - } -} - -parameter_types! { - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - pub const BaseXcmWeight: XcmWeight = XcmWeight::from_parts(100_000_000, 0); // TODO: recheck this - pub const MaxAssetsForTransfer:usize = 2; -} - -parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { - None - }; -} - impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = TokenId; - type CurrencyIdConvert = TokenIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type MinXcmFee = ParachainMinFee; + type CurrencyIdConvert = common_runtime::xcm_config::TokenToMultiLocation; + type AccountIdToMultiLocation = common_runtime::xcm_config::AccountIdToMultiLocation; + type SelfLocation = common_runtime::xcm_config::SelfLocation; + type MinXcmFee = common_runtime::xcm_config::ParachainMinFee; type XcmExecutor = XcmExecutor; type MultiLocationsFilter = Everything; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type UniversalLocation = UniversalLocation; - type MaxAssetsForTransfer = MaxAssetsForTransfer; + type Weigher = common_runtime::xcm_config::Weigher; + type BaseXcmWeight = common_runtime::xcm_config::BaseXcmWeight; + type UniversalLocation = common_runtime::xcm_config::UniversalLocation; + type MaxAssetsForTransfer = common_runtime::xcm_config::MaxAssetsForTransfer; type ReserveProvider = AbsoluteReserveProvider; } - -pub type LocalAssetTransactor = MultiCurrencyAdapter< - Tokens, - UnknownTokens, - IsNativeConcrete, - AccountId, - LocationToAccountId, - TokenId, - TokenIdConvert, - orml_xcm_support::DepositToAlternative, ->; - -/// `DropAssets` implementation support asset amount lower thant ED handled by `TakeRevenue`. -/// -/// parameters type: -/// - `NC`: native currency_id type. -/// - `NB`: the ExistentialDeposit amount of native currency_id. -/// - `GK`: the ExistentialDeposit amount of tokens. -pub struct MangataDropAssets(PhantomData<(X, T, C, GK)>); -impl DropAssets for MangataDropAssets -where - X: DropAssets, - T: TakeRevenue, - C: Convert>, - GK: GetByKey, -{ - fn drop_assets( - origin: &MultiLocation, - assets: Assets, - context: &XcmContext, - ) -> sp_weights::Weight { - let multi_assets: Vec = assets.into(); - let mut asset_traps: Vec = vec![]; - for asset in multi_assets { - if let MultiAsset { id: Concrete(location), fun: Fungible(amount) } = asset.clone() { - let currency_id = C::convert(location); - // burn asset(do nothing here) if convert result is None - if let Some(currency_id) = currency_id { - let ed = GK::get(¤cy_id); - if amount < ed { - T::take_revenue(asset); - } else { - asset_traps.push(asset); - } - } - } - } - if !asset_traps.is_empty() { - X::drop_assets(origin, asset_traps.into(), context); - } - XcmWeight::from_parts(0, 0) - } -} - -pub struct TokenIdConvert; -impl Convert> for TokenIdConvert { - fn convert(id: TokenId) -> Option { - // allow relay asset - if id == ROC_TOKEN_ID { - return Some(MultiLocation::parent()) - } - // allow native asset - if id == MGR_TOKEN_ID { - return Some(MultiLocation::new( - 1, - X2(Parachain(ParachainInfo::get().into()), general_key(&id.encode())), - )) - } - // allow assets in registry with location set - AssetRegistryOf::::multilocation(&id).unwrap_or(None) - } -} -impl Convert> for TokenIdConvert { - fn convert(location: MultiLocation) -> Option { - // allow relay asset - if location == MultiLocation::parent() { - return Some(ROC_TOKEN_ID) - } - - match location { - // allow native asset - MultiLocation { - parents: 1, - interior: X2(Parachain(para_id), GeneralKey { length, data }), - } if ParaId::from(para_id) == ParachainInfo::get() => - match TokenId::decode(&mut &data[..(length as usize)]) { - Ok(MGR_TOKEN_ID) => Some(MGR_TOKEN_ID), - _ => None, - }, - // allow native asset - MultiLocation { parents: 0, interior: X1(GeneralKey { length, data }) } => - match TokenId::decode(&mut &data[..(length as usize)]) { - Ok(MGR_TOKEN_ID) => Some(MGR_TOKEN_ID), - _ => None, - }, - - // allow assets in registry with location set - _ => AssetRegistryOf::::location_to_asset_id(location.clone()), - } - } -} -impl Convert> for TokenIdConvert { - fn convert(asset: MultiAsset) -> Option { - if let MultiAsset { id: Concrete(location), .. } = asset { - Self::convert(location) - } else { - None - } - } -} diff --git a/scripts/build-mvr-image.sh b/scripts/build-mvr-image.sh new file mode 100755 index 0000000000..8fc3d2c359 --- /dev/null +++ b/scripts/build-mvr-image.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +REPO_ROOT=$(readlink -f $(dirname $(dirname $(readlink -f $0)))) + +DOCKER_BUILDER_IMAGE=mangatasolutions/node-builder:multi-nightly-2022-11-15 \ + CODE_ROOT=${REPO_ROOT}/mvr \ + ${REPO_ROOT}/docker-cargo.sh \ + build --release + +SKIP_BUILD=1 \ + BUILD_DIR=./mvr/docker-cargo/release \ + ${REPO_ROOT}/scripts/build-image.sh mangatasolutions/mangata-node:polkadot-mvr +