diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 000000000..9a59f4c4e --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,61 @@ +# Kreivo CI Dockerfile - GitHub Actions Runner Base Image +# Provides Rust toolchain, Node.js, and smart contract tools for CI + +FROM node:22-slim + +# Prevent interactive prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# Install system dependencies required for GitHub Actions runner and builds +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + git \ + libssl-dev \ + pkg-config \ + protobuf-compiler \ + clang \ + llvm \ + jq \ + ca-certificates \ + sudo \ + && rm -rf /var/lib/apt/lists/* + +# Install Rust toolchain with CI optimizations +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none \ + && rustup install stable nightly \ + && rustup default stable \ + && rustup target add wasm32-unknown-unknown --toolchain stable \ + && rustup target add wasm32-unknown-unknown --toolchain nightly \ + && rustup component add rust-src clippy --toolchain stable \ + && rustup component add rust-src clippy --toolchain nightly + +# Install official Solidity compiler binary +RUN curl -L -o /usr/local/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.30/solc-static-linux && \ + chmod +x /usr/local/bin/solc + +# Install Parity resolc binary +RUN curl -L -o /usr/local/bin/resolc https://github.com/paritytech/revive/releases/download/v0.4.1/resolc-x86_64-unknown-linux-musl && \ + chmod +x /usr/local/bin/resolc + +# Set up environment for WASM builds +ENV WASM_BUILD_TOOLCHAIN=nightly + +# Create docker user (GitHub Actions runner requirement) +RUN useradd -m -s /bin/bash docker \ + && mkdir -p /home/docker/actions-runner \ + && chown -R docker:docker /home/docker/actions-runner /usr/local/cargo /usr/local/rustup + +USER docker +WORKDIR /home/docker/actions-runner + +# Health check for container validation +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD cargo --version && node --version && solc --version || exit 1 + +# Default command for testing the environment +CMD ["cargo", "--version"] \ No newline at end of file diff --git a/.github/Dockerfile-README.md b/.github/Dockerfile-README.md new file mode 100644 index 000000000..6396241d6 --- /dev/null +++ b/.github/Dockerfile-README.md @@ -0,0 +1,139 @@ +# Kreivo CI Dockerfile + +This Dockerfile provides a **GitHub Actions runner base image** for the Kreivo blockchain project CI environment, including Rust toolchain, Node.js, and smart contract tools. + +## Features + +- **GitHub Actions optimized** - Designed as a runner container image +- **Latest stable and nightly Rust toolchains** with WASM32 target support +- **Node.js 22** with essential packages for smart contract development +- **Solidity compiler** (`solc`) and **Parity tools** (`resolc`) +- **Rust components**: `rust-src` and `clippy` for both stable and nightly +- **Health checks** and security best practices +- **Optimized for CI/CD** with proper caching and layer optimization + +## GitHub Actions Usage + +### Basic Job Configuration + +```yaml +jobs: + test: + runs-on: ubuntu-latest + container: + image: kreivo-ci:latest + steps: + - uses: actions/checkout@v4 + - run: cargo test --release + + build-runtime: + runs-on: ubuntu-latest + container: + image: kreivo-ci:latest + steps: + - uses: actions/checkout@v4 + - run: cargo build --release -p kreivo-runtime +``` + +### With Caching + +```yaml +jobs: + quality-checks: + runs-on: ubuntu-latest + container: + image: kreivo-ci:latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - run: cargo fmt -- --check + - run: cargo clippy -- -D warnings + - run: cargo test --release +``` + +## Local Development + +### Building the Image + +```bash +# Build the CI image +docker build -f .github/Dockerfile -t kreivo-ci:latest . +``` + +### Testing Locally + +```bash +# Test the environment +docker run --rm kreivo-ci:latest cargo --version +docker run --rm kreivo-ci:latest node --version +docker run --rm kreivo-ci:latest solc --version + +# Run commands with volume mount +docker run --rm -v $(pwd):/workspace -w /workspace kreivo-ci:latest cargo build --release +``` + +### Using with Docker Compose + +```yaml +version: '3.8' +services: + kreivo-dev: + build: . + volumes: + - .:/workspace + - cargo-cache:/usr/local/cargo/registry + - target-cache:/workspace/target + working_directory: /workspace + environment: + - USER=docker # Match container user + +volumes: + cargo-cache: + target-cache: +``` + +## Environment Variables + +- `WASM_BUILD_TOOLCHAIN=nightly` - Toolchain used for WASM builds +- `RUSTUP_HOME=/usr/local/rustup` - Rust toolchain location +- `CARGO_HOME=/usr/local/cargo` - Cargo home directory + +## Included Tools + +### Rust Toolchain +- **Stable** and **Nightly** versions +- **wasm32-unknown-unknown** target for both toolchains +- **rust-src** and **clippy** components + +### Node.js 22 +- **solc** - Solidity compiler +- **resolc** - Parity Solidity compiler +- **yarn** - Package manager + +### System Dependencies +- **build-essential** - C/C++ build tools +- **clang** & **llvm** - Additional compilers +- **protobuf-compiler** - Protocol buffer compiler +- **git** - Version control + +## Security Features + +- Non-root docker user execution +- Minimal Debian base image (node:22-slim) +- Proper dependency management +- Health check monitoring + +## Performance Optimizations + +- Single-stage build for faster runner startup +- Pre-installed toolchains reduce setup time +- Optimized layer caching +- GitHub Actions runner compatible \ No newline at end of file diff --git a/.github/scripts/render-cloud-init.sh b/.github/scripts/render-cloud-init.sh new file mode 100755 index 000000000..714dba4cf --- /dev/null +++ b/.github/scripts/render-cloud-init.sh @@ -0,0 +1,215 @@ +#!/bin/bash +set -e + +TOKEN="$1" +REPO_URL="$2" +LABEL="$3" + +cat <> $GITHUB_OUTPUT + + - name: Get GitHub runner token + id: get_token + run: | + curl -s -X POST \ + -H "Authorization: Bearer ${{ secrets.PAT_VM_RUNNERS }}" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${{ github.repository }}/actions/runners/registration-token \ + > token.json + cat token.json + echo "token=$(jq -r .token token.json)" >> $GITHUB_OUTPUT + + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: '.github/scripts/render-cloud-init.sh' + + - name: Generate cloud-init + run: | + ./.github/scripts/render-cloud-init.sh "${{ steps.get_token.outputs.token }}" \ + "https://github.com/${{ github.repository }}" \ + "vm-${{ github.run_id }}" > cloud-init.txt + cat cloud-init.txt + + - name: Azure Login + run: | + az login --service-principal \ + --username "${{ secrets.AZURE_CLIENT_ID }}" \ + --password "${{ secrets.AZURE_CLIENT_SECRET }}" \ + --tenant "${{ secrets.AZURE_TENANT_ID }}" + az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}" + + - name: Launch Azure VM + run: | + az vm create \ + --name gh-vm-${{ github.run_id }} \ + --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \ + --public-ip-address "" \ + --image Ubuntu2404 \ + --generate-ssh-keys \ + --size Standard_D16s_v5 \ + --os-disk-size-gb 32 \ + --admin-username azureuser \ + --custom-data cloud-init.txt \ + --tags "github_label=vm-${{ github.run_id }}" + + - name: Wait for VM to come online + run: sleep 60 benchmark: name: Run Benchmarks - needs: build - runs-on: [self-hosted, benchmarks] + runs-on: [ self-hosted, "${{ needs.provision.outputs.label }}" ] + needs: provision permissions: contents: write pull-requests: write steps: + - name: Say hello + run: | + echo "Running on Azure VM with label ${{ needs.provision.outputs.label }}" + - uses: actions/checkout@v4 - name: Create `target/release` folder run: | - mkdir -p .benchmarking-logs target/release + mkdir -p .benchmarking-logs target/release/wbuild/kreivo-runtime - name: Get artifacts uses: actions/download-artifact@v4 with: - name: ${{ github.ref }}-runtime - path: ./target/release + name: ${{ github.run_id }}-runtime + path: ./target/release/wbuild/kreivo-runtime + + - name: Use Stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: wasm32-unknown-unknown + components: rust-src + + - name: Download CLI + run: | + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-stable2506-1/frame-omni-bencher -o frame-omni-bencher + chmod +x ./frame-omni-bencher + echo "Using frame-omni-bencher version:" + ./frame-omni-bencher --version + + echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - run: | just benchmarks @@ -69,13 +153,99 @@ jobs: path: ./.benchmarking-logs - uses: peter-evans/create-pull-request@v6 + if: success() || failure() with: add-paths: runtime/kreivo/src/weights commit-message: '[ci] calculate weights' branch: benchmarks branch-suffix: short-commit-hash - title: "Benchmarking: Calculate weights for ${{ github.sha }}" + title: "chore: Calculate weights for `${{ github.sha }}`" body: | This Pull Request is automatically raised when pushing over `master` and should be resolved and reviewed manually. assignees: ${{ github.actor_id }} + + cleanup: + name: Destroy VM + if: always() + runs-on: ubuntu-latest + needs: [ provision, benchmark ] + steps: + - name: Azure Login + run: | + az login --service-principal \ + --username "${{ secrets.AZURE_CLIENT_ID }}" \ + --password "${{ secrets.AZURE_CLIENT_SECRET }}" \ + --tenant "${{ secrets.AZURE_TENANT_ID }}" + az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}" + + - name: Remove runner from GitHub + run: | + curl -O -L https://github.com/actions/runner/releases/download/v2.324.0/actions-runner-linux-x64-2.324.0.tar.gz && + tar xzf ./actions-runner-linux-x64-2.324.0.tar.gz && + ./config.sh remove --token $TOKEN || echo "โš ๏ธ Could not remove GitHub Runner" + + - name: Delete VM and associated resources + run: | + set -euo pipefail + + RESOURCE_GROUP=${{ secrets.AZURE_RESOURCE_GROUP }} + VM_NAME=gh-vm-${{ github.run_id }} + + echo "๐Ÿงน Deleting VM: $VM_NAME" + + # โ”€โ”€โ”€ Retrieve NIC โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + NIC_ID=$(az vm show --resource-group "$RESOURCE_GROUP" --name "$VM_NAME" --query 'networkProfile.networkInterfaces[0].id' -o tsv || echo "") + NIC_NAME="" + if [ -n "$NIC_ID" ]; then + NIC_NAME=$(basename "$NIC_ID") + else + echo "โš ๏ธ NIC ID not found" + NIC_NAME="" + fi + + # โ”€โ”€โ”€ Retrieve OS Disk โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + DISK_NAME=$(az vm show --resource-group "$RESOURCE_GROUP" --name "$VM_NAME" --query 'storageProfile.osDisk.name' -o tsv || echo "โš ๏ธ OS Disk not found") + + # โ”€โ”€โ”€ Retrieve NSG โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + NSG_ID=$(az network nic show --resource-group "$RESOURCE_GROUP" --name "$NIC_NAME" --query 'networkSecurityGroup.id' -o tsv || echo "") + NSG_NAME=$(basename "$NSG_ID") + + # โ”€โ”€โ”€ Retrieve VNet from NIC โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + VNET_NAME="" + if [ -n "$NIC_NAME" ]; then + SUBNET_ID=$(az network nic show --resource-group "$RESOURCE_GROUP" --name "$NIC_NAME" --query 'ipConfigurations[0].subnet.id' -o tsv || echo "") + if [ -n "$SUBNET_ID" ]; then + VNET_NAME=$(echo "$SUBNET_ID" | cut -d'/' -f9) + fi + fi + + # Delete VM + echo "๐Ÿ—‘๏ธ Deleting VM..." + az vm delete --resource-group "$RESOURCE_GROUP" --name "$VM_NAME" --yes || echo "โš ๏ธ VM already deleted or not found" + + # Delete NIC + if [ -n "$NIC_NAME" ]; then + echo "๐Ÿ—‘๏ธ Deleting NIC: $NIC_NAME" + az network nic delete --resource-group "$RESOURCE_GROUP" --name "$NIC_NAME" || echo "โš ๏ธ NIC not found" + fi + + # Delete OS disk + if [ -n "$DISK_NAME" ]; then + echo "๐Ÿ—‘๏ธ Deleting OS disk: $DISK_NAME" + az disk delete --resource-group "$RESOURCE_GROUP" --name "$DISK_NAME" --yes || echo "โš ๏ธ Disk not found" + fi + + # Delete NSG + if [ -n "$NSG_NAME" ]; then + echo "๐Ÿ—‘๏ธ Deleting NSG: $NSG_NAME" + az network nsg delete --resource-group "$RESOURCE_GROUP" --name "$NSG_NAME" || echo "โš ๏ธ NSG not found" + fi + + # Delete VNet + if [ -n "$VNET_NAME" ]; then + echo "๐Ÿ—‘๏ธ Deleting VNet: $VNET_NAME" + az network vnet delete --resource-group "$RESOURCE_GROUP" --name "$VNET_NAME" || echo "โš ๏ธ VNet not found or shared" + fi + + echo "โœ… Cleanup complete." diff --git a/.github/workflows/check-frame-omni-bencher.yml b/.github/workflows/check-frame-omni-bencher.yml new file mode 100644 index 000000000..e3043c136 --- /dev/null +++ b/.github/workflows/check-frame-omni-bencher.yml @@ -0,0 +1,58 @@ +name: Short benchmarks (frame-omni-bencher) + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + RUNTIME_NAME: kreivo_runtime.compact.compressed.wasm + +jobs: + build: + runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci + steps: + - uses: actions/checkout@v4 + + - name: Release build with `runtime-benchmarks` + uses: actions-rs/cargo@v1 + with: + command: build + args: --profile production --features ${{ github.ref_name == 'dev' && 'paseo,runtime-benchmarks' || 'runtime-benchmarks' }} --locked -p kreivo-runtime + + - name: Upload runtime to artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ github.run_number }}-runtime + path: ./target/production/wbuild/kreivo-runtime/${{ env.RUNTIME_NAME }} + + quick-benchmarks-omni: + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Get artifacts + uses: actions/download-artifact@v4 + with: + name: ${{ github.run_number }}-runtime + + - name: Download CLI + run: | + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-stable2503/frame-omni-bencher -o frame-omni-bencher + chmod +x ./frame-omni-bencher + echo "Using frame-omni-bencher version:" + ./frame-omni-bencher --version + + - name: script + id: required + run: | + ./frame-omni-bencher v1 benchmark pallet --runtime ${{ env.RUNTIME_NAME }} --all --steps 2 --repeat 1 --quiet diff --git a/.github/workflows/check-migration.yml b/.github/workflows/check-migration.yml index eb4a509e6..f3c6166a9 100644 --- a/.github/workflows/check-migration.yml +++ b/.github/workflows/check-migration.yml @@ -1,26 +1,20 @@ name: Run Check Migrations on: - workflow_run: - workflows: ["Lint, check, clippy and test"] - types: - - completed + push: + branches: [ main ] + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci steps: - - name: Setup Ubuntu dependencies - shell: bash - run: sudo apt update && sudo apt install -y protobuf-compiler - - - name: Use Stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: wasm32-unknown-unknown - components: rust-src - - uses: actions/checkout@v4 - name: Rust Cache @@ -40,7 +34,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ github.run_number }}-runtime - path: ./target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm + path: ./target/production/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm check_migrations: name: Check Migrations @@ -49,15 +43,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Create `target/release` folder - run: | - mkdir -p target/release - - name: Get artifacts uses: actions/download-artifact@v4 with: - name: ${{ github.ref }}-runtime - path: ./target/release + name: ${{ github.run_number }}-runtime - name: Download CLI run: | @@ -83,9 +72,9 @@ jobs: if: ${{ hashFiles('snapshot.raw') == '' }} run: | echo "Creating new snapshot for today (${{ steps.get-date.outputs.today }})" - ./try-runtime create-snapshot --uri ${{ matrix.uri }} snapshot.raw + ./try-runtime create-snapshot --uri wss://kreivo.kippu.rocks snapshot.raw - run: | - ./try-runtime --runtime target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm \ + ./try-runtime --runtime kreivo_runtime.compact.compressed.wasm \ on-runtime-upgrade --disable-spec-version-check --checks=all --blocktime 6000 \ - live --uri wss://kreivo.io + snap -p snapshot.raw \ No newline at end of file diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7144cc643..65e9fa4b3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Lint, check, clippy and test +name: Checks on: push: @@ -6,42 +6,20 @@ on: pull_request: types: [ opened, synchronize, reopened, ready_for_review ] -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Use Nightly with `rustfmt` - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true - - uses: actions/checkout@v4 - - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - toolchain: nightly - command: fmt - args: --all -- --check +env: + NIGHTLY_VERSION: 'nightly' + EXTRA_ARGS: '' +jobs: check: - needs: lint runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci steps: - - name: Setup Ubuntu dependencies - shell: bash - run: sudo apt update && sudo apt install -y protobuf-compiler - - - name: Use Nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - target: wasm32-unknown-unknown - components: rust-src - - uses: actions/checkout@v4 - name: Rust Cache @@ -55,28 +33,18 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - toolchain: nightly - args: --release --locked --all-features --workspace + toolchain: ${{ env.NIGHTLY_VERSION }} + args: --release --locked --all-features --workspace ${{ env.EXTRA_ARGS }} clippy: - needs: lint runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci permissions: checks: write env: SKIP_WASM_BUILD: 1 steps: - - name: Setup Ubuntu dependencies - shell: bash - run: sudo apt update && sudo apt install -y protobuf-compiler - - - name: Use Nightly with `clippy` - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: clippy,rust-src - - uses: actions/checkout@v4 - name: Rust Cache @@ -90,26 +58,16 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - toolchain: nightly - args: --release --locked --all-features --workspace + toolchain: ${{ env.NIGHTLY_VERSION }} + args: --release --locked --all-features --workspace ${{ env.EXTRA_ARGS }} test: - needs: lint runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci env: SKIP_WASM_BUILD: 1 steps: - - name: Setup Ubuntu dependencies - shell: bash - run: sudo apt update && sudo apt install -y protobuf-compiler - - - name: Use Nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rust-src - - uses: actions/checkout@v4 - name: Rust Cache @@ -123,5 +81,5 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - toolchain: nightly - args: --lib --release --locked --all-features --workspace + toolchain: ${{ env.NIGHTLY_VERSION }} + args: --lib --locked --all-features --workspace ${{ env.EXTRA_ARGS }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..ff61a5103 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,43 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + NIGHTLY_VERSION: 'nightly' + EXTRA_ARGS: '' + +jobs: + zepter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install `zepter` CLI + run: | + cargo install zepter -f --locked + + - name: run checks + run: | + zepter run check + + fmt: + runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci + steps: + - uses: actions/checkout@v4 + + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + toolchain: ${{ env.NIGHTLY_VERSION }} + command: fmt + args: --all -- --check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b55c70b8..ed5469ac4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,19 +8,9 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: pandres95/kreivo-ci steps: - - name: Setup Ubuntu dependencies - shell: bash - run: sudo apt update && sudo apt install -y protobuf-compiler - - - name: Use Stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: wasm32-unknown-unknown - components: rust-src - - uses: actions/checkout@v4 - name: Rust Cache @@ -34,7 +24,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --profile production --features ${{ contains(github.ref, '-pre') && 'paseo' || 'try-runtime' }} --locked -p kreivo-runtime + args: --profile production --features ${{ contains(github.ref, '-pre') && 'paseo,try-runtime' || 'try-runtime' }} --locked -p kreivo-runtime - name: Upload runtime to artifacts uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 87bac7eb0..5dec71ade 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .static/ node_modules/ - +.polkadot-sdk/ # Generated by Cargo # will have compiled files and executables diff --git a/.rustfmt.toml b/.rustfmt.toml index c820ac572..5ba7c78e7 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,4 +1,4 @@ reorder_imports = true hard_tabs = true max_width = 120 -wrap_comments = true +# wrap_comments = true diff --git a/Cargo.lock b/Cargo.lock index 4c1c024b9..c616e0f21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,27 +14,27 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.27.3", + "gimli 0.31.1", ] [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ - "gimli 0.31.1", + "gimli 0.32.3", ] [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aead" @@ -73,12 +73,12 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.3.3", "once_cell", "version_check", "zerocopy", @@ -100,10 +100,234 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] -name = "android-tzdata" -version = "0.1.1" +name = "alloy-core" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575053cea24ea8cb7e775e39d5c53c33b19cfd0ca1cf6c0fd653f3d8c682095f" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6c2905bafc2df7ccd32ca3af13f0b0d82f2e2ff9dfbeb12196c0d978d5c0deb" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-eip2124" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "741bdd7499908b3aa0b159bba11e71c8cddd009a2c2eb7a06e825f1ec87900a5" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror 2.0.17", +] + +[[package]] +name = "alloy-eip2930" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b82752a889170df67bbb36d42ca63c531eb16274f0d7299ae2a680facba17bd" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4769c6ffddca380b0070d71c8b7f30bed375543fe76bb2f74ec0acf4b7cd16" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "k256", + "serde", + "thiserror 2.0.17", +] + +[[package]] +name = "alloy-eips" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305fa99b538ca7006b0c03cfed24ec6d82beda67aac857ef4714be24231d15e6" +dependencies = [ + "alloy-eip2124", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "auto_impl", + "c-kzg", + "derive_more 2.0.1", + "either", + "serde", + "serde_with", + "sha2 0.10.9", + "thiserror 2.0.17", +] + +[[package]] +name = "alloy-json-abi" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2acb6637a9c0e1cdf8971e0ced8f3fa34c04c5e9dccf6bb184f6a64fe0e37d8" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b77f7d5e60ad8ae6bd2200b8097919712a07a6db622a4b201e7ead6166f02e5" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash 0.2.0", + "hashbrown 0.16.0", + "indexmap 2.11.4", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.2", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "alloy-serde" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8468f1a7f9ee3bae73c24eead0239abea720dbf7779384b9c7e20d51bfb6b0" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c84c3637bee9b5c4a4d2b93360ee16553d299c3b932712353caf1cea76d0e6" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a882aa4e1790063362434b9b40d358942b188477ac1c44cfb8a52816ffc0cc17" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck 0.5.0", + "indexmap 2.11.4", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +checksum = "18e5772107f9bb265d8d8c86e0733937bb20d0857ea5425b1b6ddf51a9804042" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.106", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e188b939aa4793edfaaa099cb1be4e620036a775b4bdf24fdc56f1cd6fd45890" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c8a9a909872097caffc05df134e5ef2253a1cdb56d3a9cf0052a042ac763f9" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "serde", +] [[package]] name = "android_system_properties" @@ -116,9 +340,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -131,44 +355,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "once_cell", - "windows-sys 0.59.0", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "approx" @@ -190,18 +414,24 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + [[package]] name = "ark-bls12-377" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -210,10 +440,34 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-r1cs-std", + "ark-std 0.5.0", ] [[package]] @@ -222,10 +476,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "itertools 0.10.5", @@ -233,26 +487,107 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "digest 0.10.7", "itertools 0.10.5", "num-bigint", "num-traits", "paste", - "rustc_version", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", "zeroize", ] +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -263,6 +598,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.106", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -276,27 +633,107 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "ark-poly" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", ] +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-relations", + "ark-std 0.5.0", + "educe", + "num-bigint", + "num-integer", + "num-traits", + "tracing", +] + +[[package]] +name = "ark-relations" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" +dependencies = [ + "ark-ff 0.5.0", + "ark-std 0.5.0", + "tracing", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + [[package]] name = "ark-serialize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive", - "ark-std", + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", "digest 0.10.7", "num-bigint", ] @@ -312,6 +749,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -319,7 +777,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", ] [[package]] @@ -348,12 +849,12 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive 0.4.0", - "asn1-rs-impl 0.1.0", + "asn1-rs-derive 0.5.1", + "asn1-rs-impl", "displaydoc", "nom", "num-traits", @@ -364,32 +865,20 @@ dependencies = [ [[package]] name = "asn1-rs" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" dependencies = [ - "asn1-rs-derive 0.5.1", - "asn1-rs-impl 0.2.0", + "asn1-rs-derive 0.6.0", + "asn1-rs-impl", "displaydoc", "nom", "num-traits", "rusticata-macros", - "thiserror 1.0.69", + "thiserror 2.0.17", "time", ] -[[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 0.12.6", -] - [[package]] name = "asn1-rs-derive" version = "0.5.1" @@ -398,19 +887,20 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", - "synstructure 0.13.1", + "syn 2.0.106", + "synstructure 0.13.2", ] [[package]] -name = "asn1-rs-impl" -version = "0.1.0" +name = "asn1-rs-derive" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", + "synstructure 0.13.2", ] [[package]] @@ -421,7 +911,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -432,25 +922,30 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "assets-common" -version = "0.18.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d5ca479930426bccab622fd7143a67519485528f66b492cffae286081439c1b" dependencies = [ "cumulus-primitives-core", + "ethereum-standards", "frame-support", + "frame-system", "impl-trait-for-tuples", - "log", "pallet-asset-conversion", "pallet-assets", + "pallet-revive", + "pallet-revive-uapi", "pallet-xcm", "parachains-common", "parity-scale-codec", "scale-info", "sp-api", + "sp-core", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", - "substrate-wasm-builder", + "tracing", ] [[package]] @@ -460,49 +955,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener", "futures-core", ] [[package]] name = "async-io" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" dependencies = [ - "async-lock", + "autocfg", "cfg-if", "concurrent-queue", "futures-io", "futures-lite", "parking", "polling", - "rustix 0.38.44", + "rustix", "slab", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.4.0", - "event-listener-strategy", - "pin-project-lite", + "windows-sys 0.61.2", ] [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -518,6 +1001,19 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -532,28 +1028,55 @@ checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ "http 0.2.12", "log", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aurora-engine-modexp" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9" +dependencies = [ + "hex", + "num", +] + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ - "addr2line 0.24.2", + "addr2line 0.25.1", "cfg-if", "libc", "miniz_oxide", - "object 0.36.7", + "object 0.37.3", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -569,16 +1092,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] -name = "base64" -version = "0.13.1" +name = "base256emoji" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "b5e9430d9a245a77c92176e649af6e275f20839a48389859d1661e9a128d077c" +dependencies = [ + "const-str", + "match-lookup", +] [[package]] -name = "base64" -version = "0.21.7" +name = "base58" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64" @@ -588,25 +1115,76 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "binary-merkle-tree" +version = "16.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95c9f6900c9fd344d53fbdfb36e1343429079d73f4168c8ef48884bf15616dbd" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", +] + +[[package]] +name = "bip32" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" +dependencies = [ + "bs58", + "hmac 0.12.1", + "k256", + "rand_core 0.6.4", + "ripemd", + "secp256k1 0.27.0", + "sha2 0.10.9", + "subtle", + "zeroize", +] [[package]] -name = "bincode" -version = "1.3.3" +name = "bip39" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" dependencies = [ + "bitcoin_hashes 0.13.0", "serde", + "unicode-normalization", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", ] +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitcoin-internals" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -614,7 +1192,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ "bitcoin-internals", - "hex-conservative", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", ] [[package]] @@ -625,9 +1213,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "bitvec" @@ -653,9 +1241,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", @@ -664,9 +1252,9 @@ dependencies = [ [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "e90f7deecfac93095eb874a40febd69427776e24e1bd7f87f33ac62d6f0174df" dependencies = [ "arrayref", "arrayvec", @@ -675,9 +1263,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.5" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -704,11 +1292,23 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcdb4c7013139a150f9fc55d123186dbfaba0d912817466282c73ac49e71fb45" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bounded-collections" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d077619e9c237a5d1875166f5e8033e8f6bff0c96f8caf81e1c2d7738c431bf" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" dependencies = [ "log", "parity-scale-codec", @@ -717,22 +1317,30 @@ dependencies = [ ] [[package]] -name = "bp-xcm-bridge-hub-router" -version = "0.14.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "bounded-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee8eddd066a8825ec5570528e6880471210fd5d88cb6abbe1cfdd51ca249c33" dependencies = [ + "jam-codec", + "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "staging-xcm 14.2.0", + "serde", ] [[package]] -name = "bs58" -version = "0.4.0" +name = "bp-xcm-bridge-hub-router" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "63b92f03274fd9e49a1b7d265821f92b43a3afb050c63e120e61527aebe0ba79" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "staging-xcm 19.0.0", +] [[package]] name = "bs58" @@ -740,6 +1348,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ + "sha2 0.10.9", "tinyvec", ] @@ -754,21 +1363,24 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +dependencies = [ + "allocator-api2", +] [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" [[package]] name = "byteorder" @@ -778,19 +1390,37 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] [[package]] -name = "camino" -version = "1.1.9" +name = "c-kzg" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "e00bf4b112b07b505472dbefd19e37e53307e2bfed5a79e0cc161d58ccd0e687" dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", "serde", ] +[[package]] +name = "camino" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +dependencies = [ + "serde_core", +] + [[package]] name = "cargo-platform" version = "0.1.9" @@ -808,7 +1438,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.25", + "semver 1.0.27", "serde", "serde_json", "thiserror 1.0.69", @@ -816,10 +1446,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.10" +version = "1.2.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -836,9 +1467,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" @@ -866,7 +1503,7 @@ dependencies = [ [[package]] name = "chain-spec-generator" -version = "0.15.1" +version = "0.16.0" dependencies = [ "clap", "kreivo-runtime", @@ -876,16 +1513,43 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-link", +] + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", ] [[package]] @@ -903,15 +1567,14 @@ dependencies = [ [[package]] name = "cid" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +checksum = "3147d8272e8fa0ccd29ce51194dd98f79ddfb8191ba9e3409884e751798acf3a" dependencies = [ "core2", "multibase", - "multihash 0.18.1", - "serde", - "unsigned-varint 0.7.2", + "multihash 0.19.3", + "unsigned-varint 0.8.0", ] [[package]] @@ -927,9 +1590,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.27" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ "clap_builder", "clap_derive", @@ -937,9 +1600,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ "anstream", "anstyle", @@ -949,47 +1612,47 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "cobs" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" dependencies = [ - "termcolor", - "unicode-width 0.1.14", + "thiserror 2.0.17", ] [[package]] -name = "colorchoice" -version = "1.0.3" +name = "codespan-reporting" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] [[package]] -name = "combine" -version = "4.6.7" +name = "colorchoice" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "common-path" @@ -1008,17 +1671,29 @@ dependencies = [ [[package]] name = "console" -version = "0.15.10" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.0", + "unicode-width", "windows-sys 0.59.0", ] +[[package]] +name = "const-hex" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6407bff74dea37e0fa3dc1c1c974e5d46405f0c987bf9997a0762adce71eda6" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -1040,11 +1715,17 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom", + "getrandom 0.2.16", "once_cell", "tiny-keccak", ] +[[package]] +name = "const-str" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" + [[package]] name = "const_env" version = "0.1.2" @@ -1066,16 +1747,30 @@ dependencies = [ ] [[package]] -name = "constant_time_eq" -version = "0.3.1" +name = "const_format" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] [[package]] -name = "constcat" +name = "constant_time_eq" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -1093,6 +1788,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1109,81 +1814,140 @@ dependencies = [ ] [[package]] -name = "cpp_demangle" -version = "0.3.5" +name = "coset" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8cc80f631f8307b887faca24dcc3abc427cd0367f6eb6188f6e8f5b7ad8fb" +dependencies = [ + "ciborium", + "ciborium-io", +] + +[[package]] +name = "cpp_demangle" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bb79cb74d735044c972aae58ed0aaa9a837e85b01106a54c39e42e97f62253" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-assembler-x64" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +checksum = "0ae7b60ec3fd7162427d3b3801520a1908bef7c035b52983cd3ca11b8e7deb51" dependencies = [ - "cfg-if", + "cranelift-assembler-x64-meta", ] [[package]] -name = "cpufeatures" -version = "0.2.16" +name = "cranelift-assembler-x64-meta" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "6511c200fed36452697b4b6b161eae57d917a2044e6333b1c1389ed63ccadeee" dependencies = [ - "libc", + "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" +checksum = "5f7086a645aa58bae979312f64e3029ac760ac1b577f5cd2417844842a2ca07f" dependencies = [ "cranelift-entity", ] +[[package]] +name = "cranelift-bitset" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5225b4dec45f3f3dbf383f12560fac5ce8d780f399893607e21406e12e77f491" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "cranelift-codegen" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" +checksum = "858fb3331e53492a95979378d6df5208dd1d0d315f19c052be8115f4efc888e0" dependencies = [ "bumpalo", + "cranelift-assembler-x64", "cranelift-bforest", + "cranelift-bitset", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.27.3", - "hashbrown 0.13.2", + "gimli 0.31.1", + "hashbrown 0.15.5", "log", - "regalloc2 0.6.1", + "pulley-interpreter", + "regalloc2 0.12.2", + "rustc-hash 2.1.1", + "serde", "smallvec", "target-lexicon", + "wasmtime-internal-math", ] [[package]] name = "cranelift-codegen-meta" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" +checksum = "456715b9d5f12398f156d5081096e7b5d039f01b9ecc49790a011c8e43e65b5f" dependencies = [ + "cranelift-assembler-x64-meta", "cranelift-codegen-shared", + "cranelift-srcgen", + "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.95.1" +version = "0.122.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0306041099499833f167a0ddb707e1e54100f1a84eab5631bc3dad249708f482" + +[[package]] +name = "cranelift-control" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" +checksum = "1672945e1f9afc2297f49c92623f5eabc64398e2cb0d824f8f72a2db2df5af23" +dependencies = [ + "arbitrary", +] [[package]] name = "cranelift-entity" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +checksum = "aa3cd55eb5f3825b9ae5de1530887907360a6334caccdc124c52f6d75246c98a" dependencies = [ + "cranelift-bitset", "serde", + "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" +checksum = "781f9905f8139b8de22987b66b522b416fe63eb76d823f0b3a8c02c8fd9500c7" dependencies = [ "cranelift-codegen", "log", @@ -1193,15 +1957,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" +checksum = "a05337a2b02c3df00b4dd9a263a027a07b3dff49f61f7da3b5d195c21eaa633d" [[package]] name = "cranelift-native" -version = "0.95.1" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" +checksum = "2eee7a496dd66380082c9c5b6f2d5fa149cec0ec383feec5caf079ca2b3671c2" dependencies = [ "cranelift-codegen", "libc", @@ -1209,26 +1973,16 @@ dependencies = [ ] [[package]] -name = "cranelift-wasm" -version = "0.95.1" +name = "cranelift-srcgen" +version = "0.122.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.5", - "log", - "smallvec", - "wasmparser", - "wasmtime-types", -] +checksum = "b530783809a55cb68d070e0de60cfbb3db0dc94c8850dd5725411422bedcf6bb" [[package]] name = "crc" -version = "3.2.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" dependencies = [ "crc-catalog", ] @@ -1241,13 +1995,28 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -1275,9 +2044,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" @@ -1286,7 +2055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1298,7 +2067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "typenum", ] @@ -1312,6 +2081,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + [[package]] name = "ctr" version = "0.9.2" @@ -1323,8 +2107,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae71c2557c310fe8fc6bb49f4a9be0813675845c3418ec598287b53842711a1" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -1340,8 +2125,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a03fe1d388844284c6c60ef3094d7f38895ffeacb36eb0ed86c7d6eda88fc49" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1352,24 +2138,25 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "hashbrown 0.15.5", "impl-trait-for-tuples", "log", "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", - "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", + "sp-consensus-babe", "sp-core", "sp-externalities", "sp-inherents", "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", "sp-trie", "sp-version", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "trie-db", ] @@ -1377,18 +2164,20 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "befbaf3a1ce23ac8476481484fef5f4d500cbd15b4dad6380ce1d28134b0c1f7" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "cumulus-pallet-session-benchmarking" -version = "19.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8756b178fffef8c8ddaa84b0c97ac6ba2394a426b60b0ceac4e08fcd5b675d6" dependencies = [ "frame-benchmarking", "frame-support", @@ -1400,8 +2189,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a9728ca4bccdd222e3dbaf86730904649b007c35ffc75df496b01426ee91bd6" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1410,21 +2200,22 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", ] [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87feee68f7cd7f7391fbb72c922592e7b37dc8b035ef7a18861d9b77a15a10bd" dependencies = [ - "bounded-collections", + "approx", + "bounded-collections 0.3.2", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", - "log", "pallet-message-queue", "parity-scale-codec", "polkadot-runtime-common", @@ -1433,15 +2224,17 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", + "tracing", ] [[package]] name = "cumulus-primitives-aura" -version = "0.15.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af72499950fe7e8a02da9510418a90e2f9c7d4fb413a01d1889dd38641fcfedd" dependencies = [ "sp-api", "sp-consensus-aura", @@ -1449,8 +2242,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" -version = "0.16.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2534e4bc9829e463e4d65dc7429c7b78a4e71b43dd58ecf8493ec9a5d2e57860" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -1460,13 +2254,15 @@ dependencies = [ "sp-api", "sp-runtime", "sp-trie", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", + "tracing", ] [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.16.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7adeba46a8782f1505c8aae0da8c40314fa1671701c07a827460366ec992bb48" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1479,8 +2275,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.10.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25c20da1bdc3ec95e46447b83905719ef6ccf49e12990ca95252e0eb283ca816" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -1489,8 +2286,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" -version = "0.16.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f304a253e8520a49725297f3f03cea2c80b583fa8fd7341dcb2aaf2b58bfff3" dependencies = [ "cumulus-primitives-core", "sp-inherents", @@ -1499,8 +2297,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17dca78e1628a375ddf5d815b0d84c7748b40823c25df0f9d5a33d30c02ccb8" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1509,7 +2308,7 @@ dependencies = [ "parity-scale-codec", "polkadot-runtime-common", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", ] @@ -1525,7 +2324,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version", + "rustc_version 0.4.1", "subtle", "zeroize", ] @@ -1538,66 +2337,70 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "cxx" -version = "1.0.137" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc894913dccfed0f84106062c284fa021c3ba70cb1d78797d6f5165d4492e45" +checksum = "4e9c4fe7f2f5dc5c62871a1b43992d197da6fa1394656a94276ac2894a90a6fe" dependencies = [ "cc", + "cxx-build", "cxxbridge-cmd", "cxxbridge-flags", "cxxbridge-macro", - "foldhash", + "foldhash 0.2.0", "link-cplusplus", ] [[package]] name = "cxx-build" -version = "1.0.137" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503b2bfb6b3e8ce7f95d865a67419451832083d3186958290cee6c53e39dfcfe" +checksum = "b5cf2909d37d80633ddd208676fc27c2608a7f035fff69c882421168038b26dd" dependencies = [ "cc", "codespan-reporting", + "indexmap 2.11.4", "proc-macro2", "quote", "scratch", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "cxxbridge-cmd" -version = "1.0.137" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d2cb64a95b4b5a381971482235c4db2e0208302a962acdbe314db03cbbe2fb" +checksum = "077f5ee3d3bfd8d27f83208fdaa96ddd50af7f096c77077cc4b94da10bfacefd" dependencies = [ "clap", "codespan-reporting", + "indexmap 2.11.4", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "cxxbridge-flags" -version = "1.0.137" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f797b0206463c9c2a68ed605ab28892cca784f1ef066050f4942e3de26ad885" +checksum = "b0108748615125b9f2e915dfafdffcbdabbca9b15102834f6d7e9a768f2f2864" [[package]] name = "cxxbridge-macro" -version = "1.0.137" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79010a2093848e65a3e0f7062d3f02fb2ef27f866416dfe436fccfa73d3bb59" +checksum = "e6e896681ef9b8dc462cfa6961d61909704bde0984b30bcb4082fe102b478890" dependencies = [ + "indexmap 2.11.4", "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -1606,8 +2409,28 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core 0.21.3", + "darling_macro 0.21.3", ] [[package]] @@ -1624,28 +2447,78 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.106", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.106", +] + [[package]] name = "darling_macro" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core", + "darling_core 0.14.4", "quote", "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core 0.21.3", + "quote", + "syn 2.0.106", +] + [[package]] name = "data-encoding" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "data-encoding-macro" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b16d9d0d88a5273d830dac8b78ceb217ffc9b1d5404e5597a3542515329405b" +checksum = "47ce6c96ea0102f01122a185683611bd5ac8d99e62bc59dd12e6bda344ee673d" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1653,31 +2526,32 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145d32e826a7748b69ee8fc62d3e6355ff7f1051df53141e7048162fc90481b" +checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" dependencies = [ "data-encoding", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] [[package]] name = "der-parser" -version = "8.2.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs 0.6.2", "displaydoc", "nom", "num-bigint", @@ -1687,11 +2561,11 @@ dependencies = [ [[package]] name = "der-parser" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" dependencies = [ - "asn1-rs 0.6.2", + "asn1-rs 0.7.1", "displaydoc", "nom", "num-bigint", @@ -1701,11 +2575,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" dependencies = [ "powerfmt", + "serde_core", ] [[package]] @@ -1727,20 +2602,31 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", +] + +[[package]] +name = "derive-where" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 2.0.96", + "rustc_version 0.4.1", + "syn 2.0.106", ] [[package]] @@ -1749,7 +2635,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl", + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", ] [[package]] @@ -1760,15 +2655,21 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", "unicode-xid", ] [[package]] -name = "difflib" -version = "0.4.0" +name = "derive_more-impl" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "unicode-xid", +] [[package]] name = "digest" @@ -1801,6 +2702,27 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1820,7 +2742,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -1844,9 +2766,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.96", + "syn 2.0.106", "termcolor", - "toml 0.8.19", + "toml 0.8.23", "walkdir", ] @@ -1864,36 +2786,21 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dtoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" - -[[package]] -name = "dyn-clonable" -version = "0.9.0" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] +checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" [[package]] -name = "dyn-clonable-impl" -version = "0.9.0" +name = "dunce" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "ecdsa" @@ -1922,39 +2829,52 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core", + "rand_core 0.6.4", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "subtle", "zeroize", ] [[package]] name = "ed25519-zebra" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.5", - "hex", - "rand_core", - "sha2 0.10.8", + "hashbrown 0.15.5", + "pkcs8", + "rand_core 0.6.4", + "sha2 0.10.9", + "subtle", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -1969,13 +2889,25 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "serdect", "subtle", "zeroize", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encode_unicode" version = "1.0.0" @@ -1984,46 +2916,54 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enum-as-inner" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] -name = "enum-as-inner" -version = "0.6.1" +name = "enum-ordinalize" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ - "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "enumflags2" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -2034,20 +2974,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", + "syn 2.0.106", ] [[package]] @@ -2058,47 +2985,66 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] -name = "event-listener" -version = "2.5.3" +name = "ethbloom" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde 0.5.0", + "scale-info", + "tiny-keccak", +] [[package]] -name = "event-listener" -version = "5.4.0" +name = "ethereum-standards" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +checksum = "c5bb19a698ceb837a145395f230f1ee1c4ec751bc8038dfc616a669cfb4a01de" dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", + "alloy-core", ] [[package]] -name = "event-listener-strategy" -version = "0.5.3" +name = "ethereum-types" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" dependencies = [ - "event-listener 5.4.0", - "pin-project-lite", + "ethbloom", + "fixed-hash", + "impl-codec 0.7.1", + "impl-rlp", + "impl-serde 0.5.0", + "primitive-types 0.13.1", + "scale-info", + "uint 0.10.0", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "expander" version = "2.2.1" @@ -2108,18 +3054,12 @@ dependencies = [ "blake2", "file-guard", "fs-err", - "prettyplease 0.2.29", + "prettyplease", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -2132,23 +3072,105 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fc-pallet-black-hole" +version = "1.0.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + +[[package]] +name = "fc-pallet-communities" +version = "1.0.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "frame-benchmarking", + "frame-contrib-traits", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "staging-xcm 19.0.0", +] + [[package]] name = "fc-pallet-gas-transaction-payment" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ - "fc-traits-gas-tank", + "frame-contrib-traits", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + +[[package]] +name = "fc-pallet-listings" +version = "1.0.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "fc-traits-listings", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-nfts", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "fc-pallet-orders" +version = "1.0.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "frame-benchmarking", + "frame-contrib-traits", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-core", + "sp-io", "sp-runtime", ] [[package]] name = "fc-pallet-pass" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "fc-traits-authn", "frame-benchmarking", @@ -2158,15 +3180,30 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core", + "sp-runtime", +] + +[[package]] +name = "fc-pallet-payments" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "fc-traits-payments", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", ] [[package]] name = "fc-pallet-referenda-tracks" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "fc-traits-tracks", "frame-benchmarking", @@ -2179,13 +3216,12 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", ] [[package]] name = "fc-traits-authn" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "fc-traits-authn-proc", "frame-support", @@ -2197,16 +3233,17 @@ dependencies = [ [[package]] name = "fc-traits-authn-proc" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ + "proc-macro-crate 3.4.0", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "fc-traits-gas-tank" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "fc-traits-nonfungibles-helpers", "frame-support", @@ -2215,10 +3252,21 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "fc-traits-listings" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "fc-traits-memberships" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "frame-support", "parity-scale-codec", @@ -2228,12 +3276,23 @@ dependencies = [ [[package]] name = "fc-traits-nonfungibles-helpers" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" + +[[package]] +name = "fc-traits-payments" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", +] [[package]] name = "fc-traits-tracks" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ "frame-support", "pallet-referenda", @@ -2243,11 +3302,11 @@ dependencies = [ [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2267,33 +3326,23 @@ dependencies = [ "winapi", ] -[[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", - "log", -] - [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "finality-grandpa" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" +checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc" dependencies = [ "either", "futures", @@ -2301,10 +3350,16 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "scale-info", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2312,25 +3367,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "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 = "float-cmp" -version = "0.9.0" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -2340,52 +3386,44 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" - -[[package]] -name = "foreign-types" -version = "0.3.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "foldhash" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ - "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "form_urlencoded" -version = "1.2.1" -source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" +version = "1.2.2" +source = "git+https://github.com/servo/rust-url#9771ab51f0aaa02ca1884f88c577260e9b86f9b6" dependencies = [ - "percent-encoding 2.3.1 (git+https://github.com/servo/rust-url)", + "percent-encoding 2.3.2 (git+https://github.com/servo/rust-url)", ] [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "766acd80fe6ac9504415051fc183f67511eabf764a3bef74813d4111c4558774" dependencies = [ "frame-support", "frame-support-procedural", @@ -2406,37 +3444,68 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-contrib-traits" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" +dependencies = [ + "fc-traits-authn", + "fc-traits-gas-tank", + "fc-traits-listings", + "fc-traits-memberships", + "fc-traits-payments", + "fc-traits-tracks", +] + +[[package]] +name = "frame-decode" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cb8796f93fa038f979a014234d632e9688a120e745f936e2635123c77537f7" +dependencies = [ + "frame-metadata 21.0.0", + "parity-scale-codec", + "scale-decode 0.16.0", + "scale-info", + "scale-type-resolver 0.2.0", + "sp-crypto-hashing", +] + [[package]] name = "frame-election-provider-solution-type" -version = "14.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "16.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b525f462fa8121c3d143ad0d876660584f160ad5baa68c57bfeeb293c6b8fb" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "frame-election-provider-support" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ddd171c606313e738594a9dabe2d2a911239e6a78b5419faf2a2d6b106570c" dependencies = [ "frame-election-provider-solution-type", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-npos-elections", "sp-runtime", + "sp-std", ] [[package]] name = "frame-executive" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2897ed8d2696f4f7cadef11b6deabd74da7173bacf20919f8711f458fa2038cc" dependencies = [ "aquamarine", "frame-support", @@ -2453,9 +3522,31 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "16.0.0" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20dfd1d7eae1d94e32e869e2fb272d81f52dd8db57820a373adb83ea24d7d862" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2465,15 +3556,17 @@ dependencies = [ [[package]] name = "frame-support" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde06b7bc60331e0ebb9f7bededa4c79cadc209cf9728b2c685856d418e79487" dependencies = [ "aquamarine", "array-bytes", + "binary-merkle-tree", "bitflags 1.3.2", "docify", "environmental", - "frame-metadata", + "frame-metadata 23.0.0", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -2484,12 +3577,11 @@ dependencies = [ "scale-info", "serde", "serde_json", - "smallvec", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-debug-derive", "sp-genesis-builder", "sp-inherents", "sp-io", @@ -2497,17 +3589,18 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", "sp-tracing", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "static_assertions", + "sp-trie", + "sp-weights 33.1.0", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "30.0.3" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c481996abeb9027d9a4d62d0c2cb4115c0ee6ef3120ad234fa2776b6313a4ed4" dependencies = [ "Inflector", "cfg-expr", @@ -2517,39 +3610,42 @@ dependencies = [ "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", - "proc-macro-warning 1.0.2", + "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "frame-support-procedural-tools" -version = "13.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "13.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "frame-system" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ec7d4d9abe4ec9ad4a48c88ddcf654e92a47393001d55760244a906a282c9e" dependencies = [ "cfg-if", "docify", @@ -2561,15 +3657,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", "sp-version", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", ] [[package]] name = "frame-system-benchmarking" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b953ecbcccb719ec37ee0bb3711618d61ca390e9755b57a276ae536a577b66e6" dependencies = [ "frame-benchmarking", "frame-support", @@ -2582,8 +3678,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb2ff9f335375bd834a6af597e4111e9101848e407aa61442934b8f631e874c" dependencies = [ "docify", "parity-scale-codec", @@ -2592,8 +3689,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.44.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42efe41db00ed663234c202a65a97c28dfbbec37618752518127d9bb41834541" dependencies = [ "frame-support", "parity-scale-codec", @@ -2633,9 +3731,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.1.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" dependencies = [ "futures-timer", "futures-util", @@ -2677,9 +3775,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" dependencies = [ "futures-core", "pin-project-lite", @@ -2693,17 +3791,18 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "futures-rustls" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.21.12", + "rustls", + "rustls-pki-types", ] [[package]] @@ -2743,34 +3842,41 @@ dependencies = [ ] [[package]] -name = "fxhash" -version = "0.2.1" +name = "generic-array" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" dependencies = [ - "byteorder", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "getrandom" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ - "typenum", - "version_check", - "zeroize", + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.2.15" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi", + "r-efi", + "wasi 0.14.7+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -2779,8 +3885,8 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand", - "rand_core", + "rand 0.8.5", + "rand_core 0.6.4", ] [[package]] @@ -2790,35 +3896,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", - "polyval", -] - -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator 0.2.0", - "indexmap 1.9.3", - "stable_deref_trait", + "polyval", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ - "fallible-iterator 0.3.0", + "fallible-iterator", + "indexmap 2.11.4", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "gmp-mpfr-sys" +version = "1.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f8970a75c006bb2f8ae79c6768a116dd215fa8346a87aed99bf9d82ca43394" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] [[package]] name = "group" @@ -2827,15 +3939,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" dependencies = [ "bytes", "fnv", @@ -2843,7 +3955,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.1", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -2852,23 +3964,34 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.2.0", - "indexmap 2.7.1", + "http 1.3.1", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "half" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54c115d4f30f52c67202f079c5f9d8b49db4691f460fdb0b4c2e838261b2ba5" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + [[package]] name = "hash-db" version = "0.16.0" @@ -2911,13 +4034,24 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +dependencies = [ + "foldhash 0.2.0", + "serde", ] [[package]] @@ -2934,15 +4068,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -2956,12 +4084,119 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + [[package]] name = "hex-literal" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + +[[package]] +name = "hickory-proto" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ipnet", + "once_cell", + "rand 0.8.5", + "socket2 0.5.10", + "thiserror 1.0.69", + "tinyvec", + "tokio", + "tracing", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ipnet", + "once_cell", + "rand 0.9.2", + "ring 0.17.14", + "thiserror 2.0.17", + "tinyvec", + "tokio", + "tracing", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.24.4", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.5", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "hickory-resolver" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.25.2", + "ipconfig", + "moka", + "once_cell", + "parking_lot 0.12.5", + "rand 0.9.2", + "resolv-conf", + "smallvec", + "thiserror 2.0.17", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -3001,26 +4236,6 @@ dependencies = [ "hmac 0.8.1", ] -[[package]] -name = "home" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" -dependencies = [ - "windows-sys 0.59.0", -] - -[[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.12" @@ -3034,9 +4249,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -3061,27 +4276,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.2.0", + "http 1.3.1", ] [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", - "http 1.2.0", + "futures-core", + "http 1.3.1", "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -3091,9 +4306,19 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" + +[[package]] +name = "humantime-serde" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] [[package]] name = "hyper" @@ -3105,14 +4330,14 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.27", "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.8", + "socket2 0.5.10", "tokio", "tower-service", "tracing", @@ -3121,51 +4346,54 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", - "h2 0.4.7", - "http 1.2.0", + "futures-core", + "h2 0.4.12", + "http 1.3.1", "http-body 1.0.1", "httparse", "httpdate", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", ] [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "bytes", - "futures-util", - "http 1.2.0", + "futures-core", + "http 1.3.1", "http-body 1.0.1", - "hyper 1.5.2", + "hyper 1.7.0", "pin-project-lite", "tokio", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core 0.62.2", ] [[package]] @@ -3179,21 +4407,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -3202,31 +4431,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -3234,67 +4443,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -3303,30 +4499,9 @@ 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.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -3335,8 +4510,8 @@ dependencies = [ [[package]] name = "idna" -version = "1.0.3" -source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" +version = "1.1.0" +source = "git+https://github.com/servo/rust-url#9771ab51f0aaa02ca1884f88c577260e9b86f9b6" dependencies = [ "idna_adapter", "smallvec", @@ -3345,9 +4520,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -3370,7 +4545,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ "async-io", - "core-foundation", + "core-foundation 0.9.4", "fnv", "futures", "if-addrs", @@ -3387,38 +4562,76 @@ dependencies = [ ] [[package]] -name = "igd-next" -version = "0.14.3" +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.12", + "hyper 0.14.32", + "log", + "rand 0.8.5", + "tokio", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "xmltree", +] + +[[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-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + +[[package]] +name = "impl-rlp" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" dependencies = [ - "async-trait", - "attohttpc", - "bytes", - "futures", - "http 0.2.12", - "hyper 0.14.32", - "log", - "rand", - "tokio", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "xmltree", + "rlp 0.6.1", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "impl-serde" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ - "parity-scale-codec", + "serde", ] [[package]] name = "impl-serde" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" dependencies = [ "serde", ] @@ -3431,7 +4644,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -3466,12 +4679,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.16.0", + "serde", + "serde_core", ] [[package]] @@ -3518,7 +4733,7 @@ dependencies = [ "derive_more 1.0.0", "either", "heck 0.5.0", - "impl-serde", + "impl-serde 0.4.0", "ink_ir", "ink_primitives", "itertools 0.12.1", @@ -3527,7 +4742,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -3541,8 +4756,8 @@ dependencies = [ "ink_primitives", "pallet-contracts-uapi 9.0.0", "parity-scale-codec", - "secp256k1", - "sha2 0.10.8", + "secp256k1 0.28.2", + "sha2 0.10.9", "sha3", ] @@ -3566,12 +4781,12 @@ dependencies = [ "parity-scale-codec", "paste", "rlibc", - "scale-decode", - "scale-encode", + "scale-decode 0.11.1", + "scale-encode 0.6.0", "scale-info", "schnorrkel", - "secp256k1", - "sha2 0.10.8", + "secp256k1 0.28.2", + "sha2 0.10.9", "sha3", "staging-xcm 11.0.0", "static_assertions", @@ -3585,12 +4800,12 @@ checksum = "e201688fb27ff97496a4231a393dd4befcc5a9c092d6bf231f0f5d409ef44f34" dependencies = [ "blake2", "either", - "impl-serde", + "impl-serde 0.4.0", "ink_prelude", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -3605,8 +4820,8 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.96", - "synstructure 0.13.1", + "syn 2.0.106", + "synstructure 0.13.2", ] [[package]] @@ -3616,13 +4831,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27135c651274087ba0578d2c07866c31d8dd481ae8de5bb7295fe3931491aa80" dependencies = [ "derive_more 1.0.0", - "impl-serde", + "impl-serde 0.4.0", "ink_prelude", "ink_primitives", "linkme", "parity-scale-codec", "scale-info", - "schemars", + "schemars 0.8.22", "serde", ] @@ -3644,8 +4859,8 @@ dependencies = [ "derive_more 1.0.0", "ink_prelude", "parity-scale-codec", - "scale-decode", - "scale-encode", + "scale-decode 0.11.1", + "scale-encode 0.6.0", "scale-info", "xxhash-rust", ] @@ -3684,9 +4899,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "generic-array", ] @@ -3710,14 +4925,14 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "io-uring" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "hermit-abi 0.3.9", + "bitflags 2.9.4", + "cfg-if", "libc", - "windows-sys 0.48.0", ] [[package]] @@ -3732,7 +4947,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.8", + "socket2 0.5.10", "widestring", "windows-sys 0.48.0", "winreg", @@ -3744,17 +4959,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" -[[package]] -name = "is-terminal" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" -dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -3788,26 +4992,73 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jam-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb948eace373d99de60501a02fb17125d30ac632570de20dccc74370cdd611b9" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "jam-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "jam-codec-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "319af585c4c8a6b5552a52b7787a1ab3e4d59df7614190b1f85b9b842488789d" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ "once_cell", "wasm-bindgen", @@ -3824,7 +5075,7 @@ dependencies = [ "elliptic-curve", "once_cell", "serdect", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] @@ -3836,14 +5087,37 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "keccak-hash" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" +dependencies = [ + "primitive-types 0.13.1", + "tiny-keccak", +] + [[package]] name = "kreivo-apis" version = "0.1.0" dependencies = [ + "frame-contrib-traits", "frame-support", "frame-system", "ink", + "ink_env", "log", + "num_enum", "pallet-contracts", "parity-scale-codec", "scale-info", @@ -3852,7 +5126,7 @@ dependencies = [ [[package]] name = "kreivo-runtime" -version = "0.15.1" +version = "0.16.0" dependencies = [ "assets-common", "cumulus-pallet-aura-ext", @@ -3864,40 +5138,44 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "fc-pallet-black-hole", + "fc-pallet-communities", "fc-pallet-gas-transaction-payment", + "fc-pallet-listings", + "fc-pallet-orders", "fc-pallet-pass", + "fc-pallet-payments", "fc-pallet-referenda-tracks", - "fc-traits-authn", - "fc-traits-gas-tank", - "fc-traits-memberships", "frame-benchmarking", + "frame-contrib-traits", "frame-executive", "frame-support", "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 1.0.0", "kreivo-apis", "log", "pallet-asset-tx-payment", "pallet-assets", "pallet-assets-freezer", + "pallet-assets-holder", "pallet-aura", "pallet-authorship", "pallet-balances", "pallet-collator-selection", - "pallet-communities", "pallet-communities-manager", "pallet-contracts", + "pallet-contracts-store", "pallet-message-queue", "pallet-multisig", "pallet-nfts", - "pallet-payments", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", "pallet-referenda", + "pallet-revive", "pallet-scheduler", "pallet-session", "pallet-skip-feeless-payment", @@ -3912,13 +5190,16 @@ dependencies = [ "pallet-xcm-benchmarks", "parachains-common", "parity-scale-codec", - "pass-webauthn", + "pass-authenticators-substrate-keys", + "pass-authenticators-webauthn", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-runtime-common", + "rand_core 0.6.4", "runtime-common", "runtime-constants", "scale-info", + "schnorrkel", "serde_json", "smallvec", "sp-api", @@ -3931,12 +5212,11 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", "sp-transaction-pool", "sp-version", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", "staging-parachain-info", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -3957,31 +5237,39 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libp2p" -version = "0.52.4" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" dependencies = [ "bytes", "either", "futures", "futures-timer", - "getrandom", - "instant", + "getrandom 0.2.16", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", @@ -3998,7 +5286,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-upnp", - "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr 0.18.2", @@ -4009,9 +5296,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4021,9 +5308,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.2.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4033,55 +5320,55 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-identity", - "log", "multiaddr 0.18.2", "multihash 0.19.3", "multistream-select", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "pin-project", "quick-protobuf", - "rand", + "rand 0.8.5", "rw-stream-sink", "smallvec", "thiserror 1.0.69", - "unsigned-varint 0.7.2", + "tracing", + "unsigned-varint 0.8.0", "void", + "web-time", ] [[package]] name = "libp2p-dns" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" +checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", + "hickory-resolver 0.24.4", "libp2p-core", "libp2p-identity", - "log", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "smallvec", - "trust-dns-resolver", + "tracing", ] [[package]] name = "libp2p-identify" -version = "0.43.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", @@ -4089,148 +5376,150 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "lru", "quick-protobuf", "quick-protobuf-codec", "smallvec", "thiserror 1.0.69", + "tracing", "void", ] [[package]] name = "libp2p-identity" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b5621d159b32282eac446bed6670c39c7dc68a200a992d8f056afa0066f6d" +checksum = "3104e13b51e4711ff5738caa1fb54467c8604c2e94d607e27745bcf709068774" dependencies = [ - "bs58 0.5.1", + "bs58", "ed25519-dalek", "hkdf", "multihash 0.19.3", "quick-protobuf", - "rand", - "sha2 0.10.8", - "thiserror 1.0.69", + "rand 0.8.5", + "sha2 0.10.9", + "thiserror 2.0.17", "tracing", "zeroize", ] [[package]] name = "libp2p-kad" -version = "0.44.6" +version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" +checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" dependencies = [ "arrayvec", - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "either", "fnv", "futures", + "futures-bounded", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "quick-protobuf", "quick-protobuf-codec", - "rand", - "sha2 0.10.8", + "rand 0.8.5", + "sha2 0.10.9", "smallvec", "thiserror 1.0.69", - "uint", - "unsigned-varint 0.7.2", + "tracing", + "uint 0.9.5", "void", + "web-time", ] [[package]] name = "libp2p-mdns" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" +checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", + "hickory-proto 0.24.4", "if-watch", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", - "rand", + "rand 0.8.5", "smallvec", - "socket2 0.5.8", + "socket2 0.5.10", "tokio", - "trust-dns-proto 0.22.0", + "tracing", "void", ] [[package]] name = "libp2p-metrics" -version = "0.13.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ - "instant", + "futures", "libp2p-core", "libp2p-identify", "libp2p-identity", "libp2p-kad", "libp2p-ping", "libp2p-swarm", - "once_cell", + "pin-project", "prometheus-client", + "web-time", ] [[package]] name = "libp2p-noise" -version = "0.43.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" +checksum = "36b137cb1ae86ee39f8e5d6245a296518912014eaa87427d24e6ff58cfc1b28c" dependencies = [ + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", "libp2p-core", "libp2p-identity", - "log", "multiaddr 0.18.2", "multihash 0.19.3", "once_cell", "quick-protobuf", - "rand", - "sha2 0.10.8", + "rand 0.8.5", + "sha2 0.10.9", "snow", "static_assertions", "thiserror 1.0.69", + "tracing", "x25519-dalek", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.43.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" +checksum = "005a34420359223b974ee344457095f027e51346e992d1e0dcd35173f4cdd422" dependencies = [ "either", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", - "rand", + "rand 0.8.5", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-quic" -version = "0.9.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" dependencies = [ "bytes", "futures", @@ -4239,76 +5528,78 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "log", - "parking_lot 0.12.3", - "quinn 0.10.2", - "rand", - "ring 0.16.20", - "rustls 0.21.12", - "socket2 0.5.8", + "parking_lot 0.12.5", + "quinn", + "rand 0.8.5", + "ring 0.17.14", + "rustls", + "socket2 0.5.10", "thiserror 1.0.69", "tokio", + "tracing", ] [[package]] name = "libp2p-request-response" -version = "0.25.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" +checksum = "1356c9e376a94a75ae830c42cdaea3d4fe1290ba409a22c809033d1b7dcab0a6" dependencies = [ "async-trait", "futures", - "instant", + "futures-bounded", + "futures-timer", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", - "rand", + "rand 0.8.5", "smallvec", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm" -version = "0.43.7" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "log", + "lru", "multistream-select", "once_cell", - "rand", + "rand 0.8.5", "smallvec", "tokio", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" +checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" dependencies = [ - "heck 0.4.1", - "proc-macro-warning 0.4.2", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "libp2p-tcp" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" +checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" dependencies = [ "futures", "futures-timer", @@ -4316,119 +5607,107 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "log", - "socket2 0.5.8", + "socket2 0.5.10", "tokio", + "tracing", ] [[package]] name = "libp2p-tls" -version = "0.2.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" +checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" dependencies = [ "futures", "futures-rustls", "libp2p-core", "libp2p-identity", "rcgen", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-webpki", + "ring 0.17.14", + "rustls", + "rustls-webpki 0.101.7", "thiserror 1.0.69", - "x509-parser 0.15.1", + "x509-parser 0.16.0", "yasna", ] [[package]] name = "libp2p-upnp" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", "igd-next", "libp2p-core", "libp2p-swarm", - "log", "tokio", + "tracing", "void", ] -[[package]] -name = "libp2p-wasm-ext" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5d8e3a9e07da0ef5b55a9f26c009c8fb3c725d492d8bb4b431715786eea79c" -dependencies = [ - "futures", - "js-sys", - "libp2p-core", - "send_wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "libp2p-websocket" -version = "0.42.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538" +checksum = "888b2ff2e5d8dcef97283daab35ad1043d18952b65e05279eecbe02af4c6e347" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", "libp2p-identity", - "log", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "pin-project-lite", "rw-stream-sink", "soketto", "thiserror 1.0.69", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.44.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" +checksum = "788b61c80789dba9760d8c669a5bedb642c8267555c803fabd8396e4ca5c5882" dependencies = [ + "either", "futures", "libp2p-core", - "log", "thiserror 1.0.69", - "yamux", + "tracing", + "yamux 0.12.1", + "yamux 0.13.7", ] [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.18", ] [[package]] name = "libsecp256k1" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" dependencies = [ "arrayref", - "base64 0.13.1", + "base64", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -4465,9 +5744,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +checksum = "7f78c730aaa7d0b9336a299029ea49f9ee53b0ed06e9202e8cb7db9bae7b8c82" dependencies = [ "cc", ] @@ -4489,22 +5768,22 @@ dependencies = [ [[package]] name = "linkme" -version = "0.3.31" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566336154b9e58a4f055f6dd4cbab62c7dc0826ce3c0a04e63b2d2ecd784cdae" +checksum = "5e3283ed2d0e50c06dd8602e0ab319bb048b6325d0bba739db64ed8205179898" dependencies = [ "linkme-impl", ] [[package]] name = "linkme-impl" -version = "0.3.31" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbe595006d355eaf9ae11db92707d4338cd2384d16866131cc1afdbdd35d8d9" +checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -4518,92 +5797,77 @@ dependencies = [ [[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.4.15" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "litep2p" -version = "0.6.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f46c51c205264b834ceed95c8b195026e700494bc3991aaba3b4ea9e20626d9" +checksum = "c666ef772d123a7643323ad4979c30dd825e9c68ec1aa5b387a6c9a9871c11ea" dependencies = [ "async-trait", - "bs58 0.4.0", + "bs58", "bytes", - "cid 0.10.1", + "cid 0.11.1", "ed25519-dalek", "futures", "futures-timer", - "hex-literal", - "indexmap 2.7.1", + "hickory-resolver 0.25.2", + "indexmap 2.11.4", "libc", - "mockall 0.12.1", + "mockall", "multiaddr 0.17.1", "multihash 0.17.0", "network-interface", - "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "pin-project", - "prost 0.12.6", - "prost-build 0.11.9", - "quinn 0.9.4", - "rand", - "rcgen", - "ring 0.16.20", - "rustls 0.20.9", + "prost 0.13.5", + "prost-build", + "rand 0.8.5", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "simple-dns", "smallvec", "snow", - "socket2 0.5.8", - "static_assertions", - "str0m", - "thiserror 1.0.69", + "socket2 0.5.10", + "thiserror 2.0.17", "tokio", "tokio-stream", "tokio-tungstenite", "tokio-util", "tracing", - "trust-dns-resolver", - "uint", + "uint 0.10.0", "unsigned-varint 0.8.0", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "x25519-dalek", - "x509-parser 0.16.0", + "x509-parser 0.17.0", + "yamux 0.13.7", "yasna", "zeroize", ] [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.25" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "lru" @@ -4611,7 +5875,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.5", ] [[package]] @@ -4624,14 +5888,31 @@ dependencies = [ ] [[package]] -name = "mach" -version = "0.3.2" +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "mach2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" dependencies = [ "libc", ] +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "macro_magic" version = "0.5.1" @@ -4641,7 +5922,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -4655,7 +5936,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -4666,7 +5947,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -4677,35 +5958,34 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] -name = "match_cfg" -version = "0.1.0" +name = "match-lookup" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "1265724d8cb29dbbc2b0f06fffb8bf1a8c0cf73a78eede9ba73a4a66c52a981e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "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.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" dependencies = [ "autocfg", "rawpointer", @@ -4713,44 +5993,37 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.44", -] - -[[package]] -name = "memmap2" -version = "0.9.5" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "libc", + "rustix", ] [[package]] -name = "memoffset" -version = "0.8.0" +name = "memmap2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7" dependencies = [ - "autocfg", + "libc", ] [[package]] name = "memory-db" -version = "0.32.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +checksum = "7e300c54e3239a86f9c61cc63ab0f03862eb40b1c6e065dc6fd6ceaeff6da93d" dependencies = [ + "foldhash 0.1.5", "hash-db", + "hashbrown 0.15.5", ] [[package]] @@ -4761,7 +6034,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] @@ -4773,76 +6046,80 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] -name = "mockall" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +name = "mock-helpers" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#26630fbe817de8e537b37a409cce444a1c14dfbd" dependencies = [ - "cfg-if", - "downcast", - "fragile", - "lazy_static", - "mockall_derive 0.11.4", - "predicates 2.1.5", - "predicates-tree", + "fc-pallet-listings", + "frame-support", + "frame-system", + "pallet-assets", + "pallet-balances", + "sp-io", + "sp-runtime", ] [[package]] name = "mockall" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" +checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" dependencies = [ "cfg-if", "downcast", "fragile", - "lazy_static", - "mockall_derive 0.12.1", - "predicates 3.1.3", + "mockall_derive", + "predicates", "predicates-tree", ] [[package]] name = "mockall_derive" -version = "0.11.4" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] -name = "mockall_derive" -version = "0.12.1" +name = "moka" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" +checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077" dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 2.0.96", + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "equivalent", + "parking_lot 0.12.5", + "portable-atomic", + "rustc_version 0.4.1", + "smallvec", + "tagptr", + "uuid", ] [[package]] @@ -4863,11 +6140,11 @@ dependencies = [ "log", "multibase", "multihash 0.17.0", - "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "static_assertions", "unsigned-varint 0.7.2", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4882,20 +6159,21 @@ dependencies = [ "libp2p-identity", "multibase", "multihash 0.19.3", - "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "static_assertions", "unsigned-varint 0.8.0", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "multibase" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +checksum = "8694bb4835f452b0e3bb06dbebb1d6fc5385b6ca1caf2e55fd165c042390ec77" dependencies = [ "base-x", + "base256emoji", "data-encoding", "data-encoding-macro", ] @@ -4912,24 +6190,7 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.8", - "sha3", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "multihash" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.7", - "multihash-derive", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "unsigned-varint 0.7.2", ] @@ -4960,15 +6221,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "multimap" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" [[package]] name = "multistream-select" @@ -5038,16 +6293,16 @@ dependencies = [ [[package]] name = "netlink-proto" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2741a6c259755922e3ed29ebce3b299cc2160c4acae94b465b5938ab02c2bbe" +checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" dependencies = [ "bytes", "futures", "log", "netlink-packet-core", "netlink-sys", - "thiserror 2.0.11", + "thiserror 2.0.17", ] [[package]] @@ -5065,13 +6320,13 @@ dependencies = [ [[package]] name = "network-interface" -version = "1.1.4" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" +checksum = "07709a6d4eba90ab10ec170a0530b3aafc81cb8a2d380e4423ae41fc55fe5745" dependencies = [ "cc", "libc", - "thiserror 1.0.69", + "thiserror 2.0.17", "winapi", ] @@ -5103,19 +6358,26 @@ dependencies = [ ] [[package]] -name = "normalize-line-endings" -version = "0.3.0" +name = "nu-ansi-term" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "num" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "overload", - "winapi", + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", ] [[package]] @@ -5151,7 +6413,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -5173,6 +6435,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -5191,37 +6464,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] [[package]] -name = "object" -version = "0.30.4" +name = "num_enum" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", + "num_enum_derive", + "rustversion", ] [[package]] -name = "object" -version = "0.32.2" +name = "num_enum_derive" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "memchr", + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] @@ -5230,16 +6505,19 @@ version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ + "crc32fast", + "hashbrown 0.15.5", + "indexmap 2.11.4", "memchr", ] [[package]] -name = "oid-registry" -version = "0.6.1" +name = "object" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ - "asn1-rs 0.5.2", + "memchr", ] [[package]] @@ -5252,76 +6530,47 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl" -version = "0.10.68" +name = "oid-registry" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" dependencies = [ - "bitflags 2.8.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", + "asn1-rs 0.7.1", ] [[package]] -name = "openssl-macros" -version = "0.1.1" +name = "once_cell" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "critical-section", + "portable-atomic", ] [[package]] -name = "openssl-probe" -version = "0.1.6" +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] -name = "openssl-src" -version = "300.4.1+3.4.0" +name = "opaque-debug" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" -dependencies = [ - "cc", -] +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -name = "openssl-sys" -version = "0.9.104" +name = "openssl-probe" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] -name = "overload" -version = "0.1.1" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "p256" @@ -5332,13 +6581,14 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] name = "pallet-asset-conversion" -version = "20.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb23b86d86619906c25c620a6f3c6fda7501d5bcbdf248c4fa379dfdce2982e" dependencies = [ "frame-benchmarking", "frame-support", @@ -5347,7 +6597,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-io", "sp-runtime", @@ -5355,8 +6605,9 @@ dependencies = [ [[package]] name = "pallet-asset-rate" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e6cf89229b15eacd5a183070f4c1d5cd8fc9abc88e0593fb8482d6c3375534" dependencies = [ "frame-benchmarking", "frame-support", @@ -5369,8 +6620,9 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f4496707130bee919b33918c177e6e1f2fd3bb1fc36e255198f09f26d7c04" dependencies = [ "frame-benchmarking", "frame-support", @@ -5379,15 +6631,15 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-io", "sp-runtime", ] [[package]] name = "pallet-assets" -version = "40.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e13ebc641e2ae85ebde09835b7dcdfe1fcb3184afc3965007fddc0fea3fca4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5402,8 +6654,22 @@ dependencies = [ [[package]] name = "pallet-assets-freezer" -version = "0.5.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18adf19ffd4f653963d3ceb4f8a1c7c7bff9f17b6e2a2cf8e54e5fbd475d65e7" +dependencies = [ + "log", + "pallet-assets", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + +[[package]] +name = "pallet-assets-holder" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8534661fedb693833bcfa2f46b01c01616d23362cdbf00d03fcef25cd2078e9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5417,8 +6683,9 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c73adf2f98b4ba1987c76db61513de8e328ca0ece93e706c6673d74c489f344" dependencies = [ "frame-support", "frame-system", @@ -5433,8 +6700,9 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21778643fbeae9aac693eb7b821001f118622d6e9e8a81cefea8bc4c4155fe9c" dependencies = [ "frame-support", "frame-system", @@ -5448,8 +6716,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b1edb2ecfdea55cfed3c70caa111d1fdb9d78e473855bb58ffc7197011d6fa5" dependencies = [ "frame-support", "frame-system", @@ -5461,8 +6730,9 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ffa13591db366cde0f31f54f8f39f97bc41110af1f46a5992fe7fc890e2c29" dependencies = [ "frame-benchmarking", "frame-support", @@ -5484,8 +6754,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "39.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "44.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "536039f21421a4b7b75d11cb4420b0d568c6fd194275be98a874655a8f096286" dependencies = [ "docify", "frame-benchmarking", @@ -5494,13 +6765,15 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "sp-core", "sp-runtime", ] [[package]] name = "pallet-broker" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ba8a692b6503d1a228efa8c5d716dd03f91b9c25aefc89bae59e870bb754ae" dependencies = [ "bitvec", "frame-benchmarking", @@ -5510,15 +6783,16 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-runtime", ] [[package]] name = "pallet-collator-selection" -version = "19.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9248bd8e80c0f2e51061a360e02efbe38f231a0b12b9e9256a244ee762b119e" dependencies = [ "frame-benchmarking", "frame-support", @@ -5528,55 +6802,26 @@ dependencies = [ "pallet-balances", "pallet-session", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sp-runtime", "sp-staking", ] -[[package]] -name = "pallet-communities" -version = "0.1.0" -dependencies = [ - "fc-pallet-referenda-tracks", - "fc-traits-memberships", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-assets", - "pallet-assets-freezer", - "pallet-balances", - "pallet-nfts", - "pallet-preimage", - "pallet-referenda", - "pallet-scheduler", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", - "virto-common", -] - [[package]] name = "pallet-communities-manager" version = "0.1.0" dependencies = [ + "fc-pallet-communities", "fc-pallet-referenda-tracks", - "fc-traits-gas-tank", - "fc-traits-memberships", - "fc-traits-tracks", "frame-benchmarking", + "frame-contrib-traits", "frame-support", "frame-system", "log", "pallet-assets", "pallet-assets-freezer", "pallet-balances", - "pallet-communities", "pallet-nfts", "pallet-ranked-collective", "pallet-referenda", @@ -5586,16 +6831,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", "virto-common", ] [[package]] name = "pallet-contracts" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c5d74f7b6b752e8bbce1ddeb96240b23389d3e9c6bdc04082d1d7c2f9afe28" dependencies = [ - "bitflags 1.3.2", "environmental", "frame-benchmarking", "frame-support", @@ -5604,10 +6848,10 @@ dependencies = [ "log", "pallet-balances", "pallet-contracts-proc-macro", - "pallet-contracts-uapi 12.0.0", + "pallet-contracts-uapi 14.0.0", "parity-scale-codec", "paste", - "rand", + "rand 0.8.5", "rand_pcg", "scale-info", "serde", @@ -5616,21 +6860,54 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "wasm-instrument", "wasmi", ] +[[package]] +name = "pallet-contracts-fixtures" +version = "1.0.0" +dependencies = [ + "anyhow", + "frame-system", + "parity-wasm", + "sp-runtime", + "tempfile", + "toml 0.9.8", + "twox-hash 2.1.2", +] + [[package]] name = "pallet-contracts-proc-macro" -version = "23.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "23.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35aaa3d7f1dba4ea7b74d7015e6068b753d1f7f63b39a4ce6377de1bc51b476" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", +] + +[[package]] +name = "pallet-contracts-store" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-contrib-traits", + "frame-support", + "frame-system", + "mock-helpers", + "pallet-assets", + "pallet-balances", + "pallet-contracts", + "pallet-contracts-fixtures", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", ] [[package]] @@ -5641,60 +6918,48 @@ checksum = "2d7a51646d9ff1d91abd0186d2c074f0dfd3b1a2d55f08a229a2f2e4bc6d1e49" dependencies = [ "bitflags 1.3.2", "paste", - "polkavm-derive", + "polkavm-derive 0.9.1", ] [[package]] name = "pallet-contracts-uapi" -version = "12.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1175375608ec4900f1172d304f7c7ac1f7e3710be17f365121cf94028db1630" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", "paste", - "polkavm-derive", - "scale-info", -] - -[[package]] -name = "pallet-election-provider-multi-phase" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-election-provider-support-benchmarking", - "parity-scale-codec", - "rand", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "strum 0.26.3", ] [[package]] -name = "pallet-election-provider-support-benchmarking" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "pallet-election-provider-multi-phase" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a52fbda7fde4ff99e21cb48234d1dd7082f8da7eed5bcdca537e08cc9ad3159" dependencies = [ "frame-benchmarking", "frame-election-provider-support", + "frame-support", "frame-system", + "log", "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-arithmetic 28.0.0", + "sp-core", + "sp-io", "sp-npos-elections", "sp-runtime", + "strum 0.26.3", ] [[package]] name = "pallet-fast-unstake" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4e280592339eb88823ecc4cca310bf5367b5c9d73cb63943bf083ed8cecf7" dependencies = [ "docify", "frame-benchmarking", @@ -5711,8 +6976,9 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c53932cca6029c103d75dc5c5a1d015039d38de67a5713aa0769d478071da9" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5727,8 +6993,9 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "41.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf589acfe78eb44a9acc45f4d3b64e73fe178cf68587135e11461625d490462" dependencies = [ "environmental", "frame-benchmarking", @@ -5737,49 +7004,43 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", ] [[package]] name = "pallet-mmr" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee0bad214d29adb70facf811a1f4d5732161041145e571cda8f5c2add2fa8466" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-core", - "sp-io", "sp-mmr-primitives", - "sp-runtime", ] [[package]] name = "pallet-multisig" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d1704b5567cedaddd4c9ea91cd5c4db667f68afb5d02ff3cfd459c6b34f7c4" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-io", - "sp-runtime", ] [[package]] name = "pallet-nfts" -version = "32.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09138b5034ac335980fa22726d56137d2cef324055e6ee4ceebadfd5f4d7d8ab" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5794,99 +7055,166 @@ dependencies = [ ] [[package]] -name = "pallet-payments" -version = "0.1.0" +name = "pallet-preimage" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4426b05c265cca148c9b5df1e809f9b453e62f1c86fd68467286c04a5797b11a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "pallet-assets", - "pallet-balances", - "pallet-preimage", - "pallet-scheduler", - "pallet-sudo", "parity-scale-codec", "scale-info", - "serde", "sp-core", "sp-io", - "sp-keystore", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", ] [[package]] -name = "pallet-preimage" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "pallet-proxy" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7036fc8d9aeb424718082b427020c399db4702b7c352ff4b5b83ae28b527c9d" +dependencies = [ + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + +[[package]] +name = "pallet-ranked-collective" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e4daed6b5a04fd9ff2104a25b2110205b2ee096bd5e3c643ed4f2d5c2b8238" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", + "sp-arithmetic 28.0.0", "sp-core", "sp-io", "sp-runtime", ] [[package]] -name = "pallet-proxy" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "pallet-referenda" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8932d89996118a472a7a061ef412f4407c3641272ab453103b933c004ef3cc" dependencies = [ + "assert_matches", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "serde", + "sp-arithmetic 28.0.0", "sp-io", "sp-runtime", ] [[package]] -name = "pallet-ranked-collective" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "pallet-revive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dc4351f6f786afac0ac1fcc10c78df86895fc00dee8382ce1f7ab117264bfe" dependencies = [ + "alloy-core", + "derive_more 0.99.20", + "environmental", + "ethereum-standards", + "ethereum-types", "frame-benchmarking", "frame-support", "frame-system", + "hex-literal 0.4.1", + "humantime-serde", "impl-trait-for-tuples", "log", + "num-bigint", + "num-integer", + "num-traits", + "pallet-revive-fixtures", + "pallet-revive-proc-macro", + "pallet-revive-uapi", + "pallet-transaction-payment", "parity-scale-codec", + "paste", + "polkavm 0.27.0", + "polkavm-common 0.27.0", + "rand 0.8.5", + "rand_pcg", + "revm", + "ripemd", + "rlp 0.6.1", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "serde", + "sp-api", + "sp-arithmetic 28.0.0", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", "sp-core", "sp-io", "sp-runtime", + "substrate-bn", + "subxt-signer", ] [[package]] -name = "pallet-referenda" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +name = "pallet-revive-fixtures" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ccbc0280768a51a4124ab3b1e23bf22cc06425fab0bf571a735dd3be36bf1d" dependencies = [ - "assert_matches", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", + "alloy-core", + "anyhow", + "cargo_metadata", + "hex", + "pallet-revive-uapi", + "polkavm-linker 0.27.0", + "serde_json", + "sp-core", + "sp-io", + "toml 0.8.23", +] + +[[package]] +name = "pallet-revive-proc-macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad05b2a187e27ba651c31209020f3797054f406d1f9cb3f5e828fd6245f65866" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "pallet-revive-uapi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bb5c8e7dd0a30f0a19ab0a203fd91fd1ca10e4b962383f7690ccd6f223b481" +dependencies = [ + "bitflags 1.3.2", + "pallet-revive-proc-macro", "parity-scale-codec", + "polkavm-derive 0.27.0", "scale-info", - "serde", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "sp-io", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", ] [[package]] name = "pallet-scheduler" -version = "39.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "44.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff81b8f8f4282d3e436609d48f598e35f029e56fac4bdcbd2376c21a68cf3ea6" dependencies = [ "docify", "frame-benchmarking", @@ -5897,18 +7225,20 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", ] [[package]] name = "pallet-session" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88e61bebb5bfdd5be045eb902776bc376cb6b5b568eb1e616e7814f8aa74ecc" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "log", + "pallet-balances", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -5923,8 +7253,9 @@ dependencies = [ [[package]] name = "pallet-skip-feeless-payment" -version = "13.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726addd2fbeafecd93eafbbc879b1ad78c02f3933b407288efae7166b6cf0d4a" dependencies = [ "frame-support", "frame-system", @@ -5935,8 +7266,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce23099893b90f921c53ce92db08d3b9ada8ec532f3ea125e9b117236ee4808" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5946,7 +7278,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "parity-scale-codec", - "rand_chacha", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-application-crypto", @@ -5957,17 +7289,19 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "22.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2dddc795e22484cc18a6c25018d32fb4ad518491d9989edcd9cdd3090638512" dependencies = [ "log", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", ] [[package]] name = "pallet-sudo" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5bd043ab6161ce4a06daab4fb646d6ea09058bb5021607386b5486dd0c6d79" dependencies = [ "docify", "frame-benchmarking", @@ -5981,8 +7315,9 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7ef0a40eb925e3b5d10b8f673f4cd0e5fa9b0faa3d2cc38af7acf574c62b31" dependencies = [ "docify", "frame-benchmarking", @@ -5992,7 +7327,6 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", "sp-runtime", "sp-storage", "sp-timestamp", @@ -6000,41 +7334,45 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d32ad5952a49c3f06c71f2536aeb42808761272ade7ea76b54527f11cfeb0d6" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-io", "sp-runtime", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45b7aaf47d75c74ff26649290a694c4e4252467bbc9433c9c472bbabb324fc95" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", ] [[package]] name = "pallet-treasury" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7bd354ff36d74e80050e71c87c7497dc57db9b9a02ab66c8e97b04e2613d87" dependencies = [ "docify", "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-balances", "parity-scale-codec", "scale-info", @@ -6045,8 +7383,9 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff9841c0c0f081b7534c9900f5d5c72183887bd04f1cdfd7145627582cb68602" dependencies = [ "frame-benchmarking", "frame-support", @@ -6060,8 +7399,9 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90efd95270046942079947991a2d8331186683b97e086c4146755ad702796f30" dependencies = [ "frame-benchmarking", "frame-support", @@ -6074,73 +7414,78 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1494fdace5286d530b46ed4a802e3ae2c01e4be1f397ec6e989e9387f726f661" dependencies = [ - "bounded-collections", + "bounded-collections 0.3.2", "frame-benchmarking", "frame-support", "frame-system", - "log", + "hex-literal 0.4.1", "pallet-balances", + "pallet-revive", "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", + "tracing", "xcm-runtime-apis", ] [[package]] name = "pallet-xcm-benchmarks" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5268816c31ee0a68d3c20bd560c9f67cf6111dc8cacddfc85cbc9b52976bd6" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-io", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "parachains-common" -version = "18.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c0137a802599040cb6f666588fb25db08a6447b5b61b18f11646a6eb483cc" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", "frame-support", "frame-system", - "log", "pallet-asset-tx-payment", "pallet-assets", "pallet-authorship", "pallet-balances", "pallet-collator-selection", "pallet-message-queue", + "pallet-treasury", "pallet-xcm", "parity-scale-codec", "polkadot-primitives", + "polkadot-runtime-common", "scale-info", "sp-consensus-aura", "sp-core", "sp-io", "sp-runtime", "staging-parachain-info", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-executor", - "substrate-wasm-builder", + "tracing", ] [[package]] @@ -6149,38 +7494,40 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core", + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", "serde", "unicode-normalization", ] [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", "bytes", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] @@ -6208,12 +7555,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", + "parking_lot_core 0.9.12", ] [[package]] @@ -6232,15 +7579,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.18", "smallvec", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -6250,18 +7597,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" [[package]] -name = "pass-webauthn" +name = "pass-authenticators-substrate-keys" version = "0.1.0" -source = "git+https://github.com/virto-network/webauthn#c217e8a2a03f160bbf83e47c4d6d0ea46c93dcab" +source = "git+https://github.com/virto-network/pass-authenticators#92c34842f069c85851341fcce3eed594c70cd834" dependencies = [ "fc-traits-authn", - "frame-support", "log", "parity-scale-codec", "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "pass-authenticators-webauthn" +version = "0.1.0" +source = "git+https://github.com/virto-network/pass-authenticators#92c34842f069c85851341fcce3eed594c70cd834" +dependencies = [ + "bitflags 2.9.4", + "byteorder", + "coset", + "fc-traits-authn", + "log", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", + "serde", + "serde_json", "simple-base64", - "url 2.5.4 (git+https://github.com/servo/rust-url)", - "verifier", + "url 2.5.7 (git+https://github.com/servo/rust-url)", + "webauthn-verifier", ] [[package]] @@ -6271,7 +7636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -6288,57 +7653,120 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "hmac 0.12.1", "password-hash", ] [[package]] name = "pem" -version = "1.1.1" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" +dependencies = [ + "base64", + "serde_core", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "base64 0.13.1", + "base64ct", ] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "percent-encoding" -version = "2.3.1" -source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" +version = "2.3.2" +source = "git+https://github.com/servo/rust-url#9771ab51f0aaa02ca1884f88c577260e9b86f9b6" + +[[package]] +name = "pest" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e7521a040efde50c3ab6bbadafbe15ab6dc042686926be59ac35d74607df4" +dependencies = [ + "memchr", + "ucd-trie", +] [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.7.1", + "indexmap 2.11.4", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", ] [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -6365,15 +7793,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-ckb-merkle-mountain-range" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +checksum = "221c71b432b38e494a0fdedb5f720e4cb974edf03a0af09e5b2238dbac7e6947" dependencies = [ "cfg-if", "itertools 0.10.5", @@ -6381,8 +7809,9 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "15.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939814e39dbe32958ab6aafcc59c42941a98416a5504c32181b08500530f8a0c" dependencies = [ "parity-scale-codec", "scale-info", @@ -6392,27 +7821,31 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "14.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5c2305f47829e84341a570be58b79faadf12317836ed87cda55f0d148b30052" dependencies = [ - "bounded-collections", - "derive_more 0.99.18", + "array-bytes", + "bounded-collections 0.3.2", + "derive_more 0.99.20", "parity-scale-codec", "polkadot-core-primitives", "scale-info", "serde", "sp-core", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-weights 33.1.0", ] [[package]] name = "polkadot-primitives" -version = "16.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa26e15b638b6078c70e51f66b1fe857610e5a702cc9d43661652d432e9c31a" dependencies = [ "bitvec", - "hex-literal", + "bounded-collections 0.3.2", + "hex-literal 0.4.1", "log", "parity-scale-codec", "polkadot-core-primitives", @@ -6421,7 +7854,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-authority-discovery", "sp-consensus-slots", "sp-core", @@ -6430,12 +7863,15 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", + "sp-std", + "thiserror 1.0.69", ] [[package]] name = "polkadot-runtime-common" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4fff9195f82fcbcf43d32921111abfa0a8bf208c66797bc26353f8d2a1f4b5" dependencies = [ "bitvec", "frame-benchmarking", @@ -6466,17 +7902,17 @@ dependencies = [ "rustc-hex", "scale-info", "serde", - "serde_derive", "slot-range-helper", "sp-api", "sp-core", "sp-inherents", "sp-io", + "sp-keyring", "sp-npos-elections", "sp-runtime", "sp-session", "sp-staking", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", "static_assertions", @@ -6484,10 +7920,11 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97f2125c2672c7b6b3d284fc8adfeb0f39fc2dcc3b779017b07e26743f0c617e" dependencies = [ - "bs58 0.5.1", + "bs58", "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", @@ -6496,13 +7933,14 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a328d3fbbf9b702bb087be43fd9ae325061ad759f9d87793e44589c865ea052e" dependencies = [ "bitflags 1.3.2", "bitvec", - "derive_more 0.99.18", "frame-benchmarking", + "frame-election-provider-support", "frame-support", "frame-system", "impl-trait-for-tuples", @@ -6517,19 +7955,18 @@ dependencies = [ "pallet-session", "pallet-staking", "pallet-timestamp", - "pallet-vesting", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-inherents", "sp-io", @@ -6537,30 +7974,88 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "sp-std", + "staging-xcm 19.0.0", "staging-xcm-executor", "static_assertions", ] +[[package]] +name = "polkadot-sdk-frame" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c36b4da1d09fe585a15f540d32767ad91d247c8908ca11eb1b95b44d09b2ffcf" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic 28.0.0", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-grandpa", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-transaction-pool", + "sp-version", +] + +[[package]] +name = "polkavm" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa028f713d0613f0f08b8b3367402cb859218854f6b96fcbe39a501862894d6f" +dependencies = [ + "libc", + "log", + "polkavm-assembler 0.26.0", + "polkavm-common 0.26.0", + "polkavm-linux-raw 0.26.0", +] + [[package]] name = "polkavm" -version = "0.9.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +checksum = "6ef5796e5aaa109df210fed7c6ff82e89c7bf94c28f6332d57bd0efb865fdc2a" dependencies = [ "libc", "log", - "polkavm-assembler", - "polkavm-common", - "polkavm-linux-raw", + "polkavm-assembler 0.27.0", + "polkavm-common 0.27.0", + "polkavm-linux-raw 0.27.0", ] [[package]] name = "polkavm-assembler" -version = "0.9.0" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4859a29e1f4ad64610c4bc2bfc40bb9a535068a034933a5b56b5e7a0febf105a" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-assembler" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +checksum = "70bf3be2911acc089dfe54a92bfec22002f4fbf423b8fa771d1f7e7227f0195f" dependencies = [ "log", ] @@ -6570,8 +8065,26 @@ name = "polkavm-common" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + +[[package]] +name = "polkavm-common" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a5794b695626ba70d29e66e3f4f4835767452a6723f3a0bc20884b07088fe8" dependencies = [ "log", + "polkavm-assembler 0.26.0", +] + +[[package]] +name = "polkavm-common" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19805789e7bf778ac5855f6fe9350353f6a1697c2aab9bfb6fc7c831be54fad" +dependencies = [ + "blake3", + "log", + "polkavm-assembler 0.27.0", ] [[package]] @@ -6580,7 +8093,25 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.9.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95282a203ae1f6828a04ff334145c3f6dc718bba6d3959805d273358b45eab93" +dependencies = [ + "polkavm-derive-impl-macro 0.26.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eea46a17d87cbf3c0f3f6156f6300f60cec67cf9eaca296c770e0873f8389d6" +dependencies = [ + "polkavm-derive-impl-macro 0.27.0", ] [[package]] @@ -6589,10 +8120,34 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ - "polkavm-common", + "polkavm-common 0.9.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6069dc7995cde6e612b868a02ce48b54397c6d2582bd1b97b63aabbe962cd779" +dependencies = [ + "polkavm-common 0.26.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8abdd1210d96b1dda9ac21199ec469448fd628cea102e2ff0e0df1667c4c3b5f" +dependencies = [ + "polkavm-common 0.27.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -6601,44 +8156,86 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ - "polkavm-derive-impl", - "syn 2.0.96", + "polkavm-derive-impl 0.9.0", + "syn 2.0.106", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581d34cafec741dc5ffafbb341933c205b6457f3d76257a9d99fb56687219c91" +dependencies = [ + "polkavm-derive-impl 0.26.0", + "syn 2.0.106", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a45173d70138aa1879892c50777ed0d8b0c8556f7678372f09fa1d89bbbddb4" +dependencies = [ + "polkavm-derive-impl 0.27.0", + "syn 2.0.106", ] [[package]] name = "polkavm-linker" -version = "0.9.2" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb896023e5bd89bba40311797d8d42490fa4a1fd5256c74820753c5722d1e67" +dependencies = [ + "dirs", + "gimli 0.31.1", + "hashbrown 0.14.5", + "log", + "object 0.36.7", + "polkavm-common 0.26.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linker" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +checksum = "99fe3704d21e96c5d1e6a1b1a43ac57f9dce110d3331fbf8299e9f57d5884066" dependencies = [ - "gimli 0.28.1", + "dirs", + "gimli 0.31.1", "hashbrown 0.14.5", "log", - "object 0.32.2", - "polkavm-common", + "object 0.36.7", + "polkavm-common 0.27.0", "regalloc2 0.9.3", "rustc-demangle", ] [[package]] name = "polkavm-linux-raw" -version = "0.9.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" +checksum = "28919f542476f4158cc71e6c072b1051f38f4b514253594ac3ad80e3c0211fc8" + +[[package]] +name = "polkavm-linux-raw" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061088785efd93e4367faf12f341bb356208c06bab43aa942d472068af80d1c4" [[package]] name = "polling" -version = "3.7.4" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi", "pin-project-lite", - "rustix 0.38.44", - "tracing", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.61.2", ] [[package]] @@ -6665,32 +8262,45 @@ dependencies = [ ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "portable-atomic" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] -name = "ppv-lite86" -version = "0.2.20" +name = "postcard" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ - "zerocopy", + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", ] [[package]] -name = "predicates" -version = "2.1.5" +name = "potential_utf" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" dependencies = [ - "difflib", - "float-cmp", - "itertools 0.10.5", - "normalize-line-endings", - "predicates-core", - "regex", + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", ] [[package]] @@ -6721,22 +8331,12 @@ dependencies = [ [[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 = "prettyplease" -version = "0.2.29" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -6755,10 +8355,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", - "impl-codec", - "impl-serde", + "impl-codec 0.6.0", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.1", + "impl-num-traits", + "impl-rlp", + "impl-serde 0.5.0", "scale-info", - "uint", + "uint 0.10.0", ] [[package]] @@ -6773,11 +8386,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit", + "toml_edit 0.23.7", ] [[package]] @@ -6805,32 +8418,43 @@ dependencies = [ ] [[package]] -name = "proc-macro-warning" -version = "0.4.2" +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "proc-macro-warning" -version = "1.0.2" +version = "1.84.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -6845,19 +8469,19 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "thiserror 1.0.69", ] [[package]] name = "prometheus-client" -version = "0.21.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "prometheus-client-derive-encode", ] @@ -6869,17 +8493,27 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] -name = "prost" -version = "0.11.9" +name = "proptest" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "2bb0be07becd10686a0bb407298fb425360a5c44a663774406340c59a22de4ce" dependencies = [ - "bytes", - "prost-derive 0.11.9", + "bit-set", + "bit-vec", + "bitflags 2.9.4", + "lazy_static", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", ] [[package]] @@ -6893,99 +8527,91 @@ dependencies = [ ] [[package]] -name = "prost-build" -version = "0.11.9" +name = "prost" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "heck 0.4.1", - "itertools 0.10.5", - "lazy_static", - "log", - "multimap 0.8.3", - "petgraph", - "prettyplease 0.1.25", - "prost 0.11.9", - "prost-types 0.11.9", - "regex", - "syn 1.0.109", - "tempfile", - "which", + "prost-derive 0.13.5", ] [[package]] name = "prost-build" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "bytes", "heck 0.5.0", - "itertools 0.12.1", + "itertools 0.14.0", "log", - "multimap 0.10.0", + "multimap", "once_cell", "petgraph", - "prettyplease 0.2.29", - "prost 0.12.6", - "prost-types 0.12.6", + "prettyplease", + "prost 0.13.5", + "prost-types", "regex", - "syn 2.0.96", + "syn 2.0.106", "tempfile", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.106", ] [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "prost 0.11.9", + "prost 0.13.5", ] [[package]] -name = "prost-types" -version = "0.12.6" +name = "pulley-interpreter" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "b89c4319786b16c1a6a38ee04788d32c669b61ba4b69da2162c868c18be99c1b" dependencies = [ - "prost 0.12.6", + "cranelift-bitset", + "log", + "pulley-macros", + "wasmtime-internal-math", ] [[package]] -name = "psm" -version = "0.1.24" +name = "pulley-macros" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +checksum = "938543690519c20c3a480d20a8efcc8e69abeb44093ab1df4e7c1f81f26c677a" dependencies = [ - "cc", + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] @@ -7005,122 +8631,87 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", "thiserror 1.0.69", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "quinn" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto 0.9.6", - "quinn-udp 0.3.2", - "rustc-hash", - "rustls 0.20.9", - "thiserror 1.0.69", - "tokio", - "tracing", - "webpki", + "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", + "cfg_aliases", "futures-io", "pin-project-lite", - "quinn-proto 0.10.6", - "quinn-udp 0.4.1", - "rustc-hash", - "rustls 0.21.12", - "thiserror 1.0.69", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.1", + "rustls", + "socket2 0.6.1", + "thiserror 2.0.17", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" -dependencies = [ - "bytes", - "rand", - "ring 0.16.20", - "rustc-hash", - "rustls 0.20.9", - "slab", - "thiserror 1.0.69", - "tinyvec", - "tracing", - "webpki", -] - -[[package]] -name = "quinn-proto" -version = "0.10.6" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", - "rand", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.2", + "ring 0.17.14", + "rustc-hash 2.1.1", + "rustls", + "rustls-pki-types", "slab", - "thiserror 1.0.69", + "thiserror 2.0.17", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.3.2" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ + "cfg_aliases", "libc", - "quinn-proto 0.9.6", - "socket2 0.4.10", + "once_cell", + "socket2 0.6.1", "tracing", - "windows-sys 0.42.0", + "windows-sys 0.60.2", ] [[package]] -name = "quinn-udp" -version = "0.4.1" +name = "quote" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ - "bytes", - "libc", - "socket2 0.5.8", - "tracing", - "windows-sys 0.48.0", + "proc-macro2", ] [[package]] -name = "quote" -version = "1.0.38" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "radium" @@ -7135,8 +8726,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "serde", ] [[package]] @@ -7146,7 +8748,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -7155,7 +8767,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", + "serde", ] [[package]] @@ -7164,7 +8786,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", ] [[package]] @@ -7175,9 +8806,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -7185,9 +8816,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -7195,9 +8826,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ "pem", "ring 0.16.20", @@ -7216,11 +8847,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", ] [[package]] @@ -7229,108 +8860,280 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", "thiserror 1.0.69", ] [[package]] name = "ref-cast" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "regalloc2" -version = "0.6.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" dependencies = [ - "fxhash", + "hashbrown 0.13.2", "log", + "rustc-hash 1.1.0", "slice-group-by", "smallvec", ] [[package]] name = "regalloc2" -version = "0.9.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" dependencies = [ - "hashbrown 0.13.2", + "allocator-api2", + "bumpalo", + "hashbrown 0.15.5", "log", - "rustc-hash", - "slice-group-by", + "rustc-hash 2.1.1", "smallvec", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ - "regex-syntax 0.6.29", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "regex-automata" -version = "0.4.9" +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "resolv-conf" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3789b30bd25ba102de4beabd95d21ac45b69b1be7d14522bab988c526d6799" + +[[package]] +name = "revm" +version = "27.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5e6bf82101a1ad8a2b637363a37aef27f88b4efc8a6e24c72bf5f64923dc5532" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.5", + "revm-bytecode", + "revm-context", + "revm-context-interface", + "revm-database", + "revm-database-interface", + "revm-handler", + "revm-inspector", + "revm-interpreter", + "revm-precompile", + "revm-primitives", + "revm-state", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "revm-bytecode" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "66c52031b73cae95d84cd1b07725808b5fd1500da3e5e24574a3b2dc13d9f16d" +dependencies = [ + "bitvec", + "phf", + "revm-primitives", + "serde", +] [[package]] -name = "regex-syntax" -version = "0.8.5" +name = "revm-context" +version = "8.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd508416a35a4d8a9feaf5ccd06ac6d6661cd31ee2dc0252f9f7316455d71f9" +dependencies = [ + "cfg-if", + "derive-where", + "revm-bytecode", + "revm-context-interface", + "revm-database-interface", + "revm-primitives", + "revm-state", + "serde", +] + +[[package]] +name = "revm-context-interface" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "dc90302642d21c8f93e0876e201f3c5f7913c4fcb66fb465b0fd7b707dfe1c79" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "auto_impl", + "either", + "revm-database-interface", + "revm-primitives", + "revm-state", + "serde", +] [[package]] -name = "resolv-conf" -version = "0.7.0" +name = "revm-database" +version = "7.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +checksum = "39a276ed142b4718dcf64bc9624f474373ed82ef20611025045c3fb23edbef9c" dependencies = [ - "hostname", - "quick-error", + "alloy-eips", + "revm-bytecode", + "revm-database-interface", + "revm-primitives", + "revm-state", + "serde", +] + +[[package]] +name = "revm-database-interface" +version = "7.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c523c77e74eeedbac5d6f7c092e3851dbe9c7fec6f418b85992bd79229db361" +dependencies = [ + "auto_impl", + "either", + "revm-primitives", + "revm-state", + "serde", +] + +[[package]] +name = "revm-handler" +version = "8.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1529c8050e663be64010e80ec92bf480315d21b1f2dbf65540028653a621b27d" +dependencies = [ + "auto_impl", + "derive-where", + "revm-bytecode", + "revm-context", + "revm-context-interface", + "revm-database-interface", + "revm-interpreter", + "revm-precompile", + "revm-primitives", + "revm-state", + "serde", +] + +[[package]] +name = "revm-inspector" +version = "8.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78db140e332489094ef314eaeb0bd1849d6d01172c113ab0eb6ea8ab9372926" +dependencies = [ + "auto_impl", + "either", + "revm-context", + "revm-database-interface", + "revm-handler", + "revm-interpreter", + "revm-primitives", + "revm-state", + "serde", + "serde_json", +] + +[[package]] +name = "revm-interpreter" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff9d7d9d71e8a33740b277b602165b6e3d25fff091ba3d7b5a8d373bf55f28a7" +dependencies = [ + "revm-bytecode", + "revm-context-interface", + "revm-primitives", + "serde", +] + +[[package]] +name = "revm-precompile" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cee3f336b83621294b4cfe84d817e3eef6f3d0fce00951973364cc7f860424d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-bn254", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "arrayref", + "aurora-engine-modexp", + "c-kzg", + "cfg-if", + "k256", + "libsecp256k1", + "once_cell", + "p256", + "revm-primitives", + "ripemd", + "rug", + "secp256k1 0.31.1", + "sha2 0.10.9", +] + +[[package]] +name = "revm-primitives" +version = "20.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa29d9da06fe03b249b6419b33968ecdf92ad6428e2f012dc57bcd619b5d94e" +dependencies = [ + "alloy-primitives", + "num_enum", + "once_cell", + "serde", +] + +[[package]] +name = "revm-state" +version = "7.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f64fbacb86008394aaebd3454f9643b7d5a782bd251135e17c5b33da592d84d" +dependencies = [ + "bitflags 2.9.4", + "revm-bytecode", + "revm-primitives", + "serde", ] [[package]] @@ -7360,25 +9163,53 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.16", "libc", - "spin 0.9.8", "untrusted 0.9.0", "windows-sys 0.52.0", ] +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "rlibc" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + [[package]] name = "rtnetlink" version = "0.13.1" @@ -7397,6 +9228,52 @@ dependencies = [ "tokio", ] +[[package]] +name = "rug" +version = "1.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad2e973fe3c3214251a840a621812a4f40468da814b1a3d6947d433c2af11f" +dependencies = [ + "az", + "gmp-mpfr-sys", + "libc", + "libm", +] + +[[package]] +name = "ruint" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68df0380e5c9d20ce49534f292a36a7514ae21350726efe1865bdb1fa91d278" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "ark-ff 0.5.0", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.2", + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "rlp 0.5.2", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "runtime-common" version = "0.1.0" @@ -7416,7 +9293,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 1.0.0", "log", "pallet-asset-tx-payment", "pallet-assets", @@ -7437,7 +9314,6 @@ dependencies = [ "polkadot-runtime-common", "runtime-constants", "scale-info", - "smallvec", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -7446,14 +9322,12 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "staging-xcm-builder", "staging-xcm-executor", - "substrate-wasm-builder", ] [[package]] @@ -7467,17 +9341,16 @@ dependencies = [ "smallvec", "sp-core", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "sp-weights 33.1.0", + "staging-xcm 19.0.0", "staging-xcm-builder", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -7485,19 +9358,34 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[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.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.25", + "semver 1.0.27", ] [[package]] @@ -7511,73 +9399,51 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.44" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "ring 0.16.20", - "sct", - "webpki", + "linux-raw-sys", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki", - "sct", + "once_cell", + "ring 0.17.14", + "rustls-pki-types", + "rustls-webpki 0.103.7", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-pki-types" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ - "base64 0.21.7", + "web-time", + "zeroize", ] [[package]] @@ -7586,15 +9452,38 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", + "ring 0.17.14", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" +dependencies = [ + "ring 0.17.14", + "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] [[package]] name = "rw-stream-sink" @@ -7609,9 +9498,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "safe_arch" @@ -7622,6 +9511,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -7633,8 +9531,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "29.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01733879c581defda6f49ff4076033c675d7127bfab6fd0bd0e6cf10696d0564" dependencies = [ "log", "sp-core", @@ -7644,12 +9543,12 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5962282c6d40861610814dac5159a99a5b4251d89269bb4e828ff766956f1833" dependencies = [ "array-bytes", "docify", - "log", "memmap2", "parity-scale-codec", "sc-chain-spec-derive", @@ -7672,24 +9571,26 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18cef11d2c69703e0d7c3528202ef4ed1cd2b47a6f063e9e17cad8255b1fa94" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sc-client-api" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6de05f4f496f2261981b7d293ff4f5ba804bdfa924bf0cd1b48252a8a7051913" dependencies = [ "fnv", "futures", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -7701,43 +9602,19 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-state-machine", - "sp-statement-store", "sp-storage", "sp-trie", "substrate-prometheus-endpoint", ] -[[package]] -name = "sc-consensus" -version = "0.44.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" -dependencies = [ - "async-trait", - "futures", - "log", - "mockall 0.11.4", - "parking_lot 0.12.3", - "sc-client-api", - "sc-network-types", - "sc-utils", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", -] - [[package]] name = "sc-executor" -version = "0.40.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90511c3ab41be12af1ce88753de8993e0b8a5fc0453c0f48069ace06eb4a99d" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", @@ -7756,10 +9633,11 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.35.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d81bc77ad5df120ef1ffab877d71539aae878e916c0946a067e8d6b0508a7ea5" dependencies = [ - "polkavm", + "polkavm 0.26.0", "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", @@ -7769,26 +9647,26 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" -version = "0.32.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8976f310f09818f42ec389e727c91c0a75a8c363a29e3ac97d56492d83fc144f" dependencies = [ "log", - "polkavm", + "polkavm 0.26.0", "sc-executor-common", "sp-wasm-interface", ] [[package]] name = "sc-executor-wasmtime" -version = "0.35.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f8f9b2a912f0cb435d2b8e33d67010e494b07f5c6e497d8756a8c21abad199e" dependencies = [ "anyhow", - "cfg-if", - "libc", "log", - "parking_lot 0.12.3", - "rustix 0.36.17", + "parking_lot 0.12.5", + "rustix", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -7798,13 +9676,14 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.45.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc739c9acba911caecaae0a299650491fe6a837ab14d216a1f6c1987dfb6ef28" dependencies = [ "array-bytes", "async-channel", "async-trait", - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "cid 0.9.0", "either", @@ -7816,15 +9695,14 @@ dependencies = [ "linked_hash_set", "litep2p", "log", - "mockall 0.11.4", - "once_cell", + "mockall", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "partial_sort", "pin-project", "prost 0.12.6", - "prost-build 0.12.6", - "rand", + "prost-build", + "rand 0.8.5", "sc-client-api", "sc-network-common", "sc-network-types", @@ -7833,7 +9711,7 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-blockchain", "sp-core", "sp-runtime", @@ -7849,52 +9727,50 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.44.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7419cbc4a107ec4f430b263408db1527f2ce5fd6ed136c279f22057d3d202965" dependencies = [ - "async-trait", "bitflags 1.3.2", - "futures", - "libp2p-identity", "parity-scale-codec", - "prost-build 0.12.6", - "sc-consensus", - "sc-network-types", - "sp-consensus", - "sp-consensus-grandpa", "sp-runtime", ] [[package]] name = "sc-network-types" -version = "0.12.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79011e96426caf5240631af9c4d0f841a752ee2be606d782406745e76b1123dd" dependencies = [ - "bs58 0.5.1", + "bs58", + "bytes", "ed25519-dalek", "libp2p-identity", + "libp2p-kad", "litep2p", "log", "multiaddr 0.18.2", "multihash 0.19.3", - "rand", + "rand 0.8.5", + "serde", + "serde_with", "thiserror 1.0.69", "zeroize", ] [[package]] name = "sc-telemetry" -version = "25.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "661460d41cb14de3d8ad638bc34f9179eb2dd65791ccf71fa6dc0c572ad8100b" dependencies = [ "chrono", "futures", "libp2p", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "pin-project", - "rand", - "sc-network", + "rand 0.8.5", "sc-utils", "serde", "serde_json", @@ -7904,11 +9780,13 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a04c8e6a886fd4563be1cfe487af2f11280ea797298b8d831e1ee5a273cc17d" dependencies = [ "async-trait", "futures", + "indexmap 2.11.4", "log", "parity-scale-codec", "serde", @@ -7920,17 +9798,17 @@ dependencies = [ [[package]] name = "sc-utils" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58dbfbc4408b0d210a6b7099c07caf02001e6975f62e316ea5b5c1f5c2108f4" dependencies = [ "async-channel", "futures", "futures-timer", - "lazy_static", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "prometheus", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", ] [[package]] @@ -7940,7 +9818,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" dependencies = [ "parity-scale-codec", - "scale-type-resolver", + "scale-type-resolver 0.1.1", +] + +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver 0.2.0", + "serde", ] [[package]] @@ -7949,12 +9839,27 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" dependencies = [ - "derive_more 0.99.18", + "derive_more 0.99.20", + "parity-scale-codec", + "scale-bits 0.5.0", + "scale-decode-derive 0.11.1", + "scale-type-resolver 0.1.1", + "smallvec", +] + +[[package]] +name = "scale-decode" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +dependencies = [ "parity-scale-codec", - "scale-bits", - "scale-decode-derive", - "scale-type-resolver", + "primitive-types 0.13.1", + "scale-bits 0.7.0", + "scale-decode-derive 0.16.0", + "scale-type-resolver 0.2.0", "smallvec", + "thiserror 2.0.17", ] [[package]] @@ -7963,23 +9868,50 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "scale-decode-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "scale-encode" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" dependencies = [ - "derive_more 0.99.18", + "derive_more 0.99.20", + "parity-scale-codec", + "scale-encode-derive 0.6.0", + "scale-type-resolver 0.1.1", + "smallvec", +] + +[[package]] +name = "scale-encode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +dependencies = [ "parity-scale-codec", - "scale-encode-derive", - "scale-type-resolver", + "primitive-types 0.13.1", + "scale-bits 0.7.0", + "scale-encode-derive 0.10.0", + "scale-type-resolver 0.2.0", "smallvec", + "thiserror 2.0.17", ] [[package]] @@ -7988,13 +9920,26 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" dependencies = [ - "darling", + "darling 0.14.4", "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "scale-encode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +dependencies = [ + "darling 0.20.11", + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "scale-info" version = "2.11.6" @@ -8006,7 +9951,7 @@ dependencies = [ "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", - "schemars", + "schemars 0.8.22", "serde", ] @@ -8016,10 +9961,10 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -8031,20 +9976,45 @@ dependencies = [ "smallvec", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-value" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" +dependencies = [ + "either", + "parity-scale-codec", + "scale-bits 0.7.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-type-resolver 0.2.0", + "thiserror 2.0.17", +] + [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "schemars" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", "schemars_derive", @@ -8052,16 +10022,40 @@ dependencies = [ "serde_json", ] +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -8077,9 +10071,9 @@ dependencies = [ [[package]] name = "schnorrkel" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +checksum = "6e9fcb6c2e176e86ec703e22560d99d65a5ee9056ae45a08e13e84ebf796296f" dependencies = [ "aead", "arrayref", @@ -8087,9 +10081,9 @@ dependencies = [ "curve25519-dalek", "getrandom_or_panic", "merlin", - "rand_core", + "rand_core 0.6.4", "serde_bytes", - "sha2 0.10.8", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -8102,33 +10096,20 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" - -[[package]] -name = "sct" -version = "0.7.1" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] +checksum = "d68f2ec51b097e4c1a75b681a8bec621909b5e91f15bb7b840c4f2f7b01148b2" [[package]] -name = "sctp-proto" -version = "0.2.2" +name = "scrypt" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6220f78bb44c15f326b0596113305f6101097a18755d53727a575c97e09fb24" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "bytes", - "crc", - "fxhash", - "log", - "rand", - "slab", - "thiserror 1.0.69", + "password-hash", + "pbkdf2", + "salsa20", + "sha2 0.10.9", ] [[package]] @@ -8146,13 +10127,53 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys 0.8.2", +] + [[package]] name = "secp256k1" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.8.5", + "secp256k1-sys 0.10.1", +] + +[[package]] +name = "secp256k1" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3c81b43dc2d8877c216a3fccf76677ee1ebccd429566d3e67447290d0c42b2" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.9.2", + "secp256k1-sys 0.11.0", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4473013577ec77b4ee3668179ef1186df3146e2cf2d927bd200974c6fe60fd99" +dependencies = [ + "cc", ] [[package]] @@ -8164,6 +10185,24 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb913707158fadaf0d8702c2db0e857de66eb003ccfdda5924b5f5ac98efb38" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -8173,14 +10212,23 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" -version = "2.11.1" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ - "bitflags 2.8.0", - "core-foundation", + "bitflags 2.9.4", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -8188,9 +10236,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -8202,16 +10250,26 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", ] [[package]] name = "semver" -version = "1.0.25" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.3", +] + +[[package]] +name = "semver" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" dependencies = [ "serde", + "serde_core", ] [[package]] @@ -8221,38 +10279,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] -name = "send_wrapper" -version = "0.6.0" +name = "semver-parser" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" dependencies = [ "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -8263,50 +10335,80 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ + "indexmap 2.11.4", "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] [[package]] -name = "serdect" -version = "0.2.0" +name = "serde_spanned" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" dependencies = [ - "base16ct", - "serde", + "serde_core", ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "serde_with" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "6093cd8c01b25262b84927e0f7151692158fab02d961e04c979d3903eba7ecc5" dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", - "sha1-asm", + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.11.4", + "schemars 0.9.0", + "schemars 1.0.4", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e6c180db0816026a61afa1cff5344fb7ebded7e4d3062772179f2501481c27" +dependencies = [ + "darling 0.21.3", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", ] [[package]] @@ -8320,15 +10422,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha1-asm" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" -dependencies = [ - "cc", -] - [[package]] name = "sha2" version = "0.9.9" @@ -8344,9 +10437,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -8363,6 +10456,16 @@ dependencies = [ "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -8385,14 +10488,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] name = "simba" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" +checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" dependencies = [ "approx", "num-complex", @@ -8409,11 +10512,11 @@ checksum = "6385ef05b7bbfddaa8bf6306d059adac087990d659576c73b7da802d9a6ce91f" [[package]] name = "simple-dns" -version = "0.5.7" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" +checksum = "dee851d0e5e7af3721faea1843e8015e820a234f81fda3dea9247e15bac9a86a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", ] [[package]] @@ -8422,14 +10525,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "slice-group-by" @@ -8439,8 +10545,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "15.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e707f402be868574473dbdc25af1a3ce63444a936d886a497ade8670aa38f3" dependencies = [ "enumn", "parity-scale-codec", @@ -8450,9 +10557,12 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] [[package]] name = "snow" @@ -8464,31 +10574,31 @@ dependencies = [ "blake2", "chacha20poly1305", "curve25519-dalek", - "rand_core", - "ring 0.17.8", - "rustc_version", - "sha2 0.10.8", + "rand_core 0.6.4", + "ring 0.17.14", + "rustc_version 0.4.1", + "sha2 0.10.9", "subtle", ] [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "socket2" -version = "0.5.8" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -8497,19 +10607,20 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures", "httparse", "log", - "rand", + "rand 0.8.5", "sha1", ] [[package]] name = "sp-api" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc9635cc2a860eff0b2d8b05ba217085c8292f41793f9cadfd931dc54976c00" dependencies = [ "docify", "hash-db", @@ -8530,22 +10641,24 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "20.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d832cd107113d389340dc80a632330fe7ed7d20f3db50aeeb6abe40e23b6f4e" dependencies = [ "Inflector", "blake2", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sp-application-crypto" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6067f30cf3fb9270471cf24a65d73b33330f32573abab2d97196f83fc076de0" dependencies = [ "parity-scale-codec", "scale-info", @@ -8556,9 +10669,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "26.0.0" +version = "26.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" dependencies = [ "docify", "integer-sqrt", @@ -8566,14 +10679,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions", ] [[package]] name = "sp-arithmetic" -version = "26.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f4755af7cc57f4a2a830e134b403fc832caa5d93dacb970ffc7ac717f38c40" dependencies = [ "docify", "integer-sqrt", @@ -8586,8 +10699,9 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "371762212dd2ecf361913297bbc93f291bb2a020b9c483dcd1a220eb5410c324" dependencies = [ "parity-scale-codec", "scale-info", @@ -8598,8 +10712,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aed5a2780e211f8b1faac53679238e527847d345120dd9acf8e506a39505957a" dependencies = [ "sp-api", "sp-inherents", @@ -8608,12 +10723,13 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "37.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082c634447671551ea1cb8f1182d1b8a7109f7316a044b974ad9e663935f56c8" dependencies = [ "futures", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "schnellru", "sp-api", "sp-consensus", @@ -8627,13 +10743,13 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.40.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cdbfa4f10a4c0aac84f9fa3327386988aea983c503b9ec7f0bd8aa8c34c3f01" dependencies = [ "async-trait", "futures", "log", - "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", @@ -8642,8 +10758,9 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.40.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e81acacf9cd02e4a797d67d9f1c52c3efb742aa2a9fa8d3a82e7e6eda07df28d" dependencies = [ "async-trait", "parity-scale-codec", @@ -8658,8 +10775,9 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.40.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0436df503f3f56fb348d7af5f173da3887b2ab823ca2344077341cc53b778977" dependencies = [ "async-trait", "parity-scale-codec", @@ -8676,8 +10794,9 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "21.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98c710358587b555bbbc04c970093458f9c7b2361a7690deb49aa954237d1a33" dependencies = [ "finality-grandpa", "log", @@ -8693,8 +10812,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.40.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749ef013265af2514d36f68098913655b9ee1ca8b36ff8b03a0f1feed2c82387" dependencies = [ "parity-scale-codec", "scale-info", @@ -8704,20 +10824,22 @@ dependencies = [ [[package]] name = "sp-core" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "38.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707602208776d0e19d4269bb3f68c5306cacbdfabbb2e4d8d499af7b907bb0a3" dependencies = [ + "ark-vrf", "array-bytes", "bitflags 1.3.2", "blake2", - "bounded-collections", - "bs58 0.5.1", - "dyn-clonable", + "bounded-collections 0.3.2", + "bs58", + "dyn-clone", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde", + "impl-serde 0.5.0", "itertools 0.11.0", "k256", "libsecp256k1", @@ -8725,20 +10847,20 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "paste", - "primitive-types", - "rand", + "primitive-types 0.13.1", + "rand 0.8.5", "scale-info", "schnorrkel", - "secp256k1", - "secrecy", + "secp256k1 0.28.2", + "secrecy 0.8.0", "serde", + "sha2 0.10.9", "sp-crypto-hashing", - "sp-debug-derive 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-debug-derive", "sp-externalities", - "sp-runtime-interface", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", "sp-storage", "ss58-registry", "substrate-bip39", @@ -8751,33 +10873,36 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", - "twox-hash", + "twox-hash 1.6.3", ] [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", - "parking_lot 0.12.3", + "parking_lot 0.12.5", ] [[package]] @@ -8788,23 +10913,14 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", -] - -[[package]] -name = "sp-debug-derive" -version = "14.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sp-externalities" -version = "0.29.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" dependencies = [ "environmental", "parity-scale-codec", @@ -8813,8 +10929,9 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.15.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f929edd118b6332b016e0e5a3eb962b8568b14eee024f818685f8ea5f80d53" dependencies = [ "parity-scale-codec", "scale-info", @@ -8825,8 +10942,9 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2522693c705c1245ef8dbdbcf09d7cc6b139f0184d5e0a46856c546666b494d7" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8838,8 +10956,9 @@ dependencies = [ [[package]] name = "sp-io" -version = "38.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2059e3b338c0174e8dc9e144cc7e612165ca4c960c3a23c6c99c29ef34768f" dependencies = [ "bytes", "docify", @@ -8847,9 +10966,9 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.26.0", "rustversion", - "secp256k1", + "secp256k1 0.28.2", "sp-core", "sp-crypto-hashing", "sp-externalities", @@ -8862,21 +10981,34 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "sp-keyring" +version = "44.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7cc9d55214634477506144bdc32039d490d9f5ca15997403e7a7613539ddebd" +dependencies = [ + "sp-core", + "sp-runtime", + "strum 0.26.3", +] + [[package]] name = "sp-keystore" -version = "0.40.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5c0b829014afc22e992be2c198f2677592db43267fc218e9f3207dbbfb6fbb" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "sp-core", "sp-externalities", ] [[package]] name = "sp-maybe-compressed-blob" -version = "11.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d204064a17660455603ae152b02fc7ea4cfff2d14796f6483d7a35c4cca336" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -8884,18 +11016,20 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.7.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1464c9e76f97c80a8dbccfe3f9fd4be0f25d0cc372efcf8fdf8791619b0998b9" dependencies = [ - "frame-metadata", + "frame-metadata 23.0.0", "parity-scale-codec", "scale-info", ] [[package]] name = "sp-mmr-primitives" -version = "34.1.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f8f11aae717ca26ef0728aec6a68f1092c8672e385675541aad6e5e86f5528" dependencies = [ "log", "parity-scale-codec", @@ -8904,28 +11038,30 @@ dependencies = [ "serde", "sp-api", "sp-core", - "sp-debug-derive 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-debug-derive", "sp-runtime", "thiserror 1.0.69", ] [[package]] name = "sp-npos-elections" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb6b7ddeb995c6d57efbc66f42c70bd513f251025fbe9de8b5903a7f87a50de7" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-runtime", ] [[package]] name = "sp-offchain" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69dd826d2ae5e64b6bef5f670e620ddd52eb3f762a4f1a16a984c23d6113e470" dependencies = [ "sp-api", "sp-core", @@ -8934,19 +11070,21 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "13.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "13.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" dependencies = [ "backtrace", - "lazy_static", "regex", ] [[package]] name = "sp-runtime" -version = "39.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "44.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee57bb77e94c26306501426ac82aca401bb80ee2279ecdba148f68e76cf58247" dependencies = [ + "binary-merkle-tree", "docify", "either", "hash256-std-hasher", @@ -8955,32 +11093,34 @@ dependencies = [ "num-traits", "parity-scale-codec", "paste", - "rand", + "rand 0.8.5", "scale-info", "serde", "simple-mermaid", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-io", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", + "sp-trie", + "sp-weights 33.1.0", "tracing", + "tuplex", ] [[package]] name = "sp-runtime-interface" -version = "28.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efdc2bc2adbfb9b4396ae07c7d94db20414d2351608e29e1f44e4f643b387c70" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.26.0", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -8989,21 +11129,23 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04178084ae654b3924934a56943ee73e3562db4d277e948393561b08c3b5b5fe" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sp-session" -version = "36.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327e2a7cf952f6ed6ca86d3fe9ab71561d30a358a83129afe60efc9bd2720ab0" dependencies = [ "parity-scale-codec", "scale-info", @@ -9016,8 +11158,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "36.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3a442232a0bf3c0db2d0e2b0048bb5fa2ed06606cbdc018ca59d5af7294b5d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9029,14 +11172,15 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.43.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "042677239cca40eb6a0d70e0b220f5693516f59853c2d678de471a79652cd16e" dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.3", - "rand", + "parking_lot 0.12.5", + "rand 0.8.5", "smallvec", "sp-core", "sp-externalities", @@ -9047,57 +11191,30 @@ dependencies = [ "trie-db", ] -[[package]] -name = "sp-statement-store" -version = "18.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" -dependencies = [ - "aes-gcm", - "curve25519-dalek", - "ed25519-dalek", - "hkdf", - "parity-scale-codec", - "rand", - "scale-info", - "sha2 0.10.8", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-crypto-hashing", - "sp-externalities", - "sp-runtime", - "sp-runtime-interface", - "thiserror 1.0.69", - "x25519-dalek", -] - [[package]] name = "sp-std" version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" -[[package]] -name = "sp-std" -version = "14.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" - [[package]] name = "sp-storage" -version = "21.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" dependencies = [ - "impl-serde", + "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-debug-derive", ] [[package]] name = "sp-timestamp" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074a33fe8fc3b6dc53c8b3b879c68efb070aa6aea3a2cb04b714da347643494c" dependencies = [ "async-trait", "parity-scale-codec", @@ -9108,19 +11225,22 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "17.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c7372456c39cc81e15befe54d0caab8378f2b30fd34d1bcb5f0f56631c6b6e" dependencies = [ "parity-scale-codec", + "regex", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.3.20", ] [[package]] name = "sp-transaction-pool" -version = "34.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a9a006d5a5ffcc779148acabfa27dbedb3c93909e8592f2ec8c98e3a6745fe" dependencies = [ "sp-api", "sp-runtime", @@ -9128,21 +11248,24 @@ dependencies = [ [[package]] name = "sp-trie" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "41.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2a05942903900c23aaa5fded094fa8186523e646ae8874bff3fce74985d0e5" dependencies = [ "ahash", + "foldhash 0.1.5", "hash-db", - "lazy_static", + "hashbrown 0.15.5", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.3", - "rand", + "parking_lot 0.12.5", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", "sp-externalities", + "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing", "trie-db", @@ -9151,36 +11274,40 @@ dependencies = [ [[package]] name = "sp-version" -version = "37.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "42.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633ea19da3ec057d449af667099072daa4e99900984f304b96f4c2ee15aeecc7" dependencies = [ - "impl-serde", + "impl-serde 0.5.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-std", "sp-version-proc-macro", "thiserror 1.0.69", ] [[package]] name = "sp-version-proc-macro" -version = "14.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" dependencies = [ "parity-scale-codec", + "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "sp-wasm-interface" -version = "21.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd177d0658f3df0492f28bd39d665133a7868db5aa66c8642c949b6265430719" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9191,31 +11318,32 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.0.0" +version = "31.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" dependencies = [ - "bounded-collections", + "bounded-collections 0.2.4", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 26.1.0", + "sp-debug-derive", ] [[package]] name = "sp-weights" -version = "31.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "33.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb3f1b1373a0926b44ddabfa55a608ea78c20ee356f35575c031db2f0202545" dependencies = [ - "bounded-collections", + "bounded-collections 0.3.2", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "sp-debug-derive 14.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", + "sp-debug-derive", ] [[package]] @@ -9257,14 +11385,15 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "staging-parachain-info" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c09acbd6891e8b6e6ac6d2d868b4fb66bfb63e98ad0aad0e3b8935404f5b262" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -9281,7 +11410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aded0292274ad473250c22ed3deaf2d9ed47d15786d700e9e83ab7c1cad2ad44" dependencies = [ "array-bytes", - "bounded-collections", + "bounded-collections 0.2.4", "derivative", "environmental", "impl-trait-for-tuples", @@ -9289,55 +11418,62 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 31.1.0", "xcm-procedural 8.0.0", ] [[package]] name = "staging-xcm" -version = "14.2.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f8432288dfe5fff10ef690afa6c075e79831b64d58ed3e980d4b972c5416f6" dependencies = [ "array-bytes", - "bounded-collections", - "derivative", + "bounded-collections 0.3.2", + "derive-where", "environmental", + "frame-support", + "hex-literal 0.4.1", "impl-trait-for-tuples", - "log", "parity-scale-codec", "scale-info", "serde", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "xcm-procedural 10.1.0", + "sp-weights 33.1.0", + "tracing", + "xcm-procedural 11.0.2", ] [[package]] name = "staging-xcm-builder" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a747666d141266f9f94af6435337d9fc39202e50751867b1308dce71b9fa344c" dependencies = [ + "environmental", "frame-support", "frame-system", "impl-trait-for-tuples", - "log", "pallet-asset-conversion", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", + "sp-core", "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "sp-weights 33.1.0", + "staging-xcm 19.0.0", "staging-xcm-executor", + "tracing", ] [[package]] name = "staging-xcm-executor" -version = "17.0.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960590e3381796ad06ca92fdfcf0a02360de823100bd2223a3233d36833e87c9" dependencies = [ "environmental", "frame-benchmarking", @@ -9345,12 +11481,12 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", + "sp-arithmetic 28.0.0", "sp-core", "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "sp-weights 33.1.0", + "staging-xcm 19.0.0", "tracing", ] @@ -9360,26 +11496,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str0m" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6706347e49b13373f7ddfafad47df7583ed52083d6fc8a594eb2c80497ef959d" -dependencies = [ - "combine", - "crc", - "fastrand", - "hmac 0.12.1", - "once_cell", - "openssl", - "openssl-sys", - "sctp-proto", - "serde", - "sha-1", - "thiserror 1.0.69", - "tracing", -] - [[package]] name = "string-interner" version = "0.17.0" @@ -9441,28 +11557,43 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ "hmac 0.12.1", "pbkdf2", "schnorrkel", - "sha2 0.10.8", + "sha2 0.10.9", "zeroize", ] +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + [[package]] name = "substrate-prometheus-endpoint" -version = "0.17.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23e4bc8e910a312820d589047ab683928b761242dbe31dee081fbdb37cbe0be" dependencies = [ "http-body-util", - "hyper 1.5.2", + "hyper 1.7.0", "hyper-util", "log", "prometheus", @@ -9472,8 +11603,9 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "24.0.1" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2390fa52ef73008e89d01fd712e96f9288e82c30f14622c28beeebbc942b4f58" dependencies = [ "build-helper", "cargo_metadata", @@ -9481,11 +11613,12 @@ dependencies = [ "filetime", "jobserver", "parity-wasm", - "polkavm-linker", + "polkavm-linker 0.26.0", + "shlex", "sp-maybe-compressed-blob", "strum 0.26.3", "tempfile", - "toml 0.8.19", + "toml 0.8.23", "walkdir", "wasm-opt", ] @@ -9496,11 +11629,97 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "subxt-core" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66ef00be9d64885ec94e478a58e4e39d222024b20013ae7df4fc6ece545391aa" +dependencies = [ + "base58", + "blake2", + "derive-where", + "frame-decode", + "frame-metadata 20.0.0", + "hashbrown 0.14.5", + "hex", + "impl-serde 0.5.0", + "keccak-hash", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits 0.7.0", + "scale-decode 0.16.0", + "scale-encode 0.10.0", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-crypto-hashing", + "subxt-metadata", + "thiserror 2.0.17", + "tracing", +] + +[[package]] +name = "subxt-metadata" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff4591673600c4388e21305788282414d26c791b4dee21b7cb0b19c10076f98" +dependencies = [ + "frame-decode", + "frame-metadata 20.0.0", + "hashbrown 0.14.5", + "parity-scale-codec", + "scale-info", + "sp-crypto-hashing", + "thiserror 2.0.17", +] + +[[package]] +name = "subxt-signer" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a2370298a210ed1df26152db7209a85e0ed8cfbce035309c3b37f7b61755377" +dependencies = [ + "base64", + "bip32", + "bip39", + "cfg-if", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "keccak-hash", + "parity-scale-codec", + "pbkdf2", + "regex", + "schnorrkel", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "sp-crypto-hashing", + "subxt-core", + "thiserror 2.0.17", + "zeroize", +] + [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -9508,14 +11727,15 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.96" +name = "syn-solidity" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "2375c17f6067adc651d8c2c51658019cef32edfff4a982adaf1d7fd1c039f08b" dependencies = [ + "paste", "proc-macro2", "quote", - "unicode-ident", + "syn 2.0.106", ] [[package]] @@ -9532,13 +11752,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] @@ -9547,8 +11767,8 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", - "core-foundation", + "bitflags 2.9.4", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -9562,6 +11782,12 @@ dependencies = [ "libc", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -9570,22 +11796,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ - "cfg-if", "fastrand", - "getrandom", + "getrandom 0.3.3", "once_cell", - "rustix 0.38.44", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.61.2", ] [[package]] @@ -9614,11 +11839,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.17", ] [[package]] @@ -9629,35 +11854,43 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" 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 = "time" -version = "0.3.37" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -9670,15 +11903,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -9695,9 +11928,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -9705,9 +11938,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -9720,19 +11953,21 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot 0.12.5", "pin-project-lite", - "socket2 0.5.8", + "slab", + "socket2 0.6.1", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -9743,16 +11978,16 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.21.12", + "rustls", "tokio", ] @@ -9769,14 +12004,15 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "489a59b6730eda1b0171fcfda8b121f4bee2b35cba8645ca35c5f7ba3eb736c1" dependencies = [ "futures-util", "log", - "rustls 0.21.12", + "rustls", "rustls-native-certs", + "rustls-pki-types", "tokio", "tokio-rustls", "tungstenite", @@ -9784,9 +12020,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", @@ -9807,38 +12043,96 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +dependencies = [ + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.3", + "toml_datetime 0.7.3", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.11.4", "serde", - "serde_spanned", - "toml_datetime", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +dependencies = [ + "indexmap 2.11.4", + "toml_datetime 0.7.3", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower-service" version = "0.3.3" @@ -9859,20 +12153,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -9891,14 +12185,23 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -9910,9 +12213,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" dependencies = [ "hash-db", "log", @@ -9929,78 +12232,6 @@ 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 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "smallvec", - "socket2 0.4.10", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "smallvec", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.3", - "rand", - "resolv-conf", - "smallvec", - "thiserror 1.0.69", - "tokio", - "tracing", - "trust-dns-proto 0.23.2", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -10015,24 +12246,30 @@ checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "eadc29d668c91fcc564941132e17b28a7ceb2f3ebf0b9dae3e03fd7a6748eb0d" dependencies = [ - "byteorder", "bytes", "data-encoding", - "http 0.2.12", + "http 1.3.1", "httparse", "log", - "rand", - "rustls 0.21.12", + "rand 0.9.2", + "rustls", + "rustls-pki-types", "sha1", - "thiserror 1.0.69", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.17", + "url 2.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "utf-8", ] +[[package]] +name = "tuplex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" + [[package]] name = "twox-hash" version = "1.6.3" @@ -10041,15 +12278,30 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", + "rand 0.8.5", "static_assertions", ] +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" +dependencies = [ + "rand 0.9.2", +] + [[package]] name = "typenum" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -10064,16 +12316,28 @@ dependencies = [ ] [[package]] -name = "unicode-bidi" -version = "0.3.18" +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-normalization" @@ -10086,15 +12350,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -10118,7 +12376,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "futures-io", "futures-util", @@ -10148,23 +12406,25 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ - "form_urlencoded 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "form_urlencoded 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] name = "url" -version = "2.5.4" -source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" +version = "2.5.7" +source = "git+https://github.com/servo/rust-url#9771ab51f0aaa02ca1884f88c577260e9b86f9b6" dependencies = [ - "form_urlencoded 1.2.1 (git+https://github.com/servo/rust-url)", - "idna 1.0.3 (git+https://github.com/servo/rust-url)", - "percent-encoding 2.3.1 (git+https://github.com/servo/rust-url)", + "form_urlencoded 1.2.2 (git+https://github.com/servo/rust-url)", + "idna 1.1.0 (git+https://github.com/servo/rust-url)", + "percent-encoding 2.3.2 (git+https://github.com/servo/rust-url)", + "serde", ] [[package]] @@ -10173,12 +12433,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -10192,26 +12446,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "valuable" -version = "0.1.1" +name = "uuid" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "valuable" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "verifier" -version = "0.1.0" -source = "git+https://github.com/virto-network/webauthn#c217e8a2a03f160bbf83e47c4d6d0ea46c93dcab" -dependencies = [ - "log", - "p256", - "sha2 0.10.8", -] +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "version_check" @@ -10223,15 +12472,15 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" name = "virto-common" version = "0.1.0" dependencies = [ - "bs58 0.5.1", + "bs58", "cumulus-primitives-core", + "fc-pallet-payments", "frame-support", - "pallet-payments", "parity-scale-codec", "scale-info", "serde", "sp-runtime", - "staging-xcm 14.2.0", + "staging-xcm 19.0.0", "wasm-bindgen", ] @@ -10243,28 +12492,81 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a3028804c8bbae2a97a15b71ffc0e308c4b01a520994aafa77d56e94e19024" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" dependencies = [ "ark-bls12-377", - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-serialize-derive", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", "arrayref", - "constcat", "digest 0.10.7", - "rand", - "rand_chacha", - "rand_core", - "sha2 0.10.8", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.9", "sha3", - "thiserror 1.0.69", "zeroize", ] +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -10286,41 +12588,60 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" dependencies = [ "cfg-if", "js-sys", @@ -10331,9 +12652,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10341,26 +12662,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" +dependencies = [ + "leb128fmt", + "wasmparser", +] + [[package]] name = "wasm-instrument" version = "0.4.0" @@ -10467,12 +12798,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.102.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ - "indexmap 1.9.3", - "url 2.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 2.9.4", + "hashbrown 0.15.5", + "indexmap 2.11.4", + "semver 1.0.27", + "serde", ] [[package]] @@ -10484,219 +12818,254 @@ dependencies = [ "indexmap-nostd", ] +[[package]] +name = "wasmprinter" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aa8e9076de6b9544e6dab4badada518cca0bf4966d35b131bbd057aed8fa0a" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser", +] + [[package]] name = "wasmtime" -version = "8.0.1" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" +checksum = "b6fe976922a16af3b0d67172c473d1fd4f1aa5d0af9c8ba6538c741f3af686f4" dependencies = [ + "addr2line 0.24.2", "anyhow", - "bincode", + "bitflags 2.9.4", + "bumpalo", + "cc", "cfg-if", - "indexmap 1.9.3", + "gimli 0.31.1", + "hashbrown 0.15.5", + "indexmap 2.11.4", "libc", "log", - "object 0.30.4", + "mach2", + "memfd", + "object 0.36.7", "once_cell", - "paste", - "psm", + "postcard", + "pulley-interpreter", "rayon", + "rustix", "serde", + "serde_derive", + "smallvec", "target-lexicon", "wasmparser", - "wasmtime-cache", - "wasmtime-cranelift", "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", + "wasmtime-internal-asm-macros", + "wasmtime-internal-cache", + "wasmtime-internal-cranelift", + "wasmtime-internal-fiber", + "wasmtime-internal-jit-icache-coherence", + "wasmtime-internal-math", + "wasmtime-internal-slab", + "wasmtime-internal-unwinder", + "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-winch", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-environ" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b6264a78d806924abbc76bbc75eac24976bc83bdfb938e5074ae551242436f" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bitset", + "cranelift-entity", + "gimli 0.31.1", + "indexmap 2.11.4", + "log", + "object 0.36.7", + "postcard", + "rustc-demangle", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasm-encoder", + "wasmparser", + "wasmprinter", ] [[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" +name = "wasmtime-internal-asm-macros" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" +checksum = "6775a9b516559716e5710e95a8014ca0adcc81e5bf4d3ad7899d89ae40094d1a" dependencies = [ "cfg-if", ] [[package]] -name = "wasmtime-cache" -version = "8.0.1" +name = "wasmtime-internal-cache" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" +checksum = "138e33ad4bd120f3b1c77d6d0dcdce0de8239555495befcda89393a40ba5e324" dependencies = [ "anyhow", - "base64 0.21.7", - "bincode", + "base64", "directories-next", - "file-per-thread-logger", "log", - "rustix 0.36.17", + "postcard", + "rustix", "serde", - "sha2 0.10.8", - "toml 0.5.11", - "windows-sys 0.45.0", - "zstd 0.11.2+zstd.1.5.2", + "serde_derive", + "sha2 0.10.9", + "toml 0.8.23", + "windows-sys 0.59.0", + "zstd 0.13.3", ] [[package]] -name = "wasmtime-cranelift" -version = "8.0.1" +name = "wasmtime-internal-cranelift" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" +checksum = "7ec9ad7565e6a8de7cb95484e230ff689db74a4a085219e0da0cbd637a29c01c" dependencies = [ "anyhow", + "cfg-if", "cranelift-codegen", + "cranelift-control", "cranelift-entity", "cranelift-frontend", "cranelift-native", - "cranelift-wasm", - "gimli 0.27.3", + "gimli 0.31.1", + "itertools 0.14.0", "log", - "object 0.30.4", + "object 0.36.7", + "pulley-interpreter", + "smallvec", "target-lexicon", - "thiserror 1.0.69", + "thiserror 2.0.17", "wasmparser", - "wasmtime-cranelift-shared", "wasmtime-environ", + "wasmtime-internal-math", + "wasmtime-internal-versioned-export-macros", ] [[package]] -name = "wasmtime-cranelift-shared" -version = "8.0.1" +name = "wasmtime-internal-fiber" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +checksum = "8b636ff8b220ebaf29dfe3b23770e4b2bad317b9683e3bf7345e162387385b39" dependencies = [ "anyhow", - "cranelift-codegen", - "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", - "target-lexicon", - "wasmtime-environ", + "cc", + "cfg-if", + "libc", + "rustix", + "wasmtime-internal-asm-macros", + "wasmtime-internal-versioned-export-macros", + "windows-sys 0.59.0", ] [[package]] -name = "wasmtime-environ" -version = "8.0.1" +name = "wasmtime-internal-jit-icache-coherence" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" +checksum = "4417e06b7f80baff87d9770852c757a39b8d7f11d78b2620ca992b8725f16f50" dependencies = [ "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror 1.0.69", - "wasmparser", - "wasmtime-types", + "cfg-if", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "wasmtime-jit" -version = "8.0.1" +name = "wasmtime-internal-math" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" +checksum = "7710d5c4ecdaa772927fd11e5dc30a9a62d1fc8fe933e11ad5576ad596ab6612" dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-debug", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", + "libm", ] [[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" +name = "wasmtime-internal-slab" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "object 0.30.4", - "once_cell", - "rustix 0.36.17", -] +checksum = "e6ab22fabe1eed27ab01fd47cd89deacf43ad222ed7fd169ba6f4dd1fbddc53b" [[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" +name = "wasmtime-internal-unwinder" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +checksum = "307708f302f5dcf19c1bbbfb3d9f2cbc837dd18088a7988747b043a46ba38ecc" dependencies = [ + "anyhow", "cfg-if", - "libc", - "windows-sys 0.45.0", + "cranelift-codegen", + "log", + "object 0.36.7", ] [[package]] -name = "wasmtime-runtime" -version = "8.0.1" +name = "wasmtime-internal-versioned-export-macros" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" +checksum = "342b0466f92b7217a4de9e114175fedee1907028567d2548bcd42f71a8b5b016" dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] -name = "wasmtime-types" -version = "8.0.1" +name = "wasmtime-internal-winch" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +checksum = "2012e7384c25b91aab2f1b6a1e1cbab9d0f199bbea06cc873597a3f047f05730" dependencies = [ - "cranelift-entity", - "serde", - "thiserror 1.0.69", + "anyhow", + "cranelift-codegen", + "gimli 0.31.1", + "object 0.36.7", + "target-lexicon", "wasmparser", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "winch-codegen", ] [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "webpki" -version = "0.22.4" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webauthn-verifier" +version = "0.1.0" +source = "git+https://github.com/virto-network/pass-authenticators#92c34842f069c85851341fcce3eed594c70cd834" +dependencies = [ + "log", + "p256", + "sha2 0.10.9", ] [[package]] @@ -10705,23 +13074,11 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.44", -] - [[package]] name = "wide" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" dependencies = [ "bytemuck", "safe_arch", @@ -10729,9 +13086,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" [[package]] name = "winapi" @@ -10751,11 +13108,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -10764,6 +13121,26 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winch-codegen" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "839a334ef7c62d8368dbd427e767a6fbb1ba08cc12ecce19cbb666c10613b585" +dependencies = [ + "anyhow", + "cranelift-assembler-x64", + "cranelift-codegen", + "gimli 0.31.1", + "regalloc2 0.12.2", + "smallvec", + "target-lexicon", + "thiserror 2.0.17", + "wasmparser", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "wasmtime-internal-math", +] + [[package]] name = "windows" version = "0.53.0" @@ -10776,23 +13153,55 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ + "windows-result 0.1.2", "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.53.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result 0.4.1", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", ] +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-result" version = "0.1.2" @@ -10803,27 +13212,21 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-result" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 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", + "windows-link", ] [[package]] -name = "windows-sys" -version = "0.45.0" +name = "windows-strings" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-targets 0.42.2", + "windows-link", ] [[package]] @@ -10854,18 +13257,21 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 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", + "windows-link", ] [[package]] @@ -10892,7 +13298,7 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", @@ -10900,10 +13306,21 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] [[package]] name = "windows_aarch64_gnullvm" @@ -10918,10 +13335,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -10936,10 +13353,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -10953,6 +13370,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" @@ -10960,10 +13383,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnullvm" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -10978,10 +13401,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -10996,10 +13419,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -11014,10 +13437,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -11031,11 +13454,17 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" dependencies = [ "memchr", ] @@ -11051,16 +13480,16 @@ dependencies = [ ] [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wyz" @@ -11078,23 +13507,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", - "rand_core", + "rand_core 0.6.4", "serde", "zeroize", ] [[package]] name = "x509-parser" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs 0.6.2", "data-encoding", - "der-parser 8.2.0", + "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry 0.7.1", "rusticata-macros", "thiserror 1.0.69", "time", @@ -11102,18 +13531,18 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460" dependencies = [ - "asn1-rs 0.6.2", + "asn1-rs 0.7.1", "data-encoding", - "der-parser 9.0.0", + "der-parser 10.0.0", "lazy_static", "nom", - "oid-registry 0.7.1", + "oid-registry 0.8.1", "rusticata-macros", - "thiserror 1.0.69", + "thiserror 2.0.17", "time", ] @@ -11126,39 +13555,41 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "xcm-procedural" -version = "10.1.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "11.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d3d21c65cbf847ae0b1a8e6411b614d269d3108c6c649b039bffcf225e89aa4" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "xcm-runtime-apis" -version = "0.4.0" -source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2a093033360dadcda3e836d0e9734ad4d0cc42aaaa7358e59b207a36d5780a8" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", "sp-api", - "sp-weights 31.0.0 (git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409)", - "staging-xcm 14.2.0", + "sp-weights 33.1.0", + "staging-xcm 19.0.0", "staging-xcm-executor", ] [[package]] name = "xml-rs" -version = "0.8.25" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" +checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7" [[package]] name = "xmltree" @@ -11184,10 +13615,26 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot 0.12.5", + "pin-project", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yamux" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6927cfe0edfae4b26a369df6bad49cd0ef088c0ec48f4045b2084bcaedc10246" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.5", "pin-project", - "rand", + "rand 0.9.2", "static_assertions", + "web-time", ] [[package]] @@ -11201,9 +13648,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -11213,63 +13660,62 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", - "synstructure 0.13.1", + "syn 2.0.106", + "synstructure 0.13.2", ] [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", - "synstructure 0.13.1", + "syn 2.0.106", + "synstructure 0.13.2", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] @@ -11282,14 +13728,25 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", ] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" dependencies = [ "yoke", "zerofrom", @@ -11298,38 +13755,38 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.106", ] [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", + "zstd-safe 6.0.6", ] [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 6.0.6", + "zstd-safe 7.2.4", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", @@ -11337,19 +13794,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 527c3d3fc..a67402dbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,25 +16,32 @@ debug = 0 [workspace.package] authors = ['Virto Team '] edition = "2021" -homepage = 'https://github.com/virto-network/virto-node' +homepage = 'https://github.com/virto-network/kreivo' license = "GPL-3.0-only" -repository = 'https://github.com/virto-network/virto-node' +repository = 'https://github.com/virto-network/kreivo' [workspace.dependencies] # common -clap = { version = "4.5.3" } -futures = { version = "0.3.28" } -hex-literal = { version = "0.4.1" } -log = { version = "0.4.22" } +anyhow = { version = "1.0.100", default-features = false } +tempfile = { version = "3.23.0" } +toml = { version = "0.9.8" } +twox-hash = { version = "2.1.2", default-features = false } +num_enum = { version = "0.7.3", default-features = false } + +clap = { version = "4.5.48" } +hex-literal = { version = "1.0.0" } +log = { version = "0.4.28" } parity-scale-codec = { version = "3.6.4", default-features = false, features = [ - "derive", + "derive", ] } scale-info = { version = "2.10.0", default-features = false, features = [ - "derive", + "derive", ] } -serde = { version = "1.0.188", default-features = false } -serde_json = { version = "1.0.121", default-features = false } +rand_core = { version = "0.6.4", default-features = false } +serde = { version = "1.0.228", default-features = false } +serde_json = { version = "1.0.145", default-features = false } smallvec = "1.11" +schnorrkel = { version = "0.11.4", default-features = false } # Local dependencies kreivo-runtime = { path = "runtime/kreivo" } @@ -43,122 +50,125 @@ kreivo-runtime = { path = "runtime/kreivo" } kreivo-apis = { default-features = false, path = "apis" } virto-common = { default-features = false, path = "common" } -pallet-communities = { default-features = false, path = "pallets/communities" } pallet-communities-manager = { default-features = false, path = "pallets/communities-manager" } -pallet-payments = { default-features = false, path = "pallets/payments" } +pallet-contracts-store = { default-features = false, path = "pallets/contracts-store" } runtime-constants = { default-features = false, path = "runtime/runtime-constants" } runtime-common = { default-features = false, path = "runtime/common" } # Frame Contrib -fc-traits-authn = { git = "https://github.com/virto-network/frame-contrib", default-features = false } -fc-traits-gas-tank = { git = "https://github.com/virto-network/frame-contrib", default-features = false } -fc-traits-memberships = { git = "https://github.com/virto-network/frame-contrib", default-features = false } -fc-traits-tracks = { git = "https://github.com/virto-network/frame-contrib", default-features = false } -pallet-gas-transaction-payment = { git = "https://github.com/virto-network/frame-contrib", package = "fc-pallet-gas-transaction-payment", default-features = false } -pallet-pass = { git = "https://github.com/virto-network/frame-contrib", package = "fc-pallet-pass", default-features = false } -pallet-referenda-tracks = { git = "https://github.com/virto-network/frame-contrib", package = "fc-pallet-referenda-tracks", default-features = false } -pass-webauthn = { git = "https://github.com/virto-network/webauthn", default-features = false } +frame-contrib-traits = { git = "https://github.com/virto-network/frame-contrib", default-features = false } +mock-helpers = { git = "https://github.com/virto-network/frame-contrib", default-features = false } + +pallet-communities = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-communities" } +pallet-gas-transaction-payment = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-gas-transaction-payment" } +pallet-listings = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-listings" } +pallet-orders = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-orders" } +pallet-payments = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-payments" } +pallet-pass = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-pass" } +pallet-referenda-tracks = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-referenda-tracks" } +pallet-black-hole = { git = "https://github.com/virto-network/frame-contrib", default-features = false, package = "fc-pallet-black-hole" } + +# Pass Authenticators +pass-webauthn = { git = "https://github.com/virto-network/pass-authenticators", default-features = false, package = "pass-authenticators-webauthn" } +pass-substrate-keys = { git = "https://github.com/virto-network/pass-authenticators", default-features = false, package = "pass-authenticators-substrate-keys" } # Substrate std -pallet-transaction-payment-rpc = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sc-chain-spec = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sc-network = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-consensus = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +pallet-transaction-payment-rpc = { version = "46.0.0" } +sc-chain-spec = { version = "46.0.0" } +sp-consensus = { version = "0.45.0" } # Substrate non-std -frame-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-block-builder = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-consensus-aura = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-core = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-io = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-keystore = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-offchain = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-session = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-transaction-pool = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +frame-benchmarking = { version = "43.0.0", default-features = false } +sp-api = { version = "39.0.0", default-features = false } +sp-block-builder = { version = "39.0.0", default-features = false } +sp-consensus-aura = { version = "0.45.0", default-features = false } +sp-core = { version = "38.1.0", default-features = false } +sp-io = { version = "43.0.0", default-features = false } +sp-offchain = { version = "39.0.0", default-features = false } +sp-session = { version = "41.0.0", default-features = false } +sp-transaction-pool = { version = "39.0.0", default-features = false } # Substrate Runtime -sp-genesis-builder = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-inherents = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-runtime = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-std = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-version = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -sp-weights = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +sp-genesis-builder = { version = "0.20.0", default-features = false } +sp-inherents = { version = "39.0.0", default-features = false } +sp-runtime = { version = "44.0.0", default-features = false } +sp-version = { version = "42.0.0", default-features = false } +sp-weights = { version = "33.1.0", default-features = false } # Build Dependencies -substrate-wasm-builder = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } - -## Substrate FRAME Dependencies -frame-executive = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -frame-support = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -frame-system = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -frame-try-runtime = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } - -## Substrate Pallet Dependencies -pallet-asset-tx-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-assets = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-assets-freezer = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-aura = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-authorship = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-balances = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-collective = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-contracts = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-contracts-primitives = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-democracy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-identity = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-multisig = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-nfts = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-preimage = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-proxy = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-ranked-collective = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-referenda = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-remark = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-scheduler = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-session = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-skip-feeless-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-sudo = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-timestamp = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-treasury = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-uniques = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-vesting = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +substrate-wasm-builder = { version = "29.0.0" } +parity-wasm = { version = "0.45.0" } + +## FRAME Dependencies +frame-executive = { version = "43.0.0", default-features = false } +frame-support = { version = "43.0.0", default-features = false } +frame-system = { version = "43.0.0", default-features = false } +frame-system-benchmarking = { version = "43.0.0", default-features = false } +frame-system-rpc-runtime-api = { version = "39.0.0", default-features = false } +frame-try-runtime = { version = "0.49.0", default-features = false } + +## FRAME Pallets +pallet-asset-tx-payment = { version = "43.0.0", default-features = false } +pallet-assets = { version = "46.0.0", default-features = false } +pallet-assets-freezer = { version = "0.11.0", default-features = false } +pallet-assets-holder = { version = "0.6.0", default-features = false } +pallet-aura = { version = "42.0.0", default-features = false } +pallet-authorship = { version = "43.0.0", default-features = false } +pallet-balances = { version = "44.0.0", default-features = false } +pallet-contracts = { version = "43.0.0", default-features = false } +pallet-contracts-fixtures = { path = "pallets/contracts-store/fixtures", default-features = false } +pallet-multisig = { version = "43.0.0", default-features = false } +pallet-nfts = { version = "37.0.0", default-features = false } +pallet-preimage = { version = "43.0.0", default-features = false } +pallet-proxy = { version = "43.0.0", default-features = false } +pallet-ranked-collective = { version = "43.0.0", default-features = false } +pallet-referenda = { version = "43.0.0", default-features = false } +pallet-scheduler = { version = "44.0.0", default-features = false } +pallet-session = { version = "43.0.0", default-features = false } +pallet-skip-feeless-payment = { version = "18.0.0", default-features = false } +pallet-sudo = { version = "43.0.0", default-features = false } +pallet-timestamp = { version = "42.0.0", default-features = false } +pallet-transaction-payment = { version = "43.0.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { version = "43.0.0", default-features = false } +pallet-treasury = { version = "42.0.0", default-features = false } +pallet-utility = { version = "43.0.0", default-features = false } +pallet-vesting = { version = "43.0.0", default-features = false } +pallet-revive = { version = "0.10.0", default-features = false } # Cumulus client dependencies -cumulus-primitives-aura = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409", default-features = false } +cumulus-primitives-aura = { version = "0.20.0", default-features = false } # Cumulus runtime dependencies -assets-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-pallet-aura-ext = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-pallet-parachain-system = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-pallet-session-benchmarking = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-pallet-xcm = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-pallet-xcmp-queue = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-primitives-core = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-primitives-timestamp = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -cumulus-primitives-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-collator-selection = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-message-queue = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -parachain-info = { package = "staging-parachain-info", default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -parachains-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +assets-common = { version = "0.25.0", default-features = false } +cumulus-pallet-aura-ext = { version = "0.23.0", default-features = false } +cumulus-pallet-parachain-system = { version = "0.23.0", default-features = false } +cumulus-pallet-session-benchmarking = { version = "24.0.0", default-features = false } +cumulus-pallet-xcm = { version = "0.22.0", default-features = false } +cumulus-pallet-xcmp-queue = { version = "0.23.0", default-features = false } +cumulus-primitives-core = { version = "0.21.0", default-features = false } +cumulus-primitives-timestamp = { version = "0.22.0", default-features = false } +cumulus-primitives-utility = { version = "0.23.0", default-features = false } +pallet-collator-selection = { version = "24.0.0", default-features = false } +pallet-message-queue = { version = "46.0.0", default-features = false } +parachain-info = { version = "0.23.0", package = "staging-parachain-info", default-features = false } +parachains-common = { version = "25.0.0", default-features = false } # Polkadot -polkadot-primitives = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409", default-features = false } +polkadot-primitives = { version = "21.0.0", default-features = false } # Polkadot Dependencies -pallet-xcm = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -pallet-xcm-benchmarks = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -polkadot-core-primitives = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -polkadot-parachain-primitives = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -polkadot-runtime-common = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -xcm = { package = "staging-xcm", default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-stable2409" } +pallet-xcm = { version = "23.0.0", default-features = false } +pallet-xcm-benchmarks = { version = "23.0.0", default-features = false } +polkadot-core-primitives = { version = "20.0.0", default-features = false } +polkadot-parachain-primitives = { version = "19.0.0", default-features = false } +polkadot-runtime-common = { version = "22.0.0", default-features = false } +xcm = { version = "19.0.0", package = "staging-xcm", default-features = false } +xcm-builder = { version = "23.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "22.0.0", package = "staging-xcm-executor", default-features = false } # ink! ink = { version = "5.1.1", default-features = false } +ink_env = { version = "5.1.1", default-features = false } + +[workspace.lints.clippy] diff --git a/apis/Cargo.toml b/apis/Cargo.toml index 43fe167bb..4d71a5dac 100644 --- a/apis/Cargo.toml +++ b/apis/Cargo.toml @@ -9,7 +9,9 @@ license.workspace = true repository.workspace = true [dependencies] +frame-contrib-traits = { workspace = true } frame-support = { workspace = true } +num_enum.workspace = true parity-scale-codec = { workspace = true } scale-info = { workspace = true } @@ -20,26 +22,23 @@ log = { workspace = true, optional = true } # Contract ink = { workspace = true, optional = true } +ink_env = { workspace = true, optional = true } virto-common = { workspace = true, optional = true, features = ["scale"] } [features] default = ["std", "runtime", "contract"] std = [ - "frame-support/std", - "frame-system/std", - "ink?/std", - "log?/std", - "pallet-contracts?/std", - "parity-scale-codec/std", - "scale-info/std", - "virto-common?/std", -] -runtime = [ - "dep:frame-system", - "dep:log", - "dep:pallet-contracts", -] -contract = [ - "dep:ink", - "dep:virto-common" + "frame-support/std", + "frame-system/std", + "ink?/std", + "ink_env?/std", + "log?/std", + "num_enum/std", + "pallet-contracts?/std", + "parity-scale-codec/std", + "scale-info/std", + "virto-common?/std", + "frame-contrib-traits/std", ] +runtime = ["dep:frame-system", "dep:log", "dep:pallet-contracts"] +contract = ["dep:ink", "dep:ink_env", "dep:virto-common"] diff --git a/apis/src/apis.rs b/apis/src/apis.rs index e9cde60e6..a44c04b84 100644 --- a/apis/src/apis.rs +++ b/apis/src/apis.rs @@ -1,14 +1,20 @@ mod assets; mod error; +mod listings; +mod memberships; pub use assets::*; pub use error::*; +pub use listings::*; +pub use memberships::*; /// A set of APIs to interact between applications (like Smart Contracts) and /// the Kreivo runtime. -pub trait KreivoAPI { +pub trait KreivoAPI { /// Manipulation of arbitrary assets. - type Assets: AssetsAPI; - - fn assets(&self) -> &Self::Assets; + type Assets: AssetsAPI; + /// Handling of listings for a merchant: inventories and items. + type Listings: ListingsInventoriesAPI + ListingsItemsAPI; + /// Management of group's memberships + type Memberships: MembershipsAPI; } diff --git a/apis/src/apis/assets.rs b/apis/src/apis/assets.rs index e68519378..55a561f47 100644 --- a/apis/src/apis/assets.rs +++ b/apis/src/apis/assets.rs @@ -14,25 +14,27 @@ //! `asset` to a `beneficiary`. use crate::apis::error::KreivoApisError; +use core::fmt; use frame_support::Parameter; +use parity_scale_codec::{Codec, EncodeLike}; /// An API for transacting with arbitrary assets. -pub trait AssetsAPI { - type AccountId: Parameter; +pub trait AssetsAPI { + type AccountId: Codec + EncodeLike + Clone + Eq + fmt::Debug; type AssetId: Parameter; type Balance: Parameter + Copy; /// Returns the balance of an asset account. - fn balance(&self, asset: Self::AssetId, who: &Self::AccountId) -> Self::Balance; + fn balance(e: &Ext, asset: Self::AssetId, who: &Self::AccountId) -> Self::Balance; /// Receives an `amount` of a certain `asset` from the caller of the /// application. Then, deposits that amount into the balance of the /// application asset account. - fn deposit(&self, asset: Self::AssetId, amount: Self::Balance) -> Result; + fn deposit(e: &Ext, asset: Self::AssetId, amount: Self::Balance) -> Result; /// Transfers an `amount` of a certain `asset` to a `beneficiary`. fn transfer( - &self, + e: &Ext, asset: Self::AssetId, amount: Self::Balance, beneficiary: &Self::AccountId, diff --git a/apis/src/apis/error.rs b/apis/src/apis/error.rs deleted file mode 100644 index 15890350f..000000000 --- a/apis/src/apis/error.rs +++ /dev/null @@ -1,102 +0,0 @@ -use parity_scale_codec::{Decode, Encode, Error}; -use scale_info::TypeInfo; - -#[derive(Encode, Decode, Debug, Clone, Copy)] -pub struct KreivoApisErrorCode(u32); - -impl From for u32 { - fn from(value: KreivoApisErrorCode) -> Self { - value.0 - } -} - -impl From for KreivoApisErrorCode { - fn from(value: u32) -> Self { - Self(value) - } -} - -impl From for KreivoApisErrorCode { - fn from(_: Error) -> Self { - panic!("encountered unexpected invalid SCALE encoding") - } -} - -#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq)] -pub enum KreivoApisError { - UnknownError, - ExtQueryError, - Assets(AssetsApiError), -} - -impl From for KreivoApisErrorCode { - fn from(error: KreivoApisError) -> KreivoApisErrorCode { - match error { - KreivoApisError::UnknownError => Self(1), - KreivoApisError::ExtQueryError => Self(2), - KreivoApisError::Assets(e) => Self(1u32 << 16 | e as u16 as u32), - } - } -} - -impl From for KreivoApisError { - fn from(error: AssetsApiError) -> Self { - KreivoApisError::Assets(error) - } -} - -impl From for KreivoApisError { - fn from(value: KreivoApisErrorCode) -> Self { - match value.0 { - 0x00000002 => KreivoApisError::ExtQueryError, - 0x00010000..0x0001ffff => { - TryFrom::::try_from(KreivoApisErrorCode(value.0 & 0x0000ffff)) - .map(KreivoApisError::Assets) - .unwrap_or(KreivoApisError::UnknownError) - } - _ => KreivoApisError::UnknownError, - } - } -} - -#[repr(u16)] -#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq)] -pub enum AssetsApiError { - CannotDeposit, - CannotTransfer, -} - -impl TryFrom for AssetsApiError { - type Error = (); - - fn try_from(value: KreivoApisErrorCode) -> Result { - match value.0 { - 0 => Ok(AssetsApiError::CannotDeposit), - 1 => Ok(AssetsApiError::CannotTransfer), - _ => Err(()), - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - macro_rules! test_error_code_conversion { - ($error: expr) => {{ - let error: KreivoApisError = $error.into(); - let error_code: KreivoApisErrorCode = error.clone().into(); - let error_back: KreivoApisError = error_code.clone().into(); - assert_eq!(error, error_back); - }}; - } - - #[test] - fn convert_from_error_to_error_code_back_to_error_works() { - test_error_code_conversion!(KreivoApisError::UnknownError); - test_error_code_conversion!(KreivoApisError::ExtQueryError); - - test_error_code_conversion!(AssetsApiError::CannotDeposit); - test_error_code_conversion!(AssetsApiError::CannotTransfer); - } -} diff --git a/apis/src/apis/error/assets.rs b/apis/src/apis/error/assets.rs new file mode 100644 index 000000000..66086d23c --- /dev/null +++ b/apis/src/apis/error/assets.rs @@ -0,0 +1,14 @@ +use super::*; + +#[repr(u16)] +#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq, TryFromPrimitive)] +pub enum AssetsApiError { + CannotDeposit, + CannotTransfer, +} + +impl From for KreivoApisError { + fn from(error: AssetsApiError) -> Self { + KreivoApisError::Assets(error) + } +} diff --git a/apis/src/apis/error/listings.rs b/apis/src/apis/error/listings.rs new file mode 100644 index 000000000..f89ee27c2 --- /dev/null +++ b/apis/src/apis/error/listings.rs @@ -0,0 +1,39 @@ +use super::*; + +#[repr(u16)] +#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq, TryFromPrimitive)] +pub enum ListingsApiError { + /// The contract does not have an associated `MerchantId`, therefore it + /// cannot use the Listing APIs. + NoMerchantId, + /// The specified inventory is not known. + UnknownInventory, + /// There was an error while trying to create an inventory. + FailedToCreateInventory, + /// The inventory is already archived. + ArchivedInventory, + /// There was an error while trying to archive an existing inventory. + FailedToArchiveInventory, + /// There was an error while trying to publish a new item. + FailedToPublishItem, + /// The specified item is not known. + UnknownItem, + NotForResale, + ItemNonTransferable, + /// It was not possible to modify the `not_for_resale` state on an item. + FailedToSetNotForResale, + /// It was not possible to modify the `transferable` state on an item. + FailedToSetTransferable, + /// It was not possible to set some attribute. + FailedToSetAttribute, + /// Transferring an item is not possible. + CannotTransfer, + /// It was not possible to set the metadata. + FailedToSetMetadata, +} + +impl From for KreivoApisError { + fn from(error: ListingsApiError) -> Self { + KreivoApisError::Listings(error) + } +} diff --git a/apis/src/apis/error/memberships.rs b/apis/src/apis/error/memberships.rs new file mode 100644 index 000000000..80c5266fe --- /dev/null +++ b/apis/src/apis/error/memberships.rs @@ -0,0 +1,22 @@ +use super::*; + +#[repr(u16)] +#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq, TryFromPrimitive)] +pub enum MembershipsApiError { + /// The contract does not have an associated `Group`, then it's not + /// possible to use the Memberships APIs. + NoGroup, + /// The specified membership is not found. + UnknownMembership, + /// There are no available memberships, thus a new member cannot + /// be added. + CannotAddMember, + /// It is not possible to set an attribute on a membership. + FailedToSetAttribute, +} + +impl From for KreivoApisError { + fn from(error: MembershipsApiError) -> Self { + KreivoApisError::Memberships(error) + } +} diff --git a/apis/src/apis/error/mod.rs b/apis/src/apis/error/mod.rs new file mode 100644 index 000000000..36a7c7b7e --- /dev/null +++ b/apis/src/apis/error/mod.rs @@ -0,0 +1,107 @@ +use num_enum::TryFromPrimitive; +use parity_scale_codec::{Decode, Encode, Error}; +use scale_info::TypeInfo; + +mod assets; +mod listings; +mod memberships; + +pub use assets::*; +pub use listings::*; +pub use memberships::*; + +#[derive(Encode, Decode, Debug, Clone, Copy)] +pub struct KreivoApisErrorCode(u32); + +impl From for u32 { + fn from(value: KreivoApisErrorCode) -> Self { + value.0 + } +} + +impl From for KreivoApisErrorCode { + fn from(value: u32) -> Self { + Self(value) + } +} + +impl From for KreivoApisErrorCode { + fn from(_: Error) -> Self { + panic!("encountered unexpected invalid SCALE encoding") + } +} + +#[derive(TypeInfo, Encode, Decode, Clone, Debug, PartialEq)] +pub enum KreivoApisError { + UnknownError, + ExtQueryError, + Assets(AssetsApiError), + Listings(ListingsApiError), + Memberships(MembershipsApiError), +} + +impl From for KreivoApisErrorCode { + fn from(error: KreivoApisError) -> KreivoApisErrorCode { + let inner = |e: u16| e as u32; + Self(match error { + KreivoApisError::UnknownError => 1, + KreivoApisError::ExtQueryError => 2, + KreivoApisError::Assets(e) => 0x00010000 | inner(e as u16), + KreivoApisError::Listings(e) => 0x00020000 | inner(e as u16), + KreivoApisError::Memberships(e) => 0x00030000 | inner(e as u16), + }) + } +} + +impl From for KreivoApisError { + fn from(value: KreivoApisErrorCode) -> Self { + let inner = (value.0 & 0x0000ffff) as u16; + match value.0 { + 0x00000002 => Some(KreivoApisError::ExtQueryError), + 0x00010000..0x00020000 => TryFrom::::try_from(inner).ok().map(KreivoApisError::Assets), + 0x00020000..0x00030000 => TryFrom::::try_from(inner).ok().map(KreivoApisError::Listings), + 0x00030000..0x00040000 => TryFrom::::try_from(inner).ok().map(KreivoApisError::Memberships), + _ => None, + } + .unwrap_or(KreivoApisError::UnknownError) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + macro_rules! test_error_code_conversion { + ($error: expr) => {{ + let error: KreivoApisError = $error.into(); + let error_code: KreivoApisErrorCode = error.clone().into(); + let error_back: KreivoApisError = error_code.clone().into(); + assert_eq!(error, error_back); + }}; + } + + #[test] + fn convert_from_error_to_error_code_back_to_error_works() { + test_error_code_conversion!(KreivoApisError::UnknownError); + test_error_code_conversion!(KreivoApisError::ExtQueryError); + + test_error_code_conversion!(AssetsApiError::CannotDeposit); + test_error_code_conversion!(AssetsApiError::CannotTransfer); + + test_error_code_conversion!(ListingsApiError::NoMerchantId); + test_error_code_conversion!(ListingsApiError::UnknownInventory); + test_error_code_conversion!(ListingsApiError::FailedToCreateInventory); + test_error_code_conversion!(ListingsApiError::ArchivedInventory); + test_error_code_conversion!(ListingsApiError::FailedToArchiveInventory); + test_error_code_conversion!(ListingsApiError::FailedToSetAttribute); + test_error_code_conversion!(ListingsApiError::UnknownItem); + test_error_code_conversion!(ListingsApiError::NotForResale); + test_error_code_conversion!(ListingsApiError::ItemNonTransferable); + test_error_code_conversion!(ListingsApiError::FailedToSetAttribute); + + test_error_code_conversion!(MembershipsApiError::NoGroup); + test_error_code_conversion!(MembershipsApiError::UnknownMembership); + test_error_code_conversion!(MembershipsApiError::CannotAddMember); + test_error_code_conversion!(MembershipsApiError::FailedToSetAttribute); + } +} diff --git a/apis/src/apis/listings.rs b/apis/src/apis/listings.rs new file mode 100644 index 000000000..7d14fe36b --- /dev/null +++ b/apis/src/apis/listings.rs @@ -0,0 +1,181 @@ +//! # Listings APIs +//! +//! Facilitate merchants (associated to a contract by having deployed it) +//! managing inventories and items for inventories created by them. + +use crate::apis::error::KreivoApisError; +use alloc::vec::Vec; +use core::fmt; +use frame_contrib_traits::listings::item::{Item, ItemPrice}; +use frame_support::Parameter; +use parity_scale_codec::{Codec, Decode, Encode, EncodeLike}; + +/// An API for managing the listings of a merchant. It is assumed that the `Env` +/// context must provide the info of whom the merchant is. +pub trait ListingsInventoriesAPI { + type InventoryId: Parameter; + + // InspectInventory + + /// Returns whether an inventory exists. + fn inventory_exists(env: &E, id: &Self::InventoryId) -> bool; + + /// Returns whether an inventory is active or not. + fn inventory_is_active(env: &E, id: &Self::InventoryId) -> bool; + + /// Returns the value of an inventory attribute, if it exists. + fn inventory_attribute(env: &E, id: &Self::InventoryId, key: &K) -> Option; + + // InventoryLifecycle + + /// Creates a new inventory, charging the merchant as the inventory owner. + fn create(env: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError>; + + /// Archives an active inventory if owned by the merchant. + fn archive(env: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError>; + + // MutateInventory + + /// Sets the metadata of an inventory if it exists. + fn set_inventory_metadata(env: &E, id: &Self::InventoryId, metadata: &[u8]) -> Result<(), KreivoApisError>; + + /// Clears the metadata of an inventory if it exists. + fn clear_inventory_metadata(env: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError>; + + /// Sets an attribute on an inventory + fn inventory_set_attribute( + env: &E, + id: &Self::InventoryId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError>; + + /// Clears an attribute on an inventory + fn inventory_clear_attribute( + env: &E, + id: &Self::InventoryId, + key: &K, + ) -> Result<(), KreivoApisError>; +} + +type AccountIdOf = >::AccountId; +type AssetIdOf = >::AssetId; +type BalanceOf = >::Balance; + +pub type ItemOf = Item, AssetIdOf, BalanceOf>; + +pub trait ListingsItemsAPI { + type AccountId: Codec + EncodeLike + Clone + Eq + fmt::Debug; + type InventoryId: Parameter; + type ItemId: Parameter; + type AssetId: Parameter; + type Balance: Parameter + Copy; + + // InspectItems + + /// Retrieves an item by its `inventory_id` and item `id`. + fn item(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Option>; + + /// Retrieves an item attribute, if it exists. + fn item_attribute( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Option; + + /// Indicates whether an item is transferable. False if the item does not + /// exist. + fn item_transferable(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool; + + /// Indicates whether an item can be resold. False if the item does not + /// exist. + fn item_can_resell(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool; + + // MutateItems + + /// Given an existing active inventory, publishes a new item. + fn publish( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + name: Vec, + maybe_price: Option>, + ) -> Result<(), KreivoApisError>; + + /// Sets the price of an item. + fn set_price( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + price: ItemPrice, + ) -> Result<(), KreivoApisError>; + + /// Clears the price of an item. + fn clear_price(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError>; + + /// Sets the metadata of an item if it exists. + fn set_metadata( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + value: &[u8], + ) -> Result<(), KreivoApisError>; + + /// Clears the metadata of an item if it exists. + fn clear_metadata(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError>; + + /// Enables an item to be resold. + fn item_enable_resell(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError>; + + /// Disables an item to be resold. + fn item_disable_resell(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) + -> Result<(), KreivoApisError>; + + /// Enables an item to be transferable. + fn item_enable_transfer( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError>; + + /// Disables an item to be transferable. + fn item_disable_transfer( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError>; + + /// Sets the attribute on an item. + fn item_set_attribute( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError>; + + /// Sets the attribute on an item. + fn item_clear_attribute( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Result<(), KreivoApisError>; + + /// Transfers an item. + fn item_transfer( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError>; + + /// Transfers an item, also marking the beneficiary as the item creator. + fn item_creator_transfer( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError>; +} diff --git a/apis/src/apis/memberships.rs b/apis/src/apis/memberships.rs new file mode 100644 index 000000000..1fd10ca6b --- /dev/null +++ b/apis/src/apis/memberships.rs @@ -0,0 +1,56 @@ +//! # Memberships APIs +//! +//! Facilitate to manage memberships' attributes and assign new members. + +use crate::apis::KreivoApisError; +use core::fmt; +use frame_support::Parameter; +use parity_scale_codec::{Codec, Encode, EncodeLike}; + +/// An API for managing the memberships of a group. It is assumed that the `Env` +/// context must provide the info of which the group is. +pub trait MembershipsAPI { + type AccountId: Codec + EncodeLike + Clone + Eq + fmt::Debug; + type MembershipId: Parameter; + type Rank: Parameter + Copy; + + /// Assigns a membership associated to the group to [`who`]. + /// + /// Returns an error if the group doesn't have enough memberships and cannot + /// assign a new one to [`who`]. + fn assign_membership(env: &Env, who: &Self::AccountId) -> Result<(), KreivoApisError>; + + /// Returns the first found membership of [`who`] if any in the `group`, or + /// [`None`] otherwise (also returns `None` if there's no group). + fn membership_of(env: &Env, who: &Self::AccountId) -> Option; + + /// Returns the first membership of [`who`] if any, or [`None`] otherwise. + fn rank_of(env: &Env, id: &Self::MembershipId) -> Option; + + /// Returns the value of the attribute (with [`key`]) for [`id`] if any, or + /// [`None`] otherwise. + fn attribute(env: &Env, id: &Self::MembershipId, key: &K) -> Option; + + /// Attempts setting a [`value`] for the attribute (with [`key`]) for the + /// membership [`id`]. + fn set_attribute( + env: &Env, + id: &Self::MembershipId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError>; + + /// Attempts clearing the attribute (with [`key`]) for the membership + /// [`id`]. + fn clear_attribute(env: &Env, id: &Self::MembershipId, key: &K) -> Result<(), KreivoApisError>; + + /// Looks for the first hit of a membership for [`who`] that contains an + /// attribute (with [`key`]) which matches with [`value`]. Returns [`None`] + /// otherwise. + fn filter_membership( + env: &Env, + who: &Self::AccountId, + key: &K, + value: &V, + ) -> Option; +} diff --git a/apis/src/contract.rs b/apis/src/contract.rs index 9bbfacdda..f0bede0b1 100644 --- a/apis/src/contract.rs +++ b/apis/src/contract.rs @@ -1,10 +1,14 @@ use super::*; +use frame_contrib_traits::memberships::GenericRank; +use crate::contract::config::{ListingsConfig, MembershipsConfig}; use contract::config::{AssetsConfig, Config}; use ink::env::{DefaultEnvironment, Environment}; +mod api_impls; mod chain_extension; pub mod config; +pub use api_impls::KreivoApi; #[derive(Clone)] pub struct KreivoApiEnvironment(E); @@ -29,11 +33,21 @@ where } impl Config for KreivoApiEnvironment { - type AccountId = E::AccountId; + type AccountId = ink::primitives::AccountId; type Balance = E::Balance; - type Assets = Self; } impl AssetsConfig for KreivoApiEnvironment { type AssetId = virto_common::FungibleAssetLocation; + type Balance = E::Balance; +} + +impl ListingsConfig for KreivoApiEnvironment { + type InventoryId = virto_common::listings::InventoryId; + type ItemId = virto_common::listings::ItemId; +} + +impl MembershipsConfig for KreivoApiEnvironment { + type Membership = virto_common::MembershipId; + type Rank = GenericRank; } diff --git a/apis/src/contract/api_impls.rs b/apis/src/contract/api_impls.rs new file mode 100644 index 000000000..4e7405a23 --- /dev/null +++ b/apis/src/contract/api_impls.rs @@ -0,0 +1,408 @@ +use super::{ + apis::{AssetsAPI, KreivoAPI, KreivoApisError, ListingsInventoriesAPI, ListingsItemsAPI}, + chain_extension::ChainExtension, + config::{AccountIdOf, AssetBalanceOf, AssetIdOf, InventoryIdOf, ItemIdOf, ItemOf, ItemPriceOf}, + KreivoApiEnvironment, +}; +use crate::apis::MembershipsAPI; +use crate::contract::config::{MembershipOf, RankOf}; +use core::marker::PhantomData; +use frame_support::Parameter; +use ink::{ + prelude::vec::Vec, + scale::{Decode, Encode}, + EnvAccess, +}; +use ink_env::Environment; + +pub struct KreivoApi(PhantomData); + +impl> KreivoAPI> for KreivoApi { + type Assets = KreivoAssetsApi; + type Listings = KreivoListingsApi; + type Memberships = KreivoMembershipsApi; +} + +// Assets +pub struct KreivoAssetsApi; + +impl AssetsAPI> for KreivoAssetsApi +where + E: Environment, +{ + type AccountId = AccountIdOf; + type AssetId = AssetIdOf; + type Balance = AssetBalanceOf; + + fn balance(env: &EnvAccess<'_, E>, asset: Self::AssetId, who: &Self::AccountId) -> Self::Balance { + env.clone().extension().assets__balance(asset, *who) + } + + fn deposit( + env: &EnvAccess<'_, E>, + asset: Self::AssetId, + amount: Self::Balance, + ) -> Result { + env.clone() + .extension() + .assets__deposit(asset, amount) + .map_err(|code| code.into()) + } + + fn transfer( + env: &EnvAccess<'_, E>, + asset: Self::AssetId, + amount: Self::Balance, + beneficiary: &Self::AccountId, + ) -> Result { + env.clone() + .extension() + .assets__transfer(asset, amount, *beneficiary) + .map_err(|code| code.into()) + } +} + +// Listings +pub struct KreivoListingsApi; + +impl ListingsInventoriesAPI> for KreivoListingsApi +where + E: Environment, +{ + type InventoryId = InventoryIdOf; + + fn inventory_exists(env: &EnvAccess<'_, E>, id: &Self::InventoryId) -> bool { + env.clone().extension().listings__inventory_exists(*id) + } + + fn inventory_is_active(env: &EnvAccess<'_, E>, id: &Self::InventoryId) -> bool { + env.clone().extension().listings__inventory_is_active(*id) + } + + fn inventory_attribute( + env: &EnvAccess<'_, E>, + id: &Self::InventoryId, + key: &K, + ) -> Option { + env.clone() + .extension() + // Infallible: Truncates the key up to the BoundedVec limit. + .listings__inventory_attribute(*id, key.encode()) + // Infallible: Falls back to `None` if unable to decode. + .and_then(|v| Decode::decode(&mut v.as_ref()).ok()) + } + + fn create(env: &EnvAccess<'_, E>, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__inventory_create(*id) + .map_err(|code| code.into()) + } + + fn archive(env: &EnvAccess<'_, E>, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__inventory_archive(*id) + .map_err(|code| code.into()) + } + + fn set_inventory_metadata( + env: &EnvAccess<'_, E>, + id: &Self::InventoryId, + metadata: &[u8], + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__set_inventory_metadata(*id, metadata.to_vec()) + .map_err(|code| code.into()) + } + + fn clear_inventory_metadata(env: &EnvAccess<'_, E>, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__clear_inventory_metadata(*id) + .map_err(|code| code.into()) + } + + fn inventory_set_attribute( + env: &EnvAccess<'_, E>, + id: &Self::InventoryId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__inventory_set_attribute(*id, key.encode(), value.encode()) + .map_err(|code| code.into()) + } + + fn inventory_clear_attribute( + env: &EnvAccess<'_, E>, + id: &Self::InventoryId, + key: &K, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__inventory_clear_attribute(*id, key.encode()) + .map_err(|code| code.into()) + } +} + +impl ListingsItemsAPI> for KreivoListingsApi +where + E: Environment, +{ + type AccountId = AccountIdOf; + type InventoryId = InventoryIdOf; + type ItemId = ItemIdOf; + type AssetId = AssetIdOf; + type Balance = AssetBalanceOf; + + fn item( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Option> { + env.clone().extension().listings__item(*inventory_id, *id) + } + + fn item_attribute( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Option { + env.clone() + .extension() + .listings__item_attribute(*inventory_id, *id, key.encode()) + .and_then(|v| Decode::decode(&mut v.as_ref()).ok()) + } + + fn item_transferable(env: &EnvAccess<'_, E>, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool { + env.clone().extension().listings__item_transferable(*inventory_id, *id) + } + + fn item_can_resell(env: &EnvAccess<'_, E>, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool { + env.clone().extension().listings__item_can_resell(*inventory_id, *id) + } + + fn publish( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + name: Vec, + maybe_price: Option>, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_publish(*inventory_id, *id, name, maybe_price) + .map_err(|code| code.into()) + } + + fn set_price( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + price: ItemPriceOf, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_set_price(*inventory_id, *id, price) + .map_err(|code| code.into()) + } + + fn clear_price( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_clear_price(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn set_metadata( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + value: &[u8], + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__set_metadata(*inventory_id, *id, value.to_vec()) + .map_err(|code| code.into()) + } + + fn clear_metadata( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__clear_metadata(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn item_enable_resell( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_enable_resell(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn item_disable_resell( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_disable_resell(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn item_enable_transfer( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_enable_transfer(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn item_disable_transfer( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_disable_transfer(*inventory_id, *id) + .map_err(|code| code.into()) + } + + fn item_set_attribute( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_set_attribute(*inventory_id, *id, key.encode(), value.encode()) + .map_err(|code| code.into()) + } + + fn item_clear_attribute( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_clear_attribute(*inventory_id, *id, key.encode()) + .map_err(|code| code.into()) + } + + fn item_transfer( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_transfer(*inventory_id, *id, *beneficiary) + .map_err(|code| code.into()) + } + + fn item_creator_transfer( + env: &EnvAccess<'_, E>, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .listings__item_creator_transfer(*inventory_id, *id, *beneficiary) + .map_err(|code| code.into()) + } +} + +// Memberships +pub struct KreivoMembershipsApi; + +impl MembershipsAPI> for KreivoMembershipsApi +where + E: Environment, +{ + type AccountId = AccountIdOf; + type MembershipId = MembershipOf; + type Rank = RankOf; + + fn assign_membership(env: &EnvAccess<'_, E>, who: &Self::AccountId) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .memberships__assign_membership(*who) + .map_err(|code| code.into()) + } + + fn membership_of(env: &EnvAccess<'_, E>, who: &Self::AccountId) -> Option { + env.clone().extension().memberships__membership_of(*who) + } + + fn rank_of(env: &EnvAccess<'_, E>, id: &Self::MembershipId) -> Option { + env.clone().extension().memberships__rank_of(*id) + } + + fn attribute(env: &EnvAccess<'_, E>, id: &Self::MembershipId, key: &K) -> Option { + env.clone() + .extension() + .memberships__attribute(*id, key.encode()) + .and_then(|v| Decode::decode(&mut v.as_ref()).ok()) + } + + fn set_attribute( + env: &EnvAccess<'_, E>, + id: &Self::MembershipId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .memberships__set_attribute(*id, key.encode(), value.encode()) + .map_err(|code| code.into()) + } + + fn clear_attribute( + env: &EnvAccess<'_, E>, + id: &Self::MembershipId, + key: &K, + ) -> Result<(), KreivoApisError> { + env.clone() + .extension() + .memberships__clear_attribute(*id, key.encode()) + .map_err(|code| code.into()) + } + + fn filter_membership( + env: &EnvAccess<'_, E>, + who: &Self::AccountId, + key: &K, + value: &V, + ) -> Option { + env.clone() + .extension() + .memberships__filter_membership(*who, key.encode(), value.encode()) + } +} diff --git a/apis/src/contract/chain_extension.rs b/apis/src/contract/chain_extension.rs index 54d2f084c..8eea8a1b2 100644 --- a/apis/src/contract/chain_extension.rs +++ b/apis/src/contract/chain_extension.rs @@ -1,10 +1,12 @@ use super::*; use crate::apis::KreivoApisErrorCode; +use crate::contract::config::{AssetBalanceOf, InventoryIdOf, ItemIdOf, ItemOf, ItemPriceOf, MembershipOf, RankOf}; use config::{AccountIdOf, AssetIdOf, BalanceOf}; -use ink::chain_extension; +use ink::{chain_extension, prelude::vec::Vec}; type Environment = KreivoApiEnvironment; +type CallResult = Result<(), KreivoApisErrorCode>; #[chain_extension(extension = 0)] pub trait ChainExtension { @@ -13,7 +15,7 @@ pub trait ChainExtension { // Assets #[allow(non_snake_case)] #[ink(function = 0x0000, handle_status = false)] - fn assets__balance(asset: AssetIdOf, who: AccountIdOf) -> BalanceOf; + fn assets__balance(asset: AssetIdOf, who: AccountIdOf) -> AssetBalanceOf; #[allow(non_snake_case)] #[ink(function = 0x0001)] @@ -27,8 +29,191 @@ pub trait ChainExtension { fn assets__transfer( asset: AssetIdOf, amount: BalanceOf, - beneficiary: BalanceOf, + beneficiary: AccountIdOf, ) -> Result, KreivoApisErrorCode>; + + // Listings: Inventories + #[allow(non_snake_case)] + #[ink(function = 0x0100, handle_status = false)] + fn listings__inventory_exists(id: InventoryIdOf) -> bool; + + #[allow(non_snake_case)] + #[ink(function = 0x0101, handle_status = false)] + fn listings__inventory_is_active(id: InventoryIdOf) -> bool; + + #[allow(non_snake_case)] + #[ink(function = 0x0102, handle_status = false)] + fn listings__inventory_attribute(id: InventoryIdOf, k: Vec) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0103)] + fn listings__inventory_create(id: InventoryIdOf) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0104)] + fn listings__inventory_archive(id: InventoryIdOf) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0105)] + fn listings__inventory_set_attribute(id: InventoryIdOf, key: Vec, value: Vec) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0106)] + fn listings__inventory_clear_attribute(id: InventoryIdOf, key: Vec) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0107)] + fn listings__set_inventory_metadata(id: InventoryIdOf, metadata: Vec) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0108)] + fn listings__clear_inventory_metadata(id: InventoryIdOf) -> CallResult; + + // Listings: Items + #[allow(non_snake_case)] + #[ink(function = 0x0110, handle_status = false)] + fn listings__item( + inventory_id: InventoryIdOf, + id: ItemIdOf, + ) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0111, handle_status = false)] + fn listings__item_attribute( + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: Vec, + ) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0112, handle_status = false)] + fn listings__item_transferable(inventory_id: InventoryIdOf, id: ItemIdOf) -> bool; + + #[allow(non_snake_case)] + #[ink(function = 0x0113, handle_status = false)] + fn listings__item_can_resell(inventory_id: InventoryIdOf, id: ItemIdOf) -> bool; + + #[allow(non_snake_case)] + #[ink(function = 0x0114)] + fn listings__item_publish( + inventory_id: InventoryIdOf, + id: ItemIdOf, + name: Vec, + maybe_price: Option>, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0115)] + fn listings__item_set_price( + inventory_id: InventoryIdOf, + id: ItemIdOf, + price: ItemPriceOf, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0116)] + fn listings__item_clear_price(inventory_id: InventoryIdOf, id: ItemIdOf) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0117)] + fn listings__item_enable_resell(inventory_id: InventoryIdOf, id: ItemIdOf) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0118)] + fn listings__item_disable_resell(inventory_id: InventoryIdOf, id: ItemIdOf) + -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0119)] + fn listings__item_enable_transfer( + inventory_id: InventoryIdOf, + id: ItemIdOf, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011a)] + fn listings__item_disable_transfer( + inventory_id: InventoryIdOf, + id: ItemIdOf, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011b)] + fn listings__item_set_attribute( + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: Vec, + value: Vec, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011c)] + fn listings__item_clear_attribute( + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: Vec, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011d)] + fn listings__item_transfer( + inventory_id: InventoryIdOf, + id: ItemIdOf, + beneficiary: AccountIdOf, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011e)] + fn listings__item_creator_transfer( + inventory_id: InventoryIdOf, + id: ItemIdOf, + beneficiary: AccountIdOf, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x011f)] + fn listings__set_metadata( + inventory_id: InventoryIdOf, + id: ItemIdOf, + metadata: Vec, + ) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0120)] + fn listings__clear_metadata(inventory_id: InventoryIdOf, id: ItemIdOf) -> CallResult; + + // Memberships + #[allow(non_snake_case)] + #[ink(function = 0x0200)] + fn memberships__assign_membership(who: AccountIdOf) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0201, handle_status = false)] + fn memberships__membership_of(who: AccountIdOf) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0202, handle_status = false)] + fn memberships__rank_of(id: MembershipOf) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0203, handle_status = false)] + fn memberships__attribute(id: MembershipOf, key: Vec) -> Option>; + + #[allow(non_snake_case)] + #[ink(function = 0x0204)] + fn memberships__set_attribute(id: MembershipOf, key: Vec, value: Vec) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0205)] + fn memberships__clear_attribute(id: MembershipOf, key: Vec) -> CallResult; + + #[allow(non_snake_case)] + #[ink(function = 0x0206, handle_status = false)] + fn memberships__filter_membership( + who: AccountIdOf, + key: Vec, + value: Vec, + ) -> Option>; } impl ink::env::chain_extension::FromStatusCode for KreivoApisErrorCode { diff --git a/apis/src/contract/config.rs b/apis/src/contract/config.rs index bf366181c..3a5030a06 100644 --- a/apis/src/contract/config.rs +++ b/apis/src/contract/config.rs @@ -1,13 +1,56 @@ -pub trait Config { - type AccountId; - type Balance; - type Assets; +use frame_contrib_traits::listings::item::{Item, ItemPrice}; +use ink::env::FromLittleEndian; +use ink::scale; + +// Global Traits +pub trait Parameter: 'static + scale::Codec + scale::MaxEncodedLen + Clone + PartialEq + Eq {} + +impl Parameter for T where T: 'static + scale::Codec + scale::MaxEncodedLen + Clone + PartialEq + Eq {} + +pub trait Number: + 'static + scale::Codec + Clone + PartialEq + Eq + Copy + From + From + FromLittleEndian +{ } -pub trait AssetsConfig { - type AssetId; +impl Number for T where + T: 'static + scale::Codec + Clone + PartialEq + Eq + Copy + From + From + FromLittleEndian +{ +} + +// System +pub trait Config { + type AccountId: Parameter; + type Balance: Number; } pub type AccountIdOf = ::AccountId; pub type BalanceOf = ::Balance; -pub type AssetIdOf = <::Assets as AssetsConfig>::AssetId; + +// Assets +pub trait AssetsConfig: Config { + type AssetId: Parameter; + type Balance: Number; +} + +pub type AssetIdOf = ::AssetId; +pub type AssetBalanceOf = ::Balance; + +// Listings +pub trait ListingsConfig: Config { + type InventoryId: Parameter + Copy; + type ItemId: Parameter + Copy; +} + +pub type InventoryIdOf = ::InventoryId; +pub type ItemIdOf = ::ItemId; +pub type ItemOf = Item, AssetIdOf, AssetBalanceOf>; +pub type ItemPriceOf = ItemPrice, AssetBalanceOf>; + +// Memberships +pub trait MembershipsConfig: Config { + type Membership: Parameter + Copy; + type Rank: Parameter + Copy; +} + +pub type MembershipOf = ::Membership; +pub type RankOf = ::Rank; diff --git a/apis/src/lib.rs b/apis/src/lib.rs index a6b00e21d..972341d8a 100644 --- a/apis/src/lib.rs +++ b/apis/src/lib.rs @@ -12,6 +12,9 @@ //! - **[`AssetsAPI`][apis::AssetsAPI]:** These APIs can facilitate transactions //! regarding assets. +extern crate alloc; +extern crate core; + pub mod apis; #[cfg(feature = "contract")] mod contract; @@ -19,6 +22,6 @@ mod contract; mod runtime; #[cfg(feature = "contract")] -pub use contract::KreivoApiEnvironment; +pub use contract::{KreivoApi, KreivoApiEnvironment}; #[cfg(feature = "runtime")] -pub use runtime::KreivoChainExtensions; +pub use runtime::{Config, GroupInfo, KreivoChainExtensions, MerchantIdInfo}; diff --git a/apis/src/runtime.rs b/apis/src/runtime.rs index caee1c20f..99efd568f 100644 --- a/apis/src/runtime.rs +++ b/apis/src/runtime.rs @@ -1,54 +1,54 @@ -use super::*; +use super::apis::*; -mod assets; -mod types; - -use assets::*; -use types::*; - -use apis::{AssetsAPI, KreivoAPI, KreivoApisErrorCode}; +use alloc::vec::Vec; use core::marker::PhantomData; -use frame_support::pallet_prelude::Encode; +use frame_support::pallet_prelude::{Decode, Encode}; use frame_support::DefaultNoBound; use pallet_contracts::chain_extension::{ChainExtension, Environment, Ext, InitState, RetVal}; -/// A helper structure that implements [`KreivoAPI`] in the context of the -/// Runtime. -struct RuntimeKreivoAPI { - __phantom: PhantomData<(T, E)>, - assets: Assets, -} +mod config; +pub use config::{Config, GroupInfo, MerchantIdInfo}; -impl<'a, T, E: 'a, Assets: AssetsAPI + From<&'a E>> RuntimeKreivoAPI { - pub fn new(ext: &'a E) -> Self { - Self { - __phantom: PhantomData, - assets: ext.into(), - } - } +mod impls; +use impls::*; + +mod types; +use types::*; + +mod api_impls { + use super::*; + use config::*; + + mod assets; + mod listings; + mod memberships; + pub use assets::*; + pub use listings::*; + pub use memberships::*; } +use api_impls::*; + +/// A helper structure that implements [`KreivoAPI`] in the context of the +/// Runtime. +struct RuntimeKreivoAPI(PhantomData); -impl<'a, T, E, Assets> KreivoAPI for RuntimeKreivoAPI> +impl KreivoAPI for RuntimeKreivoAPI where - T: pallet_contracts::Config, + T: Config, E: Ext, - Assets: frame_support::traits::fungibles::Mutate, { - type Assets = RuntimeKreivoAssetsAPI<'a, T, E, Assets>; - - fn assets(&self) -> &Self::Assets { - &self.assets - } + type Assets = RuntimeAssetsAPI; + type Listings = RuntimeListingsAPI; + type Memberships = RuntimeMembershipsAPI; } /// A [`ChainExtension`] that implements the [`KreivoAPI`]s. #[derive(DefaultNoBound)] -pub struct KreivoChainExtensions(PhantomData<(T, Assets)>); +pub struct KreivoChainExtensions(PhantomData); -impl ChainExtension for KreivoChainExtensions +impl ChainExtension for KreivoChainExtensions where - T: pallet_contracts::Config, - A: frame_support::traits::fungibles::Mutate, + T: Config, { fn call>( &mut self, @@ -56,27 +56,19 @@ where ) -> pallet_contracts::chain_extension::Result { let mut env = env.buf_in_buf_out(); - let result = match ApiInfo::::try_from(&mut env)? { - ApiInfo::Assets(api_info) => match api_info { - AssetsApiInfo::Balance { asset, who } => { - let api = RuntimeKreivoAPI::>::new(env.ext()); - Ok(api.assets().balance(asset, &who).encode()) - } - AssetsApiInfo::Deposit { asset, amount } => { - let api = RuntimeKreivoAPI::>::new(env.ext()); - api.assets().deposit(asset, amount).map(|v| v.encode()) - } - AssetsApiInfo::Transfer { - asset, - amount, - beneficiary, - } => { - let api = RuntimeKreivoAPI::>::new(env.ext()); - api.assets().transfer(asset, amount, &beneficiary).map(|v| v.encode()) - } - }, + let request: ApiInfo<_> = ApiInfo::::try_from(&mut env)?; + + let result = match request.clone() { + ApiInfo::Assets(ref api_info) => api_info.call(env.ext()), + ApiInfo::Listings(ref api_info) => api_info.call(env.ext()), + ApiInfo::Memberships(ref api_info) => api_info.call(env.ext()), }; + log::trace!( + target: "chainx", + "call({request:#?}) -> {result:#?}", + ); + match result { Ok(result) => { env.write(&result, false, None)?; diff --git a/apis/src/runtime/api_impls/assets.rs b/apis/src/runtime/api_impls/assets.rs new file mode 100644 index 000000000..65c0f34e8 --- /dev/null +++ b/apis/src/runtime/api_impls/assets.rs @@ -0,0 +1,44 @@ +use super::*; + +use config::Config; + +use frame_support::traits::fungibles::{Inspect, Mutate}; +use frame_support::traits::tokens::Preservation; + +/// A helper structure that implements [`AssetsAPI`] in the context of the +/// Runtime. +pub struct RuntimeAssetsAPI(PhantomData); + +impl AssetsAPI for RuntimeAssetsAPI +where + T: Config, + E: Ext, +{ + type AccountId = T::AccountId; + type AssetId = >::AssetId; + type Balance = >::Balance; + + fn balance(_: &E, asset: Self::AssetId, who: &Self::AccountId) -> Self::Balance { + T::Assets::balance(asset, who) + } + + fn deposit(e: &E, asset: Self::AssetId, amount: Self::Balance) -> Result { + let caller = e + .caller() + .account_id() + .map_err(|_| KreivoApisError::ExtQueryError)? + .clone(); + T::Assets::transfer(asset, &caller, e.address(), amount, Preservation::Preserve) + .map_err(|_| AssetsApiError::CannotDeposit.into()) + } + + fn transfer( + e: &E, + asset: Self::AssetId, + amount: Self::Balance, + beneficiary: &Self::AccountId, + ) -> Result { + T::Assets::transfer(asset, e.address(), beneficiary, amount, Preservation::Preserve) + .map_err(|_| AssetsApiError::CannotTransfer.into()) + } +} diff --git a/apis/src/runtime/api_impls/listings.rs b/apis/src/runtime/api_impls/listings.rs new file mode 100644 index 000000000..5548d297a --- /dev/null +++ b/apis/src/runtime/api_impls/listings.rs @@ -0,0 +1,293 @@ +use super::*; + +use frame_contrib_traits::listings::{item::ItemPrice, *}; + +/// A helper structure that implements [`ListingsInventoriesAPI`] in the context +/// of the Runtime. +pub struct RuntimeListingsAPI(PhantomData); + +impl RuntimeListingsAPI { + fn merchant_id>(ext: &E) -> Option> { + T::MerchantIdInfo::maybe_merchant_id(ext.address()) + } +} + +impl ListingsInventoriesAPI for RuntimeListingsAPI +where + E: Ext, +{ + type InventoryId = <::Listings as InspectItem>>::InventoryId; + + fn inventory_exists(ext: &E, id: &Self::InventoryId) -> bool { + Self::merchant_id(ext).is_some_and(|merchant_id| T::Listings::exists(&(merchant_id, *id))) + } + + fn inventory_is_active(ext: &E, id: &Self::InventoryId) -> bool { + Self::merchant_id(ext).is_some_and(|merchant_id| T::Listings::is_active(&(merchant_id, *id))) + } + + fn inventory_attribute(ext: &E, id: &Self::InventoryId, key: &K) -> Option { + let merchant_id = Self::merchant_id(ext)?; + + T::Listings::inventory_attribute(&(merchant_id, *id), key) + } + + fn create(ext: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::create((merchant_id, *id), ext.address()) + .map_err(|_| ListingsApiError::FailedToCreateInventory.into()) + } + + fn archive(ext: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + if !T::Listings::exists(&(merchant_id, *id)) { + Err(ListingsApiError::UnknownInventory)? + } + if !T::Listings::is_active(&(merchant_id, *id)) { + Err(ListingsApiError::ArchivedInventory)? + } + + T::Listings::archive(&(merchant_id, *id)).map_err(|_| ListingsApiError::FailedToArchiveInventory.into()) + } + + fn set_inventory_metadata(env: &E, id: &Self::InventoryId, metadata: &[u8]) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(env).ok_or(ListingsApiError::NoMerchantId)?; + + if !T::Listings::exists(&(merchant_id, *id)) { + Err(ListingsApiError::UnknownInventory)? + } + if !T::Listings::is_active(&(merchant_id, *id)) { + Err(ListingsApiError::ArchivedInventory)? + } + + T::Listings::set_inventory_metadata(&(merchant_id, *id), metadata) + .map_err(|_| ListingsApiError::FailedToSetMetadata.into()) + } + + fn clear_inventory_metadata(env: &E, id: &Self::InventoryId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(env).ok_or(ListingsApiError::NoMerchantId)?; + + if !T::Listings::exists(&(merchant_id, *id)) { + Err(ListingsApiError::UnknownInventory)? + } + if !T::Listings::is_active(&(merchant_id, *id)) { + Err(ListingsApiError::ArchivedInventory)? + } + + T::Listings::clear_inventory_metadata(&(merchant_id, *id)) + .map_err(|_| ListingsApiError::FailedToSetMetadata.into()) + } + + fn inventory_set_attribute( + ext: &E, + id: &Self::InventoryId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + if !T::Listings::exists(&(merchant_id, *id)) { + Err(ListingsApiError::UnknownInventory)? + } + + T::Listings::set_inventory_attribute(&(merchant_id, *id), key, value) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } + + fn inventory_clear_attribute( + ext: &E, + id: &Self::InventoryId, + key: &K, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + if !T::Listings::exists(&(merchant_id, *id)) { + Err(ListingsApiError::UnknownInventory)? + } + + T::Listings::clear_inventory_attribute(&(merchant_id, *id), key) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } +} + +type AssetIdOf = <::Assets as frame_support::traits::fungibles::Inspect>>::AssetId; +type BalanceOf = <::Assets as frame_support::traits::fungibles::Inspect>>::Balance; + +type InventoryIdOf = <::Listings as InspectItem>>::InventoryId; +type ItemIdOf = <::Listings as InspectItem>>::ItemId; + +impl ListingsItemsAPI for RuntimeListingsAPI +where + E: Ext, +{ + type AccountId = AccountIdOf; + type InventoryId = InventoryIdOf; + type ItemId = ItemIdOf; + type AssetId = AssetIdOf; + type Balance = BalanceOf; + + fn item(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Option> { + let merchant_id = Self::merchant_id(ext)?; + T::Listings::item(&(merchant_id, *inventory_id), id) + } + + fn item_attribute( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Option { + let merchant_id = Self::merchant_id(ext)?; + T::Listings::attribute(&(merchant_id, *inventory_id), id, key) + } + + fn item_transferable(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool { + Self::merchant_id(ext).is_some_and(|merchant_id| T::Listings::transferable(&(merchant_id, *inventory_id), id)) + } + + fn item_can_resell(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> bool { + Self::merchant_id(ext).is_some_and(|merchant_id| T::Listings::can_resell(&(merchant_id, *inventory_id), id)) + } + + fn publish( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + name: Vec, + maybe_price: Option>, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::publish(&(merchant_id, *inventory_id), id, name, maybe_price) + .map_err(|_| ListingsApiError::FailedToCreateInventory.into()) + } + + fn set_price( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + price: ItemPrice, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::set_price(&(merchant_id, *inventory_id), id, price) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } + + fn clear_price(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::clear_price(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } + + fn set_metadata( + env: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + value: &[u8], + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(env).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::set_metadata(&(merchant_id, *inventory_id), id, value) + .map_err(|_| ListingsApiError::FailedToSetMetadata.into()) + } + + fn clear_metadata(env: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(env).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::clear_metadata(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetMetadata.into()) + } + + fn item_enable_resell(ext: &E, inventory_id: &Self::InventoryId, id: &Self::ItemId) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::enable_resell(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetNotForResale.into()) + } + + fn item_disable_resell( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::disable_resell(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetNotForResale.into()) + } + + fn item_enable_transfer( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::enable_transfer(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetTransferable.into()) + } + + fn item_disable_transfer( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::disable_transfer(&(merchant_id, *inventory_id), id) + .map_err(|_| ListingsApiError::FailedToSetTransferable.into()) + } + + fn item_set_attribute( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::set_attribute(&(merchant_id, *inventory_id), id, key, value) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } + + fn item_clear_attribute( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + key: &K, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::clear_attribute(&(merchant_id, *inventory_id), id, key) + .map_err(|_| ListingsApiError::FailedToSetAttribute.into()) + } + + fn item_transfer( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::transfer(&(merchant_id, *inventory_id), id, beneficiary) + .map_err(|_| ListingsApiError::CannotTransfer.into()) + } + + fn item_creator_transfer( + ext: &E, + inventory_id: &Self::InventoryId, + id: &Self::ItemId, + beneficiary: &Self::AccountId, + ) -> Result<(), KreivoApisError> { + let merchant_id = Self::merchant_id(ext).ok_or(ListingsApiError::NoMerchantId)?; + + T::Listings::creator_transfer(&(merchant_id, *inventory_id), id, beneficiary) + .map_err(|_| ListingsApiError::CannotTransfer.into()) + } +} diff --git a/apis/src/runtime/api_impls/memberships.rs b/apis/src/runtime/api_impls/memberships.rs new file mode 100644 index 000000000..e01a52ed1 --- /dev/null +++ b/apis/src/runtime/api_impls/memberships.rs @@ -0,0 +1,77 @@ +use crate::apis::{KreivoApisError, MembershipsAPI, MembershipsApiError}; +use crate::runtime::config::{GroupInfo, MembershipOf}; +use crate::Config; +use core::marker::PhantomData; +use frame_contrib_traits::memberships::{Attributes, GenericRank, InspectEnumerable, Manager, Rank}; +use frame_support::Parameter; +use pallet_contracts::chain_extension::Ext; +use parity_scale_codec::Encode; + +/// A helper structure that implements [`MembershipsAPI`] in the context of the +/// Runtime. +pub struct RuntimeMembershipsAPI(PhantomData); + +impl MembershipsAPI for RuntimeMembershipsAPI +where + T: Config, + Env: Ext, +{ + type AccountId = T::AccountId; + type MembershipId = MembershipOf; + type Rank = GenericRank; + + fn assign_membership(env: &Env, who: &Self::AccountId) -> Result<(), KreivoApisError> { + let group = T::GroupInfo::maybe_group(env.address()).ok_or(MembershipsApiError::NoGroup)?; + let membership = T::Memberships::group_available_memberships(&group) + .next() + .ok_or(MembershipsApiError::CannotAddMember)?; + T::Memberships::assign(&group, &membership, who).map_err(|_| MembershipsApiError::CannotAddMember.into()) + } + + fn membership_of(env: &Env, who: &Self::AccountId) -> Option { + let group = T::GroupInfo::maybe_group(env.address())?; + T::Memberships::memberships_of(who, Some(group)).map(|(_, m)| m).next() + } + + fn rank_of(env: &Env, id: &Self::MembershipId) -> Option { + let group = T::GroupInfo::maybe_group(env.address())?; + T::Memberships::rank_of(&group, id) + } + + fn attribute(env: &Env, id: &Self::MembershipId, key: &K) -> Option { + let group = T::GroupInfo::maybe_group(env.address())?; + T::Memberships::membership_attribute(&group, id, key) + } + + fn set_attribute( + env: &Env, + id: &Self::MembershipId, + key: &K, + value: &V, + ) -> Result<(), KreivoApisError> { + let group = T::GroupInfo::maybe_group(env.address()).ok_or(MembershipsApiError::NoGroup)?; + T::Memberships::set_membership_attribute(&group, id, key, value) + .map_err(|_| MembershipsApiError::FailedToSetAttribute.into()) + } + + fn clear_attribute(env: &Env, id: &Self::MembershipId, key: &K) -> Result<(), KreivoApisError> { + let group = T::GroupInfo::maybe_group(env.address()).ok_or(MembershipsApiError::NoGroup)?; + T::Memberships::clear_membership_attribute(&group, id, key) + .map_err(|_| MembershipsApiError::FailedToSetAttribute.into()) + } + + fn filter_membership( + env: &Env, + who: &Self::AccountId, + key: &K, + value: &V, + ) -> Option { + let group = T::GroupInfo::maybe_group(env.address())?; + T::Memberships::memberships_of(who, Some(group)) + .find(|(g, m)| { + let att = T::Memberships::membership_attribute::(g, m, key); + att.is_some_and(|v| &v == value) + }) + .map(|(_, m)| m) + } +} diff --git a/apis/src/runtime/assets.rs b/apis/src/runtime/assets.rs deleted file mode 100644 index ca784f1c2..000000000 --- a/apis/src/runtime/assets.rs +++ /dev/null @@ -1,68 +0,0 @@ -use super::*; - -use core::marker::PhantomData; - -use crate::apis::{AssetsApiError, KreivoApisError}; -use apis::AssetsAPI; -use frame_support::traits::tokens::Preservation; -use pallet_contracts::chain_extension::Ext; - -/// A helper structure that implements [`KreivoAPI`] in the context of the -/// Runtime. -pub struct RuntimeKreivoAssetsAPI<'a, T, E, Assets>(PhantomData<(T, Assets)>, &'a E); - -impl<'a, T, E, Assets> RuntimeKreivoAssetsAPI<'a, T, E, Assets> { - pub fn new(ext: &'a E) -> Self { - Self(PhantomData, ext) - } - - fn ext(&self) -> &E { - &self.1 - } -} - -impl<'a, T, E, A> From<&'a E> for RuntimeKreivoAssetsAPI<'a, T, E, A> -where - E: Ext, -{ - fn from(ext: &'a E) -> Self { - Self::new(ext) - } -} - -impl AssetsAPI for RuntimeKreivoAssetsAPI<'_, T, E, Assets> -where - T: pallet_contracts::Config, - E: Ext, - Assets: frame_support::traits::fungibles::Inspect - + frame_support::traits::fungibles::Mutate, -{ - type AccountId = T::AccountId; - type AssetId = Assets::AssetId; - type Balance = Assets::Balance; - - fn balance(&self, asset: Self::AssetId, who: &Self::AccountId) -> Self::Balance { - Assets::balance(asset, who) - } - - fn deposit(&self, asset: Self::AssetId, amount: Self::Balance) -> Result { - let caller = self - .ext() - .caller() - .account_id() - .map_err(|_| KreivoApisError::ExtQueryError)? - .clone(); - Assets::transfer(asset, &caller, self.ext().address(), amount, Preservation::Preserve) - .map_err(|_| AssetsApiError::CannotDeposit.into()) - } - - fn transfer( - &self, - asset: Self::AssetId, - amount: Self::Balance, - beneficiary: &Self::AccountId, - ) -> Result { - Assets::transfer(asset, self.ext().address(), beneficiary, amount, Preservation::Preserve) - .map_err(|_| AssetsApiError::CannotTransfer.into()) - } -} diff --git a/apis/src/runtime/config.rs b/apis/src/runtime/config.rs new file mode 100644 index 000000000..fe19be702 --- /dev/null +++ b/apis/src/runtime/config.rs @@ -0,0 +1,61 @@ +use frame_contrib_traits::listings; +use frame_contrib_traits::listings::ListingsIdentifier; +use frame_contrib_traits::memberships; +use frame_support::traits::{fungible, fungibles}; +use frame_support::Parameter; +use parity_scale_codec::MaxEncodedLen; + +pub trait Config: pallet_contracts::Config +where + MembershipOf: Parameter + MaxEncodedLen, +{ + /// A type that implements the balances APIs. + type Balances: fungible::Inspect; + /// A type that implements the assets' APIs. + type Assets: fungibles::Inspect + fungibles::Mutate; + /// A type that implements the `MerchantIdInfo` trait. + type MerchantIdInfo: MerchantIdInfo>; + /// A type that implements the listings' APIs. + type Listings: listings::InspectInventory< + InventoryId = >>::InventoryId, + > + listings::InventoryLifecycle> + + listings::MutateInventory> + + listings::InspectItem< + Self::AccountId, + MerchantId = MerchantIdOf, + Asset = AssetIdOf, + Balance = AssetBalanceOf, + > + listings::MutateItem< + Self::AccountId, + MerchantId = MerchantIdOf, + Asset = AssetIdOf, + Balance = AssetBalanceOf, + >; + /// A type that implements the `GroupInfo` trait. + type GroupInfo: GroupInfo, Group = GroupOf>; + /// A type that implements the memberships' APIs. + type Memberships: memberships::Inspect + + memberships::InspectEnumerable + + memberships::Attributes + + memberships::Manager + + memberships::Rank; +} + +pub trait MerchantIdInfo { + type MerchantId: ListingsIdentifier; + + fn maybe_merchant_id(who: &AccountId) -> Option; +} + +pub trait GroupInfo { + type Group: Parameter; + + fn maybe_group(who: &AccountId) -> Option; +} + +pub type AccountIdOf = ::AccountId; +pub type MerchantIdOf = <::MerchantIdInfo as MerchantIdInfo>>::MerchantId; +pub type AssetIdOf = <::Assets as fungibles::Inspect>>::AssetId; +pub type AssetBalanceOf = <::Assets as fungibles::Inspect>>::Balance; +pub type GroupOf = <::Memberships as memberships::Inspect>>::Group; +pub type MembershipOf = <::Memberships as memberships::Inspect>>::Membership; diff --git a/apis/src/runtime/impls.rs b/apis/src/runtime/impls.rs new file mode 100644 index 000000000..171de0b7e --- /dev/null +++ b/apis/src/runtime/impls.rs @@ -0,0 +1,9 @@ +use super::*; + +mod assets; +mod listings; +mod memberships; + +pub trait ChainExtensionDispatch { + fn call(&self, ext: &E) -> Result, KreivoApisError>; +} diff --git a/apis/src/runtime/impls/assets.rs b/apis/src/runtime/impls/assets.rs new file mode 100644 index 000000000..2b04599f8 --- /dev/null +++ b/apis/src/runtime/impls/assets.rs @@ -0,0 +1,23 @@ +use super::*; + +type AssetsAPIOf = as KreivoAPI>::Assets; + +impl ChainExtensionDispatch for AssetsApiInfo +where + T: Config, + E: Ext, +{ + fn call(&self, ext: &E) -> Result, KreivoApisError> { + match self { + AssetsApiInfo::Balance { asset, who } => Ok(AssetsAPIOf::::balance(ext, asset.clone(), who).encode()), + AssetsApiInfo::Deposit { asset, amount } => { + AssetsAPIOf::::deposit(ext, asset.clone(), *amount).map(|v| v.encode()) + } + AssetsApiInfo::Transfer { + asset, + amount, + beneficiary, + } => AssetsAPIOf::::transfer(ext, asset.clone(), *amount, beneficiary).map(|v| v.encode()), + } + } +} diff --git a/apis/src/runtime/impls/listings.rs b/apis/src/runtime/impls/listings.rs new file mode 100644 index 000000000..224ddaead --- /dev/null +++ b/apis/src/runtime/impls/listings.rs @@ -0,0 +1,101 @@ +use super::*; + +type ListingsAPIOf = as KreivoAPI>::Listings; + +impl ChainExtensionDispatch for ListingsApiInfo +where + T: Config, + E: Ext, +{ + fn call(&self, ext: &E) -> Result, KreivoApisError> { + match self { + ListingsApiInfo::InventoryExists { id } => Ok(ListingsAPIOf::::inventory_exists(ext, id).encode()), + ListingsApiInfo::InventoryIsActive { id } => { + Ok(ListingsAPIOf::::inventory_is_active(ext, id).encode()) + } + ListingsApiInfo::InventoryAttribute { id, key } => { + Ok(ListingsAPIOf::::inventory_attribute::<_, Vec>(ext, id, key).encode()) + } + ListingsApiInfo::Create { id } => ListingsAPIOf::::create(ext, id).map(|v| v.encode()), + ListingsApiInfo::Archive { id } => ListingsAPIOf::::archive(ext, id).map(|v| v.encode()), + ListingsApiInfo::InventorySetAttribute { id, key, value } => { + ListingsAPIOf::::inventory_set_attribute::<_, Vec>(ext, id, key, value).map(|v| v.encode()) + } + ListingsApiInfo::InventoryClearAttribute { id, key } => { + ListingsAPIOf::::inventory_clear_attribute::<_, Vec>(ext, id, key).map(|v| v.encode()) + } + ListingsApiInfo::Item { inventory_id, id } => { + Ok(ListingsAPIOf::::item(ext, inventory_id, id).encode()) + } + ListingsApiInfo::ItemAttribute { inventory_id, id, key } => { + Ok(ListingsAPIOf::::item_attribute::<_, Vec>(ext, inventory_id, id, key).encode()) + } + ListingsApiInfo::ItemTransferable { inventory_id, id } => { + Ok(ListingsAPIOf::::item_transferable(ext, inventory_id, id).encode()) + } + ListingsApiInfo::ItemCanResell { inventory_id, id } => { + Ok(ListingsAPIOf::::item_can_resell(ext, inventory_id, id).encode()) + } + ListingsApiInfo::Publish { + inventory_id, + id, + name, + maybe_price, + } => ListingsAPIOf::::publish(ext, inventory_id, id, name.to_vec(), maybe_price.clone()) + .map(|v| v.encode()), + ListingsApiInfo::SetPrice { + inventory_id, + id, + price, + } => ListingsAPIOf::::set_price(ext, inventory_id, id, price.clone()).map(|v| v.encode()), + ListingsApiInfo::ClearPrice { inventory_id, id } => { + ListingsAPIOf::::clear_price(ext, inventory_id, id).map(|v| v.encode()) + } + ListingsApiInfo::ItemEnableResell { inventory_id, id } => { + ListingsAPIOf::::item_enable_resell(ext, inventory_id, id).map(|v| v.encode()) + } + ListingsApiInfo::ItemDisableResell { inventory_id, id } => { + ListingsAPIOf::::item_disable_resell(ext, inventory_id, id).map(|v| v.encode()) + } + ListingsApiInfo::ItemEnableTransfer { inventory_id, id } => { + ListingsAPIOf::::item_enable_transfer(ext, inventory_id, id).map(|v| v.encode()) + } + ListingsApiInfo::ItemDisableTransfer { inventory_id, id } => { + ListingsAPIOf::::item_disable_transfer(ext, inventory_id, id).map(|v| v.encode()) + } + ListingsApiInfo::ItemSetAttribute { + inventory_id, + id, + key, + value, + } => ListingsAPIOf::::item_set_attribute(ext, inventory_id, id, key, value).map(|v| v.encode()), + ListingsApiInfo::ItemClearAttribute { inventory_id, id, key } => { + ListingsAPIOf::::item_clear_attribute(ext, inventory_id, id, key).map(|v| v.encode()) + } + ListingsApiInfo::Transfer { + inventory_id, + id, + beneficiary, + } => ListingsAPIOf::::item_transfer(ext, inventory_id, id, beneficiary).map(|v| v.encode()), + ListingsApiInfo::CreatorTransfer { + inventory_id, + id, + beneficiary, + } => ListingsAPIOf::::item_creator_transfer(ext, inventory_id, id, beneficiary).map(|v| v.encode()), + ListingsApiInfo::SetInventoryMetadata { inventory_id, metadata } => { + ListingsAPIOf::::set_inventory_metadata(ext, inventory_id, metadata).map(|v| v.encode()) + } + ListingsApiInfo::ClearInventoryMetadata { inventory_id } => { + ListingsAPIOf::::clear_inventory_metadata(ext, inventory_id).map(|v| v.encode()) + } + ListingsApiInfo::SetMetadata { + inventory_id, + item_id, + metadata, + } => ListingsAPIOf::::set_metadata(ext, inventory_id, item_id, metadata).map(|v| v.encode()), + ListingsApiInfo::ClearMetadata { inventory_id, item_id } => { + ListingsAPIOf::::clear_metadata(ext, inventory_id, item_id).map(|v| v.encode()) + } + } + } +} diff --git a/apis/src/runtime/impls/memberships.rs b/apis/src/runtime/impls/memberships.rs new file mode 100644 index 000000000..3020ff1e5 --- /dev/null +++ b/apis/src/runtime/impls/memberships.rs @@ -0,0 +1,40 @@ +use crate::apis::{KreivoAPI, KreivoApisError, MembershipsAPI}; +use crate::runtime::impls::ChainExtensionDispatch; +use crate::runtime::types::MembershipsApiInfo; +use crate::runtime::RuntimeKreivoAPI; +use crate::Config; +use alloc::vec::Vec; +use frame_support::traits::ConstU32; +use frame_support::BoundedVec; +use pallet_contracts::chain_extension::Ext; +use parity_scale_codec::Encode; + +type MembershipsAPIOf = as KreivoAPI>::Memberships; + +impl ChainExtensionDispatch for MembershipsApiInfo +where + T: Config, + E: Ext, +{ + fn call(&self, ext: &E) -> Result, KreivoApisError> { + match self { + MembershipsApiInfo::AssignMembership { who } => { + Ok(MembershipsAPIOf::::assign_membership(ext, who).encode()) + } + MembershipsApiInfo::MembershipOf { who } => Ok(MembershipsAPIOf::::membership_of(ext, who).encode()), + MembershipsApiInfo::RankOf { id } => Ok(MembershipsAPIOf::::rank_of(ext, id).encode()), + MembershipsApiInfo::Attribute { id, key } => { + Ok(MembershipsAPIOf::::attribute::<_, BoundedVec>>(ext, id, key).encode()) + } + MembershipsApiInfo::SetAttribute { id, key, value } => { + MembershipsAPIOf::::set_attribute(ext, id, key, value).map(|v| v.encode()) + } + MembershipsApiInfo::ClearAttribute { id, key } => { + MembershipsAPIOf::::clear_attribute(ext, id, key).map(|v| v.encode()) + } + MembershipsApiInfo::FilterMembership { who, key, value } => { + Ok(MembershipsAPIOf::::filter_membership(ext, who, key, value).encode()) + } + } + } +} diff --git a/apis/src/runtime/types.rs b/apis/src/runtime/types.rs index 021ea0ca9..bd514e637 100644 --- a/apis/src/runtime/types.rs +++ b/apis/src/runtime/types.rs @@ -1,57 +1,39 @@ -use frame_support::sp_runtime::DispatchError; -use frame_support::traits::fungibles; -use pallet_contracts::chain_extension::{BufInBufOutState, Environment, Ext}; +use super::*; +use config::AccountIdOf; +use frame_support::pallet_prelude::DispatchError; +use frame_support::{CloneNoBound, DebugNoBound}; +use pallet_contracts::chain_extension::BufInBufOutState; -pub enum ApiInfo +mod assets; +pub use assets::*; +mod listings; +pub use listings::*; + +mod memberships; +pub use memberships::*; + +#[derive(CloneNoBound, DebugNoBound)] +pub enum ApiInfo where - T: frame_system::Config, - Assets: fungibles::Inspect, + T: Config, { - Assets(AssetsApiInfo), -} - -pub enum AssetsApiInfo> { - Balance { - asset: F::AssetId, - who: T::AccountId, - }, - Deposit { - asset: F::AssetId, - amount: F::Balance, - }, - Transfer { - asset: F::AssetId, - amount: F::Balance, - beneficiary: T::AccountId, - }, + Assets(AssetsApiInfo), + Listings(ListingsApiInfo), + Memberships(MembershipsApiInfo), } -impl TryFrom<&mut Environment<'_, '_, E, BufInBufOutState>> for ApiInfo +impl TryFrom<&mut Environment<'_, '_, E, BufInBufOutState>> for ApiInfo where - T: frame_system::Config, - Assets: fungibles::Inspect, + T: Config, E: Ext, { type Error = DispatchError; fn try_from(env: &mut Environment<'_, '_, E, BufInBufOutState>) -> Result { match env.func_id() { - 0x0000 => { - let (asset, who) = env.read_as()?; - Ok(Self::Assets(AssetsApiInfo::Balance { asset, who })) - } - 0x0001 => { - let (asset, amount) = env.read_as()?; - Ok(Self::Assets(AssetsApiInfo::Deposit { asset, amount })) - } - 0x0002 => { - let (asset, amount, beneficiary) = env.read_as()?; - Ok(Self::Assets(AssetsApiInfo::Transfer { - asset, - amount, - beneficiary, - })) - } + 0x0000..0x0100 => env.try_into().map(|api_info| Self::Assets(api_info)), + 0x0100..0x0200 => env.try_into().map(|api_info| Self::Listings(api_info)), + 0x0200..0x0300 => env.try_into().map(|api_info| Self::Memberships(api_info)), id => { log::error!("Called an unregistered `func_id`: {id:}"); Err(DispatchError::Other("Unimplemented func_id")) diff --git a/apis/src/runtime/types/assets.rs b/apis/src/runtime/types/assets.rs new file mode 100644 index 000000000..ac4a6a5e7 --- /dev/null +++ b/apis/src/runtime/types/assets.rs @@ -0,0 +1,58 @@ +use super::*; + +use frame_support::sp_runtime::DispatchError; +use frame_support::traits::fungibles; +use pallet_contracts::chain_extension::{BufInBufOutState, Environment, Ext}; + +pub type AssetIdOf = <::Assets as fungibles::Inspect>>::AssetId; +pub type AssetBalanceOf = <::Assets as fungibles::Inspect>>::Balance; + +#[derive(Encode, Decode, Clone, DebugNoBound)] +pub enum AssetsApiInfo { + Balance { + asset: AssetIdOf, + who: AccountIdOf, + }, + Deposit { + asset: AssetIdOf, + amount: AssetBalanceOf, + }, + Transfer { + asset: AssetIdOf, + amount: AssetBalanceOf, + beneficiary: T::AccountId, + }, +} + +impl TryFrom<&mut Environment<'_, '_, E, BufInBufOutState>> for AssetsApiInfo +where + T: Config, + E: Ext, +{ + type Error = DispatchError; + + fn try_from(env: &mut Environment<'_, '_, E, BufInBufOutState>) -> Result { + match env.func_id() { + 0x0000 => { + let (asset, who) = env.read_as()?; + Ok(AssetsApiInfo::Balance { asset, who }) + } + 0x0001 => { + let (asset, amount) = env.read_as()?; + Ok(AssetsApiInfo::Deposit { asset, amount }) + } + 0x0002 => { + let (asset, amount, beneficiary) = env.read_as()?; + Ok(AssetsApiInfo::Transfer { + asset, + amount, + beneficiary, + }) + } + id => { + log::error!("Called an unregistered `func_id`: {id:}"); + Err(DispatchError::Other("Unimplemented func_id")) + } + } + } +} diff --git a/apis/src/runtime/types/listings.rs b/apis/src/runtime/types/listings.rs new file mode 100644 index 000000000..5202afc86 --- /dev/null +++ b/apis/src/runtime/types/listings.rs @@ -0,0 +1,272 @@ +use super::*; + +use frame_contrib_traits::listings::item::ItemPrice; +use frame_contrib_traits::listings::*; +use frame_support::traits::ConstU32; +use frame_support::BoundedVec; + +type InventoryIdOf = <::Listings as InspectItem>>::InventoryId; +type ItemIdOf = <::Listings as InspectItem>>::ItemId; + +#[derive(Encode, Decode, Clone, DebugNoBound)] +pub enum ListingsApiInfo { + InventoryExists { + id: InventoryIdOf, + }, + InventoryIsActive { + id: InventoryIdOf, + }, + InventoryAttribute { + id: InventoryIdOf, + key: BoundedVec>, + }, + Create { + id: InventoryIdOf, + }, + Archive { + id: InventoryIdOf, + }, + InventorySetAttribute { + id: InventoryIdOf, + key: BoundedVec>, + value: BoundedVec>, + }, + InventoryClearAttribute { + id: InventoryIdOf, + key: BoundedVec>, + }, + Item { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemAttribute { + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: BoundedVec>, + }, + ItemTransferable { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemCanResell { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + Publish { + inventory_id: InventoryIdOf, + id: ItemIdOf, + name: BoundedVec>, + maybe_price: Option, AssetBalanceOf>>, + }, + SetPrice { + inventory_id: InventoryIdOf, + id: ItemIdOf, + price: ItemPrice, AssetBalanceOf>, + }, + ClearPrice { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemEnableResell { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemDisableResell { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemEnableTransfer { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemDisableTransfer { + inventory_id: InventoryIdOf, + id: ItemIdOf, + }, + ItemSetAttribute { + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: BoundedVec>, + value: BoundedVec>, + }, + ItemClearAttribute { + inventory_id: InventoryIdOf, + id: ItemIdOf, + key: BoundedVec>, + }, + Transfer { + inventory_id: InventoryIdOf, + id: ItemIdOf, + beneficiary: AccountIdOf, + }, + CreatorTransfer { + inventory_id: InventoryIdOf, + id: ItemIdOf, + beneficiary: AccountIdOf, + }, + SetInventoryMetadata { + inventory_id: InventoryIdOf, + metadata: BoundedVec>, + }, + ClearInventoryMetadata { + inventory_id: InventoryIdOf, + }, + SetMetadata { + inventory_id: InventoryIdOf, + item_id: ItemIdOf, + metadata: BoundedVec>, + }, + ClearMetadata { + inventory_id: InventoryIdOf, + item_id: ItemIdOf, + }, +} + +impl TryFrom<&mut Environment<'_, '_, E, BufInBufOutState>> for ListingsApiInfo +where + T: Config, + E: Ext, +{ + type Error = DispatchError; + + fn try_from(env: &mut Environment<'_, '_, E, BufInBufOutState>) -> Result { + match env.func_id() { + // Inventories + 0x0100 => { + let id = env.read_as()?; + Ok(ListingsApiInfo::InventoryExists { id }) + } + 0x0101 => { + let id = env.read_as()?; + Ok(ListingsApiInfo::InventoryIsActive { id }) + } + 0x0102 => { + let (id, key) = env.read_as()?; + Ok(ListingsApiInfo::InventoryAttribute { id, key }) + } + 0x0103 => { + let id = env.read_as()?; + Ok(ListingsApiInfo::Create { id }) + } + 0x0104 => { + let id = env.read_as()?; + Ok(ListingsApiInfo::Archive { id }) + } + 0x0105 => { + let (id, key, value) = env.read_as()?; + Ok(ListingsApiInfo::InventorySetAttribute { id, key, value }) + } + 0x0106 => { + let (id, key) = env.read_as()?; + Ok(ListingsApiInfo::InventoryClearAttribute { id, key }) + } + 0x0107 => { + let (inventory_id, metadata) = env.read_as()?; + Ok(ListingsApiInfo::SetInventoryMetadata { inventory_id, metadata }) + } + 0x0108 => { + let inventory_id = env.read_as()?; + Ok(ListingsApiInfo::ClearInventoryMetadata { inventory_id }) + } + // Items + 0x0110 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::Item { inventory_id, id }) + } + 0x0111 => { + let (inventory_id, id, key) = env.read_as()?; + Ok(ListingsApiInfo::ItemAttribute { inventory_id, id, key }) + } + 0x0112 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemTransferable { inventory_id, id }) + } + 0x0113 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemCanResell { inventory_id, id }) + } + 0x0114 => { + let (inventory_id, id, name, maybe_price) = env.read_as()?; + Ok(ListingsApiInfo::Publish { + inventory_id, + id, + name, + maybe_price, + }) + } + 0x0115 => { + let (inventory_id, id, price) = env.read_as()?; + Ok(ListingsApiInfo::SetPrice { + inventory_id, + id, + price, + }) + } + 0x0116 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ClearPrice { inventory_id, id }) + } + 0x0117 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemEnableResell { inventory_id, id }) + } + 0x0118 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemDisableResell { inventory_id, id }) + } + 0x0119 => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemEnableTransfer { inventory_id, id }) + } + 0x011a => { + let (inventory_id, id) = env.read_as()?; + Ok(ListingsApiInfo::ItemDisableTransfer { inventory_id, id }) + } + 0x011b => { + let (inventory_id, id, key, value) = env.read_as()?; + Ok(ListingsApiInfo::ItemSetAttribute { + inventory_id, + id, + key, + value, + }) + } + 0x011c => { + let (inventory_id, id, key) = env.read_as()?; + Ok(ListingsApiInfo::ItemClearAttribute { inventory_id, id, key }) + } + 0x011d => { + let (inventory_id, id, beneficiary) = env.read_as()?; + Ok(ListingsApiInfo::Transfer { + inventory_id, + id, + beneficiary, + }) + } + 0x011e => { + let (inventory_id, id, beneficiary) = env.read_as()?; + Ok(ListingsApiInfo::CreatorTransfer { + inventory_id, + id, + beneficiary, + }) + } + 0x011f => { + let (inventory_id, item_id, metadata) = env.read_as()?; + Ok(ListingsApiInfo::SetMetadata { + inventory_id, + item_id, + metadata, + }) + } + 0x0120 => { + let (inventory_id, item_id) = env.read_as()?; + Ok(ListingsApiInfo::ClearMetadata { inventory_id, item_id }) + } + id => { + log::error!("Called an unregistered `func_id`: {id:}"); + Err(DispatchError::Other("Unimplemented func_id")) + } + } + } +} diff --git a/apis/src/runtime/types/memberships.rs b/apis/src/runtime/types/memberships.rs new file mode 100644 index 000000000..f5a8a283c --- /dev/null +++ b/apis/src/runtime/types/memberships.rs @@ -0,0 +1,83 @@ +use super::*; + +use crate::runtime::config::MembershipOf; +use frame_support::pallet_prelude::ConstU32; +use frame_support::sp_runtime::DispatchError; +use frame_support::BoundedVec; +use pallet_contracts::chain_extension::{BufInBufOutState, Environment, Ext}; + +#[derive(Encode, Decode, Clone, DebugNoBound)] +pub enum MembershipsApiInfo { + AssignMembership { + who: AccountIdOf, + }, + MembershipOf { + who: AccountIdOf, + }, + RankOf { + id: MembershipOf, + }, + Attribute { + id: MembershipOf, + key: BoundedVec>, + }, + SetAttribute { + id: MembershipOf, + key: BoundedVec>, + value: BoundedVec>, + }, + ClearAttribute { + id: MembershipOf, + key: BoundedVec>, + }, + FilterMembership { + who: AccountIdOf, + key: BoundedVec>, + value: BoundedVec>, + }, +} + +impl TryFrom<&mut Environment<'_, '_, E, BufInBufOutState>> for MembershipsApiInfo +where + T: Config, + E: Ext, +{ + type Error = DispatchError; + + fn try_from(env: &mut Environment<'_, '_, E, BufInBufOutState>) -> Result { + match env.func_id() { + 0x0200 => { + let who = env.read_as()?; + Ok(MembershipsApiInfo::AssignMembership { who }) + } + 0x0201 => { + let who = env.read_as()?; + Ok(MembershipsApiInfo::MembershipOf { who }) + } + 0x0202 => { + let id = env.read_as()?; + Ok(MembershipsApiInfo::RankOf { id }) + } + 0x0203 => { + let (id, key) = env.read_as()?; + Ok(MembershipsApiInfo::Attribute { id, key }) + } + 0x0204 => { + let (id, key, value) = env.read_as()?; + Ok(MembershipsApiInfo::SetAttribute { id, key, value }) + } + 0x0205 => { + let (id, key) = env.read_as()?; + Ok(MembershipsApiInfo::ClearAttribute { id, key }) + } + 0x0206 => { + let (who, key, value) = env.read_as()?; + Ok(MembershipsApiInfo::FilterMembership { who, key, value }) + } + id => { + log::error!("Called an unregistered `func_id`: {id:}"); + Err(DispatchError::Other("Unimplemented func_id")) + } + } + } +} diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index 71178d884..90e5381fb 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -6,7 +6,7 @@ homepage.workspace = true license.workspace = true name = "chain-spec-generator" repository.workspace = true -version = "0.15.1" +version = "0.16.0" [dependencies] clap = { workspace = true, features = ["derive"] } @@ -15,9 +15,5 @@ kreivo-runtime = { workspace = true, default-features = true } sc-chain-spec.workspace = true [features] -runtime-benchmarks = [ - "kreivo-runtime/runtime-benchmarks" -] -paseo = [ - "kreivo-runtime/paseo" -] +runtime-benchmarks = ["kreivo-runtime/runtime-benchmarks"] +paseo = ["kreivo-runtime/paseo"] diff --git a/chain-spec-generator/src/spec/local.rs b/chain-spec-generator/src/spec/local.rs index fd40ee602..bc53675d6 100644 --- a/chain-spec-generator/src/spec/local.rs +++ b/chain-spec-generator/src/spec/local.rs @@ -54,7 +54,7 @@ pub fn chain_spec() -> Result, String> { .with_name(CHAIN_NAME_STRING) .with_chain_type(ChainType::Local) .with_properties(properties()) - .with_genesis_config_preset_name("local") + .with_genesis_config_preset_name("local_testnet") .build(), )) } diff --git a/common/Cargo.toml b/common/Cargo.toml index 6866418b6..85ccc3387 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -36,13 +36,8 @@ std = [ "sp-runtime?/std", "xcm?/std", ] -scale = [ - "dep:parity-scale-codec", - "dep:scale-info", -] -serde = [ - "dep:serde", -] +scale = ["dep:parity-scale-codec", "dep:scale-info"] +serde = ["dep:serde"] alloc = [] js = ["alloc", "wasm-bindgen"] nightly = [] @@ -55,3 +50,10 @@ runtime = [ "scale", "serde", ] +runtime-benchmarks = [ + "pallet-payments?/runtime-benchmarks", + "cumulus-primitives-core?/runtime-benchmarks", + "frame-support?/runtime-benchmarks", + "sp-runtime?/runtime-benchmarks", + "xcm?/runtime-benchmarks" +] diff --git a/common/src/lib.rs b/common/src/lib.rs index 3cc0912fe..b915eac37 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -15,3 +15,8 @@ pub use multilocation_asset_id::runtime::AsFungibleAssetLocation; pub type CommunityId = u16; pub type MembershipId = u32; + +pub mod listings { + pub type InventoryId = u32; + pub type ItemId = u64; +} diff --git a/common/src/multilocation_asset_id.rs b/common/src/multilocation_asset_id.rs index a8cd85599..a32a146b1 100644 --- a/common/src/multilocation_asset_id.rs +++ b/common/src/multilocation_asset_id.rs @@ -1,3 +1,4 @@ +use parity_scale_codec::DecodeWithMemTracking; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; #[cfg(feature = "scale")] @@ -7,7 +8,10 @@ use { }; #[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "scale", derive(Encode, Decode, MaxEncodedLen, TypeInfo))] +#[cfg_attr( + feature = "scale", + derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo) +)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum FungibleAssetLocation { Here(u32), @@ -16,7 +20,10 @@ pub enum FungibleAssetLocation { } #[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "scale", derive(Encode, Decode, MaxEncodedLen, TypeInfo))] +#[cfg_attr( + feature = "scale", + derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo) +)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Para { id: u16, @@ -25,7 +32,10 @@ pub struct Para { } #[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "scale", derive(Encode, Decode, MaxEncodedLen, TypeInfo))] +#[cfg_attr( + feature = "scale", + derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo) +)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum NetworkId { Polkadot, diff --git a/common/src/payment_id.rs b/common/src/payment_id.rs index 471a430e8..4716b9fae 100644 --- a/common/src/payment_id.rs +++ b/common/src/payment_id.rs @@ -131,7 +131,7 @@ impl core::fmt::Display for PaymentId { mod runtime { use super::PaymentId; use core::mem; - use parity_scale_codec::{Decode, Encode, EncodeLike, Error, Input, MaxEncodedLen}; + use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, Error, Input, MaxEncodedLen}; use scale_info::{TypeDefPrimitive, TypeInfo}; impl EncodeLike for PaymentId {} @@ -160,6 +160,7 @@ mod runtime { Some(mem::size_of::()) } } + impl DecodeWithMemTracking for PaymentId {} impl TypeInfo for PaymentId { type Identity = u64; fn type_info() -> scale_info::Type { diff --git a/justfile b/justfile index b3df53fb2..b5323b8e3 100644 --- a/justfile +++ b/justfile @@ -1,135 +1,168 @@ # NOTE: This justfile relies heavily on nushell, make sure to install it: https://www.nushell.sh + set shell := ["nu", "-c"] -podman := `(which podman) ++ (which docker) | (first).path` # use podman otherwise docker -ver := `open chain-spec-generator/Cargo.toml | get package.version` +podman := `nu -c '(which podman) ++ (which docker) | first | get path'` +ver := `nu -c 'open chain-spec-generator/Cargo.toml | get package.version'` +psdk_ver := `nu -c 'open polkadot-sdk-version' | str trim` +psdk_dir := ".polkadot-sdk" image := "ghcr.io/virto-network/virto" - chain := "kreivo" runtime := "target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm" rol := "collator" relay := "kusama" - - alias b := build-local alias c := check alias t := test _task-selector: - #!/usr/bin/env nu - let selected_task = ( - just --summary -u | split row ' ' | to text | fzf --header 'Available Virto recipes' --header-first --layout reverse --preview 'just --show {}' | - if ($in | is-empty) { 'about' } else { $in } - ) - just $selected_task + #!/usr/bin/env nu + let selected_task = ( + just --summary -u | split row ' ' | to text | fzf --header 'Available Virto recipes' --header-first --layout reverse --preview 'just --show {}' | + if ($in | is-empty) { 'about' } else { $in } + ) + just $selected_task @about: - open chain-spec-generator/Cargo.toml | get package | table -c + open chain-spec-generator/Cargo.toml | get package | table -c @version: - echo {{ ver }} + echo {{ ver }} -@list-crates: - open Cargo.toml | get workspace.members | each { open ($in + /Cargo.toml) | get package.name } | str join "\n" +@list-crates dir='.': + cd {{ dir }}; open Cargo.toml | get workspace.members | each { open ($in + /Cargo.toml) | get package.name } | str join "\n" @_check_deps: - rustup component add clippy + rustup component add clippy check: _check_deps - cargo clippy --all-targets -- --deny warnings - cargo +nightly fmt --all -- --check + cargo clippy --all-targets -- --deny warnings + cargo +nightly fmt --all -- --check @test crate="" *rest="": - cargo test (if not ("{{crate}}" | is-empty) { "-p" } else {""}) {{crate}} {{ rest }} + cargo test (if not ("{{ crate }}" | is-empty) { "-p" } else {""}) {{ crate }} {{ rest }} build-local features="": - cargo build --release --features '{{features}}' + cargo build --release --features '{{ features }}' build-benchmarks: - cargo build --release --features 'runtime-benchmarks' -p kreivo-runtime + cargo build --release --features 'runtime-benchmarks' -p kreivo-runtime benchmarks: - # TODO: build benchmarks for every pallet that's currently within the runtime as - # a dependency - mkdir .benchmarking-logs + # TODO: build benchmarks for every pallet that's currently within the runtime as + # a dependency + mkdir .benchmarking-logs - frame-omni-bencher v1 benchmark pallet --list=pallets --runtime {{runtime}} \ - | from csv \ - | each {|record| just benchmark $record.pallet} + frame-omni-bencher v1 benchmark pallet --list=pallets --runtime {{ runtime }} \ + | from csv \ + | each {|record| just benchmark $record.pallet} benchmark pallet="" extrinsic="*": - frame-omni-bencher v1 benchmark pallet \ - --runtime {{runtime}} \ - --pallet '{{pallet}}' --extrinsic '{{extrinsic}}' \ + do -i { frame-omni-bencher v1 benchmark pallet \ + --runtime {{ runtime }} \ + --pallet '{{ pallet }}' --extrinsic '{{ extrinsic }}' \ --steps 50 \ --repeat 20 \ --output ./runtime/kreivo/src/weights/ | \ - save --force .benchmarking-logs/{{pallet}}.out.txt \ - --stderr .benchmarking-logs/{{pallet}}.log.txt + save --force ".benchmarking-logs/{{ pallet }}.out.txt" \ + --stderr ".benchmarking-logs/{{ pallet }}.log.txt" } - if ((open .benchmarking-logs/{{pallet}}.out.txt | str length) == 0) { rm .benchmarking-logs/{{pallet}}.out.txt } + if ((open ".benchmarking-logs/{{ pallet }}.out.txt" | str length) == 0) { \ + rm ".benchmarking-logs/{{ pallet }}.out.txt"; \ + echo "Failed to benchmark \"{{ pallet }}\" with --extrinsic \"{{ extrinsic }}\"" \ + } else { \ + rm ".benchmarking-logs/{{ pallet }}.log.txt"; \ + echo "Completed benchmarks for \"{{ pallet }}\" with --extrinsic \"{{ extrinsic }}\"" \ + } release-artifacts: - @mkdir release; rm -f release/* - cp {{ runtime }} release/ - cp *.container release + @mkdir release; rm -f release/* + cp {{ runtime }} release/ + cp *.container release prerelease-tag count="1": - git tag {{ ver }}-pre.{{count}} + git tag {{ ver }}-pre.{{ count }} + release-tag: - git tag {{ ver }} + git tag {{ ver }} bump mode="minor": - #!/usr/bin/env nu - let ver = '{{ ver }}' | inc --{{ mode }} - open -r runtime/kreivo/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f runtime/kreivo/Cargo.toml - open -r chain-spec-generator/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f chain-spec-generator/Cargo.toml - # bump spec version - const SRC = 'runtime/kreivo/src/lib.rs' - let src = open $SRC - let spec_ver = ($src | grep spec_version | parse -r '\s*spec_version: (?\w+),' | first | get ver | into int) - $src | str replace -m '(\s*spec_version:) (\w+)' $'$1 ($spec_ver | $in + 1)' | save -f $SRC - # assume minor and major versions channge tx version - let bump_tx = '{{ mode }}' == 'minor' or '{{ mode }}' == 'major' - if $bump_tx { - let src = open $SRC - let tx_ver = ($src | grep transaction_version | parse -r '\s*transaction_version: (?\w+),' | first | get ver | into int) - $src | str replace -m '(\s*transaction_version:) (\w+)' $'$1 ($tx_ver | $in + 1)' | save -f $SRC - } + #!/usr/bin/env nu + let ver = '{{ ver }}' | inc --{{ mode }} + open -r runtime/kreivo/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f runtime/kreivo/Cargo.toml + open -r chain-spec-generator/Cargo.toml | str replace -m '^version = "(.+)"$' $'version = "($ver)"' | save -f chain-spec-generator/Cargo.toml + # bump spec version + const SRC = 'runtime/kreivo/src/lib.rs' + let src = open $SRC + let spec_ver = ($src | grep spec_version | parse -r '\s*spec_version: (?\w+),' | first | get ver | into int) + $src | str replace -m '(\s*spec_version:) (\w+)' $'$1 ($spec_ver | $in + 1)' | save -f $SRC + # assume minor and major versions channge tx version + let bump_tx = '{{ mode }}' == 'minor' or '{{ mode }}' == 'major' + if $bump_tx { + let src = open $SRC + let tx_ver = ($src | grep transaction_version | parse -r '\s*transaction_version: (?\w+),' | first | get ver | into int) + $src | str replace -m '(\s*transaction_version:) (\w+)' $'$1 ($tx_ver | $in + 1)' | save -f $SRC + } _zufix := os() + if os() == "linux" { "-x64" } else { "" } -zombienet network="": build-local - #!/usr/bin/env nu - # Run zombienet with a profile from the `zombienet/` folder chosen interactively - mut net = "{{ network }}" - if "{{ network }}" == "" { - let net_list = (ls zombienet | get name | path basename | str replace .toml '') - $net = ($net_list | to text | fzf --preview 'open {}.toml' | if ($in | is-empty) { $net_list | first } else { $in }) - } - bin/zombienet-{{ _zufix }} -p native spawn $"zombienet/($net).toml" - -get-zombienet-dependencies: (_get-latest "zombienet" "zombienet-"+_zufix) (_get-latest "cumulus" "polkadot-parachain") compile-polkadot-for-zombienet - -compile-polkadot-for-zombienet: - #!/usr/bin/env nu - mkdir bin - # Compile polkadot with fast-runtime feature - let polkadot = (open Cargo.toml | get workspace.dependencies.sp-core) - let dir = (mktemp -d polkadot-sdk.XXX) - git clone --branch $polkadot.branch --depth 1 $polkadot.git $dir - echo $"(ansi defb)Compiling Polkadot(ansi reset) \(($polkadot.git):($polkadot.branch)\)" - cargo build --manifest-path ($dir | path join Cargo.toml) --locked --profile testnet --features fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker - mv -f ($dir | path join target/testnet/polkadot) bin/ - mv -f ($dir | path join target/testnet/polkadot-prepare-worker) bin/ - mv -f ($dir | path join target/testnet/polkadot-execute-worker) bin/ + +zombienet network="" features="zombienet": (build-local features) + #!/usr/bin/env nu + # Run zombienet with a profile from the `zombienet/` folder chosen interactively + mut net = "{{ network }}" + if "{{ network }}" == "" { + let net_list = (ls zombienet | get name | path basename | str replace .toml '') + $net = ($net_list | to text | fzf --preview 'open {}.toml' | if ($in | is-empty) { $net_list | first } else { $in }) + } + bin/zombienet-{{ _zufix }} -p native spawn $"zombienet/($net).toml" + +get-zombienet-dependencies: (_get-latest "zombienet" "zombienet-" + _zufix) (_get-latest "polkadot-sdk" "polkadot-parachain") compile-polkadot-for-zombienet + +checkout-psdk ver=psdk_ver dir=psdk_dir: + #!/usr/bin/env nu + let since = ((date now) - 280day | format date "%Y-%m-%d") # ~9 months + if ('{{ dir }}' | path exists) { + cd {{ dir }}; git fetch --shallow-since $since origin {{ ver }} + git checkout {{ ver }} + } else { + git clone --branch {{ ver }} --shallow-since $since git@github.com:paritytech/polkadot-sdk.git {{ dir }} + cd {{ dir }}; git remote set-branches origin '*' + } + +compile-polkadot-for-zombienet: checkout-psdk + #!/usr/bin/env nu + mkdir bin + # Compile polkadot with fast-runtime feature + echo $"(ansi defb)Compiling Polkadot(ansi reset) \({{ psdk_ver }}\)" + cargo build --manifest-path ("{{ psdk_dir }}" | path join Cargo.toml) --locked --profile testnet --features fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker + mv -f ("{{ psdk_dir }}" | path join target/testnet/polkadot) bin/ + mv -f ("{{ psdk_dir }}" | path join target/testnet/polkadot-prepare-worker) bin/ + mv -f ("{{ psdk_dir }}" | path join target/testnet/polkadot-execute-worker) bin/ _get-latest repo bin: - #!/usr/bin/env nu - mkdir bin - http get https://api.github.com/repos/paritytech/{{ repo }}/releases - # cumulus has two kinds of releases, we exclude runtimes - | where "tag_name" !~ "parachains" | first | get assets_url | http get $in - | where name =~ {{ bin }} | first | get browser_download_url - | http get $in --raw | save bin/{{ bin }} --progress --force - chmod u+x bin/{{ bin }} + #!/usr/bin/env nu + mkdir bin + http get https://api.github.com/repos/paritytech/{{ repo }}/releases + # cumulus has two kinds of releases, we exclude runtimes + | where "tag_name" !~ "parachains" | first | get assets_url | http get $in + | where name =~ {{ bin }} | first | get browser_download_url + | http get $in --raw | save bin/{{ bin }} --progress --force + chmod u+x bin/{{ bin }} + +compare-psdk-versions: checkout-psdk + #!/usr/bin/env nu + def dependencies [repo] { + open ($repo + /Cargo.toml) | get workspace.dependencies | items {|dep, x| { + name: $dep, + ver: (if ($x | describe) == "string" { $x } else { $x | default '' version | get version }) + }} + } + def workspace_crates [repo] { + open ($repo + /Cargo.toml) | get workspace.members | each { + open $'($repo)/($in)/Cargo.toml' | {name: $in.package.name, ver: $in.package.version} + } + } + (dependencies .) | join (workspace_crates {{ psdk_dir }} | rename name ver_psdk) name + | insert matches {|x| $x.ver == $x.ver_psdk} + | sort-by name diff --git a/pallets/communities-manager/Cargo.toml b/pallets/communities-manager/Cargo.toml index 4200ae409..0dfe461fc 100644 --- a/pallets/communities-manager/Cargo.toml +++ b/pallets/communities-manager/Cargo.toml @@ -12,27 +12,19 @@ version = "0.1.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -fc-traits-gas-tank.workspace = true -fc-traits-tracks.workspace = true - +frame-contrib-traits.workspace = true frame-benchmarking = { workspace = true, optional = true } frame-support.workspace = true frame-system.workspace = true - -pallet-communities.workspace = true +pallet-communities = { workspace = true, features = ["serde"] } pallet-nfts.workspace = true pallet-referenda.workspace = true - log.workspace = true - parity-scale-codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true, features = ["derive"] } - sp-runtime.workspace = true -sp-std.workspace = true [dev-dependencies] -fc-traits-memberships.workspace = true sp-core.workspace = true sp-io.workspace = true @@ -43,38 +35,36 @@ pallet-ranked-collective.workspace = true pallet-referenda-tracks.workspace = true pallet-scheduler.workspace = true virto-common = { workspace = true, default-features = false, features = [ - "runtime", + "runtime", ] } [features] default = ["std"] std = [ - "fc-traits-gas-tank/std", - "fc-traits-memberships/std", - "fc-traits-tracks/std", - "frame-benchmarking?/std", - "frame-support/std", - "frame-system/std", - "log/std", - "pallet-assets/std", - "pallet-assets-freezer/std", - "pallet-balances/std", - "pallet-communities/std", - "pallet-nfts/std", - "pallet-ranked-collective/std", - "pallet-referenda-tracks/std", - "pallet-referenda/std", - "pallet-scheduler/std", - "parity-scale-codec/std", - "scale-info/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "virto-common/std", + "frame-benchmarking?/std", + "frame-contrib-traits/std", + "frame-support/std", + "frame-system/std", + "log/std", + "pallet-assets/std", + "pallet-assets-freezer/std", + "pallet-balances/std", + "pallet-communities/std", + "pallet-nfts/std", + "pallet-ranked-collective/std", + "pallet-referenda-tracks/std", + "pallet-referenda/std", + "pallet-scheduler/std", + "parity-scale-codec/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "virto-common/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", + "frame-contrib-traits/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", @@ -87,17 +77,19 @@ runtime-benchmarks = [ "pallet-referenda/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "virto-common/runtime-benchmarks" ] try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-assets/try-runtime", - "pallet-assets-freezer/try-runtime", - "pallet-balances/try-runtime", - "pallet-nfts/try-runtime", - "pallet-ranked-collective/try-runtime", - "pallet-referenda-tracks/try-runtime", - "pallet-referenda/try-runtime", - "pallet-scheduler/try-runtime", - "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-assets/try-runtime", + "pallet-assets-freezer/try-runtime", + "pallet-balances/try-runtime", + "pallet-nfts/try-runtime", + "pallet-ranked-collective/try-runtime", + "pallet-referenda-tracks/try-runtime", + "pallet-referenda/try-runtime", + "pallet-scheduler/try-runtime", + "sp-runtime/try-runtime", + "pallet-communities/try-runtime", ] diff --git a/pallets/communities-manager/src/benchmarking.rs b/pallets/communities-manager/src/benchmarking.rs index 48e505658..a6c3c503e 100644 --- a/pallets/communities-manager/src/benchmarking.rs +++ b/pallets/communities-manager/src/benchmarking.rs @@ -3,25 +3,23 @@ use super::*; use frame_benchmarking::v2::*; -use frame_support::traits::fungible::Mutate; +use frame_support::{dispatch::DispatchResult, traits::fungible::Mutate}; use frame_system::RawOrigin; use sp_runtime::SaturatedConversion; -type RuntimeEventFor = ::RuntimeEvent; - // Since `periodicity` is arbitrary, we assume `DAYS` is a nominal day for 6s // block. const DAYS: u32 = 14_400; fn block_weight() -> Weight { - ::BlockWeights::get().max_block + ::BlockWeights::get().max_block / 2 } -fn assert_has_event(generic_event: RuntimeEventFor) { +fn assert_has_event(generic_event: T::RuntimeEvent) { frame_system::Pallet::::assert_has_event(generic_event.into()); } -fn setup_account(who: &AccountIdOf) -> Result<(), BenchmarkError> +fn setup_account(who: &AccountIdOf) -> DispatchResult where NativeBalanceOf: From, { @@ -30,28 +28,12 @@ where Ok(()) } -fn setup_collection() -> Result<(), BenchmarkError> { - T::CreateCollection::create_collection_with_id( - T::MembershipsManagerCollectionId::get(), - &T::MembershipsManagerOwner::get(), - &T::MembershipsManagerOwner::get(), - &pallet_nfts::CollectionConfig { - settings: Default::default(), - max_supply: None, - mint_settings: Default::default(), - }, - )?; - - Ok(()) -} - #[benchmarks( where - RuntimeEventFor: From>, + T::RuntimeEvent: From>, NativeBalanceOf: From, - BlockNumberFor: From, - CommunityIdOf: From, - ::MembershipId: From, + CommunityIdOf: One, + T::MembershipId: From, )] mod benchmarks { use super::*; @@ -59,18 +41,17 @@ mod benchmarks { #[benchmark] fn register() -> Result<(), BenchmarkError> { // setup code - let first_member: AccountIdOf = frame_benchmarking::account("founder", 0, 0); + let first_member: AccountIdOf = account("founder", 0, 0); setup_account::(&first_member)?; - let community_id: CommunityIdOf = 1.into(); - let first_admin = T::Lookup::unlookup(first_member.clone()); + let community_id: CommunityIdOf = One::one(); #[extrinsic_call] _( RawOrigin::Root, community_id, BoundedVec::truncate_from(b"Test Community".into()), - first_admin, + T::Lookup::unlookup(first_member.clone()), None, None, ); @@ -82,8 +63,7 @@ mod benchmarks { #[benchmark] fn create_memberships(q: Linear<1, 1024>) -> Result<(), BenchmarkError> { - // setup code - setup_collection::()?; + setup_account::(&T::MembershipsManagerOwner::get())?; #[extrinsic_call] _( @@ -111,8 +91,9 @@ mod benchmarks { #[benchmark] fn set_gas_tank() -> Result<(), BenchmarkError> { + setup_account::(&T::MembershipsManagerOwner::get())?; + // Setup code - setup_collection::()?; Pallet::::create_memberships( RawOrigin::Root.into(), 1, @@ -136,9 +117,5 @@ mod benchmarks { Ok(()) } - impl_benchmark_test_suite!( - Pallet, - sp_io::TestExternalities::new(Default::default()), - crate::mock::Test - ); + impl_benchmark_test_suite!(Pallet, sp_io::TestExternalities::new(Default::default()), mock::Test); } diff --git a/pallets/communities-manager/src/lib.rs b/pallets/communities-manager/src/lib.rs index aaf56a0f0..822b4f703 100644 --- a/pallets/communities-manager/src/lib.rs +++ b/pallets/communities-manager/src/lib.rs @@ -1,23 +1,13 @@ #![cfg_attr(not(feature = "std"), no_std)] -pub use pallet::*; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -#[cfg(test)] -pub(crate) mod mock; -#[cfg(test)] -mod tests; - -pub mod weights; -pub use weights::*; +extern crate alloc; -use fc_traits_gas_tank::MakeTank; -use fc_traits_tracks::MutateTracks; +use alloc::{string::String, vec::Vec}; +use frame_contrib_traits::{gas_tank::MakeTank, tracks::MutateTracks}; use frame_support::{ pallet_prelude::*, traits::{ + nonfungibles_v2::Inspect, nonfungibles_v2::Mutate as ItemMutate, nonfungibles_v2::{Create as CollectionCreate, Trading}, Incrementable, OriginTrait, RankedMembers, @@ -25,10 +15,10 @@ use frame_support::{ }; use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; use pallet_communities::{ - types::{AccountIdOf, CommunityIdOf, DecisionMethodFor, NativeBalanceOf, PalletsOriginOf, RuntimeOriginFor}, - Origin as CommunityOrigin, + AccountIdOf, AssetIdOf, CommunityIdOf, DecisionMethodFor, NativeBalanceOf, Origin as CommunityOrigin, + PalletsOriginOf, RuntimeOriginFor, }; -use pallet_nfts::CollectionConfig; +use pallet_nfts::{CollectionConfig, MintSettings, MintType}; use pallet_referenda::{TrackInfo, TracksInfo}; use parity_scale_codec::Decode; use sp_runtime::{ @@ -36,9 +26,22 @@ use sp_runtime::{ traits::{Get, StaticLookup}, }; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +#[cfg(test)] +pub(crate) mod mock; +#[cfg(test)] +mod tests; + +pub use pallet::*; + +pub mod weights; +pub use weights::*; + type TrackInfoOf = TrackInfo, BlockNumberFor>; -#[derive(Default, Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] +#[derive(Default, Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct TankConfig { capacity: Option, periodicity: Option, @@ -47,6 +50,7 @@ pub struct TankConfig { #[frame_support::pallet] pub mod pallet { use super::*; + use frame_support::DefaultNoBound; use parity_scale_codec::HasCompact; type CommunityName = BoundedVec>; @@ -54,20 +58,21 @@ pub mod pallet { /// Configure the pallet by specifying the parameters and types on which it /// depends. #[pallet::config] - pub trait Config: frame_system::Config + pallet_communities::Config { - /// Because this pallet emits events, it depends on the runtime's - /// definition of an event. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - + pub trait Config: + frame_system::Config>> + + pallet_communities::Config + where + AssetIdOf: MaybeSerializeDeserialize, + { type CreateCollection: CollectionCreate< AccountIdOf, CollectionConfig, BlockNumberFor, CommunityIdOf>, CollectionId = CommunityIdOf, >; - type MakeTank: fc_traits_gas_tank::MakeTank< + type MakeTank: MakeTank< Gas = Weight, - TankId = (CommunityIdOf, ::MembershipId), + TankId = (CommunityIdOf, Self::MembershipId), BlockNumber = BlockNumberFor, >; @@ -91,28 +96,97 @@ pub mod pallet { type CreateMembershipsOrigin: EnsureOrigin>; - type MembershipId: Parameter + Decode + Incrementable + HasCompact; - type MembershipsManagerCollectionId: Get>; type MembershipsManagerOwner: Get>; - type CreateMemberships: ItemMutate< + type ItemConfig: Default; + + type CreateMemberships: CollectionCreate< + AccountIdOf, + CollectionConfig, BlockNumberFor, CommunityIdOf>, + > + ItemMutate< AccountIdOf, Self::ItemConfig, CollectionId = CommunityIdOf, - ItemId = ::MembershipId, + ItemId = Self::MembershipId, > + Trading< AccountIdOf, NativeBalanceOf, CollectionId = CommunityIdOf, - ItemId = ::MembershipId, + ItemId = Self::MembershipId, >; } #[pallet::pallet] pub struct Pallet(_); + /// A genesis community info. + pub type GenesisCommunityOf = ( + // community_id + CommunityIdOf, + // name + String, + // admin + AccountIdOf, + // maybe_decision_method + Option>, + // maybe_rank + Option, + ); + + /// A genesis membership info. + pub type GenesisMembershipOf = ( + // starting_at + ::MembershipId, + // amount + u16, + // price + NativeBalanceOf, + // tank_config, + (Option, Option>), + // maybe_expiration + Option>, + ); + + #[pallet::genesis_config] + #[derive(DefaultNoBound)] + pub struct GenesisConfig { + /// A list of initial communities, with the most basic settings. + pub communities: Vec>, + pub memberships: Vec>, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + for (community_id, name, admin, maybe_decision_method, maybe_rank) in &self.communities { + Pallet::::try_register( + None, // genesis communities are given for free :) + *community_id, + name.as_str(), + admin, + maybe_decision_method.clone(), + None, // use the default track info. Let the community set the track later. + *maybe_rank, + ) + .unwrap(); + } + + for (starting_at, amount, price, tank_config, maybe_expiration) in &self.memberships { + let (capacity, periodicity) = *tank_config; + Pallet::::try_create_memberships( + starting_at.clone(), + *amount, + *price, + TankConfig { capacity, periodicity }, + *maybe_expiration, + ) + .unwrap() + } + } + } + // Pallets use events to inform users when important changes are made. // https://docs.substrate.io/main-docs/build/events-errors/ #[pallet::event] @@ -122,10 +196,7 @@ pub mod pallet { /// has been created. CommunityRegistered { id: T::CommunityId }, /// The - MembershipsCreated { - starting_at: ::MembershipId, - amount: u32, - }, + MembershipsCreated { starting_at: T::MembershipId, amount: u32 }, } // Errors inform users that something worked or went wrong. @@ -153,52 +224,16 @@ pub mod pallet { first_admin: pallet_communities::AccountIdLookupOf, maybe_decision_method: Option>, maybe_track_info: Option>, - // _maybe_first_member: Option>, ) -> DispatchResult { - let maybe_deposit = T::RegisterOrigin::ensure_origin(origin)?; - - let community_name = core::str::from_utf8(&name).map_err(|_| Error::::InvalidCommunityName)?; - - let first_admin_account_id = T::Lookup::lookup(first_admin)?; - let admin_origin = frame_system::Origin::::Signed(first_admin_account_id); - - // Register first to check if community exists - pallet_communities::Pallet::::register(&admin_origin.clone().into(), &community_id, maybe_deposit)?; - - if let Some(decision_method) = maybe_decision_method { - pallet_communities::Pallet::::set_decision_method( - admin_origin.into(), - community_id, - decision_method, - )?; - } - - let community_account = pallet_communities::Pallet::::community_account(&community_id); - - // Create memberships collection for community - T::CreateCollection::create_collection_with_id( + Self::try_register( + T::RegisterOrigin::ensure_origin(origin)?, community_id, - &community_account, - &community_account, - &CollectionConfig { - settings: Default::default(), - max_supply: None, - mint_settings: Default::default(), - }, - )?; - - // Create governance track for community - let community_origin: RuntimeOriginFor = CommunityOrigin::::new(community_id).into(); - T::Tracks::insert( - community_id, - maybe_track_info.unwrap_or_else(|| Self::default_tack(community_name)), - community_origin.into_caller(), - )?; - // Induct community at Kreivo Governance with rank 0 - T::RankedCollective::induct(&community_account)?; - - Self::deposit_event(Event::::CommunityRegistered { id: community_id }); - Ok(()) + core::str::from_utf8(&name).map_err(|_| Error::::InvalidCommunityName)?, + &T::Lookup::lookup(first_admin)?, + maybe_decision_method, + maybe_track_info, + None, + ) } #[pallet::weight(::WeightInfo::create_memberships((*amount).into()))] @@ -206,7 +241,7 @@ pub mod pallet { pub fn create_memberships( origin: OriginFor, amount: u16, - starting_at: ::MembershipId, + starting_at: T::MembershipId, #[pallet::compact] price: NativeBalanceOf, tank_config: TankConfig>, maybe_expiration: Option>, @@ -214,96 +249,180 @@ pub mod pallet { ensure!(amount <= 1024u16, Error::::CreatingTooManyMemberships); T::CreateMembershipsOrigin::ensure_origin(origin.clone())?; - let collection_id = &T::MembershipsManagerCollectionId::get(); - let mut id = starting_at.clone(); - let mut minted = 0u32; - for _ in 0..amount { - T::CreateMemberships::mint_into( - collection_id, - &id, - &T::MembershipsManagerOwner::get(), - &Default::default(), - true, - )?; - - Self::do_set_gas_tank(&(*collection_id, id.clone()), &tank_config)?; - - if let Some(expiration) = maybe_expiration { - T::CreateMemberships::set_typed_attribute( - collection_id, - &id, - &b"membership_expiration", - &expiration, - )?; - } - - T::CreateMemberships::set_price( - &T::MembershipsManagerCollectionId::get(), - &id, - &T::MembershipsManagerOwner::get(), - Some(price), - None, - )?; - if let Some(next_id) = id.increment() { - id = next_id; - minted += 1; - } else { - break; - } - } - - Self::deposit_event(Event::::MembershipsCreated { - starting_at, - amount: minted, - }); - Ok(()) + Self::try_create_memberships(starting_at.clone(), amount, price, tank_config, maybe_expiration) } #[pallet::call_index(2)] pub fn set_gas_tank( origin: OriginFor, community_id: CommunityIdOf, - membership_id: ::MembershipId, + membership_id: T::MembershipId, config: TankConfig>, ) -> DispatchResult { T::CreateMembershipsOrigin::ensure_origin(origin)?; Self::do_set_gas_tank(&(community_id, membership_id), &config) } } +} - impl Pallet { - #[inline] - pub(crate) fn do_set_gas_tank( - tank_id: &(CommunityIdOf, ::MembershipId), - config: &TankConfig>, - ) -> DispatchResult { - let TankConfig { capacity, periodicity } = config; - T::MakeTank::make_tank(tank_id, *capacity, *periodicity)?; +impl Pallet { + pub(crate) fn try_register( + maybe_deposit: Option<(NativeBalanceOf, AccountIdOf, AccountIdOf)>, + community_id: CommunityIdOf, + community_name: &str, + admin: &AccountIdOf, + maybe_decision_method: Option>, + maybe_track_info: Option>, + maybe_rank: Option, + ) -> DispatchResult { + let admin_origin = frame_system::Origin::::Signed(admin.clone()); + + // Register first to check if community exists + pallet_communities::Pallet::::register(&admin_origin.clone().into(), &community_id, maybe_deposit)?; + + if let Some(decision_method) = maybe_decision_method { + pallet_communities::Pallet::::set_decision_method(admin_origin.into(), community_id, decision_method)?; + } - Ok(()) + let community_account = pallet_communities::Pallet::::community_account(&community_id); + + // Create memberships collection for community + T::CreateCollection::create_collection_with_id( + community_id, + &community_account, + &community_account, + &CollectionConfig { + settings: Default::default(), + max_supply: None, + mint_settings: Default::default(), + }, + )?; + + // Create governance track for community + let community_origin: RuntimeOriginFor = CommunityOrigin::::new(community_id).into(); + T::Tracks::insert( + community_id, + maybe_track_info.unwrap_or_else(|| Self::default_tack(community_name)), + community_origin.into_caller(), + )?; + // Induct community at Kreivo Governance with rank 0 + T::RankedCollective::induct(&community_account)?; + if let Some(rank) = maybe_rank { + for _ in 0..rank { + T::RankedCollective::promote(&community_account)?; + } } - fn default_tack(name: &str) -> TrackInfoOf { - use sp_runtime::Perbill; - TrackInfo { - name: str_array(name), - max_deciding: 1, - decision_deposit: 0u8.into(), - prepare_period: 1u8.into(), - decision_period: u8::MAX.into(), - confirm_period: 1u8.into(), - min_enactment_period: 1u8.into(), - min_approval: pallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(50), - ceil: Perbill::from_percent(100), - }, - min_support: pallet_referenda::Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(50), + Self::deposit_event(Event::::CommunityRegistered { id: community_id }); + Ok(()) + } + + pub(crate) fn prepare_memberships_collection() -> Result, DispatchError> { + let collection_id = &T::MembershipsManagerCollectionId::get(); + + if T::CreateMemberships::collection_owner(collection_id).is_none() { + let owner = &T::MembershipsManagerOwner::get(); + T::CreateMemberships::create_collection_with_id( + *collection_id, + owner, + owner, + &CollectionConfig { + settings: Default::default(), + max_supply: None, + mint_settings: MintSettings { + mint_type: MintType::Issuer, + price: None, + start_block: None, + end_block: None, + default_item_settings: Default::default(), + }, }, + )?; + } + + Ok(*collection_id) + } + + pub(crate) fn try_create_memberships( + starting_at: T::MembershipId, + amount: u16, + price: NativeBalanceOf, + tank_config: TankConfig>, + maybe_expiration: Option>, + ) -> DispatchResult { + let collection_id = &Self::prepare_memberships_collection()?; + + let mut id = starting_at.clone(); + let mut minted = 0u32; + for _ in 0..amount { + T::CreateMemberships::mint_into( + collection_id, + &id, + &T::MembershipsManagerOwner::get(), + &Default::default(), + true, + )?; + + Self::do_set_gas_tank(&(*collection_id, id.clone()), &tank_config)?; + + if let Some(expiration) = maybe_expiration { + T::CreateMemberships::set_typed_attribute(collection_id, &id, &b"membership_expiration", &expiration)?; } + + T::CreateMemberships::set_price( + &T::MembershipsManagerCollectionId::get(), + &id, + &T::MembershipsManagerOwner::get(), + Some(price), + None, + )?; + if let Some(next_id) = id.increment() { + id = next_id; + minted += 1; + } else { + break; + } + } + + Self::deposit_event(Event::::MembershipsCreated { + starting_at, + amount: minted, + }); + + Ok(()) + } + + #[inline] + pub(crate) fn do_set_gas_tank( + tank_id: &(CommunityIdOf, T::MembershipId), + config: &TankConfig>, + ) -> DispatchResult { + let TankConfig { capacity, periodicity } = config; + T::MakeTank::make_tank(tank_id, *capacity, *periodicity)?; + + Ok(()) + } + + fn default_tack(name: &str) -> TrackInfoOf { + use sp_runtime::Perbill; + TrackInfo { + name: str_array(name), + max_deciding: 1, + decision_deposit: 0u8.into(), + prepare_period: 1u8.into(), + decision_period: u8::MAX.into(), + confirm_period: 1u8.into(), + min_enactment_period: 1u8.into(), + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, } } } diff --git a/pallets/communities-manager/src/mock/collective.rs b/pallets/communities-manager/src/mock/collective.rs index fbb74eac8..c2eec5818 100644 --- a/pallets/communities-manager/src/mock/collective.rs +++ b/pallets/communities-manager/src/mock/collective.rs @@ -1,16 +1,16 @@ use super::*; -use pallet_referenda::{impl_tracksinfo_get, Track}; +use alloc::borrow::Cow; +use pallet_referenda::{Curve, Track}; use sp_runtime::{str_array as s, Perbill}; -use sp_std::borrow::Cow; pub type TrackId = u16; pub type CollectiveReferendaInstance = pallet_referenda::Instance1; impl pallet_referenda::Config for Test { - type WeightInfo = pallet_referenda::weights::SubstrateWeight; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_referenda::weights::SubstrateWeight; type Scheduler = Scheduler; type Currency = Balances; // Communities can submit proposals. @@ -24,8 +24,9 @@ impl pallet_referenda::Config for Test { type MaxQueued = ConstU32<3>; type UndecidingTimeout = ConstU64<20>; type AlarmInterval = AlarmInterval; - type Tracks = TracksInfo; + type Tracks = Tracks; type Preimages = (); + type BlockNumberProvider = System; } pub type CollectiveInstance = pallet_ranked_collective::Instance1; @@ -34,26 +35,26 @@ impl pallet_ranked_collective::Config for Test { type RuntimeEvent = RuntimeEvent; type AddOrigin = EnsureNever<()>; type RemoveOrigin = Self::DemoteOrigin; - type ExchangeOrigin = EnsureNever<()>; - type MemberSwappedHandler = (); type PromoteOrigin = EnsureRootWithSuccess>; type DemoteOrigin = EnsureRootWithSuccess>; + type ExchangeOrigin = EnsureNever<()>; type Polls = CollectiveReferenda; type MinRankOfClass = (); + type MemberSwappedHandler = (); type VoteWeight = pallet_ranked_collective::Linear; type MaxMemberCount = (); #[cfg(feature = "runtime-benchmarks")] type BenchmarkSetup = (); } -pub struct TracksInfo; -impl pallet_referenda::TracksInfo> for TracksInfo { +pub struct Tracks; +impl TracksInfo> for Tracks { type Id = TrackId; - type RuntimeOrigin = ::PalletsOrigin; + type RuntimeOrigin = ::PalletsOrigin; fn tracks() -> impl Iterator>>> { - const DATA: [pallet_referenda::Track>; 1] = [Track { + const DATA: [Track>; 1] = [Track { id: 0, - info: pallet_referenda::TrackInfo { + info: TrackInfo { name: s("Root"), max_deciding: 1, decision_deposit: 0, @@ -61,12 +62,12 @@ impl pallet_referenda::TracksInfo> for TracksInfo decision_period: 4, confirm_period: 1, min_enactment_period: 1, - min_approval: pallet_referenda::Curve::LinearDecreasing { + min_approval: Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(90), ceil: Perbill::from_percent(100), }, - min_support: pallet_referenda::Curve::LinearDecreasing { + min_support: Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(0), ceil: Perbill::from_percent(100), @@ -87,4 +88,3 @@ impl pallet_referenda::TracksInfo> for TracksInfo } } } -impl_tracksinfo_get!(TracksInfo, Balance, BlockNumberFor); diff --git a/pallets/communities-manager/src/mock/mod.rs b/pallets/communities-manager/src/mock/mod.rs index 374cc20cd..47eca8643 100644 --- a/pallets/communities-manager/src/mock/mod.rs +++ b/pallets/communities-manager/src/mock/mod.rs @@ -1,6 +1,5 @@ use super::*; -use fc_traits_gas_tank::NonFungibleGasTank; -use fc_traits_memberships::NonFungiblesMemberships; +use frame_contrib_traits::{gas_tank::NonFungibleGasTank, memberships::NonFungiblesMemberships}; use frame_support::{ assert_ok, derive_impl, parameter_types, traits::{AsEnsureOriginWithArg, ConstU16, ConstU32, ConstU64, EitherOf, EqualPrivilegeOnly, VariantCountOf}, @@ -82,17 +81,15 @@ parameter_types! { pub const RootAccount: AccountId = AccountId::new([0xff; 32]); } -#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type Block = Block; type AccountId = AccountId; type Lookup = IdentityLookup; type AccountData = pallet_balances::AccountData; - type RuntimeEvent = RuntimeEvent; } -#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig -)] +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type AccountStore = System; type FreezeIdentifier = RuntimeFreezeReason; @@ -100,7 +97,7 @@ impl pallet_balances::Config for Test { type MaxFreezes = VariantCountOf; } -#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig as pallet_assets::DefaultConfig)] +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Test { type Currency = Balances; type CreateOrigin = AsEnsureOriginWithArg>; @@ -109,8 +106,8 @@ impl pallet_assets::Config for Test { } impl pallet_assets_freezer::Config for Test { - type RuntimeEvent = RuntimeEvent; type RuntimeFreezeReason = RuntimeFreezeReason; + type RuntimeEvent = RuntimeEvent; } impl pallet_scheduler::Config for Test { @@ -124,6 +121,7 @@ impl pallet_scheduler::Config for Test { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type Preimages = (); + type BlockNumberProvider = System; } parameter_types! { @@ -132,9 +130,9 @@ parameter_types! { } impl pallet_referenda::Config for Test { - type WeightInfo = (); type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); type Scheduler = Scheduler; type Currency = Balances; type SubmitOrigin = EnsureSigned; @@ -149,10 +147,10 @@ impl pallet_referenda::Config for Test { type AlarmInterval = AlarmInterval; type Tracks = Tracks; type Preimages = (); + type BlockNumberProvider = System; } impl pallet_referenda_tracks::Config for Test { - type RuntimeEvent = RuntimeEvent; type TrackId = CommunityId; type MaxTracks = MaxTracks; type AdminOrigin = EnsureRoot; @@ -199,47 +197,44 @@ impl pallet_nfts::Config for Test { type WeightInfo = (); #[cfg(feature = "runtime-benchmarks")] type Helper = (); + type BlockNumberProvider = System; } impl pallet_communities::Config for Test { - type PalletId = CommunitiesPalletId; + type RuntimeFreezeReason = RuntimeFreezeReason; + type WeightInfo = WeightInfo; + type CreateOrigin = EnsureNever; + type AdminOrigin = EnsureCommunity; + type MemberMgmtOrigin = EnsureCommunity; type CommunityId = CommunityId; type MembershipId = MembershipId; + type MemberMgmt = NonFungiblesMemberships; + type Polls = Referenda; type Assets = Assets; type AssetsFreezer = AssetsFreezer; type Balances = Balances; - type ItemConfig = pallet_nfts::ItemConfig; - type MemberMgmt = NonFungiblesMemberships; - type Polls = Referenda; - type CreateOrigin = EnsureNever; - type AdminOrigin = EnsureCommunity; - type MemberMgmtOrigin = EnsureCommunity; - type RuntimeCall = RuntimeCall; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type RuntimeFreezeReason = RuntimeFreezeReason; - type WeightInfo = WeightInfo; + type BlockNumberProvider = System; + type PalletId = CommunitiesPalletId; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = CommunityBenchmarkHelper; } impl Config for Test { - type RuntimeEvent = RuntimeEvent; // Types to support community creation type CreateCollection = Memberships; + type MakeTank = NonFungibleGasTank; type Tracks = Tracks; type RankedCollective = Collective; + type WeightInfo = WeightInfo; type RegisterOrigin = EnsureRootWithSuccess; + // Types to support memberships creation type CreateMembershipsOrigin = EnsureRoot; - type MembershipId = MembershipId; - type MembershipsManagerCollectionId = MembershipsManagerCollectionId; type MembershipsManagerOwner = RootAccount; - type CreateMemberships = Memberships; - type MakeTank = NonFungibleGasTank; + type ItemConfig = pallet_nfts::ItemConfig; - type WeightInfo = WeightInfo; + type CreateMemberships = Memberships; } pub fn new_test_ext() -> TestExternalities { diff --git a/pallets/communities/.gitignore b/pallets/communities/.gitignore deleted file mode 100644 index ffa3bbd20..000000000 --- a/pallets/communities/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Cargo.lock \ No newline at end of file diff --git a/pallets/communities/Cargo.toml b/pallets/communities/Cargo.toml deleted file mode 100644 index 17b4f138d..000000000 --- a/pallets/communities/Cargo.toml +++ /dev/null @@ -1,98 +0,0 @@ -[package] -authors.workspace = true -description = "This pallet enables the creation of communities that are soverign entities with diverse forms of governance. In simpler terms, it can be considered a DAO Factory." -edition.workspace = true -license.workspace = true -homepage.workspace = true -name = "pallet-communities" -repository.workspace = true -version = "0.1.0" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -frame-benchmarking = { workspace = true, optional = true } -frame-support.workspace = true -frame-system.workspace = true -fc-traits-memberships.workspace = true - -log.workspace = true - -parity-scale-codec = { workspace = true, features = ["derive"] } -scale-info = { workspace = true, features = ["derive"] } - -sp-io = { workspace = true, optional = true } -sp-runtime.workspace = true -sp-std.workspace = true -xcm = { workspace = true, optional = true } - -[dev-dependencies] -sp-core.workspace = true - -pallet-assets.workspace = true -pallet-assets-freezer.workspace = true -pallet-balances.workspace = true -pallet-nfts.workspace = true -pallet-preimage.workspace = true -pallet-referenda.workspace = true -pallet-referenda-tracks.workspace = true -pallet-scheduler.workspace = true -virto-common = { workspace = true, default-features = false, features = [ - "runtime", -] } - -[features] -default = ["std", "xcm"] -std = [ - "frame-benchmarking?/std", - "frame-support/std", - "frame-system/std", - "fc-traits-memberships/std", - "log/std", - "pallet-assets/std", - "pallet-assets-freezer/std", - "pallet-balances/std", - "pallet-nfts/std", - "pallet-preimage/std", - "pallet-referenda/std", - "pallet-referenda-tracks/std", - "pallet-scheduler/std", - "parity-scale-codec/std", - "scale-info/std", - "sp-core/std", - "dep:sp-io", - "sp-io?/std", - "sp-runtime/std", - "sp-std/std", - "virto-common/std", - "xcm?/std", -] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-assets-freezer/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-nfts/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-referenda-tracks/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "dep:sp-io", - "sp-runtime/runtime-benchmarks", -] -try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "pallet-assets/try-runtime", - "pallet-assets-freezer/try-runtime", - "pallet-balances/try-runtime", - "pallet-nfts/try-runtime", - "pallet-preimage/try-runtime", - "pallet-referenda/try-runtime", - "pallet-referenda-tracks/try-runtime", - "pallet-scheduler/try-runtime", - "sp-runtime/try-runtime", -] diff --git a/pallets/communities/README.md b/pallets/communities/README.md deleted file mode 100644 index 2c337c883..000000000 --- a/pallets/communities/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Communities Pallet - -This pallet enables people to form dynamic collectives refered to as -communities. In simpler terms, it can be considered a DAO Factory. - -- [`Call`] -- [`Config`] - -## Overview - -The Communities pallet provides functionality for managing communities, -facilitating its participants to have governance over the community entity -(and its associated account) which can interect with other systems: - -- Community registration and removal. -- Enrolling/removing members from a community. -- Promoting/demoting members within the community. -- Voting on proposals to enable community governance. - -## Terminology - -- **Community:** An entity comprised of _members_ โ€”each one defined by their - [`AccountId`][1]โ€” with a given _description_ who can vote on _proposals_ - and actively take decisions on behalf of it. Communities are given a - _treasury account_ they can use to hold assets. -- **Community Description:** A set of metadata used to identify a community - distinctively. Typically, a name, a description and a URL. -- **Community Status:** A community can be either `active` or `blocked`. -- **Member:** An [`AccountId`][1] registered into the community as such. Can - have a rank within it and vote in the community's polls. -- **Member Rank:** Members could have a rank within the community. This can - determine a voting weight depending on the community's voting mechanism. -- **Proposal:** A poll that executes a [call][2] dispatch if approved when - it's closed. -- **Community Account:** A keyless [`AccountId`][1] generated on behalf of - the community. Like any regular account can hold balances. It can transfer - funds via a privileged call executed by the community _admin_ or a call - dispatched from a proposal. -- **Decision Method:** Can be either rank weighed, member-counted, or - asset-weighed and determines how the votes of proposals will be tallied. - -## Lifecycle - -```ignore -[ ] --> [Pending] --> [Active] --> [Blocked] -create set_metadata set_metadata unblock - block - add_member - remove_member - promote - demote - set_voting_mechanism -``` - -## Implementations - -> TODO: Define which traits we are defining/implementing. - -## Interface - -### Permissionless Functions - -- [`apply_for`][c00]: Registers an appliation as a new community, taking an - [existential deposit][3] used to create the community account. - -### Permissioned Functions - -Calling these functions requires being a member of the community. - -- [`add_member`][c02]: Enroll an account as a community member. In theory, - any community member should be able to add a member. However, this can be - changed to ensure it is a privileged function. -- `vote`: Adds a vote into a community proposal. - -### Privileged Functions - -These functions can be called either by the community _admin_ or -dispatched through an approved proposal. ! - -- [`remove_member`][c03]: Removes an account as a community member. While - enrolling a member into the community can be an action taken by any - member, the decision to remove a member should not be taken arbitrarily by - any community member. Also, it shouldn't be possible to arbitrarily remove - the community admin, as some privileged calls would be impossible execute - thereafter. -- `promote`: Increases the rank of a member in the community. -- `demote`: Decreases the rank of a member in the community. -- `set_decision_method`: Means for a community to make decisions. - -### Public Functions - -- [`community`][g00]: Stores the basic information of the community. If a - value exists for a specified [`ComumunityId`][t00], this means a community - exists. -- [`metadata`][g01]: Stores the metadata regarding a community. - - -[1]: `frame_system::Config::AccountId` -[2]: https://docs.substrate.io/reference/glossary/#call -[3]: https://docs.substrate.io/reference/glossary/#existential-deposit - -[t00]: `Config::CommunityId` -[c00]: `crate::Pallet::create` -[c02]: `crate::Pallet::add_member` -[c03]: `crate::Pallet::remove_member` - -[g00]: `crate::Pallet::community` -[g01]: `crate::Pallet::metadata` diff --git a/pallets/communities/src/benchmarking.rs b/pallets/communities/src/benchmarking.rs deleted file mode 100644 index 3bdff2b0d..000000000 --- a/pallets/communities/src/benchmarking.rs +++ /dev/null @@ -1,456 +0,0 @@ -//! Benchmarking setup for pallet-communities -use super::*; - -use self::{ - types::{ - AccountIdOf, AssetIdOf, CommunityIdOf, DecisionMethodFor, MembershipIdOf, NativeBalanceOf, PalletsOriginOf, - PollIndexOf, RuntimeCallFor, Vote, - }, - CommunityDecisionMethod, DecisionMethod, Event, FreezeReason, Pallet as Communities, -}; -use fc_traits_memberships::{Inspect, Rank}; -use frame_benchmarking::v2::*; -use frame_support::traits::{ - fungible::{InspectFreeze, Mutate}, - fungibles::Mutate as FunsMutate, - OriginTrait, -}; -use frame_system::{ - pallet_prelude::{BlockNumberFor, OriginFor}, - RawOrigin, -}; -use sp_runtime::traits::{Hash, StaticLookup}; -use sp_std::{boxed::Box, vec, vec::Vec}; - -type RuntimeEventFor = ::RuntimeEvent; - -fn assert_has_event(generic_event: RuntimeEventFor) { - frame_system::Pallet::::assert_has_event(generic_event.into()); -} - -fn setup_account(name: &'static str, index: u32, seed: u32) -> Result, BenchmarkError> { - let who = frame_benchmarking::account(name, index, seed); - - let initial_balance: NativeBalanceOf = 1_000_000_000_000_000u128 - .try_into() - .map_err(|_| BenchmarkError::Stop("could not mint balance for a new account"))?; - - T::Balances::mint_into(&who, initial_balance)?; - - Ok(who) -} - -fn setup_accounts() -> Result>, BenchmarkError> { - let size = T::BenchmarkHelper::community_desired_size(); - let mut accounts = vec![]; - - for i in 0..size { - let who = setup_account::("community_benchmarking", i, 0)?; - accounts.push(who); - } - - Ok(accounts) -} - -fn community_params( - maybe_decision_method: Option>, -) -> (CommunityIdOf, DecisionMethodFor, OriginFor, PalletsOriginOf) -where - OriginFor: From>, -{ - let community_id = T::BenchmarkHelper::community_id(); - - let decision_method = maybe_decision_method.unwrap_or(DecisionMethod::Rank); - let admin_origin: OriginFor = Origin::::new(community_id).into(); - let admin_origin_caller: PalletsOriginOf = admin_origin.clone().into_caller(); - - (community_id, decision_method, admin_origin, admin_origin_caller) -} - -/// Creates a community, setting a [DecisionMethod], returning -/// its ID as well as the caller origin, and origin caller. -fn create_community( - origin: OriginFor, - maybe_decision_method: Option>, -) -> Result<(CommunityIdOf, OriginFor), BenchmarkError> -where - OriginFor: From>, -{ - T::BenchmarkHelper::initialize_memberships_collection()?; - let (community_id, decision_method, admin_origin, admin_origin_caller) = - community_params::(maybe_decision_method); - - Pallet::::create(origin.clone(), admin_origin_caller, community_id)?; - Pallet::::set_decision_method(admin_origin.clone(), community_id, decision_method)?; - - Ok((community_id, admin_origin)) -} - -type Member = (AccountIdOf, MembershipIdOf); - -/// Initializes the memberships of a community built for benchmarking -/// purposes. -/// -/// Then, returns a list of tuples, each one containing a member's -/// [AccountId] and their corresponding -fn setup_members(origin: OriginFor, community_id: CommunityIdOf) -> Result>, BenchmarkError> -where - T: Config, - T::MembershipId: From, -{ - let members_with_memberships = setup_accounts::()? - .into_iter() - .enumerate() - .map(|(i, account_id)| (account_id, MembershipIdOf::::from(i as u32))); - - for (who, membership_id) in members_with_memberships.clone() { - T::BenchmarkHelper::issue_membership(community_id, membership_id)?; - - let who = T::Lookup::unlookup(who.clone()); - Pallet::::add_member(origin.clone(), who.clone())?; - Pallet::::promote(origin.clone(), membership_id)?; - } - - Ok(members_with_memberships.collect()) -} - -fn prepare_track_and_prepare_poll( - track_origin: PalletsOriginOf, - submitter: AccountIdOf, -) -> Result, BenchmarkError> -where - RuntimeCallFor: From>, -{ - T::BenchmarkHelper::prepare_track(track_origin.clone())?; - - let new_member = T::Lookup::unlookup(frame_benchmarking::account("community_benchmarking", 0, 0)); - T::BenchmarkHelper::prepare_poll( - RawOrigin::Signed(submitter).into(), - track_origin.clone(), - crate::Call::::add_member { who: new_member }.into(), - ) -} - -#[benchmarks( - where - OriginFor: From> + From>, - RuntimeEventFor: From>, - AssetBalanceOf: From, - AssetIdOf: From, - MembershipIdOf: From, - BlockNumberFor: From -)] -mod benchmarks { - use super::*; - - #[benchmark] - fn create() { - // setup code - let (id, _, _, origin) = community_params::(None); - - #[extrinsic_call] - _(RawOrigin::Root, origin.clone(), id); - - // verification code - assert_has_event::(Event::CommunityCreated { id, origin }.into()); - } - - #[benchmark] - fn set_admin_origin() -> Result<(), BenchmarkError> { - // setup code - let (id, _, _, community_origin) = community_params::(None); - - let community_account = Communities::::community_account(&id); - let signed_origin: ::RuntimeOrigin = RawOrigin::Signed(community_account.clone()).into(); - let signed_origin_caller: PalletsOriginOf = signed_origin.into_caller(); - - Communities::::create(RawOrigin::Root.into(), signed_origin_caller, id)?; - - #[extrinsic_call] - _(RawOrigin::Signed(community_account), community_origin.clone()); - - // verification code - assert_eq!(CommunityIdFor::::get(community_origin.clone()), Some(id)); - assert_has_event::( - Event::AdminOriginSet { - id, - origin: community_origin, - } - .into(), - ); - - Ok(()) - } - - #[benchmark] - fn set_decision_method() -> Result<(), BenchmarkError> { - // setup code - let (id, decision_method, _, admin_origin) = community_params::(None); - Communities::::create(RawOrigin::Root.into(), admin_origin.clone(), id)?; - CommunityDecisionMethod::::set(id, decision_method); - - #[extrinsic_call] - _( - admin_origin, - id, - DecisionMethod::CommunityAsset(T::BenchmarkHelper::community_asset_id(), 10u64.into()), - ); - - // verification code - assert_has_event::(Event::DecisionMethodSet { id }.into()); - - Ok(()) - } - - #[benchmark] - fn add_member() -> Result<(), BenchmarkError> { - // setup code - let (id, origin) = create_community::(RawOrigin::Root.into(), None)?; - - let who: AccountIdOf = frame_benchmarking::account("community_benchmarking", 0, 0); - let membership_id = MembershipIdOf::::from(0); - - T::BenchmarkHelper::issue_membership(id, membership_id)?; - - #[extrinsic_call] - _(origin.into_caller(), T::Lookup::unlookup(who.clone())); - - // verification code - assert_has_event::( - Event::MemberAdded { - who: who.clone(), - membership_id, - } - .into(), - ); - assert!(T::MemberMgmt::check_membership(&who, &membership_id).is_some()); - - Ok(()) - } - - #[benchmark] - fn remove_member() -> Result<(), BenchmarkError> { - // setup code - let (id, origin): (CommunityIdOf, OriginFor) = create_community::(RawOrigin::Root.into(), None)?; - - let who: AccountIdOf = frame_benchmarking::account("community_benchmarking", 0, 0); - let membership_id = MembershipIdOf::::from(0); - - T::BenchmarkHelper::issue_membership(id, membership_id)?; - - Communities::::add_member(origin.clone(), T::Lookup::unlookup(who.clone()))?; - - #[extrinsic_call] - _(origin.into_caller(), T::Lookup::unlookup(who.clone()), membership_id); - - // verification code - assert_has_event::( - Event::MemberRemoved { - who: who.clone(), - membership_id, - } - .into(), - ); - assert!(T::MemberMgmt::check_membership(&who, &membership_id).is_none()); - - Ok(()) - } - - #[benchmark] - fn promote() -> Result<(), BenchmarkError> { - // setup code - let (id, origin): (CommunityIdOf, OriginFor) = create_community::(RawOrigin::Root.into(), None)?; - - let who: AccountIdOf = frame_benchmarking::account("community_benchmarking", 0, 0); - let membership_id = MembershipIdOf::::from(0); - - T::BenchmarkHelper::issue_membership(id, membership_id)?; - - Communities::::add_member(origin.clone(), T::Lookup::unlookup(who.clone()))?; - - #[extrinsic_call] - _(origin.into_caller(), membership_id); - - // verification code - let (_, m) = T::MemberMgmt::user_memberships(&who, Some(id)) - .next() - .ok_or::(Error::::NotAMember.into())?; - let rank = T::MemberMgmt::rank_of(&id, &m).expect("has rank"); - - assert_has_event::(Event::MembershipRankUpdated { membership_id, rank }.into()); - - assert_eq!(Communities::::member_rank(&id, &membership_id), rank); - - Ok(()) - } - - #[benchmark] - fn demote() -> Result<(), BenchmarkError> { - // setup code - let (id, origin): (CommunityIdOf, OriginFor) = create_community::(RawOrigin::Root.into(), None)?; - - let who: AccountIdOf = frame_benchmarking::account("community_benchmarking", 0, 0); - let membership_id = MembershipIdOf::::from(0); - - T::BenchmarkHelper::issue_membership(id, membership_id)?; - - Communities::::add_member(origin.clone(), T::Lookup::unlookup(who.clone()))?; - - Communities::::promote(origin.clone(), membership_id)?; - - #[extrinsic_call] - _(origin.into_caller(), membership_id); - - // verification code - assert_eq!(Communities::::member_rank(&id, &membership_id), 0.into()); - - Ok(()) - } - - #[benchmark] - fn vote() -> Result<(), BenchmarkError> { - // setup code - let (id, origin) = create_community::( - RawOrigin::Root.into(), - Some(DecisionMethodFor::::CommunityAsset(1u32.into(), 1u64.into())), - )?; - let members = setup_members::(origin.clone(), id)?; - - let (who, membership_id) = members - .first() - .expect("desired size of community to be equal or greather than 1") - .clone(); - - T::Assets::mint_into(1u32.into(), &who, 4u64.into())?; - - prepare_track_and_prepare_poll::(origin.into_caller(), who.clone())?; - - Communities::::vote( - RawOrigin::Signed(who.clone()).into(), - membership_id, - 0u32, - Vote::AssetBalance(true, 1u32.into(), 1u64.into()), - )?; - - #[extrinsic_call] - _( - RawOrigin::Signed(who.clone()), - membership_id, - 0u32, - Vote::AssetBalance(true, 1u32.into(), 2u64.into()), - ); - - // verification code - assert_has_event::( - Event::VoteCasted { - who: who.clone(), - poll_index: 0u32, - vote: Vote::AssetBalance(true, 1u32.into(), 2u32.into()), - } - .into(), - ); - - Ok(()) - } - - #[benchmark] - fn remove_vote() -> Result<(), BenchmarkError> { - // setup code - let (id, origin) = create_community::(RawOrigin::Root.into(), None)?; - let members = setup_members::(origin.clone(), id)?; - - let (who, membership_id) = members - .first() - .expect("desired size of community to be equal or greather than 1") - .clone(); - - prepare_track_and_prepare_poll::(origin.into_caller(), who.clone())?; - - Communities::::vote( - RawOrigin::Signed(who.clone()).into(), - membership_id, - 0u32, - Vote::Standard(true), - )?; - - #[extrinsic_call] - _(RawOrigin::Signed(who.clone()), membership_id, 0u32); - - // verification code - assert_has_event::( - Event::VoteRemoved { - who: who.clone(), - poll_index: 0u32, - } - .into(), - ); - - Ok(()) - } - - #[benchmark] - fn unlock() -> Result<(), BenchmarkError> { - // setup code - let (id, origin) = create_community::(RawOrigin::Root.into(), Some(DecisionMethod::NativeToken))?; - let members = setup_members::(origin.clone(), id)?; - - let (who, membership_id) = members - .first() - .expect("desired size of community to be equal or greather than 1") - .clone(); - - let index = prepare_track_and_prepare_poll::(origin.into_caller(), who.clone())?; - - Communities::::vote( - RawOrigin::Signed(who.clone()).into(), - membership_id, - 0u32, - Vote::NativeBalance(true, 1u32.into()), - )?; - - assert_eq!( - T::Balances::balance_frozen(&FreezeReason::VoteCasted.into(), &who), - 1u32.into() - ); - - T::BenchmarkHelper::finish_poll(index)?; - - #[extrinsic_call] - _(RawOrigin::Signed(who.clone()), 0u32); - - // verification code - assert_eq!( - T::Balances::balance_frozen(&FreezeReason::VoteCasted.into(), &who), - 0u32.into() - ); - - Ok(()) - } - - #[benchmark] - fn dispatch_as_account() -> Result<(), BenchmarkError> { - // setup code - let (id, origin) = create_community::(RawOrigin::Root.into(), Some(DecisionMethod::NativeToken))?; - let remark = b"Hello, world".to_vec(); - - #[extrinsic_call] - _( - origin.into_caller(), - Box::new(frame_system::Call::::remark_with_event { remark: remark.clone() }.into()), - ); - - // verification code - let sender = Communities::::community_account(&id); - let hash = ::Hashing::hash(&remark); - - assert_has_event::(frame_system::Event::::Remarked { sender, hash }.into()); - - Ok(()) - } - - impl_benchmark_test_suite!( - Communities, - sp_io::TestExternalities::new(Default::default()), - crate::mock::Test - ); -} diff --git a/pallets/communities/src/functions.rs b/pallets/communities/src/functions.rs deleted file mode 100644 index 6241feb27..000000000 --- a/pallets/communities/src/functions.rs +++ /dev/null @@ -1,233 +0,0 @@ -use super::*; -use fc_traits_memberships::{GenericRank, Inspect, Rank}; -use frame_support::{ - dispatch::PostDispatchInfo, - fail, - pallet_prelude::*, - traits::{ - fungible::{InspectFreeze, Mutate, MutateFreeze}, - fungibles::{InspectFreeze as _, MutateFreeze as _}, - tokens::Fortitude::Polite, - Polling, - }, -}; -use sp_runtime::{ - traits::{AccountIdConversion, Dispatchable}, - DispatchResultWithInfo, -}; -use sp_std::vec::Vec; - -impl Pallet { - #[inline] - pub fn community_account(community_id: &T::CommunityId) -> AccountIdOf { - T::PalletId::get().into_sub_account_truncating(community_id) - } - - pub fn community_exists(community_id: &T::CommunityId) -> bool { - Info::::contains_key(community_id) - } - - pub fn is_member(community_id: &T::CommunityId, who: &AccountIdOf) -> bool { - T::MemberMgmt::is_member_of(community_id, who) - } - - pub fn member_rank(community_id: &T::CommunityId, m: &MembershipIdOf) -> GenericRank { - T::MemberMgmt::rank_of(community_id, m).unwrap_or_default() - } - - pub fn get_memberships(community_id: T::CommunityId, who: &AccountIdOf) -> Vec> { - T::MemberMgmt::user_memberships(who, Some(community_id)) - .map(|(_, m)| m) - .collect::>() - } - - pub fn force_state(community_id: &CommunityIdOf, state: CommunityState) { - Info::::mutate(community_id, |c| c.as_mut().map(|c| c.state = state)); - } - - /// Stores an initial info about the community - /// Sets the caller as the community admin, the initial community state - /// to its default value(awaiting) - pub fn register( - admin: &PalletsOriginOf, - community_id: &CommunityIdOf, - maybe_deposit: Option<(NativeBalanceOf, AccountIdOf, AccountIdOf)>, - ) -> DispatchResult { - ensure!( - !Self::community_exists(community_id), - Error::::CommunityAlreadyExists - ); - ensure!(!CommunityIdFor::::contains_key(admin), Error::::AlreadyAdmin); - - if let Some((deposit, depositor, depositee)) = maybe_deposit { - T::Balances::transfer( - &depositor, - &depositee, - deposit, - frame_support::traits::tokens::Preservation::Preserve, - )?; - } - - CommunityIdFor::::insert(admin, community_id); - Info::::insert(community_id, CommunityInfo::default()); - frame_system::Pallet::::inc_providers(&Self::community_account(community_id)); - - Ok(()) - } - - pub(crate) fn try_vote( - community_id: &CommunityIdOf, - decision_method: &DecisionMethodFor, - who: &AccountIdOf, - membership_id: &MembershipIdOf, - poll_index: PollIndexOf, - vote: &VoteOf, - ) -> DispatchResult { - T::Polls::try_access_poll(poll_index, |poll_status| { - let (tally, class) = poll_status.ensure_ongoing().ok_or(Error::::NotOngoing)?; - ensure!(community_id == &class, Error::::InvalidTrack); - - let vote_multiplier = match CommunityDecisionMethod::::get(community_id) { - DecisionMethod::Rank => T::MemberMgmt::rank_of(community_id, membership_id) - .unwrap_or_default() - .into(), - _ => 1, - }; - - let say = *match (vote, decision_method) { - (Vote::AssetBalance(say, asset, amount), DecisionMethod::CommunityAsset(a, min)) if asset == a => { - ensure!(amount >= min, Error::::VoteBelowMinimum); - say - } - (Vote::NativeBalance(say, ..), DecisionMethod::NativeToken) - | (Vote::Standard(say), DecisionMethod::Membership | DecisionMethod::Rank) => say, - _ => fail!(Error::::InvalidVoteType), - }; - - let vote_weight = VoteWeight::from(vote); - tally.add_vote(say, vote_multiplier * vote_weight, vote_weight); - - CommunityVotes::::insert(poll_index, membership_id, (vote, who)); - Self::update_locks(who, poll_index, vote, LockUpdateType::Add) - }) - } - - pub(crate) fn try_remove_vote( - community_id: &CommunityIdOf, - decision_method: &DecisionMethodFor, - membership_id: &MembershipIdOf, - poll_index: PollIndexOf, - ) -> DispatchResult { - T::Polls::try_access_poll(poll_index, |poll_status| { - let (tally, class) = poll_status.ensure_ongoing().ok_or(Error::::NotOngoing)?; - ensure!(community_id == &class, Error::::InvalidTrack); - - let (vote, voter) = CommunityVotes::::get(poll_index, membership_id).ok_or(Error::::NoVoteCasted)?; - let vote_multiplier = match decision_method { - DecisionMethod::Rank => T::MemberMgmt::rank_of(community_id, membership_id) - .unwrap_or_default() - .into(), - _ => 1, - }; - - let vote_weight = VoteWeight::from(&vote); - tally.remove_vote(vote.say(), vote_multiplier * vote_weight, vote_weight); - - CommunityVotes::::remove(poll_index, membership_id); - Self::update_locks(&voter, poll_index, &vote, LockUpdateType::Remove) - }) - } - - pub(crate) fn update_locks( - who: &AccountIdOf, - poll_index: PollIndexOf, - vote: &VoteOf, - update_type: LockUpdateType, - ) -> DispatchResult { - use sp_runtime::traits::Zero; - - let reason = FreezeReason::VoteCasted.into(); - - match vote.clone() { - Vote::AssetBalance(..) | Vote::NativeBalance(..) => match update_type { - LockUpdateType::Add => CommunityVoteLocks::::insert(who, poll_index, vote.clone()), - LockUpdateType::Remove => CommunityVoteLocks::::remove(who, poll_index), - }, - _ => (), - } - - match (update_type, vote) { - (LockUpdateType::Add, Vote::AssetBalance(_, asset_id, amount)) => { - let amount = T::AssetsFreezer::balance_frozen(asset_id.clone(), &reason, who).max(*amount); - T::AssetsFreezer::set_frozen(asset_id.clone(), &reason, who, amount, Polite)?; - } - (LockUpdateType::Add, Vote::NativeBalance(_, amount)) => { - let amount = T::Balances::balance_frozen(&reason, who).max(*amount); - T::Balances::set_frozen(&reason, who, amount, Polite)?; - } - (LockUpdateType::Remove, Vote::AssetBalance(_, asset_id, _)) => { - let mut amount_to_freeze: AssetBalanceOf = Zero::zero(); - - for locked_vote in CommunityVoteLocks::::iter_prefix_values(who) { - if let Vote::AssetBalance(_, ref id, amount) = locked_vote { - if id == asset_id { - amount_to_freeze = amount_to_freeze.max(amount) - } - } - } - - T::AssetsFreezer::set_frozen(asset_id.clone(), &reason, who, amount_to_freeze, Polite)?; - } - (LockUpdateType::Remove, Vote::NativeBalance(_, _)) => { - let mut amount_to_freeze: NativeBalanceOf = Zero::zero(); - - for locked_vote in CommunityVoteLocks::::iter_prefix_values(who) { - if let Vote::NativeBalance(_, amount) = locked_vote { - amount_to_freeze = amount_to_freeze.max(amount) - } - } - - T::Balances::set_frozen( - &FreezeReason::VoteCasted.into(), - who, - amount_to_freeze, - frame_support::traits::tokens::Fortitude::Polite, - )?; - } - _ => (), - } - - Ok(()) - } - - pub(crate) fn do_dispatch_as_community_account( - community_id: &CommunityIdOf, - call: RuntimeCallFor, - ) -> DispatchResultWithInfo { - let community_account = Self::community_account(community_id); - let signer = frame_system::RawOrigin::Signed(community_account); - - let post = call.dispatch(signer.into()).map_err(|e| e.error)?; - Ok(post) - } -} - -impl Tally { - pub(self) fn add_vote(&mut self, say_aye: bool, multiplied_weight: VoteWeight, weight: VoteWeight) { - if say_aye { - self.ayes = self.ayes.saturating_add(multiplied_weight); - self.bare_ayes = self.bare_ayes.saturating_add(weight); - } else { - self.nays = self.nays.saturating_add(multiplied_weight); - } - } - - pub(self) fn remove_vote(&mut self, say_aye: bool, multiplied_weight: VoteWeight, weight: VoteWeight) { - if say_aye { - self.ayes = self.ayes.saturating_sub(multiplied_weight); - self.bare_ayes = self.bare_ayes.saturating_sub(weight); - } else { - self.nays = self.nays.saturating_sub(multiplied_weight); - } - } -} diff --git a/pallets/communities/src/impls.rs b/pallets/communities/src/impls.rs deleted file mode 100644 index eea66f15a..000000000 --- a/pallets/communities/src/impls.rs +++ /dev/null @@ -1,62 +0,0 @@ -use frame_support::traits::VoteTally; -use sp_runtime::Perbill; - -use crate::{ - types::{CommunityIdOf, Tally, VoteWeight}, - Config, -}; - -impl VoteTally> for Tally { - fn new(_cid: CommunityIdOf) -> Self { - Self::default() - } - - fn ayes(&self, _cid: CommunityIdOf) -> VoteWeight { - self.ayes - } - - fn support(&self, community_id: CommunityIdOf) -> sp_runtime::Perbill { - Perbill::from_rational(self.bare_ayes, Self::max_support(community_id)) - } - - fn approval(&self, _cid: CommunityIdOf) -> sp_runtime::Perbill { - Perbill::from_rational(self.ayes, 1.max(self.ayes + self.nays)) - } - - #[cfg(feature = "runtime-benchmarks")] - fn unanimity(community_id: CommunityIdOf) -> Self { - Self { - ayes: Self::max_support(community_id), - bare_ayes: Self::max_support(community_id), - nays: 0, - ..Default::default() - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn rejection(community_id: CommunityIdOf) -> Self { - Self { - ayes: 0, - bare_ayes: 0, - nays: Self::max_support(community_id), - ..Default::default() - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn from_requirements(support: Perbill, approval: Perbill, community_id: CommunityIdOf) -> Self { - let approval_weight = approval * Self::max_support(community_id); - let rejection_weight = (Perbill::from_percent(100) - approval) * Self::max_support(community_id); - let support_weight = support * Self::max_support(community_id); - - Self { - ayes: approval_weight, - nays: rejection_weight, - bare_ayes: support_weight, - ..Default::default() - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn setup(_community_id: CommunityIdOf, _granularity: Perbill) {} -} diff --git a/pallets/communities/src/lib.rs b/pallets/communities/src/lib.rs deleted file mode 100644 index 2e92945b1..000000000 --- a/pallets/communities/src/lib.rs +++ /dev/null @@ -1,590 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] -//! # Communities Pallet -//! -//! This pallet enables people to form dynamic collectives refered to as -//! communities. In simpler terms, it can be considered a DAO Factory. -//! -//! - [`Call`] -//! - [`Config`] -//! -//! ## Overview -//! -//! The Communities pallet provides functionality for managing communities, -//! facilitating its participants to have governance over the community entity -//! (and its associated account) which can interect with other systems: -//! -//! - Community registration and removal. -//! - Enrolling/removing members from a community. -//! - Promoting/demoting members within the community. -//! - Voting on proposals to enable community governance. -//! -//! ## Terminology -//! -//! - **Community:** An entity comprised of _members_ โ€”each one defined by their -//! [`AccountId`][1]โ€” with a given _description_ who can vote on _proposals_ -//! and actively take decisions on behalf of it. Communities are given a -//! _treasury account_ they can use to hold assets. -//! - **Community Description:** A set of metadata used to identify a community -//! distinctively. Typically, a name, a description and a URL. -//! - **Community Status:** A community can be either `active` or `blocked`. -//! - **Member:** An [`AccountId`][1] registered into the community as such. Can -//! have a rank within it and vote in the community's polls. -//! - **Member Rank:** Members could have a rank within the community. This can -//! determine a voting weight depending on the community's voting mechanism. -//! - **Proposal:** A poll that executes a [call][2] dispatch if approved when -//! it's closed. -//! - **Community Account:** A keyless [`AccountId`][1] generated on behalf of -//! the community. Like any regular account can hold balances. It can transfer -//! funds via a privileged call executed by the community _admin_ or a call -//! dispatched from a proposal. -//! - **Decision Method:** Can be either rank weighed, member-counted, or -//! asset-weighed and determines how the votes of proposals will be tallied. -//! -//! ## Lifecycle -//! -//! ```ignore -//! [ ] --> [Pending] --> [Active] --> [Blocked] -//! create set_metadata set_metadata unblock -//! block -//! add_member -//! remove_member -//! promote -//! demote -//! set_voting_mechanism -//! ``` -//! -//! ## Implementations -//! -//! > TODO: Define which traits we are defining/implementing. -//! -//! ## Interface -//! -//! ### Permissionless Functions -//! -//! - [`apply_for`][c00]: Registers an appliation as a new community, taking an -//! [existential deposit][3] used to create the community account. -//! -//! ### Permissioned Functions -//! -//! Calling these functions requires being a member of the community. -//! -//! - [`add_member`][c02]: Enroll an account as a community member. In theory, -//! any community member should be able to add a member. However, this can be -//! changed to ensure it is a privileged function. -//! - `vote`: Adds a vote into a community proposal. -//! -//! ### Privileged Functions -//! -//! These functions can be called either by the community _admin_ or -//! dispatched through an approved proposal. ! -//! - [`remove_member`][c03]: Removes an account as a community member. While -//! enrolling a member into the community can be an action taken by any -//! member, the decision to remove a member should not be taken arbitrarily by -//! any community member. Also, it shouldn't be possible to arbitrarily remove -//! the community admin, as some privileged calls would be impossible execute -//! thereafter. -//! - `promote`: Increases the rank of a member in the community. -//! - `demote`: Decreases the rank of a member in the community. -//! - `set_decision_method`: Means for a community to make decisions. -//! -//! ### Public Functions -//! -//! - [`community`][g00]: Stores the basic information of the community. If a -//! value exists for a specified [`ComumunityId`][t00], this means a community -//! exists. -//! - [`metadata`][g01]: Stores the metadata regarding a community. -//! -//! -//! [1]: `frame_system::Config::AccountId` -//! [2]: https://docs.substrate.io/reference/glossary/#call -//! [3]: https://docs.substrate.io/reference/glossary/#existential-deposit -//! -//! [t00]: `Config::CommunityId` -//! [t01]: `types::CommunityMetadata` -//! -//! [c00]: `crate::Pallet::create` -//! [c01]: `crate::Pallet::set_metadata` -//! [c02]: `crate::Pallet::add_member` -//! [c03]: `crate::Pallet::remove_member` -//! -//! [g00]: `crate::Pallet::community` -//! [g01]: `crate::Pallet::metadata` -//! [g02]: `crate::Pallet::membership` -//! [g03]: `crate::Pallet::members_count` -pub use pallet::*; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; -#[cfg(feature = "runtime-benchmarks")] -pub use types::BenchmarkHelper; - -#[cfg(test)] -mod mock; -#[cfg(test)] -mod tests; - -mod functions; -mod impls; - -pub mod types; -pub use types::*; - -pub mod weights; -pub use weights::*; - -pub mod origin; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use core::num::NonZeroU8; - use fc_traits_memberships::{self as membership, Inspect, Manager, Rank}; - use frame_support::{ - dispatch::{DispatchResultWithPostInfo, GetDispatchInfo, PostDispatchInfo}, - pallet_prelude::*, - traits::{fungible, fungibles, EnsureOrigin, IsSubType, OriginTrait, Polling}, - Blake2_128Concat, Parameter, - }; - use frame_system::pallet_prelude::{ensure_signed, BlockNumberFor, OriginFor}; - use sp_runtime::traits::AccountIdConversion; - use sp_runtime::traits::{Dispatchable, StaticLookup}; - use sp_std::prelude::Box; - - const ONE: NonZeroU8 = NonZeroU8::MIN; - - #[pallet::pallet] - pub struct Pallet(_); - - /// Configure the pallet by specifying the parameters and types on which it - /// depends. - #[pallet::config] - pub trait Config: frame_system::Config { - /// This type represents an unique ID for the community - type CommunityId: Parameter + MaxEncodedLen + Copy; - - /// This type represents an unique ID to identify a membership within a - /// community - type MembershipId: Parameter + MaxEncodedLen + Copy; - - type ItemConfig: Default; - - /// Means to manage memberships of a community - type MemberMgmt: membership::Inspect, Membership = MembershipIdOf> - + membership::Manager< - Self::AccountId, - Self::ItemConfig, - Group = CommunityIdOf, - Membership = MembershipIdOf, - > + membership::Rank< - Self::AccountId, - Self::ItemConfig, - Group = CommunityIdOf, - Membership = MembershipIdOf, - >; - - type CreateOrigin: EnsureOrigin< - OriginFor, - Success = Option<(NativeBalanceOf, AccountIdOf, AccountIdOf)>, - >; - - /// Origin authorized to administer an active community - type AdminOrigin: EnsureOrigin, Success = Self::CommunityId>; - - /// Origin authorized to manage memeberships of an active community - type MemberMgmtOrigin: EnsureOrigin, Success = Self::CommunityId>; - - type Polls: Polling< - Tally, - Class = CommunityIdOf, - Index = u32, - Votes = VoteWeight, - Moment = BlockNumberFor, - >; - - /// Type represents interactions between fungibles (i.e. assets) - type Assets: fungibles::Inspect> - + fungibles::Mutate - + fungibles::Create; - - /// Type allows for handling fungibles' freezes - type AssetsFreezer: fungibles::Inspect, AssetId = AssetIdOf> - + fungibles::freeze::Inspect> - + fungibles::freeze::Mutate>; - - /// Type represents interactions between fungible tokens (native token) - type Balances: fungible::Inspect - + fungible::Mutate - + fungible::freeze::Inspect - + fungible::freeze::Mutate; - - /// The overarching call type. - type RuntimeCall: Parameter - + Dispatchable, PostInfo = PostDispatchInfo> - + GetDispatchInfo - + From> - + From> - + IsSubType> - + IsType<::RuntimeCall>; - - /// The `RuntimeOrigin` type used by dispatchable calls. - type RuntimeOrigin: Into, RuntimeOriginFor>> - + From> - + From> - + Clone - + OriginTrait, AccountId = Self::AccountId, PalletsOrigin = PalletsOriginOf>; - - /// The overarching freeze reason. - type RuntimeFreezeReason: From; - - /// Because this pallet emits events, it depends on the runtime's - /// definition of an event. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - /// Type representing the weight of this pallet - type WeightInfo: WeightInfo; - - /// The pallet id used for deriving sovereign account IDs. - #[pallet::constant] - type PalletId: Get; - - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper: BenchmarkHelper; - } - - /// The origin of the pallet - #[pallet::origin] - pub type Origin = origin::RawOrigin; - - /// A reason for the pallet communities placing a freeze on funds. - #[pallet::composite_enum] - pub enum FreezeReason { - // A vote has been casted on a poll - VoteCasted, - } - - /// Stores the basic information of the community. If a value exists for a - /// specified [`ComumunityId`][`Config::CommunityId`], this means a - /// community exists. - #[pallet::storage] - pub(super) type Info = StorageMap<_, Blake2_128Concat, CommunityIdOf, CommunityInfo>; - - /// List of origins and how they map to communities - #[pallet::storage] - pub(super) type CommunityIdFor = StorageMap<_, Blake2_128Concat, PalletsOriginOf, CommunityIdOf>; - - /// Stores the decision method for a community - #[pallet::storage] - pub(super) type CommunityDecisionMethod = - StorageMap<_, Blake2_128Concat, CommunityIdOf, DecisionMethodFor, ValueQuery>; - - /// Stores the list of votes for a community. - #[pallet::storage] - pub(super) type CommunityVotes = StorageDoubleMap< - _, - Blake2_128Concat, - PollIndexOf, - Blake2_128Concat, - MembershipIdOf, - (VoteOf, AccountIdOf), - >; - - /// Stores the list of votes for a community. - #[pallet::storage] - pub(super) type CommunityVoteLocks = - StorageDoubleMap<_, Blake2_128Concat, AccountIdOf, Blake2_128Concat, PollIndexOf, VoteOf>; - - // Pallets use events to inform users when important changes are made. - // https://docs.substrate.io/main-docs/build/events-errors/ - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// A [`Commmunity`][`types::Community`] has been created. - CommunityCreated { - id: T::CommunityId, - origin: PalletsOriginOf, - }, - AdminOriginSet { - id: T::CommunityId, - origin: PalletsOriginOf, - }, - DecisionMethodSet { - id: T::CommunityId, - }, - MemberAdded { - who: AccountIdOf, - membership_id: MembershipIdOf, - }, - MemberRemoved { - who: AccountIdOf, - membership_id: MembershipIdOf, - }, - MembershipRankUpdated { - membership_id: MembershipIdOf, - rank: membership::GenericRank, - }, - VoteCasted { - who: AccountIdOf, - poll_index: PollIndexOf, - vote: VoteOf, - }, - VoteRemoved { - who: AccountIdOf, - poll_index: PollIndexOf, - }, - } - - // Errors inform users that something worked or went wrong. - #[pallet::error] - pub enum Error { - /// The community doesn't exist in storage, nor they have members. - CommunityDoesNotExist, - /// A community with the same [`CommunityId`][`Config::CommunityId`] - /// already exists, therefore cannot be applied for. - CommunityAlreadyExists, - /// The community can't introduce new members at the moment - CommunityAtCapacity, - /// The specified [`AccountId`][`frame_system::Config::AccountId`] is - /// not a member of the community - NotAMember, - /// The indicated index corresponds to a poll that is already ongoing - AlreadyOngoing, - /// The indicated index corresponds to a poll that is not ongoing - NotOngoing, - /// The track for the poll voted for does not correspond to the - /// community ID - InvalidTrack, - /// The vote type does not correspond with the community's selected - /// [`DecisionMethod`][`origin::DecisionMethod`] - InvalidVoteType, - /// The signer tried to remove a vote from a poll they haven't - /// casted a vote yet, or they have already removed it from. - NoVoteCasted, - /// The poll - NoLocksInPlace, - /// The origin already controls another community - AlreadyAdmin, - /// The vote is below the minimum requried - VoteBelowMinimum, - } - - // Dispatchable functions allows users to interact with the pallet and invoke - // state changes. These functions materialize as "extrinsics", which are often - // compared to transactions. Dispatchable functions must be annotated with a - // weight and must return a DispatchResult. - #[pallet::call(weight(::WeightInfo))] - impl Pallet { - /// Creates a new community managed by the given origin - #[pallet::call_index(0)] - pub fn create( - origin: OriginFor, - admin_origin: PalletsOriginOf, - community_id: T::CommunityId, - ) -> DispatchResult { - let maybe_deposit = T::CreateOrigin::ensure_origin(origin)?; - - Self::register(&admin_origin, &community_id, maybe_deposit)?; - - Self::deposit_event(crate::Event::CommunityCreated { - id: community_id, - origin: admin_origin, - }); - Ok(()) - } - - /// Creates a new community managed by the given origin - #[pallet::call_index(1)] - pub fn set_admin_origin(origin: OriginFor, admin_origin: PalletsOriginOf) -> DispatchResult { - let community_id = T::AdminOrigin::ensure_origin(origin.clone())?; - - ensure!( - CommunityIdFor::::get(origin.clone().caller()) == Some(community_id), - DispatchError::BadOrigin - ); - - CommunityIdFor::::remove(origin.caller()); - CommunityIdFor::::insert(admin_origin.clone(), community_id); - - Self::deposit_event(Event::AdminOriginSet { - id: community_id, - origin: admin_origin, - }); - Ok(()) - } - - // === Memberships management === - - /// Enroll an account as a community member that receives a membership - /// from the available pool of memberships of the community. - #[pallet::call_index(3)] - pub fn add_member(origin: OriginFor, who: AccountIdLookupOf) -> DispatchResult { - let community_id = T::MemberMgmtOrigin::ensure_origin(origin)?; - let who = T::Lookup::lookup(who)?; - - let account = Self::community_account(&community_id); - // assume the community has memberships to give out to the new member - let (_, membership_id) = T::MemberMgmt::user_memberships(&account, None) - .next() - .ok_or(Error::::CommunityAtCapacity)?; - - T::MemberMgmt::assign(&community_id, &membership_id, &who)?; - - Self::deposit_event(Event::MemberAdded { who, membership_id }); - Ok(()) - } - - /// Removes an account as a community member. While - /// enrolling a member into the community can be an action taken by any - /// member, the decision to remove a member should not be taken - /// arbitrarily by any community member. Also, it shouldn't be possible - /// to arbitrarily remove the community admin, as some privileged calls - /// would be impossible to execute thereafter. - #[pallet::call_index(4)] - pub fn remove_member( - origin: OriginFor, - who: AccountIdLookupOf, - membership_id: MembershipIdOf, - ) -> DispatchResult { - let community_id = T::MemberMgmtOrigin::ensure_origin(origin)?; - let who = T::Lookup::lookup(who)?; - - ensure!(T::MemberMgmt::is_member_of(&community_id, &who), Error::::NotAMember); - - T::MemberMgmt::release(&community_id, &membership_id)?; - - Self::deposit_event(Event::MemberRemoved { who, membership_id }); - Ok(()) - } - - /// Increases the rank of a member in the community - #[pallet::call_index(5)] - pub fn promote(origin: OriginFor, membership_id: MembershipIdOf) -> DispatchResult { - let community_id = T::MemberMgmtOrigin::ensure_origin(origin)?; - - let rank = T::MemberMgmt::rank_of(&community_id, &membership_id) - .ok_or(Error::::NotAMember)? - .promote_by(ONE); - T::MemberMgmt::set_rank(&community_id, &membership_id, rank)?; - - Self::deposit_event(Event::MembershipRankUpdated { membership_id, rank }); - Ok(()) - } - - /// Decreases the rank of a member in the community - #[pallet::call_index(6)] - pub fn demote(origin: OriginFor, membership_id: MembershipIdOf) -> DispatchResult { - let community_id = T::MemberMgmtOrigin::ensure_origin(origin)?; - - let rank = T::MemberMgmt::rank_of(&community_id, &membership_id).ok_or(Error::::NotAMember)?; - T::MemberMgmt::set_rank(&community_id, &membership_id, rank.demote_by(ONE))?; - - Self::deposit_event(Event::MembershipRankUpdated { membership_id, rank }); - Ok(()) - } - - // === Governance === - - /// Decide the method used by the community to vote on proposals - #[pallet::call_index(7)] - pub fn set_decision_method( - origin: OriginFor, - community_id: T::CommunityId, - decision_method: DecisionMethodFor, - ) -> DispatchResult { - T::AdminOrigin::ensure_origin(origin)?; - if let DecisionMethod::CommunityAsset(ref asset, min_vote) = decision_method { - // best effort attemt to create the asset if it doesn't exist - let _ = >::create( - asset.clone(), - T::PalletId::get().into_account_truncating(), - false, - min_vote, - ); - } - CommunityDecisionMethod::::set(community_id, decision_method); - Self::deposit_event(Event::DecisionMethodSet { id: community_id }); - Ok(()) - } - - /// Cast a vote on an on-going referendum - #[pallet::call_index(8)] - pub fn vote( - origin: OriginFor, - membership_id: MembershipIdOf, - #[pallet::compact] poll_index: PollIndexOf, - vote: VoteOf, - ) -> DispatchResult { - ensure!(VoteWeight::from(&vote).gt(&0), Error::::VoteBelowMinimum); - let who = ensure_signed(origin)?; - let community_id = T::MemberMgmt::check_membership(&who, &membership_id).ok_or(Error::::NotAMember)?; - let decision_method = CommunityDecisionMethod::::get(community_id); - if CommunityVotes::::contains_key(poll_index, membership_id) { - Self::try_remove_vote(&community_id, &decision_method, &membership_id, poll_index)?; - } - Self::try_vote(&community_id, &decision_method, &who, &membership_id, poll_index, &vote)?; - Self::deposit_event(Event::::VoteCasted { - who: who.clone(), - poll_index, - vote, - }); - Ok(()) - } - - /// Remove any previous vote on a given referendum - #[pallet::call_index(9)] - pub fn remove_vote( - origin: OriginFor, - membership_id: MembershipIdOf, - #[pallet::compact] poll_index: PollIndexOf, - ) -> DispatchResult { - let who = ensure_signed(origin)?; - let community_id = T::MemberMgmt::check_membership(&who, &membership_id).ok_or(Error::::NotAMember)?; - let decision_method = CommunityDecisionMethod::::get(community_id); - Self::try_remove_vote(&community_id, &decision_method, &membership_id, poll_index)?; - Self::deposit_event(Event::::VoteRemoved { - who: who.clone(), - poll_index, - }); - Ok(()) - } - - /// Make previously held or locked funds from a vote available - // if the refereundum has finished - #[pallet::call_index(10)] - pub fn unlock(origin: OriginFor, #[pallet::compact] poll_index: PollIndexOf) -> DispatchResult { - let who = ensure_signed(origin)?; - ensure!(T::Polls::as_ongoing(poll_index).is_none(), Error::::AlreadyOngoing); - let vote = CommunityVoteLocks::::get(&who, poll_index).ok_or(Error::::NoLocksInPlace)?; - Self::update_locks(&who, poll_index, &vote, LockUpdateType::Remove) - } - - /// Dispatch a callable as the community account - #[pallet::call_index(11)] - #[pallet::weight({ - let di = call.get_dispatch_info(); - let weight = T::WeightInfo::dispatch_as_account() - .saturating_add(T::DbWeight::get().reads_writes(1, 1)) - .saturating_add(di.weight); - (weight, di.class) - })] - pub fn dispatch_as_account(origin: OriginFor, call: Box>) -> DispatchResultWithPostInfo { - let community_id = T::MemberMgmtOrigin::ensure_origin(origin)?; - Self::do_dispatch_as_community_account(&community_id, *call) - } - - // /// Dispatch a callable as the community account - // #[pallet::call_index(12)] - // #[pallet::weight({ - // let di = call.get_dispatch_info(); - // let weight = T::WeightInfo::dispatch_as_account() - // .saturating_add(T::DbWeight::get().reads_writes(1, 1)) - // .saturating_add(di.weight); - // (weight, di.class) - // })] - // pub fn dispatch_as_origin(origin: OriginFor, call: Box>) - // -> DispatchResultWithPostInfo { let community_id = - // T::MemberMgmtOrigin::ensure_origin(origin)?; let origin = - // crate::Origin::::new(community_id); let post = - // call.dispatch(origin.into()).map_err(|e| e.error)?; Ok(post) - // } - } -} diff --git a/pallets/communities/src/mock.rs b/pallets/communities/src/mock.rs deleted file mode 100644 index 446f2cea9..000000000 --- a/pallets/communities/src/mock.rs +++ /dev/null @@ -1,632 +0,0 @@ -use fc_traits_memberships::NonFungiblesMemberships; -use frame_support::{ - derive_impl, - dispatch::DispatchResult, - parameter_types, - traits::{ - fungible::HoldConsideration, tokens::nonfungible_v2::ItemOf, AsEnsureOriginWithArg, ConstU32, ConstU64, - EitherOf, EnsureOriginWithArg, EqualPrivilegeOnly, Footprint, VariantCountOf, - }, - weights::{ - constants::{WEIGHT_REF_TIME_PER_NANOS, WEIGHT_REF_TIME_PER_SECOND}, - Weight, - }, - PalletId, -}; -use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; -use pallet_referenda::{TrackIdOf, TrackInfoOf, TracksInfo}; -use sp_io::TestExternalities; -use sp_runtime::{ - traits::{Convert, IdentifyAccount, IdentityLookup, Verify}, - BuildStorage, MultiSignature, Perbill, -}; -pub use virto_common::{CommunityId, MembershipId}; - -use crate::{ - self as pallet_communities, - origin::{EnsureCommunity, EnsureSignedPays}, - types::{Tally, VoteWeight}, - Config, DecisionMethod, -}; - -// Weights constants - -// max block: 0.5s compute with 12s average block time -pub const MAX_BLOCK_REF_TIME: u64 = WEIGHT_REF_TIME_PER_SECOND.saturating_div(2); // https://github.com/paritytech/cumulus/blob/98e68bd54257b4039a5d5b734816f4a1b7c83a9d/parachain-template/runtime/src/lib.rs#L221 -pub const MAX_BLOCK_POV_SIZE: u64 = 5 * 1024 * 1024; // https://github.com/paritytech/polkadot/blob/ba1f65493d91d4ab1787af2fd6fe880f1da90586/primitives/src/v4/mod.rs#L384 -pub const MAX_BLOCK_WEIGHT: Weight = Weight::from_parts(MAX_BLOCK_REF_TIME, MAX_BLOCK_POV_SIZE); - -// max extrinsics: 75% of block -pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/lib.rs#L218 - -// max extrinsic: max total extrinsics less average on_initialize ratio and less -// base extrinsic weight -pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/lib.rs#L214 -pub const BASE_EXTRINSIC: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/weights/extrinsic_weights.rs#L26 - -type Block = frame_system::mocking::MockBlock; -type WeightInfo = (); - -pub type AccountPublic = ::Signer; -pub type AccountId = ::AccountId; -pub type Balance = ::Balance; -pub type AssetId = ::AssetId; - -// Configure a mock runtime to test the pallet. -#[frame_support::runtime] -mod runtime { - #[runtime::runtime] - #[runtime::derive( - RuntimeCall, - RuntimeEvent, - RuntimeError, - RuntimeOrigin, - RuntimeTask, - RuntimeHoldReason, - RuntimeFreezeReason - )] - pub struct Test; - - #[runtime::pallet_index(0)] - pub type System = frame_system; - #[runtime::pallet_index(1)] - pub type Scheduler = pallet_scheduler; - #[runtime::pallet_index(2)] - pub type Preimage = pallet_preimage; - - #[runtime::pallet_index(10)] - pub type Balances = pallet_balances; - #[runtime::pallet_index(11)] - pub type Assets = pallet_assets; - #[runtime::pallet_index(12)] - pub type AssetsFreezer = pallet_assets_freezer; - - #[runtime::pallet_index(21)] - pub type Referenda = pallet_referenda; - #[runtime::pallet_index(31)] - pub type Communities = pallet_communities; - #[runtime::pallet_index(32)] - pub type Tracks = pallet_referenda_tracks; - #[runtime::pallet_index(33)] - pub type Nfts = pallet_nfts; -} - -#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] -impl frame_system::Config for Test { - type Block = Block; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type AccountData = pallet_balances::AccountData; -} - -// Monetary operations -#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] -impl pallet_balances::Config for Test { - type AccountStore = System; - type FreezeIdentifier = RuntimeFreezeReason; - type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxFreezes = VariantCountOf; -} - -#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig as pallet_assets::DefaultConfig)] -impl pallet_assets::Config for Test { - type Balance = Balance; - type Currency = Balances; - type CreateOrigin = AsEnsureOriginWithArg>; - type ForceOrigin = EnsureRoot; - type Freezer = AssetsFreezer; - type RuntimeHoldReason = RuntimeHoldReason; -} - -impl pallet_assets_freezer::Config for Test { - type RuntimeFreezeReason = RuntimeFreezeReason; - type RuntimeEvent = RuntimeEvent; -} - -// Memberships -#[cfg(feature = "runtime-benchmarks")] -pub struct NftsBenchmarksHelper; -#[cfg(feature = "runtime-benchmarks")] -impl pallet_nfts::BenchmarkHelper - for NftsBenchmarksHelper -{ - fn collection(_i: u16) -> CommunityId { - COMMUNITY - } - fn item(i: u16) -> MembershipId { - i as MembershipId - } - fn signer() -> (AccountPublic, AccountId) { - let public = sp_io::crypto::sr25519_generate(0.into(), None); - let account = sp_runtime::MultiSigner::Sr25519(public).into_account(); - (public.into(), account) - } - fn sign(signer: &AccountPublic, message: &[u8]) -> MultiSignature { - sp_runtime::MultiSignature::Sr25519( - sp_io::crypto::sr25519_sign(0.into(), &signer.clone().try_into().unwrap(), message).unwrap(), - ) - } -} - -parameter_types! { - pub const RootAccount: AccountId = AccountId::new([0xff; 32]); -} -impl pallet_nfts::Config for Test { - type ApprovalsLimit = (); - type AttributeDepositBase = (); - type CollectionDeposit = (); - type CollectionId = CommunityId; - type CreateOrigin = - AsEnsureOriginWithArg, EnsureSigned>>; - type Currency = (); - type DepositPerByte = (); - type Features = (); - type ForceOrigin = EnsureRoot; - type ItemAttributesApprovalsLimit = (); - type ItemDeposit = (); - type ItemId = MembershipId; - type KeyLimit = ConstU32<64>; - type Locker = (); - type MaxAttributesPerCall = (); - type MaxDeadlineDuration = (); - type MaxTips = (); - type MetadataDepositBase = (); - type OffchainPublic = AccountPublic; - type OffchainSignature = MultiSignature; - type RuntimeEvent = RuntimeEvent; - type StringLimit = (); - type ValueLimit = ConstU32<10>; - type WeightInfo = (); - - #[cfg(feature = "runtime-benchmarks")] - type Helper = NftsBenchmarksHelper; -} - -// Governance at Communities -parameter_types! { - pub MaximumSchedulerWeight: Weight = Weight::from_parts(MAX_BLOCK_REF_TIME, MAX_BLOCK_POV_SIZE); - pub const MaxScheduledPerBlock: u32 = 512; -} -pub struct ConvertDeposit; -impl Convert for ConvertDeposit { - fn convert(a: Footprint) -> u64 { - a.count * 2 + a.size - } -} - -parameter_types! { - pub PreimageHoldReason: RuntimeHoldReason = pallet_preimage::HoldReason::Preimage.into(); -} - -impl pallet_preimage::Config for Test { - type WeightInfo = (); - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type ManagerOrigin = EnsureSigned; - type Consideration = HoldConsideration; -} - -impl pallet_scheduler::Config for Test { - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type PalletsOrigin = OriginCaller; - type RuntimeCall = RuntimeCall; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureRoot; - type OriginPrivilegeCmp = EqualPrivilegeOnly; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = pallet_scheduler::weights::SubstrateWeight; - type Preimages = Preimage; -} - -pub struct EnsureOriginToTrack; -impl EnsureOriginWithArg> for EnsureOriginToTrack { - type Success = (); - - fn try_origin(o: RuntimeOrigin, id: &TrackIdOf) -> Result { - let track_id_for_origin: TrackIdOf = Tracks::track_for(&o.clone().caller).map_err(|_| o.clone())?; - frame_support::ensure!(&track_id_for_origin == id, o); - - Ok(()) - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(id: &TrackIdOf) -> Result { - Ok(pallet_communities::Origin::::new(id.clone()).into()) - } -} - -#[cfg(feature = "runtime-benchmarks")] -use sp_runtime::SaturatedConversion; - -#[cfg(feature = "runtime-benchmarks")] -pub struct TracksBenchmarkHelper; - -#[cfg(feature = "runtime-benchmarks")] -impl pallet_referenda_tracks::BenchmarkHelper for TracksBenchmarkHelper { - fn track_id(id: u32) -> TrackIdOf { - id.saturated_into() - } -} - -parameter_types! { - pub const MaxTracks: u32 = u32::MAX; -} -impl pallet_referenda_tracks::Config for Test { - type RuntimeEvent = RuntimeEvent; - type TrackId = CommunityId; - type MaxTracks = MaxTracks; - type AdminOrigin = EnsureRoot; - type UpdateOrigin = EnsureOriginToTrack; - type WeightInfo = (); - - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = TracksBenchmarkHelper; -} - -parameter_types! { - pub static AlarmInterval: u64 = 1; -} -impl pallet_referenda::Config for Test { - type WeightInfo = (); - type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type Scheduler = Scheduler; - type Currency = pallet_balances::Pallet; - type SubmitOrigin = frame_system::EnsureSigned; - type CancelOrigin = EnsureRoot; - type KillOrigin = EnsureRoot; - type Slash = (); - type Votes = VoteWeight; - type Tally = Tally; - type SubmissionDeposit = ConstU64<2>; - type MaxQueued = ConstU32<3>; - type UndecidingTimeout = ConstU64<20>; - type AlarmInterval = AlarmInterval; - type Tracks = Tracks; - type Preimages = Preimage; -} - -// Communities - -parameter_types! { - pub const CommunitiesPalletId: PalletId = PalletId(*b"kv/comms"); - pub const MembershipsManagerCollectionId: CommunityId = 0; - pub const MembershipNftAttr: &'static [u8; 10] = b"membership"; - pub const TestCommunity: CommunityId = COMMUNITY; -} - -type MembershipCollection = ItemOf; - -#[cfg(feature = "runtime-benchmarks")] -use crate::{ - types::{AssetIdOf, CommunityIdOf, MembershipIdOf, PollIndexOf}, - BenchmarkHelper, -}; - -#[cfg(feature = "runtime-benchmarks")] -use { - frame_benchmarking::BenchmarkError, - frame_support::BoundedVec, - frame_system::pallet_prelude::{OriginFor, RuntimeCallFor}, - pallet_referenda::{BoundedCallOf, Curve, PalletsOriginOf, TrackInfo}, - parity_scale_codec::Encode, -}; - -#[cfg(feature = "runtime-benchmarks")] -pub struct CommunityBenchmarkHelper; - -#[cfg(feature = "runtime-benchmarks")] -impl BenchmarkHelper for CommunityBenchmarkHelper { - fn community_id() -> CommunityIdOf { - COMMUNITY - } - - fn community_asset_id() -> AssetIdOf { - 1u32 - } - - fn community_desired_size() -> u32 { - u8::MAX as u32 - } - - fn initialize_memberships_collection() -> Result<(), frame_benchmarking::BenchmarkError> { - TestEnvBuilder::initialize_memberships_manager_collection()?; - TestEnvBuilder::initialize_community_memberships_collection(&Self::community_id())?; - Ok(()) - } - - fn issue_membership( - community_id: CommunityIdOf, - membership_id: MembershipIdOf, - ) -> Result<(), frame_benchmarking::BenchmarkError> { - use frame_support::traits::tokens::nonfungible_v2::Mutate; - - let community_account = Communities::community_account(&community_id); - MembershipCollection::mint_into(&membership_id, &community_account, &Default::default(), true)?; - - Ok(()) - } - - fn prepare_track(track_origin: PalletsOriginOf) -> Result<(), BenchmarkError> { - let id = Self::community_id(); - let info = TrackInfo { - name: sp_runtime::str_array("Community"), - max_deciding: 1, - decision_deposit: 5, - prepare_period: 1, - decision_period: 5, - confirm_period: 1, - min_enactment_period: 1, - min_approval: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(50), - ceil: Perbill::from_percent(100), - }, - min_support: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(100), - }, - }; - - Tracks::insert(RuntimeOrigin::root(), id, info, track_origin.clone())?; - - Ok(()) - } - - fn prepare_poll( - origin: OriginFor, - proposal_origin: PalletsOriginOf, - proposal_call: RuntimeCallFor, - ) -> Result, BenchmarkError> { - let proposal = BoundedCallOf::::Inline(BoundedVec::truncate_from(proposal_call.encode())); - let enactment_moment = frame_support::traits::schedule::DispatchTime::After(1); - Referenda::submit(origin.clone(), Box::new(proposal_origin), proposal, enactment_moment)?; - Referenda::place_decision_deposit(origin, 0)?; - - System::set_block_number(2); - Referenda::nudge_referendum(RuntimeOrigin::root(), 0)?; - - Ok(0) - } - - fn finish_poll(index: PollIndexOf) -> Result<(), BenchmarkError> { - System::set_block_number(8); - Referenda::nudge_referendum(RuntimeOrigin::root(), index)?; - - frame_support::assert_ok!(Referenda::ensure_ongoing(index)); - - System::set_block_number(9); - Referenda::nudge_referendum(RuntimeOrigin::root(), index)?; - - frame_support::assert_err!( - Referenda::ensure_ongoing(index), - pallet_referenda::Error::::NotOngoing - ); - - Ok(()) - } -} - -parameter_types! { - pub const NoPay: Option<(Balance, AccountId, AccountId)> = None; -} -type RootCreatesCommunitiesForFree = EnsureRootWithSuccess; -type AnyoneElsePays = EnsureSignedPays, RootAccount>; - -pub type MembershipsManager = NonFungiblesMemberships; - -impl Config for Test { - type PalletId = CommunitiesPalletId; - type CommunityId = CommunityId; - type MembershipId = MembershipId; - - type Assets = Assets; - type AssetsFreezer = AssetsFreezer; - type Balances = Balances; - type ItemConfig = pallet_nfts::ItemConfig; - type MemberMgmt = MembershipsManager; - type Polls = Referenda; - - type CreateOrigin = EitherOf; - type AdminOrigin = EnsureCommunity; - type MemberMgmtOrigin = EnsureCommunity; - - type RuntimeCall = RuntimeCall; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type RuntimeFreezeReason = RuntimeFreezeReason; - type WeightInfo = WeightInfo; - - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = CommunityBenchmarkHelper; -} - -pub const COMMUNITY: CommunityId = 1; -pub const COMMUNITY_ORIGIN: OriginCaller = - OriginCaller::Communities(pallet_communities::Origin::::new(COMMUNITY)); - -// Build genesis storage according to the mock runtime. -pub fn new_test_ext(members: &[AccountId], memberships: &[MembershipId]) -> sp_io::TestExternalities { - TestEnvBuilder::new() - .add_community(COMMUNITY, DecisionMethod::Membership, members, memberships, None) - .build() -} - -#[derive(Default)] -pub(crate) struct TestEnvBuilder { - assets_config: AssetsConfig, - balances: Vec<(AccountId, Balance)>, - communities: Vec, - decision_methods: sp_std::collections::btree_map::BTreeMap>, - members: Vec<(CommunityId, AccountId)>, - memberships: Vec<(CommunityId, MembershipId)>, - tracks: Vec<(TrackIdOf, TrackInfoOf)>, -} - -impl TestEnvBuilder { - pub(crate) fn new() -> Self { - Self::default() - } - - pub(crate) fn add_asset( - mut self, - id: &AssetId, - owner: &AccountId, - is_sufficient: bool, - min_balance: Balance, - // name, symbol, decimals - maybe_metadata: Option<(Vec, Vec, u8)>, - maybe_accounts: Option>, - ) -> Self { - self.assets_config - .assets - .push((*id, owner.clone(), is_sufficient, min_balance)); - - if let Some((name, symbol, decimals)) = maybe_metadata { - self.assets_config.metadata.push((*id, name, symbol, decimals)); - } - - self.assets_config.accounts.append( - &mut maybe_accounts - .unwrap_or_default() - .into_iter() - .map(|(account_id, balance)| (*id, account_id, balance)) - .collect(), - ); - - self - } - - pub(crate) fn add_community( - mut self, - community_id: CommunityId, - decision_method: DecisionMethod, - members: &[AccountId], - memberships: &[MembershipId], - maybe_track: Option>, - ) -> Self { - self.communities.push(community_id); - self.decision_methods.insert(community_id, decision_method); - self.members - .append(&mut members.iter().map(|m| (community_id, m.to_owned())).collect::>()); - self.memberships.append( - &mut memberships - .iter() - .map(|m| (community_id, m.to_owned())) - .collect::>(), - ); - if let Some(track) = maybe_track { - self.tracks.push((community_id, track)); - } - - self - } - - pub(crate) fn with_balances(mut self, balances: &[(AccountId, Balance)]) -> Self { - self.balances = balances.to_vec(); - self - } - - pub(crate) fn build(self) -> sp_io::TestExternalities { - let t = RuntimeGenesisConfig { - assets: self.assets_config, - balances: pallet_balances::GenesisConfig { - balances: self.balances, - }, - system: Default::default(), - } - .build_storage() - .unwrap(); - - let mut ext = TestExternalities::new(t); - - ext.execute_with(|| { - System::set_block_number(1); - - Self::initialize_memberships_manager_collection().expect("collection is initialized"); - - for community_id in &self.communities { - Self::initialize_community_memberships_collection(community_id).expect("collection is initialized"); - - let decision_method = self - .decision_methods - .get(community_id) - .expect("should include decision_method on add_community"); - let community_origin: RuntimeOrigin = Self::create_community_origin(community_id); - - Communities::create(RuntimeOrigin::root(), community_origin.caller.clone(), *community_id) - .expect("can add community"); - - Communities::set_decision_method(community_origin.clone(), *community_id, decision_method.clone()) - .expect("can set decision info"); - - let mut members = self.members.iter().filter(|(cid, _)| cid == community_id); - let memberships = self.memberships.iter().filter(|(cid, _)| cid == community_id); - - assert!( - self.memberships.len() >= self.members.len(), - "there should be at least as many memberships as there are members" - ); - - for (_, membership) in memberships { - use frame_support::traits::tokens::nonfungible_v2::Mutate; - - let account = Communities::community_account(community_id); - MembershipCollection::mint_into(membership, &account, &Default::default(), true) - .expect("can mint membership"); - - if let Some((_, who)) = members.next() { - Communities::add_member(community_origin.clone(), who.clone()).expect("can add member"); - } - } - - for (_, track_info) in self.tracks.iter().filter(|(cid, _)| cid == community_id) { - Tracks::insert( - RuntimeOrigin::root(), - *community_id, - track_info.clone(), - community_origin.caller.clone(), - ) - .expect("can add track"); - } - } - }); - - ext - } - - pub(crate) fn initialize_memberships_manager_collection() -> DispatchResult { - Nfts::do_create_collection( - MembershipsManagerCollectionId::get(), - RootAccount::get(), - RootAccount::get(), - Default::default(), - 0, - pallet_nfts::Event::ForceCreated { - collection: MembershipsManagerCollectionId::get(), - owner: RootAccount::get(), - }, - ) - } - - pub(crate) fn initialize_community_memberships_collection(community_id: &CommunityId) -> DispatchResult { - let account = Communities::community_account(community_id); - Nfts::do_create_collection( - *community_id, - account.clone(), - account.clone(), - Default::default(), - 0, - pallet_nfts::Event::ForceCreated { - collection: *community_id, - owner: account, - }, - ) - } - - pub fn create_community_origin(community_id: &CommunityId) -> RuntimeOrigin { - pallet_communities::Origin::::new(*community_id).into() - } -} diff --git a/pallets/communities/src/origin.rs b/pallets/communities/src/origin.rs deleted file mode 100644 index 1746279f1..000000000 --- a/pallets/communities/src/origin.rs +++ /dev/null @@ -1,258 +0,0 @@ -use crate::{ - types::{CommunityIdOf, CommunityState::Active, MembershipIdOf, RuntimeOriginFor}, - AccountIdOf, CommunityIdFor, Config, Info, Pallet, -}; -use core::marker::PhantomData; -use fc_traits_memberships::{GenericRank, Inspect}; -use frame_support::{ - pallet_prelude::*, - traits::{EnsureOriginWithArg, MapSuccess, OriginTrait}, -}; -use frame_system::EnsureSigned; -#[cfg(feature = "xcm")] -use sp_runtime::traits::TryConvert; -use sp_runtime::{morph_types, Permill}; - -pub struct EnsureCommunity(PhantomData); - -impl EnsureOrigin> for EnsureCommunity -where - RuntimeOriginFor: OriginTrait + Into, RuntimeOriginFor>> + From>, - T: Config, -{ - type Success = T::CommunityId; - - fn try_origin(o: RuntimeOriginFor) -> Result> { - use frame_system::RawOrigin::{None, Root}; - if matches!(o.as_system_ref(), Some(Root) | Some(None)) { - return Err(o); - } - let id = match o.clone().into() { - Ok(RawOrigin { community_id, .. }) => community_id, - Err(_) => { - let origin = o.clone().into_caller(); - CommunityIdFor::::get(origin).ok_or_else(|| o.clone())? - } - }; - Info::::get(id) - .and_then(|c| c.state.eq(&Active).then_some(id)) - .ok_or(o) - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result, ()> { - use crate::BenchmarkHelper; - Ok(RawOrigin::new(T::BenchmarkHelper::community_id()).into()) - } -} - -morph_types! { - pub type PaymentForCreate< - AccountId, - GetAmount: TypedGet, - GetReceiver: TypedGet - >: Morph = |sender: AccountId| -> Option<(GetAmount::Type, AccountId, GetReceiver::Type)> { - Some((GetAmount::get(), sender, GetReceiver::get())) - }; -} - -pub type EnsureSignedPays = - MapSuccess>, PaymentForCreate, Amount, Beneficiary>>; - -pub struct EnsureMember(PhantomData); - -impl EnsureOriginWithArg, CommunityIdOf> for EnsureMember -where - T: Config, - RuntimeOriginFor: OriginTrait + From>, -{ - type Success = (); - - fn try_origin( - o: RuntimeOriginFor, - community_id: &CommunityIdOf, - ) -> Result> { - use frame_system::RawOrigin::Signed; - - match o.clone().into() { - Ok(Signed(who)) => { - if T::MemberMgmt::is_member_of(community_id, &who) { - Ok(()) - } else { - Err(o.clone()) - } - } - _ => Err(o), - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_community_id: &CommunityIdOf) -> Result, ()> { - todo!("Find an account that is a member of this community"); - } -} - -/// Origin to represent the voice of a community or a subset of its members -/// as well as the voting preference of said group. -#[derive(TypeInfo, Encode, Decode, MaxEncodedLen, Clone, Eq, PartialEq, Debug)] -pub struct RawOrigin { - community_id: CommunityIdOf, - subset: Option>, -} - -impl RawOrigin { - pub const fn new(community_id: CommunityIdOf) -> Self { - RawOrigin { - community_id, - subset: None, - } - } - - pub fn with_subset(&mut self, s: Subset) { - self.subset = Some(s); - } - - pub fn id(&self) -> CommunityIdOf { - self.community_id - } -} - -/// Subsets of the community can also have a voice -#[derive(Clone, Debug, Decode, Encode, Eq, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum Subset { - Member(MembershipIdOf), - Members { count: u32 }, - Fraction(Permill), - AtLeastRank(GenericRank), -} - -#[cfg(feature = "xcm")] -impl TryConvert, xcm::latest::Location> for RawOrigin -where - T: Config, - RuntimeOriginFor: Into, RuntimeOriginFor>>, - xcm::latest::Junction: TryFrom>, -{ - fn try_convert(o: RuntimeOriginFor) -> Result> { - let Ok(community @ RawOrigin { .. }) = o.clone().into() else { - return Err(o); - }; - let j = xcm::latest::Junction::try_from(community).map_err(|_| o)?; - Ok(j.into()) - } -} - -#[cfg(feature = "xcm")] -impl TryFrom> for xcm::latest::Junction -where - T: Config, - u32: From>, -{ - type Error = (); - - fn try_from(o: RawOrigin) -> Result { - use xcm::latest::{BodyId, BodyPart, Junction::Plurality}; - let part = match o.subset { - None => BodyPart::Voice, - Some(Subset::Member(_)) => BodyPart::Members { count: 1 }, - Some(Subset::Members { count }) => BodyPart::Members { count }, - Some(Subset::Fraction(per)) => BodyPart::Fraction { - nom: per.deconstruct(), - denom: ::ACCURACY, - }, - Some(Subset::AtLeastRank(_)) => return Err(()), - }; - Ok(Plurality { - id: BodyId::Index(o.community_id.into()), - part, - }) - } -} - -#[cfg(feature = "xcm")] -impl TryFrom for RawOrigin -where - T: Config, - T::CommunityId: From + From, -{ - type Error = (); - - fn try_from(value: xcm::latest::Junction) -> Result { - use xcm::latest::{BodyId::Index, BodyPart::*, Junction::Plurality}; - let Plurality { id: Index(id), part } = value else { - return Err(()); - }; - let subset = match part { - Voice => None, - Members { count } => Some(Subset::Members { count }), - Fraction { nom, denom } => Some(Subset::Fraction(Permill::from_rational(nom, denom))), - _ => return Err(()), - }; - let mut origin = RawOrigin::new(id.into()); - if let Some(s) = subset { - origin.with_subset(s); - } - Ok(origin) - } -} - -/// Ensure the origin is any `Signed` origin. -pub struct AsSignedByCommunity(PhantomData); -impl EnsureOrigin for AsSignedByCommunity -where - OuterOrigin: OriginTrait - + From> - + From> - + Clone - + Into, OuterOrigin>> - + Into, OuterOrigin>>, - T: Config, -{ - type Success = T::AccountId; - - fn try_origin(o: OuterOrigin) -> Result { - match o.clone().into() { - Ok(RawOrigin { community_id, .. }) => Ok(Pallet::::community_account(&community_id)), - _ => Err(o.clone()), - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { - use crate::BenchmarkHelper; - let community_id = T::BenchmarkHelper::community_id(); - Ok(frame_system::RawOrigin::Signed(Pallet::::community_account(&community_id)).into()) - } -} - -/// Ensure the origin is any `Signed` origin. -pub struct AsSignedByStaticCommunity(PhantomData<(T, C)>); -impl EnsureOrigin for AsSignedByStaticCommunity -where - OuterOrigin: OriginTrait - + From> - + From> - + Clone - + Into, OuterOrigin>> - + Into, OuterOrigin>>, - T: Config, - C: Get>, -{ - type Success = T::AccountId; - - fn try_origin(o: OuterOrigin) -> Result { - match o.clone().into() { - Ok(RawOrigin { ref community_id, .. }) if community_id == &C::get() => { - Ok(Pallet::::community_account(community_id)) - } - _ => Err(o.clone()), - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { - use crate::BenchmarkHelper; - let community_id = T::BenchmarkHelper::community_id(); - Ok(frame_system::RawOrigin::Signed(Pallet::::community_account(&community_id)).into()) - } -} diff --git a/pallets/communities/src/tests/governance.rs b/pallets/communities/src/tests/governance.rs deleted file mode 100644 index fdba36fb8..000000000 --- a/pallets/communities/src/tests/governance.rs +++ /dev/null @@ -1,1151 +0,0 @@ -use super::*; - -use frame_support::{parameter_types, traits::OriginTrait}; -use pallet_referenda::{BoundedCallOf, Curve, TrackInfoOf}; -use parity_scale_codec::Encode; -use sp_runtime::{str_array as s, BoundedVec, TokenError}; - -use crate::{ - types::{Tally, Vote}, - Call, DecisionMethod, -}; -use frame_support::assert_noop; -use pallet_referenda::TrackInfo; -use sp_runtime::Perbill; -use virto_common::MembershipId; - -const COMMUNITY_A: CommunityId = 1; -const COMMUNITY_B: CommunityId = 2; -const COMMUNITY_C: CommunityId = 3; -const COMMUNITY_D: CommunityId = 4; - -const MS_X_COMMUNITY: usize = 3; -const MEMBERSHIPS: [[MembershipId; MS_X_COMMUNITY]; 4] = { - let mut m = [[0; MS_X_COMMUNITY]; 4]; - let mut i = 0; - while i < MS_X_COMMUNITY * 4 { - m[i / MS_X_COMMUNITY][i % MS_X_COMMUNITY] = (i + 1) as MembershipId; - i += 1; - } - m -}; -const fn memberships_of(community: CommunityId) -> &'static [MembershipId] { - &MEMBERSHIPS[community as usize - 1] -} -const fn membership(community: CommunityId, m: usize) -> MembershipId { - MEMBERSHIPS[community as usize - 1][m - 1] -} - -const COMMUNITY_B_ASSET_ID: AssetId = 2; - -const ALICE: AccountId = AccountId::new([1; 32]); -const BOB: AccountId = AccountId::new([2; 32]); -const CHARLIE: AccountId = AccountId::new([3; 32]); - -parameter_types! { - pub OriginForCommunityA: Box = - Box::new(TestEnvBuilder::create_community_origin(&COMMUNITY_A).caller().clone()); - pub OriginForCommunityB: Box = - Box::new(TestEnvBuilder::create_community_origin(&COMMUNITY_B).caller().clone()); - pub OriginForCommunityC: Box = - Box::new(TestEnvBuilder::create_community_origin(&COMMUNITY_C).caller().clone()); - pub OriginForCommunityD: Box = - Box::new(TestEnvBuilder::create_community_origin(&COMMUNITY_D).caller().clone()); - - pub CommunityTrack: TrackInfoOf = TrackInfo { - name: s("Community"), - max_deciding: 1, - decision_deposit: 5, - prepare_period: 1, - decision_period: 5, - confirm_period: 1, - min_enactment_period: 1, - min_approval: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(50), - ceil: Perbill::from_percent(100), - }, - min_support: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(100), - }, - }; - - pub ProposalCallAddBob: BoundedCallOf = { - let call: RuntimeCall = Call::::add_member { who: BOB }.into(); - BoundedCallOf::::Inline(BoundedVec::truncate_from(call.encode())) - }; - - pub ProposalCallAddAlice: BoundedCallOf = { - let call: RuntimeCall = Call::::add_member { who: ALICE }.into(); - BoundedCallOf::::Inline(BoundedVec::truncate_from(call.encode())) - }; - - pub ProposalCallRemoveCharlieFromC: BoundedCallOf = { - let call: RuntimeCall = Call::::remove_member { who: CHARLIE, membership_id: membership(COMMUNITY_C, 3) }.into(); - BoundedCallOf::::Inline(BoundedVec::truncate_from(call.encode())) - }; - - pub ProposalCallPromoteCharlie: BoundedCallOf = { - let call: RuntimeCall = Call::::promote { membership_id: membership(COMMUNITY_D, 3) }.into(); - BoundedCallOf::::Inline(BoundedVec::truncate_from(call.encode())) - }; -} - -fn new_test_ext() -> sp_io::TestExternalities { - let mut t = TestEnvBuilder::new() - .with_balances(&[(ALICE, 15), (BOB, 15), (CHARLIE, 15)]) - // Membership-based - .add_community( - COMMUNITY_A, - DecisionMethod::Membership, - &[ALICE], - memberships_of(COMMUNITY_A), - Some(CommunityTrack::get()), - ) - // Community-asset based - .add_community( - COMMUNITY_B, - DecisionMethod::CommunityAsset(COMMUNITY_B_ASSET_ID, 10), - &[BOB, CHARLIE], - memberships_of(COMMUNITY_B), - Some(CommunityTrack::get()), - ) - .add_asset( - &COMMUNITY_B_ASSET_ID, - &Communities::community_account(&COMMUNITY_B), - true, - 1, - None, - Some(vec![(BOB, 50), (CHARLIE, 50)]), - ) - // Native-asset based - .add_community( - COMMUNITY_C, - DecisionMethod::NativeToken, - &[ALICE, BOB, CHARLIE], - memberships_of(COMMUNITY_C), - Some(CommunityTrack::get()), - ) - // Rank-based - .add_community( - COMMUNITY_D, - DecisionMethod::Rank, - &[ALICE, BOB, CHARLIE], - memberships_of(COMMUNITY_D), - Some(CommunityTrack::get()), - ) - .build(); - - t.execute_with(|| { - assert_ok!(Referenda::submit( - RuntimeOrigin::signed(ALICE), - OriginForCommunityA::get(), - ProposalCallAddBob::get(), - frame_support::traits::schedule::DispatchTime::After(1), - )); - assert_ok!(Referenda::submit( - RuntimeOrigin::signed(BOB), - OriginForCommunityB::get(), - ProposalCallAddAlice::get(), - frame_support::traits::schedule::DispatchTime::After(1), - )); - assert_ok!(Referenda::submit( - RuntimeOrigin::signed(BOB), - OriginForCommunityC::get(), - ProposalCallRemoveCharlieFromC::get(), - frame_support::traits::schedule::DispatchTime::After(1), - )); - - System::assert_has_event( - pallet_referenda::Event::::Submitted { - index: 0, - proposal: ProposalCallAddBob::get(), - track: COMMUNITY_A, - } - .into(), - ); - System::assert_has_event( - pallet_referenda::Event::::Submitted { - index: 1, - proposal: ProposalCallAddAlice::get(), - track: COMMUNITY_B, - } - .into(), - ); - System::assert_has_event( - pallet_referenda::Event::::Submitted { - index: 2, - proposal: ProposalCallRemoveCharlieFromC::get(), - track: COMMUNITY_C, - } - .into(), - ); - - assert_ok!(Referenda::place_decision_deposit(RuntimeOrigin::signed(ALICE), 0)); - assert_ok!(Referenda::place_decision_deposit(RuntimeOrigin::signed(BOB), 1)); - assert_ok!(Referenda::place_decision_deposit(RuntimeOrigin::signed(BOB), 2)); - - tick_block(); - }); - - t -} - -mod vote { - use super::*; - - mod common { - use super::*; - - #[test] - fn fails_if_vote_weight_is_zero() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 0) - ), - Error::VoteBelowMinimum - ); - }); - } - - #[test] - fn fails_if_not_a_member() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_A, 2), - 0, - Vote::Standard(true) - ), - Error::NotAMember - ); - }); - } - - #[test] - fn fails_if_poll_is_not_ongoing() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 256, - Vote::Standard(true) - ), - Error::NotOngoing - ); - }); - } - - #[test] - fn fails_if_voting_on_invalid_track() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 0, - Vote::Standard(true) - ), - Error::InvalidTrack - ); - }); - } - - #[test] - fn transferring_memberships_does_not_lead_to_double_voting() { - new_test_ext().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 0, - Vote::Standard(true) - )); - - System::assert_last_event( - crate::Event::VoteCasted { - who: ALICE, - poll_index: 0, - vote: Vote::Standard(true), - } - .into(), - ); - - assert_ok!(Nfts::transfer( - RuntimeOrigin::signed(ALICE), - COMMUNITY_A, - membership(COMMUNITY_A, 1), - BOB - )); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_A, 1), - 0, - Vote::Standard(true) - )); - - System::assert_last_event( - crate::Event::VoteCasted { - who: BOB, - poll_index: 0, - vote: Vote::Standard(true), - } - .into(), - ); - - use frame_support::traits::Polling; - assert_eq!( - Referenda::as_ongoing(0), - Some(( - Tally { - ayes: 1, - bare_ayes: 1, - nays: 0, - ..Default::default() - }, - COMMUNITY_A - )) - ); - }); - } - } - - mod membership { - use fc_traits_memberships::Inspect; - - use super::*; - - #[test] - fn passing_poll_executes() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 0, - track: COMMUNITY_A, - proposal: ProposalCallAddBob::get(), - tally: Tally::default(), - } - .into(), - ); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 0, - Vote::Standard(true) - )); - - tick_block(); - - // After voting, the poll starts confirmation - System::assert_has_event(pallet_referenda::Event::::ConfirmStarted { index: 0 }.into()); - - tick_block(); - - // After confirmation, vote should be completed and approved - System::assert_has_event( - pallet_referenda::Event::::Confirmed { - index: 0, - tally: Tally { - ayes: 1, - nays: 0, - bare_ayes: 1, - ..Default::default() - }, - } - .into(), - ); - - let community_account = Communities::community_account(&COMMUNITY_A); - let (_, membership_id) = MembershipsManager::user_memberships(&community_account, None) - .next() - .expect("CommunityA should still have memberships"); - - tick_block(); - - // Proposal is enacted and exeuted - System::assert_has_event( - crate::Event::::MemberAdded { - who: BOB, - membership_id, - } - .into(), - ); - }); - } - - #[test] - fn poll_rejects_on_single_nay() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 0, - track: COMMUNITY_A, - proposal: ProposalCallAddBob::get(), - tally: Tally::default(), - } - .into(), - ); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 0, - Vote::Standard(false) - )); - - tick_blocks(5); - - // After voting, the poll should be completed and approved - System::assert_has_event( - pallet_referenda::Event::::Rejected { - index: 0, - tally: Tally { - ayes: 0, - nays: 1, - bare_ayes: 0, - ..Default::default() - }, - } - .into(), - ); - }); - } - - #[test] - fn tie_breaking_works() { - fn run_referenda() -> sp_io::TestExternalities { - let mut ext = new_test_ext(); - - ext.execute_with(|| { - // For now, this community will vote membership-based - assert_ok!(Communities::set_decision_method( - TestEnvBuilder::create_community_origin(&COMMUNITY_C), - COMMUNITY_C, - DecisionMethod::Membership - )); - - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 2, - track: COMMUNITY_C, - proposal: ProposalCallRemoveCharlieFromC::get(), - tally: Tally::default(), - } - .into(), - ); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_C, 1), - 2, - Vote::Standard(true) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_C, 3), - 2, - Vote::Standard(false) - )); - - tick_blocks(4); - - // After voting, the poll starts confirmation - System::assert_has_event(pallet_referenda::Event::::ConfirmStarted { index: 2 }.into()); - }); - - ext - } - - run_referenda().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_C, 2), - 2, - Vote::Standard(true) - )); - - tick_block(); - - // After confirmation, vote should be completed and approved - System::assert_has_event( - pallet_referenda::Event::::Confirmed { - index: 2, - tally: Tally { - ayes: 2, - nays: 1, - bare_ayes: 2, - ..Default::default() - }, - } - .into(), - ); - }); - - run_referenda().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_C, 2), - 2, - Vote::Standard(false) - )); - - tick_block(); - - // After voting, the poll starts confirmation - System::assert_has_event( - pallet_referenda::Event::::Rejected { - index: 2, - tally: Tally { - ayes: 1, - nays: 2, - bare_ayes: 1, - ..Default::default() - }, - } - .into(), - ); - }); - } - } - - mod asset_balance { - use super::*; - - #[test] - fn fails_if_not_enough_balance() { - new_test_ext().execute_with(|| { - // Cannot keep free funds lower than min. balance - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_B, 2), - 1, - Vote::AssetBalance(false, COMMUNITY_B_ASSET_ID, 51) - ), - TokenError::FundsUnavailable - ); - }); - } - - #[test] - fn fails_if_asset_vote_weight_is_under_minimum() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 9) - ), - Error::VoteBelowMinimum - ); - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 10) - )); - }); - } - - #[test] - fn passes_with_approval_and_support() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 1, - track: COMMUNITY_B, - proposal: ProposalCallAddAlice::get(), - tally: Tally::default(), - } - .into(), - ); - - // We're going to vote high enough to pass to confirmation immediately: - // 66% approval / 10% of support - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 30) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_B, 2), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 30) - )); - - tick_block(); - - System::assert_has_event(pallet_referenda::Event::::ConfirmStarted { index: 1 }.into()); - - tick_block(); - - System::assert_has_event( - pallet_referenda::Event::::Confirmed { - index: 1, - tally: Tally { - ayes: 60, - nays: 0, - bare_ayes: 60, - ..Default::default() - }, - } - .into(), - ); - }); - } - - #[test] - fn passes_with_approval_but_not_support() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 1, - track: COMMUNITY_B, - proposal: ProposalCallAddAlice::get(), - tally: Tally::default(), - } - .into(), - ); - - // We're going to vote high enough to have a pass in approval, but not enough to - // pass in support until decision period ends: 66% approval / 10% of support - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 12) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_B, 2), - 1, - Vote::AssetBalance(false, COMMUNITY_B_ASSET_ID, 11) - )); - - tick_blocks(4); - - System::assert_has_event(pallet_referenda::Event::::ConfirmStarted { index: 1 }.into()); - - tick_block(); - - System::assert_has_event( - pallet_referenda::Event::::Confirmed { - index: 1, - tally: Tally { - ayes: 12, - nays: 11, - bare_ayes: 12, - ..Default::default() - }, - } - .into(), - ); - }); - } - - #[test] - fn voter_can_change_decision_over_time() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 1, - track: COMMUNITY_B, - proposal: ProposalCallAddAlice::get(), - tally: Tally::default(), - } - .into(), - ); - - tick_block(); - - // We're going to vote high in a series of three votes, each one attempting to - // turn the poll over. - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_B, 2), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 11) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(false, COMMUNITY_B_ASSET_ID, 12) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_B, 2), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 13) - )); - - tick_blocks(3); - - System::assert_has_event( - pallet_referenda::Event::::Confirmed { - index: 1, - tally: Tally { - ayes: 13, - nays: 12, - bare_ayes: 13, - ..Default::default() - }, - } - .into(), - ); - }); - } - } - - mod native_balance { - use super::*; - - #[test] - fn fails_if_not_enough_balance() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_C, 2), - 2, - Vote::NativeBalance(true, 16) - ), - TokenError::FundsUnavailable - ); - }); - } - - #[test] - fn rejects_on_most_nays() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 2, - track: COMMUNITY_C, - proposal: ProposalCallRemoveCharlieFromC::get(), - tally: Tally::default(), - } - .into(), - ); - - tick_block(); - - // BOB won't be able to vote, since they don't have enough funds to do so - // ALICE has a limited support they can put, so CHARLIE will be able to - // cast a majority nay vote. - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_C, 3), - 2, - Vote::NativeBalance(false, 14) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_C, 1), - 2, - Vote::NativeBalance(true, 7) - )); - - tick_blocks(3); - - System::assert_has_event( - pallet_referenda::Event::::Rejected { - index: 2, - tally: Tally { - ayes: 7, - nays: 14, - bare_ayes: 7, - ..Default::default() - }, - } - .into(), - ); - }); - } - - #[test] - fn voter_can_change_decision() { - new_test_ext().execute_with(|| { - // Before voting, the poll is ongoing - System::assert_has_event( - pallet_referenda::Event::::DecisionStarted { - index: 2, - track: COMMUNITY_C, - proposal: ProposalCallRemoveCharlieFromC::get(), - tally: Tally::default(), - } - .into(), - ); - - tick_block(); - - // We're going to vote high in a series of three votes, each one attempting to - // turn the poll over. - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_C, 3), - 2, - Vote::NativeBalance(false, 6) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_C, 1), - 2, - Vote::NativeBalance(true, 7) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_C, 3), - 2, - Vote::NativeBalance(false, 8) - )); - - tick_blocks(2); - - System::assert_has_event( - pallet_referenda::Event::::Rejected { - index: 2, - tally: Tally { - ayes: 7, - nays: 8, - bare_ayes: 7, - ..Default::default() - }, - } - .into(), - ); - }); - } - } - - mod rank { - use frame_support::traits::Polling; - - use super::*; - - fn new_test_ext() -> sp_io::TestExternalities { - let mut ext = super::new_test_ext(); - - ext.execute_with(|| { - assert_ok!(Communities::promote( - Into::::into(*OriginForCommunityD::get()), - membership(COMMUNITY_D, 1) - )); - assert_ok!(Communities::promote( - Into::::into(*OriginForCommunityD::get()), - membership(COMMUNITY_D, 2) - )); - assert_ok!(Communities::promote( - Into::::into(*OriginForCommunityD::get()), - membership(COMMUNITY_D, 3) - )); - - assert_ok!(Referenda::submit( - RuntimeOrigin::signed(CHARLIE), - OriginForCommunityD::get(), - ProposalCallPromoteCharlie::get(), - frame_support::traits::schedule::DispatchTime::After(1), - )); - - System::assert_has_event( - pallet_referenda::Event::::Submitted { - index: 3, - proposal: ProposalCallPromoteCharlie::get(), - track: COMMUNITY_D, - } - .into(), - ); - - assert_ok!(Referenda::place_decision_deposit(RuntimeOrigin::signed(CHARLIE), 3)); - - tick_block(); - }); - - ext - } - - #[test] - fn it_works() { - new_test_ext().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_D, 1), - 3, - Vote::Standard(true) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_D, 2), - 3, - Vote::Standard(false) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_D, 3), - 3, - Vote::Standard(true) - )); - - tick_blocks(2); - - System::assert_has_event(pallet_referenda::Event::::ConfirmStarted { index: 3 }.into()); - }); - } - - #[test] - fn it_works_with_different_ranks() { - new_test_ext().execute_with(|| { - assert_ok!(Communities::promote( - Into::::into(*OriginForCommunityD::get()), - membership(COMMUNITY_D, 1) - )); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_D, 1), - 3, - Vote::Standard(false) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_D, 2), - 3, - Vote::Standard(true) - )); - - tick_block(); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_D, 3), - 3, - Vote::Standard(true) - )); - - assert_eq!( - Referenda::as_ongoing(3).expect("the poll was initiated; qed").0, - Tally { - ayes: 2, - nays: 2, - bare_ayes: 2, - ..Default::default() - } - ) - }); - } - } -} - -mod remove_vote { - use frame_support::traits::{fungible::Inspect, Polling}; - - use super::*; - - #[test] - fn fails_if_not_a_member() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::remove_vote(RuntimeOrigin::signed(BOB), membership(COMMUNITY_A, 2), 0,), - Error::NotAMember - ); - }); - } - - #[test] - fn fails_if_trying_to_remove_vote_from_invalid_track() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::remove_vote(RuntimeOrigin::signed(ALICE), membership(COMMUNITY_A, 1), 1), - Error::InvalidTrack - ); - }); - } - - #[test] - fn fails_if_poll_is_no_vote_casted() { - new_test_ext().execute_with(|| { - assert_noop!( - Communities::remove_vote(RuntimeOrigin::signed(ALICE), membership(COMMUNITY_A, 1), 0), - Error::NoVoteCasted - ); - }); - } - - #[test] - fn it_works() { - new_test_ext().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 0, - Vote::Standard(true) - )); - - tick_block(); - - assert_ok!(Communities::remove_vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_A, 1), - 0 - )); - - System::assert_has_event( - crate::Event::::VoteRemoved { - who: ALICE, - poll_index: 0, - } - .into(), - ); - - assert_eq!( - Referenda::as_ongoing(0).expect("we already created poll 0; qed").0, - Tally::default() - ); - }); - - new_test_ext().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_C, 1), - 2, - Vote::NativeBalance(true, 15) - )); - - assert_eq!( - Balances::reducible_balance( - &ALICE, - frame_support::traits::tokens::Preservation::Expendable, - frame_support::traits::tokens::Fortitude::Polite - ), - 0 - ); - - tick_block(); - - assert_ok!(Communities::remove_vote( - RuntimeOrigin::signed(ALICE), - membership(COMMUNITY_C, 1), - 2 - )); - - System::assert_has_event( - crate::Event::::VoteRemoved { - who: ALICE, - poll_index: 2, - } - .into(), - ); - - assert_eq!( - Referenda::as_ongoing(2).expect("we already created poll 2; qed").0, - Tally::default() - ); - - assert_eq!( - Balances::reducible_balance( - &ALICE, - frame_support::traits::tokens::Preservation::Expendable, - frame_support::traits::tokens::Fortitude::Polite - ), - 7 - ); - }); - } -} - -mod unlock { - use super::*; - - #[test] - fn fails_if_trying_to_unlock_on_an_ongoing_poll() { - new_test_ext().execute_with(|| { - // Since BOB never casted a vote, a lock wasn't put in place - assert_noop!( - Communities::unlock(RuntimeOrigin::signed(BOB), 1), - Error::AlreadyOngoing - ); - }); - } - - #[test] - fn it_works() { - new_test_ext().execute_with(|| { - assert_ok!(Communities::vote( - RuntimeOrigin::signed(BOB), - membership(COMMUNITY_B, 1), - 1, - Vote::AssetBalance(true, COMMUNITY_B_ASSET_ID, 15) - )); - - assert_ok!(Communities::vote( - RuntimeOrigin::signed(CHARLIE), - membership(COMMUNITY_C, 3), - 2, - Vote::NativeBalance(true, 15) - )); - - tick_blocks(6); - - assert_ok!(Communities::unlock(RuntimeOrigin::signed(BOB), 1)); - - assert_ok!(Communities::unlock(RuntimeOrigin::signed(CHARLIE), 2)); - }); - } -} diff --git a/pallets/communities/src/tests/helpers.rs b/pallets/communities/src/tests/helpers.rs deleted file mode 100644 index d1bf9c4c3..000000000 --- a/pallets/communities/src/tests/helpers.rs +++ /dev/null @@ -1,56 +0,0 @@ -use super::*; -use frame_support::traits::Hooks; -use frame_system::pallet_prelude::BlockNumberFor; - -pub fn tick_block() { - on_finalize(); - - // if System::block_number() > 1 { - // println!( - // "Finished block {} with events:\n{}\n\n", - // System::block_number(), - // &System::events() - // .into_iter() - // .map(|ev| format!("\t{:?}", &ev)) - // .collect::>() - // .join("\n") - // ); - // } - System::reset_events(); - System::set_block_number(System::block_number() + 1); - // println!("Starting block {}", System::block_number()); - - on_initialize(); -} - -pub fn tick_blocks(n: BlockNumberFor) { - for _ in 0..n { - tick_block(); - } -} - -fn on_finalize() { - let block_number = System::block_number(); - - Referenda::on_finalize(block_number); - Scheduler::on_finalize(block_number); - Tracks::on_finalize(block_number); - Communities::on_finalize(block_number); - Nfts::on_finalize(block_number); - Assets::on_finalize(block_number); - Balances::on_finalize(block_number); - System::on_finalize(block_number); -} - -fn on_initialize() { - let block_number = System::block_number(); - - Referenda::on_initialize(block_number); - Scheduler::on_initialize(block_number); - Tracks::on_initialize(block_number); - Communities::on_initialize(block_number); - Nfts::on_initialize(block_number); - Assets::on_initialize(block_number); - Balances::on_initialize(block_number); - System::on_initialize(block_number); -} diff --git a/pallets/communities/src/tests/membership.rs b/pallets/communities/src/tests/membership.rs deleted file mode 100644 index 318377d40..000000000 --- a/pallets/communities/src/tests/membership.rs +++ /dev/null @@ -1,190 +0,0 @@ -use super::*; -use crate::types::CommunityState::Blocked; -use frame_support::assert_noop; -use frame_system::RawOrigin::Root; -use sp_runtime::{traits::BadOrigin, DispatchError}; -use virto_common::MembershipId; - -const COMMUNITY_NON_MEMBER: AccountId = AccountId::new([0; 32]); -const COMMUNITY_MEMBER_1: AccountId = AccountId::new([1; 32]); -const COMMUNITY_MEMBER_2: AccountId = AccountId::new([2; 32]); -const MEMBERSHIP_1: MembershipId = 1; -const MEMBERSHIP_2: MembershipId = 2; - -mod add_member { - use super::*; - - #[test] - fn fails_when_community_is_not_active() { - new_test_ext(&[], &[MEMBERSHIP_1]).execute_with(|| { - Communities::force_state(&COMMUNITY, Blocked); - assert_noop!( - Communities::add_member(COMMUNITY_ORIGIN.into(), COMMUNITY_MEMBER_1), - DispatchError::BadOrigin - ); - }); - } - - #[test] - fn fails_when_caller_not_a_valid_origin() { - new_test_ext(&[], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!( - Communities::add_member(RuntimeOrigin::none(), COMMUNITY_MEMBER_1), - DispatchError::BadOrigin - ); - assert_noop!( - Communities::add_member(Root.into(), COMMUNITY_MEMBER_1), - DispatchError::BadOrigin - ); - }); - } - - #[test] - fn adds_members() { - new_test_ext(&[], &[MEMBERSHIP_1, MEMBERSHIP_2]).execute_with(|| { - // Successfully adds members - assert_ok!(Communities::add_member(COMMUNITY_ORIGIN.into(), COMMUNITY_MEMBER_1)); - assert_ok!(Communities::add_member(COMMUNITY_ORIGIN.into(), COMMUNITY_MEMBER_2)); - - assert!(Communities::is_member(&COMMUNITY, &COMMUNITY_MEMBER_1)); - assert!(Communities::is_member(&COMMUNITY, &COMMUNITY_MEMBER_2)); - }); - } - - #[test] - fn can_add_member_twice() { - // As memberships could be transfered there is no use in restricting adding the - // same member twice - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1, MEMBERSHIP_2]).execute_with(|| { - // Fails to add a member twice - assert_ok!(Communities::add_member(COMMUNITY_ORIGIN.into(), COMMUNITY_MEMBER_1)); - assert_eq!( - Communities::get_memberships(COMMUNITY, &COMMUNITY_MEMBER_1), - vec![MEMBERSHIP_2, MEMBERSHIP_1] - ); - }); - } -} - -mod remove_member { - use super::*; - - #[test] - fn fails_when_community_is_not_active() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - Communities::force_state(&COMMUNITY, Blocked); - assert_noop!( - Communities::remove_member(COMMUNITY_ORIGIN.into(), COMMUNITY_MEMBER_1, MEMBERSHIP_1), - DispatchError::BadOrigin - ); - }); - } - - #[test] - fn fails_when_caller_not_a_privileged_origin() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!( - Communities::remove_member(RuntimeOrigin::none(), COMMUNITY_MEMBER_1, MEMBERSHIP_1), - DispatchError::BadOrigin - ); - assert_noop!( - Communities::remove_member(Root.into(), COMMUNITY_MEMBER_1, MEMBERSHIP_1), - DispatchError::BadOrigin - ); - }); - } - - #[test] - fn fails_when_not_a_community_member() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!( - Communities::remove_member(COMMUNITY_ORIGIN.into(), COMMUNITY_NON_MEMBER, MEMBERSHIP_1), - Error::NotAMember - ); - }); - } - - #[test] - fn it_works() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_ok!(Communities::remove_member( - COMMUNITY_ORIGIN.into(), - COMMUNITY_MEMBER_1, - MEMBERSHIP_1 - )); - }); - } -} - -mod member_rank { - use super::*; - - mod promote_member { - use super::*; - - #[test] - fn fails_when_caller_not_admin_origin() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!(Communities::promote(Root.into(), MEMBERSHIP_1), BadOrigin); - }); - } - - #[test] - fn fails_when_not_a_community_member() { - new_test_ext(&[], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!( - Communities::promote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1), - Error::NotAMember, - ); - }); - } - - #[test] - fn it_works() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_ok!(Communities::promote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1)); - assert_eq!(Communities::member_rank(&COMMUNITY, &MEMBERSHIP_1), 1.into()); - }); - } - } - - mod demote_member { - use super::*; - - #[test] - fn fails_when_caller_not_a_privleged_origin() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_noop!(Communities::demote(Root.into(), MEMBERSHIP_1), BadOrigin); - }); - } - - #[test] - fn fails_when_not_a_community_member() { - new_test_ext(&[], &[]).execute_with(|| { - assert_noop!( - Communities::demote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1), - Error::NotAMember, - ); - }); - } - - #[test] - fn it_works() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - Communities::promote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1).expect("can promote"); - Communities::promote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1).expect("can promote"); - assert_ok!(Communities::demote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1)); - assert_eq!(Communities::member_rank(&COMMUNITY, &MEMBERSHIP_1), 1.into()); - }); - } - - #[test] - fn should_remain_at_min_rank() { - new_test_ext(&[COMMUNITY_MEMBER_1], &[MEMBERSHIP_1]).execute_with(|| { - assert_eq!(Communities::member_rank(&COMMUNITY, &MEMBERSHIP_1), 0.into()); - assert_ok!(Communities::demote(COMMUNITY_ORIGIN.into(), MEMBERSHIP_1,)); - assert_eq!(Communities::member_rank(&COMMUNITY, &MEMBERSHIP_1), 0.into()); - }); - } - } -} diff --git a/pallets/communities/src/tests/mod.rs b/pallets/communities/src/tests/mod.rs deleted file mode 100644 index fe59d028a..000000000 --- a/pallets/communities/src/tests/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -use frame_support::assert_ok; - -mod helpers; - -use crate::mock::*; -use helpers::*; - -type Error = crate::Error; - -mod governance; -mod membership; -mod registry; -mod weights; diff --git a/pallets/communities/src/tests/registry.rs b/pallets/communities/src/tests/registry.rs deleted file mode 100644 index c8700a09f..000000000 --- a/pallets/communities/src/tests/registry.rs +++ /dev/null @@ -1,76 +0,0 @@ -use super::*; -use crate::{types::CommunityInfo, Event, Info}; -use frame_support::assert_noop; -use frame_system::RawOrigin::Root; - -mod create { - use super::*; - - const COMMUNITY_B: CommunityId = 2; - const COMMUNITY_B_ORIGIN: OriginCaller = OriginCaller::Communities(crate::Origin::::new(COMMUNITY_B)); - - #[test] - fn fails_if_community_already_exists() { - new_test_ext(&[], &[]).execute_with(|| { - // Simulate a pre-existing community - Info::::insert(COMMUNITY, CommunityInfo::default()); - - // Should fail adding the community - assert_noop!( - Communities::create(Root.into(), COMMUNITY_ORIGIN, COMMUNITY), - Error::CommunityAlreadyExists - ); - }); - } - - #[test] - fn it_works() { - new_test_ext(&[], &[]).execute_with(|| { - System::assert_has_event( - Event::CommunityCreated { - id: COMMUNITY, - origin: COMMUNITY_ORIGIN, - } - .into(), - ); - }); - } - - #[test] - fn takes_deposit_if_permissionlessly_creating_community() { - new_test_ext(&[], &[]).execute_with(|| { - const ALICE: AccountId = AccountId::new([1; 32]); - assert_ok!(Balances::force_set_balance(RuntimeOrigin::root(), ALICE, 15)); - - assert_ok!(Communities::create( - RuntimeOrigin::signed(ALICE), - COMMUNITY_B_ORIGIN, - COMMUNITY_B - )); - - System::assert_has_event( - Event::CommunityCreated { - id: COMMUNITY_B, - origin: COMMUNITY_B_ORIGIN, - } - .into(), - ); - assert_eq!(Balances::free_balance(ALICE), 5); - }); - } - - #[test] - fn fails_if_admin_already_controls_another_community() { - new_test_ext(&[], &[]).execute_with(|| { - const ANOTHER_COMMUNITY: CommunityId = 99; - // Simulate a pre-existing community - Info::::insert(COMMUNITY, CommunityInfo::default()); - - // Should fail adding another community with existing admin - assert_noop!( - Communities::create(Root.into(), COMMUNITY_ORIGIN, ANOTHER_COMMUNITY), - Error::AlreadyAdmin - ); - }); - } -} diff --git a/pallets/communities/src/tests/weights.rs b/pallets/communities/src/tests/weights.rs deleted file mode 100644 index 1c9652a0f..000000000 --- a/pallets/communities/src/tests/weights.rs +++ /dev/null @@ -1,54 +0,0 @@ -use super::*; -use crate::weights::{SubstrateWeight, WeightInfo}; -use frame_support::weights::Weight; - -#[test] -fn weights() { - let max_total_extrinsics = MAX_BLOCK_WEIGHT * NORMAL_DISPATCH_RATIO; - let max_extrinsic_weight = max_total_extrinsics - .saturating_sub(MAX_BLOCK_WEIGHT * AVERAGE_ON_INITIALIZE_RATIO) - .saturating_sub(BASE_EXTRINSIC); - - assert_eq!(max_extrinsic_weight, Weight::from_parts(349_875_000_000, 3_670_016)); - - println!("max block weight: {MAX_BLOCK_WEIGHT}"); - println!("max total extrinsics weight: {max_total_extrinsics}"); - println!("max extrinsic weight: {max_extrinsic_weight}\n"); - - let mut total = Weight::zero(); - - for (function, weight) in vec![ - // Examples: call available weight functions with various parameters (as applicable) to gauge weight usage in - // comparison to limits - ("create", SubstrateWeight::::create()), - ("set_admin_origin", SubstrateWeight::::set_admin_origin()), - ("set_decision_method", SubstrateWeight::::set_decision_method()), - ("add_member", SubstrateWeight::::add_member()), - ("remove_member", SubstrateWeight::::remove_member()), - ("promote", SubstrateWeight::::promote()), - ("demote", SubstrateWeight::::demote()), - ("vote", SubstrateWeight::::vote()), - ("remove_vote", SubstrateWeight::::remove_vote()), - ("unlock", SubstrateWeight::::unlock()), - ("dispatch_as_account", SubstrateWeight::::dispatch_as_account()), - ] { - println!("{function}: {weight:?}",); - println!( - "\tpercentage of max extrinsic weight: {:.2}% (ref_time), {:.2}% (proof_size)", - (weight.ref_time() as f64 / max_extrinsic_weight.ref_time() as f64) * 100.0, - (weight.proof_size() as f64 / max_extrinsic_weight.proof_size() as f64) * 100.0, - ); - println!( - "\tmax tx per block: {} (ref_time), {} (proof_size)", - max_extrinsic_weight.ref_time() / weight.ref_time(), - max_extrinsic_weight.proof_size() / weight.proof_size().max(1) - ); - - assert!(weight.all_lt(max_extrinsic_weight)); - - total += weight; - } - - // output total weight, useful for evaluating net weight changes when optimising - println!("\ntotal weight: {total:?}"); -} diff --git a/pallets/communities/src/types.rs b/pallets/communities/src/types.rs deleted file mode 100644 index c44df27b8..000000000 --- a/pallets/communities/src/types.rs +++ /dev/null @@ -1,194 +0,0 @@ -use crate::{CommunityDecisionMethod, Config}; -use fc_traits_memberships::{Inspect, Rank}; -use frame_support::pallet_prelude::*; -use frame_support::traits::{ - fungible::{self, Inspect as FunInspect}, - fungibles::{self, Inspect as FunsInspect}, - Polling, -}; -use sp_runtime::traits::{StaticLookup, UniqueSaturatedInto}; -use sp_runtime::SaturatedConversion; - -pub type AssetIdOf = <::Assets as fungibles::Inspect>>::AssetId; -pub type AssetBalanceOf = <::Assets as fungibles::Inspect>>::Balance; -pub type NativeBalanceOf = <::Balances as fungible::Inspect>>::Balance; -pub type AccountIdOf = ::AccountId; -pub type CommunityIdOf = ::CommunityId; -pub type VoteOf = Vote, AssetBalanceOf, NativeBalanceOf>; -pub type DecisionMethodFor = DecisionMethod, AssetBalanceOf>; -pub type PollIndexOf = <::Polls as Polling>>::Index; -pub type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -pub type PalletsOriginOf = - <::RuntimeOrigin as frame_support::traits::OriginTrait>::PalletsOrigin; -pub type MembershipIdOf = ::MembershipId; -pub type RuntimeCallFor = ::RuntimeCall; -pub type RuntimeOriginFor = ::RuntimeOrigin; - -#[cfg(feature = "runtime-benchmarks")] -pub type BenchmarkHelperOf = ::BenchmarkHelper; - -/// The Community struct holds the basic definition of a community. It includes -/// the current state of a community, the [`AccountId`][1] for the community -/// admin, and (if any) the ID of the community-issued asset the community has -/// marked to be sufficient. -/// -/// [1]: `frame_system::Config::AccountId` -#[derive(Decode, Default, Encode, MaxEncodedLen, TypeInfo)] -pub struct CommunityInfo { - /// The current state of the community. - pub state: CommunityState, -} - -/// The current state of the community. It represents whether a community -/// is awaiting to prove their contribution to the network, is active -/// and can operate, blocked due to a violation of network norms, or -/// it's being frozen by the community administrators. -#[derive(Decode, Default, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum CommunityState { - /// The community is opperating normally. - #[default] - Active, - /// The community is blocked, typically as a result of a restriction imposed - /// by violating the norms of the network. - Blocked, -} - -/// The mechanism used by the community or one of its subsets to make decisions -#[derive(Clone, Debug, Decode, Default, Encode, Eq, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum DecisionMethod { - #[default] - Membership, - NativeToken, - CommunityAsset(AssetId, MinVote), - Rank, -} - -// Governance -pub type VoteWeight = u32; - -#[derive(Clone, Debug, Decode, Encode, PartialEq, MaxEncodedLen, TypeInfo)] -#[scale_info(skip_type_params(AssetId, AssetBalance, NativeBalance))] -pub enum Vote { - AssetBalance(bool, AssetId, AssetBalance), - NativeBalance(bool, NativeBalance), - Standard(bool), -} - -impl Vote -where - B: UniqueSaturatedInto + Clone, - N: UniqueSaturatedInto + Clone, -{ - pub fn say(&self) -> bool { - *match self { - Vote::AssetBalance(say, _, _) => say, - Vote::NativeBalance(say, _) => say, - Vote::Standard(say) => say, - } - } - - pub fn weight(&self) -> VoteWeight { - match self { - Vote::AssetBalance(_, _, balance) => balance.clone().saturated_into(), - Vote::NativeBalance(_, balance) => balance.clone().saturated_into(), - Vote::Standard(_) => 1, - } - } -} - -impl From<&Vote> for VoteWeight -where - B: UniqueSaturatedInto + Clone, - N: UniqueSaturatedInto + Clone, -{ - fn from(vote: &Vote) -> Self { - vote.weight() - } -} - -#[derive(Clone, Debug, Decode, Encode, Eq, MaxEncodedLen, PartialEq, TypeInfo)] -#[scale_info(skip_type_params(T))] -#[codec(mel_bound(T: Config))] -pub struct Tally { - pub(crate) _phantom: PhantomData, - pub(crate) ayes: VoteWeight, - pub(crate) nays: VoteWeight, - pub(crate) bare_ayes: VoteWeight, -} - -impl Default for Tally { - fn default() -> Self { - Self { - _phantom: Default::default(), - ayes: Default::default(), - nays: Default::default(), - bare_ayes: Default::default(), - } - } -} - -impl Tally { - pub(crate) fn max_support(community_id: CommunityIdOf) -> VoteWeight { - match CommunityDecisionMethod::::get(community_id) { - DecisionMethod::Membership => T::MemberMgmt::members_total(&community_id), - DecisionMethod::Rank => T::MemberMgmt::ranks_total(&community_id), - DecisionMethod::NativeToken => T::Balances::total_issuance().saturated_into::(), - DecisionMethod::CommunityAsset(asset_id, _) => { - T::Assets::total_issuance(asset_id).saturated_into::() - } - } - } -} - -#[derive(PartialEq)] -pub enum LockUpdateType { - Add, - Remove, -} - -#[cfg(feature = "runtime-benchmarks")] -use {frame_benchmarking::BenchmarkError, frame_system::pallet_prelude::OriginFor}; - -#[cfg(feature = "runtime-benchmarks")] -pub trait BenchmarkHelper { - /// Returns the ID of the community to use in benchmarks - fn community_id() -> CommunityIdOf; - - /// Returns the ID of the community to use in benchmarks - fn community_asset_id() -> AssetIdOf - where - AssetIdOf: From, - { - 1u32.into() - } - - /// Returns the desired size of the community for - /// effects of benchmark testing - fn community_desired_size() -> u32 { - u8::MAX as u32 - } - - /// Initializes the membership collection of a community. - fn initialize_memberships_collection() -> Result<(), frame_benchmarking::BenchmarkError>; - - /// Extends the membership collection of a community with a given - /// membership ID. - fn issue_membership( - community_id: CommunityIdOf, - membership_id: MembershipIdOf, - ) -> Result<(), frame_benchmarking::BenchmarkError>; - - /// This method prepares the referenda track to be used - /// to submit the poll, for benchmarking purposes. - fn prepare_track(track_origin: PalletsOriginOf) -> Result<(), BenchmarkError>; - - /// This method prepares the poll to be used to - /// benchmark vote-related calls. - fn prepare_poll( - origin: OriginFor, - proposal_origin: PalletsOriginOf, - proposal_call: RuntimeCallFor, - ) -> Result, BenchmarkError>; - - fn finish_poll(index: PollIndexOf) -> Result<(), BenchmarkError>; -} diff --git a/pallets/communities/src/weights.rs b/pallets/communities/src/weights.rs deleted file mode 100644 index 8dbb4f9ea..000000000 --- a/pallets/communities/src/weights.rs +++ /dev/null @@ -1,490 +0,0 @@ - -//! Autogenerated weights for `pallet_communities` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-04-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-builder`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("kreivo-local")`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/virto-node -// benchmark -// pallet -// --chain -// kreivo-local -// --pallet -// pallet_communities -// --extrinsic -// * -// --steps -// 50 -// --repeat -// 20 -// --output -// runtime/kreivo/src/weights/pallet_communities.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weight functions needed for pallet_communities. -pub trait WeightInfo { - fn create() -> Weight; - fn add_member() -> Weight; - fn set_admin_origin () -> Weight; - fn set_decision_method () -> Weight; - fn promote() -> Weight; - fn demote() -> Weight; - fn remove_member() -> Weight; - fn vote() -> Weight; - fn remove_vote() -> Weight; - fn unlock() -> Weight; - fn dispatch_as_account() -> Weight; -} - -/// Weights for pallet_communities using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - /// Storage: `Communities::Info` (r:1 w:1) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityIdFor` (r:0 w:1) - /// Proof: `Communities::CommunityIdFor` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) - fn create() -> Weight { - // Proof Size summary in bytes: - // Measured: `56` - // Estimated: `3593` - // Minimum execution time: 39_254_000 picoseconds. - Weight::from_parts(44_989_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Communities::CommunityIdFor` (r:1 w:2) - /// Proof: `Communities::CommunityIdFor` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - fn set_admin_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `122` - // Estimated: `4087` - // Minimum execution time: 39_264_000 picoseconds. - Weight::from_parts(59_388_000, 0) - .saturating_add(Weight::from_parts(0, 4087)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:0 w:1) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - fn set_decision_method() -> Weight { - // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `3484` - // Minimum execution time: 24_894_000 picoseconds. - Weight::from_parts(36_775_000, 0) - .saturating_add(Weight::from_parts(0, 3484)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Account` (r:1 w:2) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:3 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemConfigOf` (r:2 w:2) - /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:2 w:2) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Item` (r:2 w:2) - /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemMetadataOf` (r:1 w:0) - /// Proof: `CommunityMemberships::ItemMetadataOf` (`max_values`: None, `max_size`: Some(345), added: 2820, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::CollectionConfigOf` (r:1 w:0) - /// Proof: `CommunityMemberships::CollectionConfigOf` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemAttributesApprovalsOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemAttributesApprovalsOf` (`max_values`: None, `max_size`: Some(999), added: 3474, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::PendingSwapOf` (r:0 w:1) - /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) - fn add_member() -> Weight { - // Proof Size summary in bytes: - // Measured: `880` - // Estimated: `9846` - // Minimum execution time: 245_334_000 picoseconds. - Weight::from_parts(360_487_000, 0) - .saturating_add(Weight::from_parts(0, 9846)) - .saturating_add(T::DbWeight::get().reads(13)) - .saturating_add(T::DbWeight::get().writes(13)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Account` (r:1 w:1) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:4 w:3) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemConfigOf` (r:1 w:1) - /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Item` (r:1 w:1) - /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemMetadataOf` (r:1 w:0) - /// Proof: `CommunityMemberships::ItemMetadataOf` (`max_values`: None, `max_size`: Some(345), added: 2820, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemAttributesApprovalsOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemAttributesApprovalsOf` (`max_values`: None, `max_size`: Some(999), added: 3474, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::PendingSwapOf` (r:0 w:1) - /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) - fn remove_member() -> Weight { - // Proof Size summary in bytes: - // Measured: `1006` - // Estimated: `12798` - // Minimum execution time: 317_361_000 picoseconds. - Weight::from_parts(465_610_000, 0) - .saturating_add(Weight::from_parts(0, 12798)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(10)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:2 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - fn promote() -> Weight { - // Proof Size summary in bytes: - // Measured: `717` - // Estimated: `6894` - // Minimum execution time: 134_868_000 picoseconds. - Weight::from_parts(158_292_000, 0) - .saturating_add(Weight::from_parts(0, 6894)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:2 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - fn demote() -> Weight { - // Proof Size summary in bytes: - // Measured: `755` - // Estimated: `6894` - // Minimum execution time: 198_275_000 picoseconds. - Weight::from_parts(202_790_000, 0) - .saturating_add(Weight::from_parts(0, 6894)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `CommunityMemberships::Account` (r:1 w:0) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:1 w:0) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVotes` (r:1 w:1) - /// Proof: `Communities::CommunityVotes` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:1) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVoteLocks` (r:2 w:1) - /// Proof: `Communities::CommunityVoteLocks` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:1 w:1) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `3035` - // Estimated: `6148` - // Minimum execution time: 393_947_000 picoseconds. - Weight::from_parts(476_186_000, 0) - .saturating_add(Weight::from_parts(0, 6148)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: `CommunityMemberships::Account` (r:1 w:0) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:1 w:0) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:1) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVotes` (r:1 w:1) - /// Proof: `Communities::CommunityVotes` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:1 w:0) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - fn remove_vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `2898` - // Estimated: `4365` - // Minimum execution time: 178_506_000 picoseconds. - Weight::from_parts(241_482_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:0) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVoteLocks` (r:2 w:1) - /// Proof: `Communities::CommunityVoteLocks` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Balances::Freezes` (r:1 w:1) - /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(4658), added: 7133, mode: `MaxEncodedLen`) - /// Storage: `Balances::Locks` (r:1 w:0) - /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) - fn unlock() -> Weight { - // Proof Size summary in bytes: - // Measured: `1082` - // Estimated: `8123` - // Minimum execution time: 164_095_000 picoseconds. - Weight::from_parts(219_358_000, 0) - .saturating_add(Weight::from_parts(0, 8123)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - fn dispatch_as_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `3484` - // Minimum execution time: 33_857_000 picoseconds. - Weight::from_parts(47_890_000, 0) - .saturating_add(Weight::from_parts(0, 3484)) - .saturating_add(T::DbWeight::get().reads(1)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// Storage: `Communities::Info` (r:1 w:1) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityIdFor` (r:0 w:1) - /// Proof: `Communities::CommunityIdFor` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) - fn create() -> Weight { - // Proof Size summary in bytes: - // Measured: `56` - // Estimated: `3593` - // Minimum execution time: 39_254_000 picoseconds. - Weight::from_parts(44_989_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: `Communities::CommunityIdFor` (r:1 w:2) - /// Proof: `Communities::CommunityIdFor` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - fn set_admin_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `122` - // Estimated: `4087` - // Minimum execution time: 39_264_000 picoseconds. - Weight::from_parts(59_388_000, 0) - .saturating_add(Weight::from_parts(0, 4087)) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(2)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:0 w:1) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - fn set_decision_method() -> Weight { - // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `3484` - // Minimum execution time: 24_894_000 picoseconds. - Weight::from_parts(36_775_000, 0) - .saturating_add(Weight::from_parts(0, 3484)) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Account` (r:1 w:2) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:3 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemConfigOf` (r:2 w:2) - /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:2 w:2) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Item` (r:2 w:2) - /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemMetadataOf` (r:1 w:0) - /// Proof: `CommunityMemberships::ItemMetadataOf` (`max_values`: None, `max_size`: Some(345), added: 2820, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::CollectionConfigOf` (r:1 w:0) - /// Proof: `CommunityMemberships::CollectionConfigOf` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemAttributesApprovalsOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemAttributesApprovalsOf` (`max_values`: None, `max_size`: Some(999), added: 3474, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::PendingSwapOf` (r:0 w:1) - /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) - fn add_member() -> Weight { - // Proof Size summary in bytes: - // Measured: `880` - // Estimated: `9846` - // Minimum execution time: 245_334_000 picoseconds. - Weight::from_parts(360_487_000, 0) - .saturating_add(Weight::from_parts(0, 9846)) - .saturating_add(RocksDbWeight::get().reads(13)) - .saturating_add(RocksDbWeight::get().writes(13)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Account` (r:1 w:1) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:4 w:3) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemConfigOf` (r:1 w:1) - /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Item` (r:1 w:1) - /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemMetadataOf` (r:1 w:0) - /// Proof: `CommunityMemberships::ItemMetadataOf` (`max_values`: None, `max_size`: Some(345), added: 2820, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::ItemAttributesApprovalsOf` (r:0 w:1) - /// Proof: `CommunityMemberships::ItemAttributesApprovalsOf` (`max_values`: None, `max_size`: Some(999), added: 3474, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::PendingSwapOf` (r:0 w:1) - /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) - fn remove_member() -> Weight { - // Proof Size summary in bytes: - // Measured: `1006` - // Estimated: `12798` - // Minimum execution time: 317_361_000 picoseconds. - Weight::from_parts(465_610_000, 0) - .saturating_add(Weight::from_parts(0, 12798)) - .saturating_add(RocksDbWeight::get().reads(10)) - .saturating_add(RocksDbWeight::get().writes(10)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:2 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - fn promote() -> Weight { - // Proof Size summary in bytes: - // Measured: `717` - // Estimated: `6894` - // Minimum execution time: 134_868_000 picoseconds. - Weight::from_parts(158_292_000, 0) - .saturating_add(Weight::from_parts(0, 6894)) - .saturating_add(RocksDbWeight::get().reads(4)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:2 w:2) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Collection` (r:1 w:1) - /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - fn demote() -> Weight { - // Proof Size summary in bytes: - // Measured: `755` - // Estimated: `6894` - // Minimum execution time: 198_275_000 picoseconds. - Weight::from_parts(202_790_000, 0) - .saturating_add(Weight::from_parts(0, 6894)) - .saturating_add(RocksDbWeight::get().reads(4)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: `CommunityMemberships::Account` (r:1 w:0) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:1 w:0) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVotes` (r:1 w:1) - /// Proof: `Communities::CommunityVotes` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:1) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVoteLocks` (r:2 w:1) - /// Proof: `Communities::CommunityVoteLocks` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:1 w:1) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `3035` - // Estimated: `6148` - // Minimum execution time: 393_947_000 picoseconds. - Weight::from_parts(476_186_000, 0) - .saturating_add(Weight::from_parts(0, 6148)) - .saturating_add(RocksDbWeight::get().reads(10)) - .saturating_add(RocksDbWeight::get().writes(6)) - } - /// Storage: `CommunityMemberships::Account` (r:1 w:0) - /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityDecisionMethod` (r:1 w:0) - /// Proof: `Communities::CommunityDecisionMethod` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`) - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:1) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVotes` (r:1 w:1) - /// Proof: `Communities::CommunityVotes` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::Attribute` (r:1 w:0) - /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) - fn remove_vote() -> Weight { - // Proof Size summary in bytes: - // Measured: `2898` - // Estimated: `4365` - // Minimum execution time: 178_506_000 picoseconds. - Weight::from_parts(241_482_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(RocksDbWeight::get().reads(5)) - .saturating_add(RocksDbWeight::get().writes(2)) - } - /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:0) - /// Proof: `CommunityReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) - /// Storage: `Communities::CommunityVoteLocks` (r:2 w:1) - /// Proof: `Communities::CommunityVoteLocks` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Balances::Freezes` (r:1 w:1) - /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(4658), added: 7133, mode: `MaxEncodedLen`) - /// Storage: `Balances::Locks` (r:1 w:0) - /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) - fn unlock() -> Weight { - // Proof Size summary in bytes: - // Measured: `1082` - // Estimated: `8123` - // Minimum execution time: 164_095_000 picoseconds. - Weight::from_parts(219_358_000, 0) - .saturating_add(Weight::from_parts(0, 8123)) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: `Communities::Info` (r:1 w:0) - /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) - fn dispatch_as_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `115` - // Estimated: `3484` - // Minimum execution time: 33_857_000 picoseconds. - Weight::from_parts(47_890_000, 0) - .saturating_add(Weight::from_parts(0, 3484)) - .saturating_add(RocksDbWeight::get().reads(1)) - } -} diff --git a/pallets/payments/Cargo.toml b/pallets/contracts-store/Cargo.toml similarity index 57% rename from pallets/payments/Cargo.toml rename to pallets/contracts-store/Cargo.toml index aac278cc0..54b544794 100644 --- a/pallets/payments/Cargo.toml +++ b/pallets/contracts-store/Cargo.toml @@ -1,10 +1,10 @@ [package] authors.workspace = true -description = "This pallet enables managing smart, reversible payments on-chain using assets" +description = "This pallet helps with all the necesary steps to publish and acquire 'apps' (contracts) from publishers." edition.workspace = true license.workspace = true homepage.workspace = true -name = "pallet-payments" +name = "pallet-contracts-store" repository.workspace = true version = "0.1.0" @@ -12,66 +12,55 @@ version = "0.1.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = ["derive"] } -scale-info.workspace = true -sp-runtime.workspace = true -sp-std.workspace = true -sp-core.workspace = true -sp-io.workspace = true +frame-contrib-traits.workspace = true +frame-benchmarking.workspace = true frame-support.workspace = true frame-system.workspace = true -frame-benchmarking = { workspace = true, optional = true } -log.workspace = true +pallet-contracts.workspace = true +parity-scale-codec = { workspace = true, features = ["derive"] } +scale-info = { workspace = true, features = ["derive"] } +sp-runtime.workspace = true [dev-dependencies] -serde.workspace = true -pallet-balances.workspace = true -pallet-sudo.workspace = true +mock-helpers = { workspace = true, features = ["pallet-assets", "pallet-balances"] } pallet-assets.workspace = true -sp-keystore.workspace = true -pallet-preimage.workspace = true -pallet-scheduler.workspace = true - +pallet-balances.workspace = true +pallet-contracts-fixtures.workspace = true +sp-core.workspace = true +sp-io.workspace = true [features] default = ["std"] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", -] std = [ "frame-benchmarking/std", + "frame-contrib-traits/std", "frame-support/std", "frame-system/std", - "log/std", + "mock-helpers/std", "pallet-assets/std", "pallet-balances/std", - "pallet-sudo/std", - "pallet-preimage/std", - "pallet-scheduler/std", + "pallet-contracts/std", "parity-scale-codec/std", "scale-info/std", - "serde/std", "sp-core/std", "sp-io/std", - "sp-keystore/std", - "sp-runtime/std", - "sp-std/std", + "sp-runtime/std" +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-contrib-traits/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-contracts/runtime-benchmarks", + "sp-runtime/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "pallet-assets/try-runtime", "pallet-balances/try-runtime", - "pallet-preimage/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-sudo/try-runtime", - "sp-runtime/try-runtime", + "pallet-contracts/try-runtime", + "sp-runtime/try-runtime" ] diff --git a/pallets/contracts-store/fixtures/Cargo.toml b/pallets/contracts-store/fixtures/Cargo.toml new file mode 100644 index 000000000..090b0b622 --- /dev/null +++ b/pallets/contracts-store/fixtures/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "pallet-contracts-fixtures" +publish = false +version = "1.0.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +description = "Fixtures for testing contracts pallet." + +[lints] +workspace = true + +[dependencies] +anyhow = { workspace = true, default-features = true } +frame-system.default-features = true +frame-system.workspace = true +sp-runtime.default-features = true +sp-runtime.workspace = true + +[build-dependencies] +anyhow = { workspace = true, default-features = true } +parity-wasm = { workspace = true } +tempfile = { workspace = true } +toml = { workspace = true } +twox-hash = { workspace = true, default-features = true } diff --git a/pallets/contracts-store/fixtures/build.rs b/pallets/contracts-store/fixtures/build.rs new file mode 100644 index 000000000..8f5ad3e1f --- /dev/null +++ b/pallets/contracts-store/fixtures/build.rs @@ -0,0 +1,283 @@ +// This file is part of Substrate. + +// Copyright (C) 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. + +//! Compile contracts to wasm. +use anyhow::{bail, Context, Result}; +use parity_wasm::elements::{deserialize_file, serialize_to_file, Internal}; +use std::{ + env, fs, + hash::Hasher, + path::{Path, PathBuf}, + process::Command, +}; +use twox_hash::XxHash32; + +/// Read the file at `path` and return its hash as a hex string. +fn file_hash(path: &Path) -> String { + let data = fs::read(path).expect("file exists; qed"); + let mut hasher = XxHash32::default(); + hasher.write(&data); + hasher.write(include_bytes!("build.rs")); + let hash = hasher.finish(); + format!("{:x}", hash) +} + +/// A contract entry. +struct Entry { + /// The path to the contract source file. + path: PathBuf, + /// The hash of the contract source file. + hash: String, +} + +impl Entry { + /// Create a new contract entry from the given path. + fn new(path: PathBuf) -> Self { + let hash = file_hash(&path); + Self { path, hash } + } + + /// Return the path to the contract source file. + fn path(&self) -> &str { + self.path.to_str().expect("path is valid unicode; qed") + } + + /// Return the name of the contract. + fn name(&self) -> &str { + self.path + .file_stem() + .expect("file exits; qed") + .to_str() + .expect("name is valid unicode; qed") + } + + /// Return whether the contract has already been compiled. + fn is_cached(&self, out_dir: &Path) -> bool { + out_dir.join(self.name()).join(&self.hash).exists() + } + + /// Update the cache file for the contract. + fn update_cache(&self, out_dir: &Path) -> Result<()> { + let cache_dir = out_dir.join(self.name()); + + // clear the cache dir if it exists + if cache_dir.exists() { + fs::remove_dir_all(&cache_dir)?; + } + + // re-populate the cache dir with the new hash + fs::create_dir_all(&cache_dir)?; + fs::write(out_dir.join(&self.hash), "")?; + Ok(()) + } + + /// Return the name of the output wasm file. + fn out_wasm_filename(&self) -> String { + format!("{}.wasm", self.name()) + } +} + +/// Collect all contract entries from the given source directory. +/// Contracts that have already been compiled are filtered out. +fn collect_entries(contracts_dir: &Path, out_dir: &Path) -> Vec { + fs::read_dir(contracts_dir) + .expect("src dir exists; qed") + .filter_map(|file| { + let path = file.expect("file exists; qed").path(); + if path.extension().is_none_or(|ext| ext != "rs") { + return None; + } + + let entry = Entry::new(path); + if entry.is_cached(out_dir) { + None + } else { + Some(entry) + } + }) + .collect::>() +} + +/// Create a `Cargo.toml` to compile the given contract entries. +fn create_cargo_toml<'a>( + fixtures_dir: &Path, + _root_cargo_toml: &Path, + entries: impl Iterator, + output_dir: &Path, +) -> Result<()> { + let mut cargo_toml: toml::Value = toml::from_str(include_str!("build/Cargo.toml"))?; + let mut set_dep = |name, path| -> Result<()> { + cargo_toml["dependencies"][name]["path"] = + toml::Value::String(fixtures_dir.join(path).canonicalize()?.to_str().unwrap().to_string()); + Ok(()) + }; + set_dep("common", "./contracts/common")?; + + cargo_toml["bin"] = toml::Value::Array( + entries + .map(|entry| { + let name = entry.name(); + let path = entry.path(); + toml::Value::Table(toml::toml! { + name = name + path = path + }) + }) + .collect::>(), + ); + + let cargo_toml = toml::to_string_pretty(&cargo_toml)?; + fs::write(output_dir.join("Cargo.toml"), cargo_toml).map_err(Into::into) +} + +/// Invoke `cargo fmt` to check that fixtures files are formatted. +fn invoke_cargo_fmt<'a>(config_path: &Path, files: impl Iterator, contract_dir: &Path) -> Result<()> { + // If rustfmt is not installed, skip the check. + if !Command::new("rustup") + .args(["nightly-2025-10-10", "run", "rustfmt", "--version"]) + .output() + .is_ok_and(|o| o.status.success()) + { + return Ok(()); + } + + let fmt_res = Command::new("rustup") + .args(["nightly-2025-10-10", "run", "rustfmt", "--check", "--config-path"]) + .arg(config_path) + .args(files) + .output() + .expect("failed to execute process"); + + if fmt_res.status.success() { + return Ok(()); + } + + let stdout = String::from_utf8_lossy(&fmt_res.stdout); + let stderr = String::from_utf8_lossy(&fmt_res.stderr); + eprintln!("{}\n{}", stdout, stderr); + eprintln!( + "Fixtures files are not formatted.\n + Please run `rustup nightly-2025-10-10 run rustfmt --config-path {} {}/*.rs`", + config_path.display(), + contract_dir.display() + ); + + anyhow::bail!("Fixtures files are not formatted") +} + +/// Build contracts for wasm. +fn invoke_wasm_build(current_dir: &Path) -> Result<()> { + let encoded_rustflags = [ + "-Clink-arg=-zstack-size=65536", + "-Clink-arg=--import-memory", + "-Clinker-plugin-lto", + "-Ctarget-cpu=mvp", + "-Dwarnings", + ] + .join("\x1f"); + + let build_res = Command::new(env::var("CARGO")?) + .current_dir(current_dir) + .env("CARGO_TARGET_DIR", current_dir.join("target").display().to_string()) + .env("CARGO_ENCODED_RUSTFLAGS", encoded_rustflags) + .args(["build", "--release", "--target=wasm32-unknown-unknown"]) + .output() + .expect("failed to execute process"); + + if build_res.status.success() { + return Ok(()); + } + + let stderr = String::from_utf8_lossy(&build_res.stderr); + eprintln!("{}", stderr); + bail!("Failed to build wasm contracts"); +} + +/// Post-process the compiled wasm contracts. +fn post_process_wasm(input_path: &Path, output_path: &Path) -> Result<()> { + let mut module = deserialize_file(input_path).with_context(|| format!("Failed to read {:?}", input_path))?; + if let Some(section) = module.export_section_mut() { + section.entries_mut().retain(|entry| { + matches!(entry.internal(), Internal::Function(_)) && (entry.field() == "call" || entry.field() == "deploy") + }); + } + + serialize_to_file(output_path, module).map_err(Into::into) +} + +/// Write the compiled contracts to the given output directory. +fn write_output(build_dir: &Path, out_dir: &Path, entries: Vec) -> Result<()> { + for entry in entries { + let wasm_output = entry.out_wasm_filename(); + post_process_wasm( + &build_dir + .join("target/wasm32-unknown-unknown/release") + .join(&wasm_output), + &out_dir.join(&wasm_output), + )?; + + entry.update_cache(out_dir)?; + } + + Ok(()) +} + +/// Returns the root path of the wasm workspace. +fn find_workspace_root(current_dir: &Path) -> Option { + let mut current_dir = current_dir.to_path_buf(); + + while current_dir.parent().is_some() { + if current_dir.join("Cargo.toml").exists() { + let cargo_toml_contents = fs::read_to_string(current_dir.join("Cargo.toml")).ok()?; + if cargo_toml_contents.contains("[workspace]") { + return Some(current_dir); + } + } + + current_dir.pop(); + } + + None +} + +fn main() -> Result<()> { + let fixtures_dir: PathBuf = env::var("CARGO_MANIFEST_DIR")?.into(); + let contracts_dir = fixtures_dir.join("contracts"); + let out_dir: PathBuf = env::var("OUT_DIR")?.into(); + let workspace_root = find_workspace_root(&fixtures_dir).expect("workspace root exists; qed"); + let root_cargo_toml = workspace_root.join("Cargo.toml"); + + let entries = collect_entries(&contracts_dir, &out_dir); + if entries.is_empty() { + return Ok(()); + } + + let tmp_dir = tempfile::tempdir()?; + let tmp_dir_path = tmp_dir.path(); + + create_cargo_toml(&fixtures_dir, &root_cargo_toml, entries.iter(), tmp_dir.path())?; + invoke_cargo_fmt( + &workspace_root.join(".rustfmt.toml"), + entries.iter().map(|entry| &entry.path as _), + &contracts_dir, + )?; + + invoke_wasm_build(tmp_dir_path)?; + + write_output(tmp_dir_path, &out_dir, entries)?; + Ok(()) +} diff --git a/pallets/contracts-store/fixtures/build/Cargo.toml b/pallets/contracts-store/fixtures/build/Cargo.toml new file mode 100644 index 000000000..b55b60b4e --- /dev/null +++ b/pallets/contracts-store/fixtures/build/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "contracts" +version = "0.6.3" +edition = "2021" + +# Binary targets are injected dynamically by the build script. +[[bin]] + +# All paths or versions are injected dynamically by the build script. +[dependencies] +common = { package = 'pallet-contracts-fixtures-common', path = "" } +polkavm-derive = { version = "0.23.0" } +uapi = { package = 'pallet-contracts-uapi', version = "14.0.0", default-features = false } + +[profile.release] +opt-level = 3 +lto = true +codegen-units = 1 diff --git a/pallets/contracts-store/fixtures/contracts/balance.rs b/pallets/contracts-store/fixtures/contracts/balance.rs new file mode 100644 index 000000000..4011b8379 --- /dev/null +++ b/pallets/contracts-store/fixtures/contracts/balance.rs @@ -0,0 +1,36 @@ +// This file is part of Substrate. + +// Copyright (C) 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. + +#![no_std] +#![no_main] + +use common::output; +use uapi::{HostFn, HostFnImpl as api}; + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() {} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() { + // Initialize buffer with 1s so that we can check that it is overwritten. + output!(balance, [1u8; 8], api::balance,); + + // Assert that the balance is 0. + assert_eq!(&[0u8; 8], balance); +} diff --git a/pallets/contracts-store/fixtures/contracts/call.rs b/pallets/contracts-store/fixtures/contracts/call.rs new file mode 100644 index 000000000..535745ffc --- /dev/null +++ b/pallets/contracts-store/fixtures/contracts/call.rs @@ -0,0 +1,49 @@ +// This file is part of Substrate. + +// Copyright (C) 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. + +//! This calls another contract as passed as its account id. +#![no_std] +#![no_main] + +use common::input; +use uapi::{HostFn, HostFnImpl as api}; + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() {} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() { + input!( + callee_input: [u8; 4], + callee_addr: [u8; 32], + ); + + // Call the callee + api::call_v2( + uapi::CallFlags::empty(), + callee_addr, + 0u64, // How much ref_time to devote for the execution. 0 = all. + 0u64, // How much proof_size to devote for the execution. 0 = all. + None, // No deposit limit. + &0u64.to_le_bytes(), // Value transferred to the contract. + callee_input, + None, + ) + .unwrap(); +} diff --git a/pallets/contracts-store/fixtures/contracts/common/Cargo.toml b/pallets/contracts-store/fixtures/contracts/common/Cargo.toml new file mode 100644 index 000000000..ef08c40f5 --- /dev/null +++ b/pallets/contracts-store/fixtures/contracts/common/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "pallet-contracts-fixtures-common" +publish = false +version = "1.0.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +description = "Common utilities for pallet-contracts-fixtures." + +[dependencies] +uapi = { package = 'pallet-contracts-uapi', version = "14.0.0", default-features = false } diff --git a/pallets/contracts-store/fixtures/contracts/common/src/lib.rs b/pallets/contracts-store/fixtures/contracts/common/src/lib.rs new file mode 100644 index 000000000..504fa7f9e --- /dev/null +++ b/pallets/contracts-store/fixtures/contracts/common/src/lib.rs @@ -0,0 +1,154 @@ +// This file is part of Substrate. + +// Copyright (C) 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. +#![no_std] + +pub use uapi::{HostFn, HostFnImpl as api}; + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + #[cfg(target_arch = "wasm32")] + core::arch::wasm32::unreachable(); +} + +/// Utility macro to read input passed to a contract. +/// +/// Example: +/// +/// ``` +/// input$!( +/// var1: u32, // [0, 4) var1 decoded as u32 +/// var2: [u8; 32], // [4, 36) var2 decoded as a [u8] slice +/// var3: u8, // [36, 37) var3 decoded as a u8 +/// ); +/// +/// // Input and size can be specified as well: +/// input$!( +/// input, // input buffer (optional) +/// 512, // input size (optional) +/// var4: u32, // [0, 4) var4 decoded as u32 +/// var5: [u8], // [4, ..) var5 decoded as a [u8] slice +/// ); +/// ``` +#[macro_export] +macro_rules! input { + (@inner $input:expr, $cursor:expr,) => {}; + (@size $size:expr, ) => { $size }; + + // Match a u8 variable. + // e.g input!(var1: u8, ); + (@inner $input:expr, $cursor:expr, $var:ident: u8, $($rest:tt)*) => { + let $var = $input[$cursor]; + input!(@inner $input, $cursor + 1, $($rest)*); + }; + + // Size of u8 variable. + (@size $size:expr, $var:ident: u8, $($rest:tt)*) => { + input!(@size $size + 1, $($rest)*) + }; + + // Match a u64 variable. + // e.g input!(var1: u64, ); + (@inner $input:expr, $cursor:expr, $var:ident: u64, $($rest:tt)*) => { + let $var = u64::from_le_bytes($input[$cursor..$cursor + 8].try_into().unwrap()); + input!(@inner $input, $cursor + 8, $($rest)*); + }; + + // Size of u64 variable. + (@size $size:expr, $var:ident: u64, $($rest:tt)*) => { + input!(@size $size + 8, $($rest)*) + }; + + // Match a u32 variable. + // e.g input!(var1: u32, ); + (@inner $input:expr, $cursor:expr, $var:ident: u32, $($rest:tt)*) => { + let $var = u32::from_le_bytes($input[$cursor..$cursor + 4].try_into().unwrap()); + input!(@inner $input, $cursor + 4, $($rest)*); + }; + + // Size of u32 variable. + (@size $size:expr, $var:ident: u32, $($rest:tt)*) => { + input!(@size $size + 4, $($rest)*) + }; + + // Match a u8 slice with the remaining bytes. + // e.g input!(512, var1: [u8; 32], var2: [u8], ); + (@inner $input:expr, $cursor:expr, $var:ident: [u8],) => { + let $var = &$input[$cursor..]; + }; + + // Match a u8 slice of the given size. + // e.g input!(var1: [u8; 32], ); + (@inner $input:expr, $cursor:expr, $var:ident: [u8; $n:expr], $($rest:tt)*) => { + let $var = &$input[$cursor..$cursor+$n]; + input!(@inner $input, $cursor + $n, $($rest)*); + }; + + // Size of a u8 slice. + (@size $size:expr, $var:ident: [u8; $n:expr], $($rest:tt)*) => { + input!(@size $size + $n, $($rest)*) + }; + + // Entry point, with the buffer and it's size specified first. + // e.g input!(buffer, 512, var1: u32, var2: [u8], ); + ($buffer:ident, $size:expr, $($rest:tt)*) => { + let mut $buffer = [0u8; $size]; + let $buffer = &mut &mut $buffer[..]; + $crate::api::input($buffer); + input!(@inner $buffer, 0, $($rest)*); + }; + + // Entry point, with the name of the buffer specified and size of the input buffer computed. + // e.g input!(buffer, var1: u32, var2: u64, ); + ($buffer: ident, $($rest:tt)*) => { + input!($buffer, input!(@size 0, $($rest)*), $($rest)*); + }; + + // Entry point, with the size of the input buffer computed. + // e.g input!(var1: u32, var2: u64, ); + ($($rest:tt)*) => { + input!(buffer, $($rest)*); + }; +} + +/// Utility macro to invoke a host function that expect a `output: &mut &mut [u8]` as last argument. +/// +/// Example: +/// ``` +/// // call `api::caller` and store the output in `caller` +/// output!(caller, [0u8; 32], api::caller,); +/// +/// // call `api::get_storage` and store the output in `address` +/// output!(address, [0u8; 32], api::get_storage, &[1u8; 32]); +/// ``` +#[macro_export] +macro_rules! output { + ($output: ident, $buffer: expr, $host_fn:path, $($arg:expr),*) => { + let mut $output = $buffer; + let $output = &mut &mut $output[..]; + $host_fn($($arg,)* $output); + }; +} + +/// Similar to `output!` but unwraps the result. +#[macro_export] +macro_rules! unwrap_output { + ($output: ident, $buffer: expr, $host_fn:path, $($arg:expr),*) => { + let mut $output = $buffer; + let $output = &mut &mut $output[..]; + $host_fn($($arg,)* $output).unwrap(); + }; +} diff --git a/pallets/contracts-store/fixtures/contracts/dummy.rs b/pallets/contracts-store/fixtures/contracts/dummy.rs new file mode 100644 index 000000000..bde0d15e2 --- /dev/null +++ b/pallets/contracts-store/fixtures/contracts/dummy.rs @@ -0,0 +1,28 @@ +// This file is part of Substrate. + +// Copyright (C) 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. +#![no_std] +#![no_main] + +extern crate common; + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() {} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() {} diff --git a/pallets/contracts-store/fixtures/src/lib.rs b/pallets/contracts-store/fixtures/src/lib.rs new file mode 100644 index 000000000..7409f099e --- /dev/null +++ b/pallets/contracts-store/fixtures/src/lib.rs @@ -0,0 +1,42 @@ +// This file is part of Substrate. + +// Copyright (C) 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. + +use sp_runtime::traits::Hash; +use std::{fs, path::PathBuf}; + +/// Load a given wasm module and returns a wasm binary contents along with it's +/// hash. Use the legacy compile_module as fallback, if the rust fixture does +/// not exist yet. +pub fn compile_module(fixture_name: &str) -> anyhow::Result<(Vec, ::Output)> +where + T: frame_system::Config, +{ + let out_dir: PathBuf = env!("OUT_DIR").into(); + let fixture_path = out_dir.join(format!("{fixture_name}.wasm")); + let binary = fs::read(fixture_path)?; + let code_hash = T::Hashing::hash(&binary); + Ok((binary, code_hash)) +} + +#[cfg(test)] +mod test { + #[test] + fn out_dir_should_have_compiled_mocks() { + let out_dir: std::path::PathBuf = env!("OUT_DIR").into(); + assert!(out_dir.join("dummy.wasm").exists()); + } +} diff --git a/pallets/contracts-store/src/benchmarking.rs b/pallets/contracts-store/src/benchmarking.rs new file mode 100644 index 000000000..c8456d57f --- /dev/null +++ b/pallets/contracts-store/src/benchmarking.rs @@ -0,0 +1,164 @@ +use super::*; + +use alloc::vec; +use frame_benchmarking::v2::*; +use frame_support::traits::fungible::Mutate; +use parity_scale_codec::HasCompact; +use sp_runtime::traits::{Bounded, EnsureDiv, Hash}; + +fn assert_has_event(generic_event: T::RuntimeEvent) { + frame_system::Pallet::::assert_has_event(generic_event.into()); +} + +fn mock_upload_code(app_info: &mut AppInfoFor, _: &AccountIdOf, code: Vec) -> DispatchResult { + app_info + .bump_version(T::Hashing::hash(&code)) + .ok_or(Error::::CannotIncrement)?; + Ok(()) +} + +fn prepare_publisher(who: &AccountIdOf) -> DispatchResult +where + BalanceOf: Bounded, +{ + let amount = BalanceOf::::max_value().ensure_div(2u32.into())?; + ::Currency::mint_into(who, amount)?; + Ok(()) +} + +fn publish_app( + origin: OriginFor, + max_instances: Option, + price: Option>, +) -> Result +where + BalanceOf: Bounded, + as HasCompact>::Type: Parameter, +{ + let id = Pallet::::generate_app_id()?; + let publisher = T::UploadOrigin::ensure_origin(origin)?; + prepare_publisher::(&publisher)?; + + Pallet::::do_publish( + id.clone(), + &publisher, + vec![0u8; 32], + max_instances, + price.clone(), + mock_upload_code::, + )?; + Ok(id) +} + +#[benchmarks( +where + BalanceOf: Bounded, + as HasCompact>::Type: Parameter, + ListingsAssetOf: Default, + ListingsBalanceOf: Bounded, +)] +pub mod benchmarks { + use super::*; + use frame_contrib_traits::listings::item::ItemPrice; + + #[benchmark] + fn publish() -> Result<(), BenchmarkError> { + let origin = T::UploadOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Stop("Couldn't get successful origin"))?; + let code = vec![0u8; 32]; + let id = NextAppId::::get(); + let publisher = + T::UploadOrigin::ensure_origin(origin.clone()).map_err(|_| BenchmarkError::Stop("Invalid origin"))?; + prepare_publisher::(&publisher)?; + let max_instances = Some(u64::MAX); + let price = None; + + #[block] + { + let id = Pallet::::generate_app_id()?; + let publisher = + T::UploadOrigin::ensure_origin(origin).map_err(|_| BenchmarkError::Stop("Invalid origin"))?; + + Pallet::::do_publish( + id.clone(), + &publisher, + code, + max_instances, + price.clone(), + mock_upload_code::, + )?; + } + + assert_has_event::( + Event::AppPublished { + id, + publisher, + max_instances, + price, + } + .into(), + ); + + Ok(()) + } + + #[benchmark] + fn set_parameters() -> Result<(), BenchmarkError> { + let origin = T::UploadOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Stop("Couldn't get successful origin"))?; + let id = publish_app::(origin.clone(), None, None)?; + let price = ItemPrice { + asset: ListingsAssetOf::::default(), + amount: ListingsBalanceOf::::max_value(), + }; + + #[extrinsic_call] + _( + origin as T::RuntimeOrigin, + id.clone(), + Some(u64::MAX), + Some(price.clone()), + ); + + assert_has_event::(Event::::AppPriceUpdated { id, price }.into()); + + Ok(()) + } + + #[benchmark] + fn publish_upgrade() -> Result<(), BenchmarkError> { + let origin = T::UploadOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Stop("Couldn't get successful origin"))?; + let id = publish_app::(origin.clone(), None, None)?; + + #[block] + { + let publisher = + T::UploadOrigin::ensure_origin(origin.clone()).map_err(|_| BenchmarkError::Stop("Invalid origin"))?; + Pallet::::do_publish_upgrade(&publisher, id.clone(), vec![1u8; 32], mock_upload_code::)?; + } + + assert_has_event::(Event::::AppUpdated { id, version: 2 }.into()); + + Ok(()) + } + + #[benchmark] + fn request_license() -> Result<(), BenchmarkError> { + let origin = T::UploadOrigin::try_successful_origin() + .map_err(|_| BenchmarkError::Stop("Couldn't get successful origin"))?; + let app_id = publish_app::(origin.clone(), None, None)?; + let license_id = NextLicenseId::::get(app_id.clone()); + let caller = <::InstantiateOrigin>::try_successful_origin() + .map_err(|_| BenchmarkError::Stop("Couldn't get successful origin"))?; + + #[extrinsic_call] + _(caller, app_id.clone()); + + assert_has_event::(Event::::AppLicenseEmitted { app_id, license_id }.into()); + + Ok(()) + } + + impl_benchmark_test_suite!(Pallet, sp_io::TestExternalities::default(), mock::Test); +} diff --git a/pallets/contracts-store/src/lib.rs b/pallets/contracts-store/src/lib.rs new file mode 100644 index 000000000..884e4a167 --- /dev/null +++ b/pallets/contracts-store/src/lib.rs @@ -0,0 +1,484 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +//! # Contracts Store Pallet +//! +//! ## Overview +//! +//! This pallet provides a way to publish and instantiate smart contracts. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! - [publish][Pallet::publish] publishes new applications, given an authorized +//! origin. +//! - [set_parameters][Pallet::set_parameters] sets the parameters of an +//! existing application. +//! - [publish_upgrade][Pallet::publish_upgrade] publishes the code version of +//! an existing application. +//! - [request_license][Pallet::request_license] requests a license for +//! instantiating an application. +//! - [instantiate][Pallet::instantiate] instantiates an application. +//! - [upgrade][Pallet::upgrade] upgrades an application. +//! - [transfer_license][Pallet::transfer_license] transfers a license to +//! another account. +//! - [transfer_ownership][Pallet::transfer_ownership] transfers the ownership +//! of an application. +//! - [set_price][Pallet::set_price] sets the price for an application. +//! - [set_max_instances][Pallet::set_max_instances] sets the maximum number of +//! instances for an application. +//! - [set_determinism][Pallet::set_determinism] sets the determinism for an +//! application. +//! +//! ## Contract Fixtures +//! +//! This crate uses a copy of +//! [pallet-contract-fixtures](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/contract-fixtures) +//! to provide a set of contracts that can be used for testing. + +extern crate alloc; +extern crate core; + +use alloc::vec::Vec; +use frame_contrib_traits::listings::{item::Item, InspectInventory, InspectItem, InventoryLifecycle, MutateItem}; +use frame_support::{pallet_prelude::*, traits::Incrementable}; +use frame_system::pallet_prelude::*; +use pallet_contracts::{Code, CodeUploadReturnValue, CollectEvents, DebugInfo, Determinism, InstantiateReturnValue}; +use parity_scale_codec::HasCompact; +use sp_runtime::traits::StaticLookup; + +#[cfg(test)] +pub(crate) mod mock; +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +mod types; +pub mod weights; + +pub use pallet::*; +pub use types::*; +pub use weights::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + + pub const CONTRACT_MERCHANT_ID: [u8; 20] = *b"CONTRACT_MERCHANT_ID"; + + #[pallet::config] + pub trait Config: pallet_contracts::Config + frame_system::Config>> { + // Primitives: Some overarching types that are aggregated in the system. + + /// The weight information for this pallet. + type WeightInfo: WeightInfo; + + // Origins: Types that manage authorization rules to allow or deny some caller + // origins to execute a method. + + /// An origin to allowed to request copies of an application, and + /// instantiate it once proven they own a copy of the application. + type InstantiateOrigin: EnsureOrigin< + Self::RuntimeOrigin, + Success = (Self::AccountId, ListingsMerchantIdOf), + >; + + // Types: A set of parameter types that the pallet uses to handle information. + + /// An unique identification for an application. + type AppId: Parameter + MaxEncodedLen + Default + Incrementable; + /// An unique identification for a license of the application. + type LicenseId: Parameter + MaxEncodedLen + Default + Incrementable; + + // Dependencies: The external components this pallet depends on. + /// The `Listings` component of a `Marketplace` system. + type Listings: InventoryLifecycle + + InspectItem< + Self::AccountId, + MerchantId = ListingsMerchantIdOf, + InventoryId = Self::AppId, + ItemId = Self::LicenseId, + > + MutateItem; + + // Parameters: A set of constant parameters to configure limits. + + /// The `MerchantId` associated to the contracts store. + #[pallet::constant] + type ContractsStoreMerchantId: Get>; + } + + #[pallet::pallet] + pub struct Pallet(_); + + // Errors inform users that something worked or went wrong. + #[pallet::error] + pub enum Error { + /// The specified app is not found. + AppNotFound, + /// The caller does not have permissions to mutate the specified app. + NoPermission, + /// The given change of the price is invalid. + InvalidPriceChange, + /// Incrementing a parameter failed. + CannotIncrement, + /// The maximum amount of licenses for an application has been already + /// issued. Please contact the publisher of this application. + MaxLicensesExceeded, + /// It is not possible to issue a license, due to a problem issuing the + /// item that represents the license. Contact the publisher of this + /// application. + CannotIssueLicense, + /// The specified license is not found. + LicenseNotFound, + /// The address associated to an app license is not a valid instance. + AppInstanceNotFound, + /// The contract was not instantiated due to being reverted. + ContractReverted, + /// The application instance is up to date. + AppInstanceUpToDate, + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A new app has been published in the store. + AppPublished { + id: T::AppId, + publisher: AccountIdOf, + max_instances: Option, + price: Option>, + }, + /// A new app has been published in the store. + AppUpdated { id: T::AppId, version: u32 }, + /// The price of an application has been updated. + AppPriceUpdated { id: T::AppId, price: ItemPriceOf }, + /// A new license of the app has been emitted and is ready to be + /// acquired. + AppLicenseEmitted { + app_id: T::AppId, + license_id: LicenseIdFor, + }, + /// An app has been instanced. This follows the instantiation a new + /// contract using the application `CodeHash`, using a valid app + /// license. + AppInstantiated { + app_id: T::AppId, + license_id: T::LicenseId, + caller: T::AccountId, + }, + } + + /// The next `AppId` to be used when publishing a new app. + #[pallet::storage] + pub type NextAppId = StorageValue<_, T::AppId, ValueQuery>; + + /// The next `LicenseId` to be used when emitting a new license for an app. + #[pallet::storage] + pub type NextLicenseId = StorageMap<_, Blake2_128Concat, T::AppId, T::LicenseId, ValueQuery>; + + /// The information of registered apps. + #[pallet::storage] + pub type Apps = StorageMap<_, Blake2_128Concat, T::AppId, AppInfoFor>; + + /// The `MerchantId` associated to a contract account. + #[pallet::storage] + pub type ContractMerchantId = StorageMap<_, Blake2_128Concat, T::AccountId, ListingsMerchantIdOf>; + + /// The contract account of an app instance. + #[pallet::storage] + pub type ContractAccount = StorageMap<_, Blake2_128Concat, (T::AppId, T::LicenseId), AccountIdOf>; + + #[pallet::call(weight(::WeightInfo))] + impl Pallet + where + as HasCompact>::Type: Parameter, + { + /// Publish a new application, + #[pallet::call_index(0)] + #[pallet::weight( + ::WeightInfo::publish() + .saturating_add(<::WeightInfo as pallet_contracts::WeightInfo>::upload_code_determinism_enforced(code.len() as u32)) + )] + pub fn publish( + origin: OriginFor, + code: Vec, + max_instances: Option, + price: Option>, + ) -> DispatchResult { + let publisher = T::UploadOrigin::ensure_origin(origin)?; + let id = Self::generate_app_id()?; + + Self::do_publish(id, &publisher, code, max_instances, price, Self::upload_code) + } + + /// Sets the price for an existing application. + /// + /// The caller must be a valid [`UploadOrigin`][T::UploadOrigin], and + /// the account derived from it must be publisher of the application. + #[pallet::call_index(1)] + pub fn set_parameters( + origin: OriginFor, + app_id: T::AppId, + max_instances: Option, + price: Option>, + ) -> DispatchResult { + let who = T::UploadOrigin::ensure_origin(origin)?; + Apps::::try_mutate(app_id.clone(), |maybe_app| { + let Some(app) = maybe_app else { + Err(Error::::AppNotFound)? + }; + + ensure!(app.publisher == who, Error::::NoPermission); + + app.max_instances = max_instances; + // Can't remove the price for an app. + if let Some(price) = price { + app.price = Some(price.clone()); + Self::deposit_event(Event::::AppPriceUpdated { id: app_id, price }) + } + + Ok(()) + }) + } + + /// Publishes the code version of an existing application. Then, every + /// app instance can upgrade to the latest version. + /// + /// The caller must be a valid [`UploadOrigin`][T::UploadOrigin], and + /// the account derived from it must be publisher of the application. + /// + /// This would call a migration to set the new code on for every app + /// instance. + #[pallet::call_index(2)] + #[pallet::weight( + ::WeightInfo::publish_upgrade() + .saturating_add(<::WeightInfo as pallet_contracts::WeightInfo>::upload_code_determinism_enforced(code.len() as u32)) + )] + pub fn publish_upgrade(origin: OriginFor, app_id: T::AppId, code: Vec) -> DispatchResult { + let who = &T::UploadOrigin::ensure_origin(origin)?; + Self::do_publish_upgrade(who, app_id, code, Self::upload_code) + } + + /// Request a license for instantiating an application. + /// + /// The caller must be a valid + /// [`InstantiateOrigin`][T::InstantiateOrigin]. + /// + /// When successful, a new license would be issued, available for + /// purchase or transferred to the caller, if the application is free. + #[pallet::call_index(3)] + pub fn request_license(origin: OriginFor, app_id: T::AppId) -> DispatchResult { + let (who, _) = &<::InstantiateOrigin>::ensure_origin(origin)?; + Apps::::try_mutate(app_id.clone(), |app_info| { + let Some(app) = app_info else { + Err(Error::::AppNotFound)? + }; + let inventory_id = (T::ContractsStoreMerchantId::get(), app_id.clone()); + let license_id = Self::generate_license_id(app_id.clone())?; + + match app.max_instances { + Some(max_instances) if app.instances == max_instances => Err(Error::::MaxLicensesExceeded), + _ => { + app.instances += 1; + Ok(()) + } + }?; + + T::Listings::publish(&inventory_id, &license_id, b"".to_vec(), app.price.clone())?; + + if app.price.is_none() { + T::Listings::transfer(&inventory_id, &license_id, who)?; + } + + Self::deposit_event(Event::::AppLicenseEmitted { app_id, license_id }); + + Ok(()) + }) + } + + #[pallet::call_index(4)] + #[pallet::weight( + <::WeightInfo as pallet_contracts::WeightInfo>::instantiate( + data.len() as u32, + salt.len() as u32, + ) + // + app info + item info + .saturating_add(::DbWeight::get().reads(3)) + )] + pub fn instantiate( + origin: OriginFor, + app_id: T::AppId, + license_id: T::LicenseId, + #[pallet::compact] value: BalanceOf, + data: Vec, + salt: Vec, + ) -> DispatchResult { + let (caller, merchant_id) = <::InstantiateOrigin>::ensure_origin(origin)?; + let inventory_id = (T::ContractsStoreMerchantId::get(), app_id.clone()); + + let AppInfo { code_hash, .. } = Apps::::get(&app_id).ok_or(Error::::AppNotFound)?; + let Item { owner, .. } = + T::Listings::item(&inventory_id, &license_id).ok_or(Error::::LicenseNotFound)?; + + ensure!(caller == owner, Error::::NoPermission); + + let InstantiateReturnValue { result, account_id } = Contracts::::bare_instantiate( + caller.clone(), + value, + Weight::MAX, // TODO: Replace with something reasonable. + None, // Again, charging the uploader with the deposit for instantiating the contract. + Code::Existing(code_hash), + data, + salt, + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result?; + + if result.did_revert() { + Err(Error::::ContractReverted)? + } + + ContractAccount::::insert((app_id.clone(), license_id.clone()), account_id.clone()); + ContractMerchantId::::insert(account_id, merchant_id); + + Self::deposit_event(Event::::AppInstantiated { + app_id, + license_id, + caller, + }); + + Ok(()) + } + + #[pallet::call_index(5)] + #[pallet::weight( + <::WeightInfo as pallet_contracts::WeightInfo>::set_code() + // + app info + item info + instance hash + .saturating_add(::DbWeight::get().reads(4)) + )] + pub fn upgrade(origin: OriginFor, app_id: T::AppId, license_id: T::LicenseId) -> DispatchResult { + let (who, _) = &<::InstantiateOrigin>::ensure_origin(origin)?; + + let AppInfo { code_hash, .. } = Apps::::get(&app_id).ok_or(Error::::AppNotFound)?; + let inventory_id = (T::ContractsStoreMerchantId::get(), app_id.clone()); + let Item { ref owner, .. } = + T::Listings::item(&inventory_id, &license_id).ok_or(Error::::LicenseNotFound)?; + + ensure!(who == owner, Error::::NoPermission); + + let contract_account = + ContractAccount::::get(&(app_id, license_id)).ok_or(Error::::AppInstanceNotFound)?; + + let instance_hash = Contracts::::code_hash(&contract_account).ok_or(Error::::AppInstanceNotFound)?; + + ensure!(code_hash != instance_hash, Error::::AppInstanceUpToDate); + + Contracts::::set_code( + frame_system::Origin::::Root.into(), + T::Lookup::unlookup(contract_account), + code_hash, + )?; + + Ok(()) + } + } +} + +impl Pallet { + fn generate_app_id() -> Result { + NextAppId::::try_mutate(|next_id| { + let id = next_id.clone(); + *next_id = id.increment().ok_or(Error::::CannotIncrement)?; + Ok(id) + }) + } + + fn generate_license_id(app_id: T::AppId) -> Result { + NextLicenseId::::try_mutate(app_id, |next_id| { + let id = next_id.clone(); + *next_id = id.increment().ok_or(Error::::CannotIncrement)?; + Ok(id) + }) + } + + fn do_publish( + id: T::AppId, + publisher: &AccountIdOf, + code: Vec, + max_instances: Option, + price: Option>, + upload_code: impl FnOnce(&mut AppInfoFor, &AccountIdOf, Vec) -> DispatchResult, + ) -> DispatchResult { + Apps::::try_mutate_exists(id.clone(), |app| -> DispatchResult { + let mut app_info = AppInfo { + code_hash: Default::default(), + publisher: publisher.clone(), + max_instances, + instances: 0, + price: price.clone(), + version: 0, + }; + + upload_code(&mut app_info, publisher, code)?; + *app = Some(app_info); + + let inventory_id = (T::ContractsStoreMerchantId::get(), id.clone()); + T::Listings::create(inventory_id, publisher)?; + + Self::deposit_event(Event::AppPublished { + id, + publisher: publisher.clone(), + max_instances, + price, + }); + + Ok(()) + }) + } + + fn do_publish_upgrade( + who: &AccountIdOf, + app_id: T::AppId, + code: Vec, + upload_code: impl FnOnce(&mut AppInfoFor, &AccountIdOf, Vec) -> DispatchResult, + ) -> DispatchResult { + Apps::::try_mutate(app_id.clone(), |maybe_app| { + let Some(app_info) = maybe_app else { + Err(Error::::AppNotFound)? + }; + + ensure!(&app_info.publisher == who, Error::::NoPermission); + upload_code(app_info, who, code)?; + + Self::deposit_event(Event::::AppUpdated { + id: app_id, + version: app_info.version, + }); + Ok(()) + }) + } + + /// Uploads the code of an app, and increases the version of such app. + /// + /// To achieve this as briefly as possible, we take two considerations: + /// + /// 1. No deposit limit: publishers must be aware of this. + /// 2. Enforced determinism: every contract must be executable on-chain. + fn upload_code(app_info: &mut AppInfoFor, publisher: &AccountIdOf, code: Vec) -> DispatchResult { + // Uploads the code: if successful, would return a new `CodeHash` for the + // application. + let CodeUploadReturnValue { code_hash, .. } = + Contracts::::bare_upload_code(publisher.clone(), code, None, Determinism::Enforced)?; + app_info.bump_version(code_hash).ok_or(Error::::CannotIncrement)?; + Ok(()) + } +} + +impl Pallet { + pub fn maybe_merchant_id(who: &T::AccountId) -> Option> { + ContractMerchantId::::get(who) + } +} diff --git a/pallets/contracts-store/src/mock.rs b/pallets/contracts-store/src/mock.rs new file mode 100644 index 000000000..5c07da5da --- /dev/null +++ b/pallets/contracts-store/src/mock.rs @@ -0,0 +1,172 @@ +//! Test environment for contracts store pallet. + +use crate as pallet_contracts_store; + +use frame_contrib_traits::listings::test_utils::{self, MockListings}; +use frame_support::traits::Time; +use frame_support::{derive_impl, pallet_prelude::ConstU32, traits::EnsureOrigin}; +use frame_system::pallet_prelude::BlockNumberFor; +use frame_system::EnsureSigned; +use pallet_contracts::{AddressGenerator, Frame, Schedule}; +use sp_core::parameter_types; +use sp_runtime::{traits::IdentityLookup, BuildStorage, SaturatedConversion}; + +use mock_helpers::ExtHelper; +pub use sp_io::TestExternalities; + +pub const ALICE: AccountId = 1; +pub const BOB: AccountId = 2; + +pub type Block = frame_system::mocking::MockBlock; +pub type AccountId = u128; +pub type AssetId = u32; +pub type Balance = ::Balance; + +pub type Listings = MockListings; + +// Configure a mock runtime to test the pallet. +#[frame_support::runtime] +mod runtime { + #[runtime::runtime] + #[runtime::derive( + RuntimeCall, + RuntimeEvent, + RuntimeError, + RuntimeOrigin, + RuntimeTask, + RuntimeHoldReason, + RuntimeFreezeReason + )] + pub struct Test; + + #[runtime::pallet_index(0)] + pub type System = frame_system; + #[runtime::pallet_index(10)] + pub type Balances = pallet_balances; + #[runtime::pallet_index(30)] + pub type Contracts = pallet_contracts; + #[runtime::pallet_index(31)] + pub type ContractStore = pallet_contracts_store; +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::Config for Test { + type AccountId = AccountId; + type Block = Block; + type Lookup = IdentityLookup; + type AccountData = pallet_balances::AccountData; +} + +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] +impl pallet_balances::Config for Test { + type AccountStore = System; +} + +parameter_types! { + pub MySchedule: Schedule = >::default(); +} + +type MerchantId = u32; +pub type AppId = u64; +pub type LicenseId = u16; + +impl test_utils::Config for Test { + type MerchantId = MerchantId; + type InventoryId = AppId; + type ItemId = LicenseId; + type AssetId = AssetId; + type Balance = Balance; + type MaxMetadataLen = ConstU32<64>; + type MaxKeyLen = ConstU32<32>; + type MaxValueLen = ConstU32<64>; +} + +pub struct SimpleAddressGenerator; + +impl AddressGenerator for SimpleAddressGenerator { + fn contract_address( + deploying_address: &AccountId, + code_hash: &::Hash, + input_data: &[u8], + salt: &[u8], + ) -> AccountId { + let deploying_address = deploying_address << 64; + let code_hash = (code_hash.0.into_iter().filter(|b| *b == 0).count() as AccountId) << 32; + let input_data = (input_data.len() as AccountId) << 16; + let salt = salt.len() as AccountId; + + deploying_address + code_hash + input_data + salt + } +} + +impl Time for Test { + type Moment = BlockNumberFor; + + fn now() -> Self::Moment { + System::block_number() + } +} + +#[derive_impl(pallet_contracts::config_preludes::TestDefaultConfig)] +impl pallet_contracts::Config for Test { + type Time = Self; + type Currency = Balances; + type UploadOrigin = EnsureSigned; + type InstantiateOrigin = EnsureSigned; + type AddressGenerator = SimpleAddressGenerator; + type Schedule = MySchedule; + type CallStack = [Frame; 5]; +} + +pub struct EnsureSignedMerchant; + +impl EnsureOrigin for EnsureSignedMerchant { + type Success = (AccountId, u32); + + fn try_origin(o: RuntimeOrigin) -> Result { + match o.clone().caller { + OriginCaller::system(frame_system::RawOrigin::Signed(who)) => Ok((who, who.saturated_into::())), + _ => Err(o), + } + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(RuntimeOrigin::signed(ALICE)) + } +} + +impl pallet_contracts_store::Config for Test { + type WeightInfo = (); + type InstantiateOrigin = EnsureSignedMerchant; + type AppId = AppId; + type LicenseId = LicenseId; + type Listings = Listings; + type ContractsStoreMerchantId = ConstU32<0>; +} + +#[derive(Default)] +pub struct ExtBuilder { + accounts: mock_helpers::BalancesExtBuilder, +} + +impl ExtBuilder { + fn with_account(mut self, who: AccountId, amount: Balance) -> Self { + self.accounts = self.accounts.with_account(who, amount); + self + } + + fn build(self) -> TestExternalities { + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + self.accounts.as_storage().assimilate_storage(&mut storage).unwrap(); + + let mut ext = TestExternalities::from(storage); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub fn new_test_ext() -> TestExternalities { + ExtBuilder::default().with_account(ALICE, Balance::MAX / 2).build() +} diff --git a/pallets/contracts-store/src/tests.rs b/pallets/contracts-store/src/tests.rs new file mode 100644 index 000000000..cffa5d6c6 --- /dev/null +++ b/pallets/contracts-store/src/tests.rs @@ -0,0 +1,443 @@ +use crate::{ + mock::{self, *}, + Apps, Error, Event, +}; +use frame_contrib_traits::listings::item::ItemPrice; +use frame_contrib_traits::listings::*; +use frame_support::{assert_noop, assert_ok, traits::fungible::Mutate}; +use pallet_contracts_fixtures::compile_module; +use sp_runtime::DispatchError; + +pub const APP_ID: AppId = 0; +pub const LICENSE_ID: LicenseId = 0; + +fn contract(name: &'static str) -> Vec { + compile_module::(name).unwrap().0 +} + +fn code_hash(name: &'static str) -> ::Hash { + compile_module::(name).unwrap().1 +} + +mod publish { + use super::*; + + #[test] + fn fails_if_bad_origin() { + mock::new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::publish(RuntimeOrigin::root(), vec![], None, None), + DispatchError::BadOrigin + ); + }) + } + + #[test] + fn fails_if_caller_cannot_reserve_storage_deposit() { + mock::new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::publish(RuntimeOrigin::signed(BOB), contract("call"), None, None), + pallet_contracts::Error::::StorageDepositNotEnoughFunds + ); + }) + } + + #[test] + fn it_works() { + mock::new_test_ext().execute_with(|| { + assert_ok!(ContractStore::publish( + RuntimeOrigin::signed(ALICE), + contract("call"), + None, + None + )); + + // The app was published. + System::assert_has_event( + Event::::AppPublished { + id: APP_ID, + publisher: ALICE, + max_instances: None, + price: None, + } + .into(), + ); + + // An inventory for storing the licenses was created. + assert!(Listings::exists(&(0, APP_ID))); + }) + } +} + +fn new_test_ext() -> TestExternalities { + let mut t = mock::new_test_ext(); + t.execute_with(|| { + assert_ok!(ContractStore::publish( + RuntimeOrigin::signed(ALICE), + contract("call"), + None, + None + )); + }); + t +} + +mod set_parameters { + use super::*; + use crate::AppInfo; + use frame_support::assert_storage_noop; + + #[test] + fn fails_if_bad_origin() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::set_parameters(RuntimeOrigin::root(), APP_ID, None, None), + DispatchError::BadOrigin + ); + }) + } + + #[test] + fn fails_if_app_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::set_parameters(RuntimeOrigin::signed(ALICE), 1, None, None), + Error::::AppNotFound + ); + }) + } + + #[test] + fn fails_if_not_the_publisher() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::set_parameters(RuntimeOrigin::signed(BOB), APP_ID, None, None), + Error::::NoPermission + ); + }) + } + + #[test] + fn it_works() { + new_test_ext().execute_with(|| { + assert_storage_noop!({ + let _ = ContractStore::set_parameters(RuntimeOrigin::signed(ALICE), APP_ID, None, None); + }); + }); + + new_test_ext().execute_with(|| { + assert_ok!(ContractStore::set_parameters( + RuntimeOrigin::signed(ALICE), + APP_ID, + Some(10), + None + )); + + assert!(matches!( + Apps::::get(0), + Some(AppInfo { + max_instances: Some(10), + .. + }) + )); + }); + + new_test_ext().execute_with(|| { + assert_ok!(ContractStore::set_parameters( + RuntimeOrigin::signed(ALICE), + APP_ID, + None, + Some(ItemPrice { asset: 0, amount: 10 }) + )); + + System::assert_has_event( + Event::::AppPriceUpdated { + id: APP_ID, + price: ItemPrice { asset: 0, amount: 10 }, + } + .into(), + ) + }) + } +} + +mod publish_upgrade { + use super::*; + + #[test] + fn fails_if_bad_origin() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::publish_upgrade(RuntimeOrigin::root(), APP_ID, contract("balance")), + DispatchError::BadOrigin + ); + }) + } + + #[test] + fn fails_if_app_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::publish_upgrade(RuntimeOrigin::signed(ALICE), 1, contract("balance")), + Error::::AppNotFound + ); + }) + } + + #[test] + fn fails_if_caller_cannot_reserve_storage_deposit() { + mock::new_test_ext().execute_with(|| { + Balances::set_balance(&BOB, Balance::MAX / 2); + assert_ok!(ContractStore::publish( + RuntimeOrigin::signed(BOB), + contract("call"), + None, + None + )); + Balances::set_balance(&BOB, 0); + assert_noop!( + ContractStore::publish_upgrade(RuntimeOrigin::signed(BOB), APP_ID, contract("balance")), + pallet_contracts::Error::::StorageDepositNotEnoughFunds, + ); + }) + } + + #[test] + fn it_works() { + new_test_ext().execute_with(|| { + assert_ok!(ContractStore::publish_upgrade( + RuntimeOrigin::signed(ALICE), + APP_ID, + contract("balance") + )); + }) + } +} + +mod request_license { + use super::*; + + #[test] + fn fails_if_bad_origin() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::request_license(RuntimeOrigin::root(), APP_ID), + DispatchError::BadOrigin + ); + }) + } + + #[test] + fn fails_if_app_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::request_license(RuntimeOrigin::signed(ALICE), 1), + Error::::AppNotFound + ); + }) + } + + #[test] + fn fails_if_max_licenses_exceeded() { + mock::new_test_ext().execute_with(|| { + assert_ok!(ContractStore::publish( + RuntimeOrigin::signed(ALICE), + contract("call"), + Some(0), + None + )); + + assert_noop!( + ContractStore::request_license(RuntimeOrigin::signed(BOB), APP_ID), + Error::::MaxLicensesExceeded + ); + }) + } + + #[test] + fn it_works() { + // App is free. + new_test_ext().execute_with(|| { + assert_ok!(ContractStore::request_license(RuntimeOrigin::signed(BOB), APP_ID)); + assert!(matches!( + Listings::item(&(0, APP_ID), &LICENSE_ID), + Some(item::Item { owner: BOB, .. }) + )); + }); + + // App has a price. + mock::new_test_ext().execute_with(|| { + assert_ok!(ContractStore::publish( + RuntimeOrigin::signed(ALICE), + contract("call"), + None, + Some(ItemPrice { asset: 0, amount: 10 }) + )); + assert_ok!(ContractStore::request_license(RuntimeOrigin::signed(BOB), APP_ID)); + + System::assert_has_event( + Event::::AppLicenseEmitted { + app_id: APP_ID, + license_id: LICENSE_ID, + } + .into(), + ); + + assert!(matches!( + Listings::item(&(0, 0), &0), + Some(item::Item { + owner: ALICE, + price: Some(ItemPrice { asset: 0, amount: 10 }), + .. + }) + )); + }) + } +} + +fn test_ext_post_license() -> TestExternalities { + let mut t = new_test_ext(); + t.execute_with(|| { + assert_ok!(ContractStore::request_license(RuntimeOrigin::signed(BOB), APP_ID)); + }); + t +} + +mod instantiate { + use super::*; + use pallet_contracts::AddressGenerator; + use sp_runtime::TokenError; + + #[test] + fn fails_if_bad_origin() { + test_ext_post_license().execute_with(|| { + assert_noop!( + ContractStore::instantiate(RuntimeOrigin::root(), APP_ID, LICENSE_ID, 0, vec![], vec![]), + DispatchError::BadOrigin + ); + }) + } + + #[test] + fn fails_if_instantiation_data_not_found() { + test_ext_post_license().execute_with(|| { + assert_noop!( + ContractStore::instantiate(RuntimeOrigin::signed(ALICE), 1, LICENSE_ID, 0, vec![], vec![]), + Error::::AppNotFound + ); + }); + + test_ext_post_license().execute_with(|| { + assert_noop!( + ContractStore::instantiate(RuntimeOrigin::signed(ALICE), APP_ID, 1, 0, vec![], vec![]), + Error::::LicenseNotFound + ); + }) + } + + #[test] + fn fails_if_caller_is_not_the_license_owner() { + test_ext_post_license().execute_with(|| { + assert_noop!( + ContractStore::instantiate(RuntimeOrigin::signed(ALICE), APP_ID, LICENSE_ID, 0, vec![], vec![]), + Error::::NoPermission + ); + }) + } + + #[test] + fn fails_if_caller_cannot_reserve_storage_deposit() { + test_ext_post_license().execute_with(|| { + assert_noop!( + ContractStore::instantiate(RuntimeOrigin::signed(BOB), APP_ID, LICENSE_ID, 0, vec![], vec![]), + TokenError::FundsUnavailable + ); + }) + } + + #[test] + fn it_works() { + test_ext_post_license().execute_with(|| { + Balances::set_balance(&BOB, Balance::MAX / 2); + assert_ok!(ContractStore::instantiate( + RuntimeOrigin::signed(BOB), + APP_ID, + LICENSE_ID, + 0, + vec![], + vec![] + )); + + System::assert_has_event( + Event::::AppInstantiated { + app_id: APP_ID, + license_id: LICENSE_ID, + caller: BOB, + } + .into(), + ); + + let contract_address = SimpleAddressGenerator::contract_address(&BOB, &code_hash("call"), &[], &[]); + + assert_eq!(ContractStore::maybe_merchant_id(&contract_address), Some(2)); + }) + } +} + +mod upgrade { + use super::*; + + fn new_test_ext() -> TestExternalities { + let mut t = test_ext_post_license(); + t.execute_with(|| { + Balances::set_balance(&BOB, Balance::MAX / 2); + assert_ok!(ContractStore::instantiate( + RuntimeOrigin::signed(BOB), + APP_ID, + LICENSE_ID, + 0, + vec![], + vec![] + )); + }); + t + } + + #[test] + fn fails_if_app_instance_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::upgrade(RuntimeOrigin::signed(BOB), 1, LICENSE_ID), + Error::::AppNotFound + ); + + assert_noop!( + ContractStore::upgrade(RuntimeOrigin::signed(BOB), APP_ID, 1), + Error::::LicenseNotFound + ); + }) + } + + #[test] + fn fails_if_app_is_up_to_date() { + new_test_ext().execute_with(|| { + assert_noop!( + ContractStore::upgrade(RuntimeOrigin::signed(BOB), APP_ID, LICENSE_ID), + Error::::AppInstanceUpToDate + ); + }) + } + + #[test] + fn it_works() { + new_test_ext().execute_with(|| { + assert_ok!(ContractStore::publish_upgrade( + RuntimeOrigin::signed(ALICE), + APP_ID, + contract("balance") + )); + + assert_ok!(ContractStore::upgrade(RuntimeOrigin::signed(BOB), APP_ID, LICENSE_ID)); + }) + } +} diff --git a/pallets/contracts-store/src/types.rs b/pallets/contracts-store/src/types.rs new file mode 100644 index 000000000..8852dc464 --- /dev/null +++ b/pallets/contracts-store/src/types.rs @@ -0,0 +1,36 @@ +use super::*; + +use frame_contrib_traits::listings::item::ItemPrice; +use frame_support::traits::fungible::Inspect; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; + +pub type CodeHash = ::Hash; +pub type AccountIdOf = ::AccountId; +pub type AppInfoFor = AppInfo, AccountIdOf, ItemPriceOf>; +pub type BalanceOf = <::Currency as Inspect>>::Balance; +pub type Contracts = pallet_contracts::Pallet; +pub type ListingsMerchantIdOf = <::Listings as InspectInventory>::MerchantId; +pub type ListingsAssetOf = <::Listings as InspectItem>>::Asset; +pub type ListingsBalanceOf = <::Listings as InspectItem>>::Balance; +pub type ItemPriceOf = ItemPrice, ListingsBalanceOf>; + +type ListingsOf = ::Listings; +pub type LicenseIdFor = as InspectItem>>::ItemId; + +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Eq, Debug)] +pub struct AppInfo { + pub(crate) code_hash: Hash, + pub(crate) publisher: AccountId, + pub(crate) max_instances: Option, + pub(crate) instances: u64, + pub(crate) price: Option, + pub(crate) version: u32, +} + +impl AppInfo { + pub(crate) fn bump_version(&mut self, code_hash: Hash) -> Option<()> { + self.code_hash = code_hash; + self.version = self.version.checked_add(1)?; + Some(()) + } +} diff --git a/pallets/contracts-store/src/weights.rs b/pallets/contracts-store/src/weights.rs new file mode 100644 index 000000000..dd1f5aeca --- /dev/null +++ b/pallets/contracts-store/src/weights.rs @@ -0,0 +1,69 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +pub trait WeightInfo { + fn publish() -> Weight; + fn set_parameters() -> Weight; + fn publish_upgrade() -> Weight; + fn request_license() -> Weight; +} + +/// Weights for pallet_contracts_store using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn publish() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(14)) + } + fn set_parameters() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(14)) + } + fn publish_upgrade() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(14)) + } + fn request_license() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(14)) + } +} + +impl WeightInfo for () { + fn publish() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(RocksDbWeight::get().reads(8)) + .saturating_add(RocksDbWeight::get().writes(14)) + } + fn set_parameters() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(RocksDbWeight::get().reads(8)) + .saturating_add(RocksDbWeight::get().writes(14)) + } + fn publish_upgrade() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(RocksDbWeight::get().reads(8)) + .saturating_add(RocksDbWeight::get().writes(14)) + } + fn request_license() -> Weight { + Weight::from_parts(181_851_000, 0) + .saturating_add(Weight::from_parts(0, 132561)) + .saturating_add(RocksDbWeight::get().reads(8)) + .saturating_add(RocksDbWeight::get().writes(14)) + } +} \ No newline at end of file diff --git a/pallets/payments/README.md b/pallets/payments/README.md deleted file mode 100644 index 5a6461233..000000000 --- a/pallets/payments/README.md +++ /dev/null @@ -1 +0,0 @@ -License: Unlicense diff --git a/pallets/payments/src/benchmarking.rs b/pallets/payments/src/benchmarking.rs deleted file mode 100644 index 8a5313e00..000000000 --- a/pallets/payments/src/benchmarking.rs +++ /dev/null @@ -1,255 +0,0 @@ -use super::*; -#[allow(unused)] -use crate::{types::*, Pallet as Payments}; -use frame_benchmarking::{account, v2::*}; -use frame_support::{ - assert_ok, - traits::{ - fungibles::{Inspect, Mutate}, - Get, - }, - BoundedVec, -}; - -use frame_system::RawOrigin; -use log; -use sp_runtime::Percent; -use sp_std::vec; - -macro_rules! assert_has_event { - ($patt:pat $(if $guard:expr)?) => { - assert!(frame_system::Pallet::::events().iter().any(|record| { - let e = ::RuntimeEvent::from(record.event.clone()); - matches!(e.try_into(), Ok($patt) $(if $guard)?) - })); - }; -} - -fn create_accounts() -> (T::AccountId, T::AccountId, AccountIdLookupOf, AccountIdLookupOf) { - let sender: T::AccountId = account("Alice", 0, 10); - let beneficiary: T::AccountId = account("Bob", 0, 11); - let sender_lookup = T::Lookup::unlookup(sender.clone()); - let beneficiary_lookup = T::Lookup::unlookup(beneficiary.clone()); - - (sender, beneficiary, sender_lookup, beneficiary_lookup) -} - -fn create_and_mint_asset( - sender: &T::AccountId, - beneficiary: &T::AccountId, - asset: &AssetIdOf, -) -> Result<(), BenchmarkError> { - T::BenchmarkHelper::create_asset(asset.clone(), sender.clone(), true, >::from(1u32)); - T::Assets::mint_into(asset.clone(), &sender, >::from(10000000u32))?; - T::Assets::mint_into(asset.clone(), &beneficiary, >::from(10000000u32))?; - - Ok(()) -} - -fn create_payment( - amount: &BalanceOf, - asset: &AssetIdOf, - remark: Option>, -) -> Result< - ( - T::PaymentId, - T::AccountId, - T::AccountId, - AccountIdLookupOf, - AccountIdLookupOf, - ), - BenchmarkError, -> { - let (sender, beneficiary, sender_lookup, beneficiary_lookup) = create_accounts::(); - create_and_mint_asset::(&sender, &beneficiary, &asset)?; - - let (payment_id, payment_detail) = Payments::::create_payment( - &sender, - beneficiary.clone(), - asset.clone(), - amount.clone(), - PaymentState::Created, - T::IncentivePercentage::get(), - remark.as_ref().map(|x| x.as_slice()), - )?; - - // reserve funds for payment - Payments::::reserve_payment_amount(&sender, payment_detail)?; - - log::info!("reserve_payment_amount executed"); - - // TODO: check storage items - - Ok((payment_id, sender, beneficiary, sender_lookup, beneficiary_lookup)) -} - -#[benchmarks( - where - <::Assets as Inspect<::AccountId>>::AssetId: Default, -)] -mod benchmarks { - use super::*; - #[benchmark] - fn pay(q: Linear<1, { T::MaxRemarkLength::get() }>) -> Result<(), BenchmarkError> { - let (sender, beneficiary, _, beneficiary_lookup) = create_accounts::(); - - let asset_id: AssetIdOf = >::default(); - create_and_mint_asset::(&sender, &beneficiary, &asset_id)?; - let payment_amount = >::from(100000_u32); - - let order_remark: Option> = if q == 0 { - None - } else { - Some(BoundedVec::try_from(vec![1 as u8; q as usize]).unwrap()) - }; - - #[extrinsic_call] - _( - RawOrigin::Signed(sender.clone()), - beneficiary_lookup, - asset_id.clone(), - payment_amount, - order_remark.clone(), - ); - - assert_has_event!( - Event::PaymentCreated { asset, amount, remark, .. } - if asset == asset_id && amount == payment_amount && remark == order_remark - ); - Ok(()) - } - - #[benchmark] - fn release() -> Result<(), BenchmarkError> { - let amount = >::from(100000_u32); - let asset = >::default(); - let (payment_id, sender, _beneficiary, _, beneficiary_lookup) = create_payment::(&amount, &asset, None)?; - - log::info!("beneficiary_lookup: {:?}", beneficiary_lookup); - - #[extrinsic_call] - _(RawOrigin::Signed(sender), payment_id); - - assert_has_event!(Event::PaymentReleased { .. }); - Ok(()) - } - - #[benchmark] - fn cancel() -> Result<(), BenchmarkError> { - let amount = >::from(100000_u32); - let asset = >::default(); - let (payment_id, _sender, beneficiary, _sender_lookup, _beneficiary_lookup) = - create_payment::(&amount, &asset, None)?; - - #[extrinsic_call] - _(RawOrigin::Signed(beneficiary.clone()), payment_id); - - assert_has_event!(Event::PaymentCancelled { .. }); - Ok(()) - } - - #[benchmark] - fn request_refund() -> Result<(), BenchmarkError> { - let amount = >::from(100000_u32); - let asset = >::default(); - let (payment_id, sender, _beneficiary, _sender_lookup, _beneficiary_lookup) = - create_payment::(&amount, &asset, None)?; - - #[extrinsic_call] - _(RawOrigin::Signed(sender.clone()), payment_id); - - let current_block = frame_system::Pallet::::block_number(); - assert_has_event!( - Event::PaymentCreatorRequestedRefund { expiry, .. } - if expiry == (current_block + T::CancelBufferBlockLength::get()) - ); - Ok(()) - } - - #[benchmark] - fn dispute_refund() -> Result<(), BenchmarkError> { - let amount = >::from(100000_u32); - let asset = >::default(); - let (payment_id, sender, beneficiary, _sender_lookup, _beneficiary_lookup) = - create_payment::(&amount, &asset, None)?; - - assert_ok!(Payments::::request_refund( - RawOrigin::Signed(sender.clone()).into(), - payment_id - )); - - #[extrinsic_call] - _(RawOrigin::Signed(beneficiary.clone()), payment_id); - - assert_has_event!(Event::PaymentRefundDisputed { .. }); - Ok(()) - } - - #[benchmark] - fn resolve_dispute() -> Result<(), BenchmarkError> { - let amount = >::from(100000_u32); - let asset = >::default(); - let (payment_id, sender, beneficiary, _sender_lookup, _beneficiary_lookup) = - create_payment::(&amount, &asset, None)?; - - assert_ok!(Payments::::request_refund( - RawOrigin::Signed(sender.clone()).into(), - payment_id - )); - assert_ok!(Payments::::dispute_refund( - RawOrigin::Signed(beneficiary.clone()).into(), - payment_id - )); - - let dispute_result = DisputeResult { - percent_beneficiary: Percent::from_percent(90), - in_favor_of: Role::Sender, - }; - - #[extrinsic_call] - _(RawOrigin::Root, payment_id, dispute_result); - - assert_has_event!(Event::PaymentDisputeResolved { .. }); - Ok(()) - } - - #[benchmark] - fn request_payment() -> Result<(), BenchmarkError> { - let (sender, beneficiary, sender_lookup, _beneficiary_lookup) = create_accounts::(); - let asset: AssetIdOf = >::default(); - create_and_mint_asset::(&sender, &beneficiary, &asset)?; - let amount = >::from(100000_u32); - - #[extrinsic_call] - _(RawOrigin::Signed(beneficiary.clone()), sender_lookup, asset, amount); - - assert_has_event!(Event::PaymentRequestCreated { .. }); - Ok(()) - } - - #[benchmark] - fn accept_and_pay() -> Result<(), BenchmarkError> { - let (sender, beneficiary, _sender_lookup, _beneficiary_lookup) = create_accounts::(); - let asset: AssetIdOf = >::default(); - create_and_mint_asset::(&sender, &beneficiary, &asset)?; - let amount = >::from(100000_u32); - - let (payment_id, _) = Payments::::create_payment( - &sender, - beneficiary, - asset.clone(), - amount.clone(), - PaymentState::PaymentRequested, - T::IncentivePercentage::get(), - None, - )?; - - #[extrinsic_call] - _(RawOrigin::Signed(sender.clone()), payment_id); - - assert_has_event!(Event::PaymentRequestCompleted { .. }); - Ok(()) - } - - impl_benchmark_test_suite!(Payments, crate::mock::new_test_ext(), crate::mock::Test); -} diff --git a/pallets/payments/src/lib.rs b/pallets/payments/src/lib.rs deleted file mode 100644 index 622130d9c..000000000 --- a/pallets/payments/src/lib.rs +++ /dev/null @@ -1,706 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_system::pallet_prelude::BlockNumberFor; -/// Edit this file to define custom logic or remove it if it is not needed. -/// Learn more about FRAME and the core library of Substrate FRAME pallets: -/// -pub use pallet::*; - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod tests; - -pub use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use sp_io::hashing::blake2_256; - -use frame_support::{ - dispatch::{GetDispatchInfo, PostDispatchInfo}, - ensure, fail, - traits::{ - fungibles::{ - hold::Mutate as FunHoldMutate, Balanced as FunBalanced, Inspect as FunInspect, Mutate as FunMutate, - }, - schedule::{v3::Named as ScheduleNamed, DispatchTime}, - tokens::{ - fungibles::Inspect as FunsInspect, - Fortitude::Polite, - Precision::Exact, - Preservation::{Expendable, Preserve}, - }, - Bounded, CallerTrait, QueryPreimage, StorePreimage, - }, -}; -use sp_std::vec::Vec; - -pub mod weights; -use sp_runtime::{ - traits::{CheckedAdd, Dispatchable, StaticLookup}, - DispatchError, DispatchResult, Percent, Saturating, -}; -pub use weights::*; - -pub mod types; -pub use types::*; - -pub trait PaymentId: Copy + Clone { - fn next(sender: &T::AccountId, beneficiary: &T::AccountId) -> Option; -} - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::{ - dispatch::DispatchResultWithPostInfo, - pallet_prelude::{StorageDoubleMap, *}, - PalletId, - }; - use frame_system::pallet_prelude::*; - - use sp_runtime::{traits::Get, Percent}; - - #[cfg(feature = "runtime-benchmarks")] - pub trait BenchmarkHelper { - fn create_asset(id: AssetId, admin: AccountId, is_sufficient: bool, min_balance: Balance); - } - - #[pallet::config] - pub trait Config: frame_system::Config { - type RuntimeEvent: TryInto> - + From> - + IsType<::RuntimeEvent>; - - /// The caller origin, overarching type of all pallets origins. - type PalletsOrigin: From> - + CallerTrait - + MaxEncodedLen; - - /// The aggregated call type. - type RuntimeCall: Parameter - + Dispatchable - + GetDispatchInfo - + From>; - - /// Currency type that this works on. - type Assets: FunInspect - + FunMutate - + FunBalanced - + FunHoldMutate - + FunsInspect; - - /// Just the `Currency::Balance` type; we have this item to allow us to - /// constrain it to `From`. - type AssetsBalance: sp_runtime::traits::AtLeast32BitUnsigned - + parity_scale_codec::FullCodec - + Copy - + MaybeSerializeDeserialize - + sp_std::fmt::Debug - + Default - + TypeInfo - + MaxEncodedLen; - - type FeeHandler: FeeHandler; - - type SenderOrigin: EnsureOrigin; - - type BeneficiaryOrigin: EnsureOrigin; - - type DisputeResolver: EnsureOrigin; - - type PaymentId: PaymentId + Member + Parameter + MaxEncodedLen; - - type Scheduler: ScheduleNamed, CallOf, Self::PalletsOrigin, Hasher = Self::Hashing>; - - /// The preimage provider used to look up call hashes to get the call. - type Preimages: QueryPreimage + StorePreimage; - - /// The overarching hold reason. - type RuntimeHoldReason: From; - - /// Weight information for extrinsics in this pallet. - type WeightInfo: WeightInfo; - - #[pallet::constant] - type PalletId: Get; - - #[pallet::constant] - type IncentivePercentage: Get; - - #[pallet::constant] - type MaxRemarkLength: Get; - - #[pallet::constant] - type MaxFees: Get; - - #[pallet::constant] - type MaxDiscounts: Get; - - /// Buffer period - number of blocks to wait before user can claim - /// canceled payment - #[pallet::constant] - type CancelBufferBlockLength: Get>; - - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper: BenchmarkHelper, AssetIdOf, BalanceOf>; - } - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::storage] - #[pallet::getter(fn payment)] - /// Payments created by a user, this method of storageDoubleMap is chosen - /// since there is no usecase for listing payments by provider/currency. The - /// payment will only be referenced by the creator in any transaction of - /// interest. The storage map keys are the creator and the recipient, this - /// also ensures that for any (sender,recipient) combo, only a single - /// payment is active. The history of payment is not stored. - pub type Payment = StorageDoubleMap< - _, - Blake2_128Concat, - // Sender - T::AccountId, - Twox64Concat, - T::PaymentId, - PaymentDetail, - ResultQuery::NonExistentStorageValue>, - >; - - #[pallet::storage] - pub type PaymentParties = StorageMap< - _, - Twox64Concat, - T::PaymentId, - // Sender, Beneficiary pair - (T::AccountId, T::AccountId), - ResultQuery::NonExistentStorageValue>, - >; - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// A new payment has been created - PaymentCreated { - payment_id: T::PaymentId, - asset: AssetIdOf, - amount: BalanceOf, - remark: Option>, - }, - /// Payment amount released to the recipient - PaymentReleased { payment_id: T::PaymentId }, - /// Payment has been cancelled by the creator - PaymentCancelled { payment_id: T::PaymentId }, - /// A payment that NeedsReview has been resolved by Judge - PaymentResolved { - payment_id: T::PaymentId, - recipient_share: Percent, - }, - /// the payment creator has created a refund request - PaymentCreatorRequestedRefund { - payment_id: T::PaymentId, - expiry: BlockNumberFor, - }, - /// the payment was refunded - PaymentRefunded { payment_id: T::PaymentId }, - /// the refund request from creator was disputed by recipient - PaymentRefundDisputed { payment_id: T::PaymentId }, - /// Payment request was created by recipient - PaymentRequestCreated { payment_id: T::PaymentId }, - /// Payment request was completed by sender - PaymentRequestCompleted { payment_id: T::PaymentId }, - /// Payment disputed resolved - PaymentDisputeResolved { payment_id: T::PaymentId }, - } - - #[pallet::error] - pub enum Error { - /// The selected payment does not exist - InvalidPayment, - /// The selected payment cannot be released - PaymentAlreadyReleased, - /// The selected payment already exists and is in process - PaymentAlreadyInProcess, - /// Action permitted only for whitelisted users - InvalidAction, - /// Payment is in review state and cannot be modified - PaymentNeedsReview, - /// Unexpeted math error - MathError, - /// Payment request has not been created - RefundNotRequested, - /// Dispute period has not passed - DisputePeriodNotPassed, - /// The automatic cancelation queue cannot accept - RefundQueueFull, - /// Release was not possible - ReleaseFailed, - /// Transfer failed - TransferFailed, - /// Storage Value does not exist - NonExistentStorageValue, - /// Unable to issue a payment id - NoPaymentIdAvailable, - /// Call from wrong beneficiary - InvalidBeneficiary, - } - - #[pallet::composite_enum] - pub enum HoldReason { - #[codec(index = 0)] - TransferPayment, - } - - #[pallet::call] - impl Pallet { - /// This allows any user to create a new payment, that releases only to - /// specified recipient The only action is to store the details of this - /// payment in storage and reserve the specified amount. User also has - /// the option to add a remark, this remark can then be used to run - /// custom logic and trigger alternate payment flows. the specified - /// amount. - #[pallet::call_index(0)] - #[pallet::weight(::WeightInfo::pay(remark.as_ref().map(|x| x.len() as u32).unwrap_or(0)))] - pub fn pay( - origin: OriginFor, - beneficiary: AccountIdLookupOf, - asset: AssetIdOf, - #[pallet::compact] amount: BalanceOf, - remark: Option>, - ) -> DispatchResultWithPostInfo { - let sender = T::SenderOrigin::ensure_origin(origin)?; - let beneficiary = T::Lookup::lookup(beneficiary)?; - - // create PaymentDetail and add to storage - let (payment_id, payment_detail) = Self::create_payment( - &sender, - beneficiary, - asset.clone(), - amount, - PaymentState::Created, - T::IncentivePercentage::get(), - remark.as_ref().map(|x| x.as_slice()), - )?; - - // reserve funds for payment - Self::reserve_payment_amount(&sender, payment_detail)?; - // emit paymentcreated event - Self::deposit_event(Event::PaymentCreated { - payment_id, - asset, - amount, - remark, - }); - Ok(().into()) - } - - /// Release any created payment, this will transfer the reserved amount - /// from the creator of the payment to the assigned recipient - #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::release())] - pub fn release(origin: OriginFor, payment_id: T::PaymentId) -> DispatchResultWithPostInfo { - let sender = T::SenderOrigin::ensure_origin(origin)?; - - // ensure the payment is in Created state - let payment = Payment::::get(&sender, &payment_id).map_err(|_| Error::::InvalidPayment)?; - ensure!(payment.state == PaymentState::Created, Error::::InvalidAction); - Self::settle_payment(&sender, &payment.beneficiary, &payment_id, None)?; - - Self::deposit_event(Event::PaymentReleased { payment_id }); - Ok(().into()) - } - - /// Allow the creator of a payment to initiate a refund that will return - /// the funds after a configured amount of time that the receiver has to - /// react and opose the request - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::request_refund())] - pub fn request_refund(origin: OriginFor, payment_id: T::PaymentId) -> DispatchResultWithPostInfo { - let sender = T::SenderOrigin::ensure_origin(origin)?; - - let expiry = Payment::::try_mutate(&sender, &payment_id, |maybe_payment| -> Result<_, DispatchError> { - // ensure the payment exists - let payment = maybe_payment.as_mut().map_err(|_| Error::::InvalidPayment)?; - // refunds only possible for payments in created state - ensure!(payment.state == PaymentState::Created, Error::::InvalidAction); - - // set the payment to requested refund - let current_block = frame_system::Pallet::::block_number(); - let cancel_block = current_block - .checked_add(&T::CancelBufferBlockLength::get()) - .ok_or(Error::::MathError)?; - let cancel_call = ::RuntimeCall::from(pallet::Call::::cancel { payment_id }); - - T::Scheduler::schedule_named( - ("payment", payment_id).using_encoded(blake2_256), - DispatchTime::At(cancel_block), - None, - 63, - frame_system::RawOrigin::Signed(payment.beneficiary.clone()).into(), - T::Preimages::bound(cancel_call)?, - )?; - - payment.state = PaymentState::RefundRequested { cancel_block }; - - Ok(cancel_block) - })?; - - Self::deposit_event(Event::PaymentCreatorRequestedRefund { payment_id, expiry }); - - Ok(().into()) - } - - #[pallet::call_index(3)] - #[pallet::weight(::WeightInfo::accept_and_pay())] - pub fn accept_and_pay(origin: OriginFor, payment_id: T::PaymentId) -> DispatchResultWithPostInfo { - let sender = T::SenderOrigin::ensure_origin(origin)?; - let (_, beneficiary) = PaymentParties::::get(&payment_id)?; - - Payment::::try_mutate(&sender, payment_id, |maybe_payment| -> Result<_, DispatchError> { - let payment = maybe_payment.as_mut().map_err(|_| Error::::InvalidPayment)?; - const IS_DISPUTE: bool = false; - - // Release sender fees recipients - let (fee_sender_recipients, _total_sender_fee_amount_mandatory, _total_sender_fee_amount_optional) = - payment.fees.summary_for(Role::Sender, IS_DISPUTE)?; - - let ( - fee_beneficiary_recipients, - _total_beneficiary_fee_amount_mandatory, - _total_beneficiary_fee_amount_optional, - ) = payment.fees.summary_for(Role::Beneficiary, IS_DISPUTE)?; - - Self::try_transfer_fees(&sender, payment, fee_sender_recipients, IS_DISPUTE)?; - - T::Assets::transfer(payment.asset.clone(), &sender, &beneficiary, payment.amount, Expendable) - .map_err(|_| Error::::TransferFailed)?; - - Self::try_transfer_fees(&beneficiary, payment, fee_beneficiary_recipients, IS_DISPUTE)?; - - payment.state = PaymentState::Finished; - Ok(()) - })?; - - Self::deposit_event(Event::PaymentRequestCompleted { payment_id }); - Ok(().into()) - } - - /// Cancel a payment in created state, this will release the reserved - /// back to creator of the payment. This extrinsic can only be called by - /// the recipient of the payment - #[pallet::call_index(10)] - #[pallet::weight(::WeightInfo::cancel())] - pub fn cancel(origin: OriginFor, payment_id: T::PaymentId) -> DispatchResultWithPostInfo { - let beneficiary = T::BeneficiaryOrigin::ensure_origin(origin)?; - let (sender, b) = PaymentParties::::get(&payment_id)?; - ensure!(beneficiary == b, Error::::InvalidBeneficiary); - - let payment = Payment::::get(&sender, &payment_id).map_err(|_| Error::::InvalidPayment)?; - - match payment.state { - PaymentState::Created => { - Self::cancel_payment(&sender, payment)?; - Self::deposit_event(Event::PaymentCancelled { payment_id }); - } - PaymentState::RefundRequested { cancel_block: _ } => { - Self::cancel_payment(&sender, payment)?; - Self::deposit_event(Event::PaymentRefunded { payment_id }); - } - _ => fail!(Error::::InvalidAction), - } - - Payment::::remove(&sender, &payment_id); - PaymentParties::::remove(payment_id); - - Ok(().into()) - } - - /// Allow payment beneficiary to dispute the refund request from the - /// payment creator This does not cancel the request, instead sends the - /// payment to a NeedsReview state The assigned resolver account can - /// then change the state of the payment after review. - #[pallet::call_index(11)] - #[pallet::weight(::WeightInfo::dispute_refund())] - pub fn dispute_refund(origin: OriginFor, payment_id: T::PaymentId) -> DispatchResultWithPostInfo { - let beneficiary = T::BeneficiaryOrigin::ensure_origin(origin)?; - let (sender, b) = PaymentParties::::get(&payment_id)?; - ensure!(beneficiary == b, Error::::InvalidBeneficiary); - - Payment::::try_mutate(&sender, &payment_id, |maybe_payment| -> Result<_, DispatchError> { - // ensure the payment exists - let payment = maybe_payment.as_mut().map_err(|_| Error::::InvalidPayment)?; - - // ensure the payment is in Requested Refund state - let PaymentState::RefundRequested { cancel_block } = payment.state else { - fail!(Error::::InvalidAction); - }; - ensure!( - cancel_block > frame_system::Pallet::::block_number(), - Error::::InvalidAction - ); - - // Hold beneficiary incentive amount to balance the incentives at the time to - // resolve the dispute - let reason = &HoldReason::TransferPayment.into(); - T::Assets::hold(payment.asset.clone(), reason, &beneficiary, payment.incentive_amount)?; - - payment.state = PaymentState::NeedsReview; - - T::Scheduler::cancel_named(("payment", payment_id).using_encoded(blake2_256)) - })?; - - Self::deposit_event(Event::PaymentRefundDisputed { payment_id }); - Ok(().into()) - } - - // Creates a new payment with the given details. This can be called by the - // recipient of the payment to create a payment and then completed by the sender - // using the `accept_and_pay` extrinsic. The payment will be in - // PaymentRequested State and can only be modified by the `accept_and_pay` - // extrinsic. - #[pallet::call_index(12)] - #[pallet::weight(::WeightInfo::request_payment())] - pub fn request_payment( - origin: OriginFor, - sender: AccountIdLookupOf, - asset: AssetIdOf, - #[pallet::compact] amount: BalanceOf, - ) -> DispatchResultWithPostInfo { - let beneficiary = T::BeneficiaryOrigin::ensure_origin(origin)?; - let sender = T::Lookup::lookup(sender)?; - // create PaymentDetail and add to storage - let (payment_id, _) = Self::create_payment( - &sender, - beneficiary, - asset, - amount, - PaymentState::PaymentRequested, - T::IncentivePercentage::get(), - None, - )?; - - Self::deposit_event(Event::PaymentRequestCreated { payment_id }); - - Ok(().into()) - } - - #[pallet::call_index(20)] - #[pallet::weight(::WeightInfo::resolve_dispute())] - pub fn resolve_dispute( - origin: OriginFor, - payment_id: T::PaymentId, - dispute_result: DisputeResult, - ) -> DispatchResultWithPostInfo { - let dispute_resolver = T::DisputeResolver::ensure_origin(origin)?; - let (sender, beneficiary) = PaymentParties::::get(&payment_id)?; - - let payment = Payment::::get(&sender, &payment_id).map_err(|_| Error::::InvalidPayment)?; - ensure!(payment.state == PaymentState::NeedsReview, Error::::InvalidAction); - - let dispute = Some((dispute_result, dispute_resolver)); - Self::settle_payment(&sender, &beneficiary, &payment_id, dispute)?; - - Self::deposit_event(Event::PaymentDisputeResolved { payment_id }); - Ok(().into()) - } - } -} - -impl Pallet { - /// The function will create a new payment. The fee and incentive - /// amounts will be calculated and the `PaymentDetail` will be added to - /// storage. - #[allow(clippy::too_many_arguments)] - fn create_payment( - sender: &T::AccountId, - beneficiary: T::AccountId, - asset: AssetIdOf, - amount: BalanceOf, - payment_state: PaymentState>, - incentive_percentage: Percent, - remark: Option<&[u8]>, - ) -> Result<(T::PaymentId, PaymentDetail), DispatchError> { - let payment_id = T::PaymentId::next(sender, &beneficiary).ok_or(Error::::NoPaymentIdAvailable)?; - Payment::::try_mutate(sender, payment_id, |maybe_payment| -> Result<_, DispatchError> { - if let Ok(payment) = maybe_payment { - ensure!( - payment.state == PaymentState::PaymentRequested, - Error::::PaymentAlreadyInProcess - ); - } - - let incentive_amount = incentive_percentage.mul_floor(amount); - - let fees_details: Fees = T::FeeHandler::apply_fees(&asset, sender, &beneficiary, &amount, remark); - - let new_payment = PaymentDetail:: { - asset, - amount, - beneficiary: beneficiary.clone(), - incentive_amount, - state: payment_state, - fees: fees_details, - }; - *maybe_payment = Ok(new_payment.clone()); - PaymentParties::::insert(payment_id, (sender, beneficiary)); - - Ok(new_payment) - }) - .map(|payment| (payment_id, payment)) - } - - fn reserve_payment_amount(sender: &T::AccountId, payment: PaymentDetail) -> DispatchResult { - let (_fee_recipients, total_fee_from_sender_mandatory, total_fee_from_sender_optional) = - payment.fees.summary_for(Role::Sender, false)?; - - let total_hold_amount = total_fee_from_sender_mandatory - .saturating_add(payment.incentive_amount) - .saturating_add(total_fee_from_sender_optional); - let reason = &HoldReason::TransferPayment.into(); - T::Assets::hold(payment.asset.clone(), reason, sender, total_hold_amount)?; - - T::Assets::transfer_and_hold( - payment.asset, - reason, - sender, - &payment.beneficiary, - payment.amount, - Exact, - Preserve, - Polite, - )?; - - Ok(()) - } - - fn cancel_payment(sender: &T::AccountId, payment: PaymentDetail) -> DispatchResult { - let (_fee_recipients, total_fee_from_sender_mandatory, total_fee_from_sender_optional) = - payment.fees.summary_for(Role::Sender, false)?; - - let total_hold_amount = total_fee_from_sender_mandatory - .saturating_add(payment.incentive_amount) - .saturating_add(total_fee_from_sender_optional); - let reason = &HoldReason::TransferPayment.into(); - - T::Assets::release(payment.asset.clone(), reason, sender, total_hold_amount, Exact) - .map_err(|_| Error::::ReleaseFailed)?; - - let beneficiary = &payment.beneficiary; - T::Assets::release(payment.asset.clone(), reason, beneficiary, payment.amount, Exact) - .map_err(|_| Error::::ReleaseFailed)?; - - T::Assets::transfer(payment.asset, beneficiary, sender, payment.amount, Expendable) - .map_err(|_| Error::::TransferFailed)?; - - Ok(()) - } - - fn settle_payment( - sender: &T::AccountId, - beneficiary: &T::AccountId, - payment_id: &T::PaymentId, - maybe_dispute: Option<(DisputeResult, T::AccountId)>, - ) -> DispatchResult { - Payment::::try_mutate(sender, payment_id, |maybe_payment| -> DispatchResult { - let payment = maybe_payment.as_mut().map_err(|_| Error::::InvalidPayment)?; - - let reason = &HoldReason::TransferPayment.into(); - let is_dispute = maybe_dispute.is_some(); - - // Release sender fees recipients - let (fee_sender_recipients, total_sender_fee_amount_mandatory, total_sender_fee_amount_optional) = - payment.fees.summary_for(Role::Sender, is_dispute)?; - - let total_sender_release = total_sender_fee_amount_mandatory - .saturating_add(payment.incentive_amount) - .saturating_add(total_sender_fee_amount_optional); - - T::Assets::release(payment.asset.clone(), reason, sender, total_sender_release, Exact) - .map_err(|_| Error::::ReleaseFailed)?; - - let ( - fee_beneficiary_recipients, - _total_beneficiary_fee_amount_mandatory, - _total_beneficiary_fee_amount_optional, - ) = payment.fees.summary_for(Role::Beneficiary, is_dispute)?; - - let mut beneficiary_release_amount = payment.amount; - - if is_dispute { - beneficiary_release_amount = beneficiary_release_amount.saturating_add(payment.incentive_amount); - } - - T::Assets::release( - payment.asset.clone(), - reason, - beneficiary, - beneficiary_release_amount, - Exact, - ) - .map_err(|_| Error::::ReleaseFailed)?; - - Self::try_transfer_fees(sender, payment, fee_sender_recipients, is_dispute)?; - - Self::try_transfer_fees(beneficiary, payment, fee_beneficiary_recipients, is_dispute)?; - - if let Some((dispute_result, resolver)) = maybe_dispute { - match dispute_result.in_favor_of { - Role::Sender => { - let amount_to_sender = dispute_result.percent_beneficiary.mul_floor(payment.amount); - - // Beneficiary looses the dispute and has to transfer the incentive_amount to - // the dispute_resolver. - T::Assets::transfer( - payment.asset.clone(), - beneficiary, - &resolver, - payment.incentive_amount, - Expendable, - ) - .map_err(|_| Error::::TransferFailed)?; - - T::Assets::transfer(payment.asset.clone(), beneficiary, sender, amount_to_sender, Expendable) - .map_err(|_| Error::::TransferFailed)?; - } - Role::Beneficiary => { - let amount_to_beneficiary = dispute_result.percent_beneficiary.mul_floor(payment.amount); - let amount_to_sender = payment.amount.saturating_sub(amount_to_beneficiary); - - T::Assets::transfer( - payment.asset.clone(), - sender, - &resolver, - payment.incentive_amount, - Expendable, - ) - .map_err(|_| Error::::TransferFailed)?; - - T::Assets::transfer(payment.asset.clone(), beneficiary, sender, amount_to_sender, Expendable) - .map_err(|_| Error::::TransferFailed)?; - } - } - } - - payment.state = PaymentState::Finished; - Ok(()) - }) - } - - fn try_transfer_fees( - account: &T::AccountId, - payment: &PaymentDetail, - fee_recipients: Vec>, - is_dispute: bool, - ) -> Result<(), sp_runtime::DispatchError> { - for (recipient_account, fee_amount, mandatory) in fee_recipients.iter() { - if !is_dispute || *mandatory { - T::Assets::transfer(payment.asset.clone(), account, recipient_account, *fee_amount, Preserve) - .map_err(|_| Error::::TransferFailed)?; - } - } - Ok(()) - } -} diff --git a/pallets/payments/src/mock.rs b/pallets/payments/src/mock.rs deleted file mode 100644 index 9ad8240a0..000000000 --- a/pallets/payments/src/mock.rs +++ /dev/null @@ -1,297 +0,0 @@ -pub use crate::{self as pallet_payments, types::*, Config}; -use frame_support::{ - derive_impl, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, EqualPrivilegeOnly, OnFinalize, OnInitialize}, - weights::Weight, - PalletId, -}; - -use frame_system::{EnsureRoot, EnsureSigned}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_keystore::{testing::MemoryKeystore, KeystoreExt}; -use sp_runtime::{BoundedVec, BuildStorage, Percent}; - -type Block = frame_system::mocking::MockBlock; -type AccountId = u64; -#[allow(unused)] -type AssetId = u32; - -#[derive(Clone, Copy, Debug, Decode, Encode, Eq, MaxEncodedLen, PartialEq, TypeInfo)] -pub struct PaymentId(pub u32); - -pub const SENDER_ACCOUNT: AccountId = 10; -pub const PAYMENT_BENEFICIARY: AccountId = 11; -pub const ASSET_ADMIN_ACCOUNT: AccountId = 3; -pub const ROOT_ACCOUNT: AccountId = 1; - -pub const ASSET_ID: u32 = 1; -pub const INCENTIVE_PERCENTAGE: u8 = 10; -pub const MARKETPLACE_FEE_PERCENTAGE: u8 = 15; -pub const INITIAL_BALANCE: u64 = 100; -pub const PAYMENT_ID: PaymentId = PaymentId(1); - -pub const FEE_SENDER_ACCOUNT: AccountId = 30; -pub const FEE_BENEFICIARY_ACCOUNT: AccountId = 31; -pub const FEE_SYSTEM_ACCOUNT: AccountId = 32; - -pub const SYSTEM_FEE: u64 = 3; -pub const EXPECTED_SYSTEM_TOTAL_FEE: u64 = 6; -pub const EXPECTED_SYSTEM_SENDER_FEE: u64 = 3; // 15% of 20 - -pub const FEE_SENDER_AMOUNT: Balance = 2; -pub const FEE_BENEFICIARY_AMOUNT: Balance = 3; -pub const PAYMENT_AMOUNT: u64 = 20; -pub const INCENTIVE_AMOUNT: u64 = PAYMENT_AMOUNT / INCENTIVE_PERCENTAGE as u64; - -// Configure a mock runtime to test the pallet. -#[frame_support::runtime] -mod runtime { - #[runtime::runtime] - #[runtime::derive( - RuntimeCall, - RuntimeEvent, - RuntimeError, - RuntimeOrigin, - RuntimeTask, - RuntimeHoldReason, - RuntimeFreezeReason - )] - pub struct Test; - - #[runtime::pallet_index(0)] - pub type System = frame_system; - #[runtime::pallet_index(1)] - pub type Sudo = pallet_sudo; - #[runtime::pallet_index(5)] - pub type Scheduler = pallet_scheduler; - #[runtime::pallet_index(6)] - pub type Preimage = pallet_preimage; - - #[runtime::pallet_index(10)] - pub type Balances = pallet_balances; - #[runtime::pallet_index(11)] - pub type Assets = pallet_assets; - #[runtime::pallet_index(20)] - pub type Payments = pallet_payments; -} - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; - pub MaxWeight: Weight = Weight::from_parts(2_000_000_000_000, u64::MAX); -} - -pub type Balance = ::Balance; - -#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] -impl frame_system::Config for Test { - type Block = Block; - type AccountData = pallet_balances::AccountData; -} - -#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] -impl pallet_balances::Config for Test { - type AccountStore = System; -} - -#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig as pallet_assets::DefaultConfig)] -impl pallet_assets::Config for Test { - type Currency = Balances; - type CreateOrigin = AsEnsureOriginWithArg>; - type ForceOrigin = frame_system::EnsureRoot; - type Freezer = (); - type RuntimeHoldReason = RuntimeHoldReason; -} - -#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig as pallet_sudo::DefaultConfig)] -impl pallet_sudo::Config for Test {} - -impl pallet_preimage::Config for Test { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type ManagerOrigin = EnsureRoot; - type Consideration = (); - type WeightInfo = (); -} - -impl pallet_scheduler::Config for Test { - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type PalletsOrigin = OriginCaller; - type RuntimeCall = RuntimeCall; - type MaximumWeight = MaxWeight; - type ScheduleOrigin = EnsureRoot; - type OriginPrivilegeCmp = EqualPrivilegeOnly; - type MaxScheduledPerBlock = ConstU32<100>; - type WeightInfo = (); - type Preimages = Preimage; -} - -pub struct MockFeeHandler; - -const MANDATORY_FEE: bool = true; - -impl crate::types::FeeHandler for MockFeeHandler { - fn apply_fees( - _asset: &AssetIdOf, - _sender: &AccountId, - _beneficiary: &AccountId, - amount: &Balance, - _remark: Option<&[u8]>, - ) -> Fees { - let sender_fees = vec![ - SubTypes::Fixed(FEE_SENDER_ACCOUNT, FEE_SENDER_AMOUNT, !MANDATORY_FEE), - SubTypes::Percentage( - FEE_SYSTEM_ACCOUNT, - Percent::from_percent(MARKETPLACE_FEE_PERCENTAGE), - MANDATORY_FEE, - ), - ]; - - let beneficiary_fees = vec![ - SubTypes::Fixed(FEE_BENEFICIARY_ACCOUNT, FEE_BENEFICIARY_AMOUNT, !MANDATORY_FEE), - SubTypes::Percentage( - FEE_SYSTEM_ACCOUNT, - Percent::from_percent(MARKETPLACE_FEE_PERCENTAGE), - MANDATORY_FEE, - ), - ]; - - let compute_fee = |fees: &Vec>| -> FeeDetails { - let details = fees - .iter() - .map(|fee| match fee { - SubTypes::Fixed(account, amount_fixed, charged_disputes) => { - (*account, *amount_fixed, *charged_disputes) - } - SubTypes::Percentage(account, percent, charged_disputes) => { - (*account, percent.mul_floor(*amount), *charged_disputes) - } - }) - .collect::>(); - // This is a test, so i'm just unwrapping - let bounded_details: FeeDetails = BoundedVec::try_from(details).unwrap(); - bounded_details - }; - - Fees { - sender_pays: compute_fee(&sender_fees), - beneficiary_pays: compute_fee(&beneficiary_fees), - } - } -} - -#[cfg(feature = "runtime-benchmarks")] -pub struct BenchmarkHelper; -#[cfg(feature = "runtime-benchmarks")] -impl super::BenchmarkHelper for BenchmarkHelper { - fn create_asset(id: AssetId, admin: AccountId, is_sufficient: bool, min_balance: Balance) { - >::create( - id, - admin, - is_sufficient, - min_balance, - ) - .unwrap(); - } -} - -parameter_types! { - pub const MaxRemarkLength: u8 = 50; - pub const IncentivePercentage: Percent = Percent::from_percent(INCENTIVE_PERCENTAGE); - pub const PaymentPalletId: PalletId = PalletId(*b"payments"); -} - -impl Config for Test { - type RuntimeEvent = RuntimeEvent; - type Assets = Assets; - type AssetsBalance = u64; - type PaymentId = PaymentId; - type FeeHandler = MockFeeHandler; - type IncentivePercentage = IncentivePercentage; - type MaxRemarkLength = MaxRemarkLength; - type SenderOrigin = EnsureSigned; - type BeneficiaryOrigin = EnsureSigned; - type DisputeResolver = frame_system::EnsureRootWithSuccess>; - type PalletId = PaymentPalletId; - type RuntimeHoldReason = RuntimeHoldReason; - type MaxDiscounts = ConstU32<50>; - type MaxFees = ConstU32<50>; - type RuntimeCall = RuntimeCall; - type Scheduler = Scheduler; - type Preimages = (); - type CancelBufferBlockLength = ConstU64<10>; - type PalletsOrigin = OriginCaller; - type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = BenchmarkHelper; -} - -// Build genesis storage according to the mock runtime. -pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); - - pallet_balances::GenesisConfig:: { - balances: vec![ - // id, owner, is_sufficient, min_balance - (FEE_SENDER_ACCOUNT, INITIAL_BALANCE), - (FEE_BENEFICIARY_ACCOUNT, INITIAL_BALANCE), - (FEE_SYSTEM_ACCOUNT, INITIAL_BALANCE), - (PAYMENT_BENEFICIARY, INITIAL_BALANCE), - ], - } - .assimilate_storage(&mut t) - .unwrap(); - - pallet_assets::GenesisConfig:: { - assets: vec![ - // id, owner, is_sufficient, min_balance - (ASSET_ID, ASSET_ADMIN_ACCOUNT, true, 1), - ], - metadata: vec![ - // id, name, symbol, decimals - (ASSET_ID, "Token Name".into(), "TOKEN".into(), 10), - ], - accounts: vec![ - // id, account_id, balance - (ASSET_ID, SENDER_ACCOUNT, 100), - ], - next_asset_id: None, - } - .assimilate_storage(&mut t) - .unwrap(); - - pallet_sudo::GenesisConfig:: { - key: Some(ROOT_ACCOUNT), - } - .assimilate_storage(&mut t) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.register_extension(KeystoreExt::new(MemoryKeystore::new())); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -pub fn run_to_block(n: u64) { - while System::block_number() < n { - Scheduler::on_finalize(System::block_number()); - System::set_block_number(System::block_number() + 1); - Scheduler::on_initialize(System::block_number()); - } -} - -use core::cell::Cell; -thread_local! { - pub static LAST_ID: Cell = const { Cell::new(0) }; -} -impl pallet_payments::PaymentId for PaymentId { - fn next(_sender: &AccountId, _beneficiary: &AccountId) -> Option { - LAST_ID.with(|id| { - let new_id = id.get() + 1; - id.set(new_id); - Some(PaymentId(new_id)) - }) - } -} diff --git a/pallets/payments/src/tests.rs b/pallets/payments/src/tests.rs deleted file mode 100644 index b5a959b70..000000000 --- a/pallets/payments/src/tests.rs +++ /dev/null @@ -1,606 +0,0 @@ -use super::*; -use crate::{ - mock::*, - types::{PaymentDetail, PaymentState}, - Payment as PaymentStore, PaymentId, -}; -use frame_support::{assert_err, assert_ok, traits::fungibles, weights::constants::WEIGHT_REF_TIME_PER_NANOS}; -use weights::SubstrateWeight; - -use sp_runtime::{BoundedVec, Perbill}; - -const ASSERT_PAYMENT_CREATION: bool = true; - -fn build_payment(assert_payment_creation: bool) -> Fees { - let remark: BoundedVec = BoundedVec::truncate_from(b"remark".to_vec()); - let reason: &::RuntimeHoldReason = &HoldReason::TransferPayment.into(); - - assert_ok!(Payments::pay( - RuntimeOrigin::signed(SENDER_ACCOUNT), - PAYMENT_BENEFICIARY, - ASSET_ID, - PAYMENT_AMOUNT, - Some(remark.clone()), - )); - - let fees_details: Fees = ::FeeHandler::apply_fees( - &ASSET_ID, - &SENDER_ACCOUNT, - &PAYMENT_BENEFICIARY, - &PAYMENT_AMOUNT, - Some(remark.as_slice()), - ); - - if assert_payment_creation { - System::assert_has_event(RuntimeEvent::Payments(pallet_payments::Event::PaymentCreated { - payment_id: PaymentId(1), - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - remark: Some(remark.clone()), - })); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::Created, - fees: fees_details.clone(), - beneficiary: PAYMENT_BENEFICIARY - } - ); - - assert_eq!( - >::balance_on_hold(ASSET_ID, reason, &PAYMENT_BENEFICIARY), - PAYMENT_AMOUNT - ); - assert_eq!( - >::balance_on_hold(ASSET_ID, reason, &SENDER_ACCOUNT), - INCENTIVE_AMOUNT + FEE_SENDER_AMOUNT + EXPECTED_SYSTEM_SENDER_FEE - ); - } - - fees_details -} - -fn check_balance_cancellation() { - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - 0 - ); - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - 0 - ); - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - 100 - ); -} - -/// What we will do: -/// Sender(2) pays 20 tokens to the PAYMENT_BENEFICIARY(11) -/// Sender pays the following fees: -/// - 2 tokens to the FEE_SENDER_ACCOUNT(30) -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT(31) (total of 5 tokens) -/// -/// Beneficiary pays the following fees: -/// - 3 tokens to the FEE_BENEFICIARY_ACCOUNT(32) -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT(31) (total of 6 tokens) -/// -/// The PAYMENT_BENEFICIARY will receive 14 tokens free of charge -/// The sender will need have a balance at least of 27 tokens to make the -/// purchase: -/// - 20 tokens for the payment + 5 tokens for the fee + 2 tokens for the -/// incentive -#[test] -fn test_pay_and_release_works() { - new_test_ext().execute_with(|| { - let fees: Fees = build_payment(ASSERT_PAYMENT_CREATION); - - assert_ok!(Payments::release(RuntimeOrigin::signed(SENDER_ACCOUNT), PAYMENT_ID)); - - System::assert_has_event(RuntimeEvent::Payments(pallet_payments::Event::PaymentReleased { - payment_id: PAYMENT_ID, - })); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::Finished, - fees, - beneficiary: PAYMENT_BENEFICIARY - } - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - EXPECTED_SYSTEM_TOTAL_FEE - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - FEE_SENDER_AMOUNT - ); - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - FEE_BENEFICIARY_AMOUNT - ); - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - PAYMENT_AMOUNT - FEE_BENEFICIARY_AMOUNT - SYSTEM_FEE - ); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - INITIAL_BALANCE - PAYMENT_AMOUNT - FEE_SENDER_AMOUNT - SYSTEM_FEE - ); - }); -} - -#[test] -fn test_pay_and_cancel_works() { - new_test_ext().execute_with(|| { - build_payment(ASSERT_PAYMENT_CREATION); - assert_err!( - Payments::cancel(RuntimeOrigin::signed(999), PAYMENT_ID), - Error::::InvalidBeneficiary - ); - assert_ok!(Payments::cancel(RuntimeOrigin::signed(PAYMENT_BENEFICIARY), PAYMENT_ID)); - - System::assert_has_event(RuntimeEvent::Payments(pallet_payments::Event::PaymentCancelled { - payment_id: PAYMENT_ID, - })); - - // This validates that the payment was removed from the storage. - assert!(PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).is_err()); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - 0 - ); - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - 0 - ); - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - 100 - ); - }); -} - -#[test] -fn payment_refunded_request() { - new_test_ext().execute_with(|| { - let fees: Fees = build_payment(ASSERT_PAYMENT_CREATION); - - assert_ok!(Payments::request_refund( - RuntimeOrigin::signed(SENDER_ACCOUNT), - PAYMENT_ID - )); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::RefundRequested { cancel_block: 11 }, - fees, - beneficiary: PAYMENT_BENEFICIARY - } - ); - - run_to_block(11); - - System::assert_has_event(RuntimeEvent::Payments(pallet_payments::Event::PaymentRefunded { - payment_id: PAYMENT_ID, - })); - - check_balance_cancellation(); - }) -} - -/// Initial balances before transactions: -/// SENDER(10) = 100 / PAYMENT_BENEFICIARY(11) = 10 -/// -/// Testing scenario: -/// 1) SENDER pays 20 tokens to the PAYMENT_BENEFICIARY -/// 2) Sender requests a refund. -/// 3) The PAYMENT_BENEFICIARY disputes the refund, a total of 2 tokens are -/// locked from the PAYMENT_BENEFICIARY because of the incentive amount. -/// 4) The RESOLVER, rule in favor of PAYMENT_BENEFICIARY to pay 90%. -/// -/// Mandatory Fees: -/// The SENDER should pay the mandatory fee: -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT -/// The PAYMENT_BENEFICIARY should pay the mandatory fee: -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT -/// -/// Fee not deducted during dispute: -/// SENDER's fee: -/// - 2 tokens to the FEE_SENDER_AMOUNT -/// PAYMENT_BENEFICIARY's fee: -/// - 3 tokens to FEE_BENEFICIARY_AMOUNT -/// -/// 4.1) PAYMENT_BENEFICIARY should receive: -/// + 18 token (90% because of dispute ruling) -/// + 2 token (incentive amount give back because of wining side of dispute) -/// - 3 tokens (deducted mandatory fee) -/// -/// Beneficiary receives: 17 token / total balance: 27 token. -/// 4.2) SENDER should receive: -/// + 2 token (remaining 10% of dispute ruling) -/// + 2 token (fee not deducted ) -/// - 2 token (incentive amount deducted because of wining side of dispute) -/// - 3 tokens (deducted mandatory fee) total: -1 token / total balance: 73 -/// token. -/// -/// Sender's expected Balance after dispute: -/// 100(initial) - 18(payment) - 3(system fee) - 2(incentive for loosing) = -/// -/// 77 Beneficiary's expected Balance after dispute: -/// 10(initial) + 18(payment) - 3(system fee) = 25 - -#[test] -fn payment_disputed_beneficiary_wins() { - new_test_ext().execute_with(|| { - const EXPECTED_BALANCE_SENDER: u64 = 77; - const EXPECTED_BALANCE_BENEFICIARY: u64 = 25; - - let _ = Assets::mint( - RuntimeOrigin::signed(ASSET_ADMIN_ACCOUNT), - ASSET_ID, - PAYMENT_BENEFICIARY, - 10, - ); - - let fees: Fees = build_payment(ASSERT_PAYMENT_CREATION); - - assert_ok!(Payments::request_refund( - RuntimeOrigin::signed(SENDER_ACCOUNT), - PAYMENT_ID - )); - - assert_err!( - Payments::dispute_refund(RuntimeOrigin::signed(999), PAYMENT_ID), - Error::::InvalidBeneficiary - ); - assert_ok!(Payments::dispute_refund( - RuntimeOrigin::signed(PAYMENT_BENEFICIARY), - PAYMENT_ID - )); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::NeedsReview, - fees, - beneficiary: PAYMENT_BENEFICIARY - } - ); - - assert_ok!(Payments::resolve_dispute( - RuntimeOrigin::root(), - PAYMENT_ID, - DisputeResult { - percent_beneficiary: Percent::from_percent(90), - in_favor_of: Role::Beneficiary - } - )); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - EXPECTED_BALANCE_SENDER - ); - - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - EXPECTED_BALANCE_BENEFICIARY - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - EXPECTED_SYSTEM_TOTAL_FEE - ); - }) -} - -/// Initial balances before transactions: -/// SENDER(10) = 100 / PAYMENT_BENEFICIARY(11) = 10 -/// -/// Testing scenario: -/// 1) SENDER pays 20 tokens to the PAYMENT_BENEFICIARY -/// 2) Sender requests a refund. -/// 3) The PAYMENT_BENEFICIARY disputes the refund, a total of 2 tokens are -/// locked from the PAYMENT_BENEFICIARY because of the incentive amount. -/// 4) The RESOLVER, rule in favor of SENDER to pay 90%. -/// -/// Mandatory Fees: -/// The SENDER should pay the mandatory fee: -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT -/// The PAYMENT_BENEFICIARY should pay the mandatory fee: -/// - 15% of the payment amount (meaning 3 tokens) to the -/// FEE_SYSTEM_ACCOUNT -/// -/// Fee not deducted during dispute: -/// SENDER's fee: -/// - 2 tokens to the FEE_SENDER_AMOUNT -/// PAYMENT_BENEFICIARY's fee: -/// - 3 tokens to FEE_BENEFICIARY_AMOUNT -/// -/// 4.1) PAYMENT_BENEFICIARY should receive: -/// + 2 token (10% because of dispute ruling) -/// - 2 token (incentive amount give back because of loosing side of dispute) -/// - 3 tokens (deducted mandatory fee) Beneficiary loose: -3 tokens -/// -/// 4.2) SENDER should receive: -/// + 18 token (remaining 90% of dispute ruling) -/// + 2 token (fee not deducted ) -/// + 2 token (incentive amount returned because of wining side of -/// dispute) -/// - 3 tokens (deducted mandatory fee) -/// -/// total: 19 token / total balance: 81 token. -/// -/// Sender's expected Balance after dispute: -/// 100(initial) - 2 (dispute ruling) - 3(system fee) = 95 -/// Beneficiary's expected Balance after dispute: -/// 10(initial) + 2(dispute ruling) - 3(system fee) - 2(incentive for -/// loosing)= 7 -#[test] -fn payment_disputed_sender_wins() { - new_test_ext().execute_with(|| { - const EXPECTED_BALANCE_SENDER: u64 = 95; - const EXPECTED_BALANCE_BENEFICIARY: u64 = 7; - const EXPECTED_RESOLVER_BALANCE: u64 = 2; - - let _ = Assets::mint( - RuntimeOrigin::signed(ASSET_ADMIN_ACCOUNT), - ASSET_ID, - PAYMENT_BENEFICIARY, - 10, - ); - - let fees: Fees = build_payment(ASSERT_PAYMENT_CREATION); - - assert_ok!(Payments::request_refund( - RuntimeOrigin::signed(SENDER_ACCOUNT), - PAYMENT_ID - )); - - assert_ok!(Payments::dispute_refund( - RuntimeOrigin::signed(PAYMENT_BENEFICIARY), - PAYMENT_ID - )); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::NeedsReview, - fees, - beneficiary: PAYMENT_BENEFICIARY - } - ); - - assert_ok!(Payments::resolve_dispute( - RuntimeOrigin::root(), - PAYMENT_ID, - DisputeResult { - percent_beneficiary: Percent::from_percent(90), - in_favor_of: Role::Sender - } - )); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - EXPECTED_BALANCE_SENDER - ); - - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - EXPECTED_BALANCE_BENEFICIARY - ); - - assert_eq!( - >::balance(ASSET_ID, &ROOT_ACCOUNT), - EXPECTED_RESOLVER_BALANCE - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - 0 - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - EXPECTED_SYSTEM_TOTAL_FEE - ); - }) -} - -#[test] -fn request_payment() { - new_test_ext().execute_with(|| { - assert_ok!(Payments::request_payment( - RuntimeOrigin::signed(PAYMENT_BENEFICIARY), - SENDER_ACCOUNT, - ASSET_ID, - PAYMENT_AMOUNT - )); - - System::assert_has_event(RuntimeEvent::Payments(pallet_payments::Event::PaymentRequestCreated { - payment_id: mock::PaymentId(1), - })); - - let fees: Fees = ::FeeHandler::apply_fees( - &ASSET_ID, - &SENDER_ACCOUNT, - &PAYMENT_BENEFICIARY, - &PAYMENT_AMOUNT, - None, - ); - - assert_eq!( - PaymentStore::::get(SENDER_ACCOUNT, PAYMENT_ID).unwrap(), - PaymentDetail { - asset: ASSET_ID, - amount: PAYMENT_AMOUNT, - incentive_amount: INCENTIVE_AMOUNT, - state: PaymentState::PaymentRequested, - fees, - beneficiary: PAYMENT_BENEFICIARY - } - ); - - assert_ok!(Payments::accept_and_pay( - RuntimeOrigin::signed(SENDER_ACCOUNT), - PAYMENT_ID - )); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SYSTEM_ACCOUNT), - EXPECTED_SYSTEM_TOTAL_FEE - ); - - assert_eq!( - >::balance(ASSET_ID, &FEE_SENDER_ACCOUNT), - FEE_SENDER_AMOUNT - ); - assert_eq!( - >::balance(ASSET_ID, &FEE_BENEFICIARY_ACCOUNT), - FEE_BENEFICIARY_AMOUNT - ); - assert_eq!( - >::balance(ASSET_ID, &PAYMENT_BENEFICIARY), - PAYMENT_AMOUNT - FEE_BENEFICIARY_AMOUNT - SYSTEM_FEE - ); - - assert_eq!( - >::balance(ASSET_ID, &SENDER_ACCOUNT), - INITIAL_BALANCE - PAYMENT_AMOUNT - FEE_SENDER_AMOUNT - SYSTEM_FEE - ); - }) -} - -#[test] -fn next_id_works() { - new_test_ext().execute_with(|| { - assert_eq!( - mock::PaymentId::next(&SENDER_ACCOUNT, &PAYMENT_BENEFICIARY), - Some(mock::PaymentId(1)) - ); - assert_eq!( - mock::PaymentId::next(&SENDER_ACCOUNT, &PAYMENT_BENEFICIARY), - Some(mock::PaymentId(2)) - ); - }); -} - -#[test] -fn weights() { - use crate::weights::WeightInfo; - use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}; - // max block: 0.5s compute with 12s average block time - const MAX_BLOCK_REF_TIME: u64 = WEIGHT_REF_TIME_PER_SECOND.saturating_div(2); // https://github.com/paritytech/cumulus/blob/98e68bd54257b4039a5d5b734816f4a1b7c83a9d/parachain-template/runtime/src/lib.rs#L221 - const MAX_BLOCK_POV_SIZE: u64 = 5 * 1024 * 1024; // https://github.com/paritytech/polkadot/blob/ba1f65493d91d4ab1787af2fd6fe880f1da90586/primitives/src/v4/mod.rs#L384 - const MAX_BLOCK_WEIGHT: Weight = Weight::from_parts(MAX_BLOCK_REF_TIME, MAX_BLOCK_POV_SIZE); - // max extrinsics: 75% of block - const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/lib.rs#L218 - let max_total_extrinsics = MAX_BLOCK_WEIGHT * NORMAL_DISPATCH_RATIO; - // max extrinsic: max total extrinsics less average on_initialize ratio and less - // base extrinsic weight - const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/lib.rs#L214 - const BASE_EXTRINSIC: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); // https://github.com/paritytech/cumulus/blob/d20c4283fe85df0c1ef8cb7c9eb7c09abbcbfa31/parachain-template/runtime/src/weights/extrinsic_weights.rs#L26 - let max_extrinsic_weight = max_total_extrinsics - .saturating_sub(MAX_BLOCK_WEIGHT * AVERAGE_ON_INITIALIZE_RATIO) - .saturating_sub(BASE_EXTRINSIC); - assert_eq!(max_extrinsic_weight, Weight::from_parts(349_875_000_000, 3_670_016)); - - println!("max block weight: {MAX_BLOCK_WEIGHT}"); - println!("max total extrinsics weight: {max_total_extrinsics}"); - println!("max extrinsic weight: {max_extrinsic_weight}\n"); - - let mut total = Weight::zero(); - for (function, weight) in vec![ - // Examples: call available weight functions with various parameters (as applicable) to gauge weight usage in - // comparison to limits - ("pay (20)", SubstrateWeight::::pay(20_u32)), - ("release", SubstrateWeight::::release()), - ("cancel", SubstrateWeight::::cancel()), - ("request_refund", SubstrateWeight::::request_refund()), - ("dispute_refund", SubstrateWeight::::dispute_refund()), - ("resolve_dispute", SubstrateWeight::::resolve_dispute()), - ("request_payment", SubstrateWeight::::request_payment()), - ("accept_and_pay", SubstrateWeight::::accept_and_pay()), - ] { - println!("{function}: {weight:?}",); - println!( - "\tpercentage of max extrinsic weight: {:.2}% (ref_time), {:.2}% (proof_size)", - (weight.ref_time() as f64 / max_extrinsic_weight.ref_time() as f64) * 100.0, - (weight.proof_size() as f64 / max_extrinsic_weight.proof_size() as f64) * 100.0, - ); - println!( - "\tmax tx per block: {} (ref_time), {} (proof_size)", - max_extrinsic_weight.ref_time() / weight.ref_time(), - max_extrinsic_weight.proof_size() / weight.proof_size() - ); - assert!(weight.all_lt(max_extrinsic_weight)); - - total += weight; - } - - // output total weight, useful for evaluating net weight changes when optimising - println!("\ntotal weight: {total:?}"); -} diff --git a/pallets/payments/src/types.rs b/pallets/payments/src/types.rs deleted file mode 100644 index ed76fc17a..000000000 --- a/pallets/payments/src/types.rs +++ /dev/null @@ -1,170 +0,0 @@ -#![allow(unused_qualifications)] -use crate::*; - -use frame_system::pallet_prelude::BlockNumberFor; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_runtime::{traits::Zero, BoundedVec, Percent, Saturating}; -use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; - -// This pallet's asset id and balance type. -pub type AssetIdOf = <::Assets as FunsInspect<::AccountId>>::AssetId; -pub type AccountIdOf = ::AccountId; -pub type MaxFeesOf = ::MaxFees; -pub type BalanceOf = <::Assets as FunsInspect<::AccountId>>::Balance; -pub type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -pub type BoundedDataOf = BoundedVec::MaxRemarkLength>; -pub type ChargableOnDisputes = bool; -pub type Fee = (AccountIdOf, BalanceOf, ChargableOnDisputes); -pub type FeesSummaryForRole = (Vec>, BalanceOf, BalanceOf); -pub type FeeDetails = BoundedVec, MaxFeesOf>; -pub type CallOf = ::RuntimeCall; -pub type PreimagesOf = ::Preimages; -pub type BoundedCallOf = Bounded, ::Hashing>; - -/// The PaymentDetail struct stores information about the payment -/// A "payment" is similar to an escrow, it is used to guarantee proof of -/// funds and can be released once an agreed upon condition has reached -/// between the payment creator and recipient. The payment lifecycle is -/// tracked using the state field. -#[derive(Clone, Debug, Decode, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -// #[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] -#[scale_info(skip_type_params(T))] -#[codec(mel_bound(T: pallet::Config))] -pub struct PaymentDetail { - /// type of asset used for payment - pub asset: AssetIdOf, - /// amount of asset used for payment - pub amount: BalanceOf, - /// the recipient of the payment - pub beneficiary: AccountIdOf, - /// incentive amount that is credited to creator for resolving - pub incentive_amount: BalanceOf, - /// enum to track payment lifecycle [Created, NeedsReview, RefundRequested, - /// Requested] - pub state: PaymentState>, - /// fee charged and recipient account details - pub fees: Fees, -} - -/// The `PaymentState` enum tracks the possible states that a payment can be in. -/// When a payment is 'completed' or 'cancelled' it is removed from storage and -/// hence not tracked by a state. -#[derive(Clone, Encode, Decode, Eq, PartialEq, MaxEncodedLen, TypeInfo, Debug)] -pub enum PaymentState { - /// Amounts have been reserved and waiting for release/cancel - Created, - /// A judge needs to review and release manually - NeedsReview, - /// The user has requested refund and will be processed by `BlockNumber` - RefundRequested { - cancel_block: BlockNumber, - }, - /// The recipient of this transaction has created a request - PaymentRequested, - Finished, -} - -/// Fee Handler trait that defines how to handle marketplace fees to every -/// payment/swap -pub trait FeeHandler { - /// Get the distribution of fees to marketplace participants - fn apply_fees( - asset: &AssetIdOf, - sender: &T::AccountId, - beneficiary: &T::AccountId, - amount: &BalanceOf, - remark: Option<&[u8]>, - ) -> Fees; -} - -impl FeeHandler for () { - fn apply_fees( - _asset: &AssetIdOf, - _sender: &::AccountId, - _beneficiary: &::AccountId, - _amount: &BalanceOf, - _remark: Option<&[u8]>, - ) -> Fees { - Fees { - sender_pays: Default::default(), - beneficiary_pays: Default::default(), - } - } -} - -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] -pub enum SubTypes { - Fixed(T::AccountId, BalanceOf, ChargableOnDisputes), - Percentage(T::AccountId, Percent, ChargableOnDisputes), -} - -#[derive(Clone, Encode, Decode, Eq, PartialEq, Default, MaxEncodedLen, TypeInfo, Debug)] -#[scale_info(skip_type_params(T))] -#[codec(mel_bound(T: pallet::Config))] -pub struct Fees { - pub sender_pays: FeeDetails, - pub beneficiary_pays: FeeDetails, -} - -impl Fees { - pub fn summary_for(&self, role: Role, is_dispute: bool) -> Result, DispatchError> { - let fees = match role { - Role::Sender => &self.sender_pays, - Role::Beneficiary => &self.beneficiary_pays, - }; - Self::get_summary(fees, is_dispute) - } - - fn get_summary(fees: &FeeDetails, is_dispute: bool) -> Result, DispatchError> { - let mut fees_per_account: BTreeMap, Fee> = BTreeMap::new(); - let mut total_to_discount: BalanceOf = Zero::zero(); - let mut total_to_return: BalanceOf = Zero::zero(); - - for (account, fee, charge_dispute) in fees.iter() { - if is_dispute { - if *charge_dispute { - total_to_discount = total_to_discount.saturating_add(*fee); - } else { - total_to_return = total_to_return.saturating_add(*fee); - } - } else { - total_to_discount = total_to_discount.saturating_add(*fee); - } - - let current_fee = fees_per_account - .entry(account.clone()) - .or_insert_with(|| (account.clone(), Zero::zero(), *charge_dispute)); - let (_, current_balance, _) = current_fee; - *current_balance = current_balance.saturating_add(*fee); - } - - Ok(( - fees_per_account.into_values().collect(), - total_to_discount, - total_to_return, - )) - } -} - -/// Types of Tasks that can be scheduled in the pallet -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] -pub enum Task { - // payment `from` to `to` has to be cancelled - Cancel, - Dispute, -} - -/// Types of Tasks that can be scheduled in the pallet -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] -pub enum Role { - // payment `from` to `to` has to be cancelled - Sender, - Beneficiary, -} - -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] -pub struct DisputeResult { - pub percent_beneficiary: Percent, - pub in_favor_of: Role, -} diff --git a/pallets/payments/src/weights.rs b/pallets/payments/src/weights.rs deleted file mode 100644 index bd0aa26a4..000000000 --- a/pallets/payments/src/weights.rs +++ /dev/null @@ -1,376 +0,0 @@ - -//! Autogenerated weights for `pallet_payments` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-03-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-builder`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("kreivo-local")`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/virto-node -// benchmark -// pallet -// --chain -// kreivo-local -// --pallet -// pallet_payments -// --extrinsic -// * -// --steps -// 50 -// --repeat -// 20 -// --output -// runtime/kreivo/src/weights/pallet_payments.rs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; - -/// Weight functions needed for pallet_payments. -pub trait WeightInfo { - fn pay(q: u32, ) -> Weight; - fn release() -> Weight; - fn cancel() -> Weight; - fn request_refund() -> Weight; - fn dispute_refund() -> Weight; - fn resolve_dispute() -> Weight; - fn request_payment() -> Weight; - fn accept_and_pay() -> Weight; -} - -/// Weights for pallet_payments using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Payments::PaymentParties` (r:0 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// The range of component `q` is `[1, 50]`. - fn pay(q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `473` - // Estimated: `8517` - // Minimum execution time: 161_587_000 picoseconds. - Weight::from_parts(218_726_681, 0) - .saturating_add(Weight::from_parts(0, 8517)) - // Standard Error: 78_914 - .saturating_add(Weight::from_parts(900_944, 0).saturating_mul(q.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn release() -> Weight { - // Proof Size summary in bytes: - // Measured: `1082` - // Estimated: `8856` - // Minimum execution time: 398_666_000 picoseconds. - Weight::from_parts(404_550_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(8)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - fn cancel() -> Weight { - // Proof Size summary in bytes: - // Measured: `1049` - // Estimated: `8517` - // Minimum execution time: 300_337_000 picoseconds. - Weight::from_parts(308_347_000, 0) - .saturating_add(Weight::from_parts(0, 8517)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(7)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Lookup` (r:1 w:1) - /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Agenda` (r:1 w:1) - /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) - fn request_refund() -> Weight { - // Proof Size summary in bytes: - // Measured: `343` - // Estimated: `159279` - // Minimum execution time: 80_215_000 picoseconds. - Weight::from_parts(82_549_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:1 w:1) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Lookup` (r:1 w:1) - /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Agenda` (r:1 w:1) - /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) - fn dispute_refund() -> Weight { - // Proof Size summary in bytes: - // Measured: `1150` - // Estimated: `159279` - // Minimum execution time: 213_633_000 picoseconds. - Weight::from_parts(216_604_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn resolve_dispute() -> Weight { - // Proof Size summary in bytes: - // Measured: `1152` - // Estimated: `8856` - // Minimum execution time: 588_034_000 picoseconds. - Weight::from_parts(602_119_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(8)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Payments::PaymentParties` (r:0 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - fn request_payment() -> Weight { - // Proof Size summary in bytes: - // Measured: `320` - // Estimated: `8517` - // Minimum execution time: 57_887_000 picoseconds. - Weight::from_parts(58_829_000, 0) - .saturating_add(Weight::from_parts(0, 8517)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn accept_and_pay() -> Weight { - // Proof Size summary in bytes: - // Measured: `943` - // Estimated: `8856` - // Minimum execution time: 364_626_000 picoseconds. - Weight::from_parts(369_330_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(6)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Payments::PaymentParties` (r:0 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// The range of component `q` is `[1, 50]`. - fn pay(q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `473` - // Estimated: `8517` - // Minimum execution time: 161_587_000 picoseconds. - Weight::from_parts(218_726_681, 0) - .saturating_add(Weight::from_parts(0, 8517)) - // Standard Error: 78_914 - .saturating_add(Weight::from_parts(900_944, 0).saturating_mul(q.into())) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(6)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn release() -> Weight { - // Proof Size summary in bytes: - // Measured: `1082` - // Estimated: `8856` - // Minimum execution time: 398_666_000 picoseconds. - Weight::from_parts(404_550_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(RocksDbWeight::get().reads(8)) - .saturating_add(RocksDbWeight::get().writes(8)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - fn cancel() -> Weight { - // Proof Size summary in bytes: - // Measured: `1049` - // Estimated: `8517` - // Minimum execution time: 300_337_000 picoseconds. - Weight::from_parts(308_347_000, 0) - .saturating_add(Weight::from_parts(0, 8517)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(7)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Lookup` (r:1 w:1) - /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Agenda` (r:1 w:1) - /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) - fn request_refund() -> Weight { - // Proof Size summary in bytes: - // Measured: `343` - // Estimated: `159279` - // Minimum execution time: 80_215_000 picoseconds. - Weight::from_parts(82_549_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(RocksDbWeight::get().reads(3)) - .saturating_add(RocksDbWeight::get().writes(3)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:1 w:1) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Lookup` (r:1 w:1) - /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) - /// Storage: `Scheduler::Agenda` (r:1 w:1) - /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) - fn dispute_refund() -> Weight { - // Proof Size summary in bytes: - // Measured: `1150` - // Estimated: `159279` - // Minimum execution time: 213_633_000 picoseconds. - Weight::from_parts(216_604_000, 0) - .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(6)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(982), added: 3457, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn resolve_dispute() -> Weight { - // Proof Size summary in bytes: - // Measured: `1152` - // Estimated: `8856` - // Minimum execution time: 588_034_000 picoseconds. - Weight::from_parts(602_119_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(RocksDbWeight::get().reads(9)) - .saturating_add(RocksDbWeight::get().writes(8)) - } - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Payments::PaymentParties` (r:0 w:1) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - fn request_payment() -> Weight { - // Proof Size summary in bytes: - // Measured: `320` - // Estimated: `8517` - // Minimum execution time: 57_887_000 picoseconds. - Weight::from_parts(58_829_000, 0) - .saturating_add(Weight::from_parts(0, 8517)) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(2)) - } - /// Storage: `Payments::PaymentParties` (r:1 w:0) - /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) - /// Storage: `Payments::Payment` (r:1 w:1) - /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5052), added: 7527, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(223), added: 2698, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:3 w:3) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn accept_and_pay() -> Weight { - // Proof Size summary in bytes: - // Measured: `943` - // Estimated: `8856` - // Minimum execution time: 364_626_000 picoseconds. - Weight::from_parts(369_330_000, 0) - .saturating_add(Weight::from_parts(0, 8856)) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(6)) - } -} diff --git a/polkadot-sdk-version b/polkadot-sdk-version new file mode 100644 index 000000000..df3b841d3 --- /dev/null +++ b/polkadot-sdk-version @@ -0,0 +1 @@ +stable2506 diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 67cb219c2..ccf8e9325 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -4,22 +4,18 @@ description = "Common logic for all virto runtimes" version = "0.1.0" authors = ['Virto Team '] license = "GPL-3.0-only" -homepage = 'https://github.com/virto-network/virto-node' -repository = 'https://github.com/virto-network/virto-node' +homepage = 'https://github.com/virto-network/kreivo' +repository = 'https://github.com/virto-network/kreivo' edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -substrate-wasm-builder.workspace = true - [dependencies] parity-scale-codec = { workspace = true, features = ["derive"] } hex-literal = { workspace = true, optional = true } log.workspace = true scale-info = { workspace = true, features = ["derive"] } -smallvec.workspace = true # Substrate frame-benchmarking = { workspace = true, optional = true } @@ -48,7 +44,6 @@ sp-inherents.workspace = true sp-offchain.workspace = true sp-runtime.workspace = true sp-session.workspace = true -sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true @@ -77,56 +72,55 @@ parachains-common.workspace = true [features] default = ["std"] std = [ - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "cumulus-primitives-utility/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system/std", - "frame-system-benchmarking/std", - "frame-system-rpc-runtime-api/std", - "frame-try-runtime/std", - "runtime-constants/std", - "log/std", - "pallet-assets/std", - "pallet-asset-tx-payment/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", - "pallet-treasury/std", - "parachain-info/std", - "parachains-common/std", - "parity-scale-codec/std", - "polkadot-core-primitives/std", - "polkadot-runtime-common/std", - "scale-info/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/std", - "xcm-builder/std", - "xcm-executor/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system/std", + "frame-system-benchmarking/std", + "frame-system-rpc-runtime-api/std", + "frame-try-runtime/std", + "runtime-constants/std", + "log/std", + "pallet-assets/std", + "pallet-asset-tx-payment/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", + "pallet-treasury/std", + "parachain-info/std", + "parachains-common/std", + "parity-scale-codec/std", + "polkadot-core-primitives/std", + "polkadot-runtime-common/std", + "scale-info/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-transaction-pool/std", + "sp-version/std", + "xcm/std", + "xcm-builder/std", + "xcm-executor/std", ] runtime-benchmarks = [ @@ -153,6 +147,9 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", + "pallet-transaction-payment/runtime-benchmarks", + "xcm/runtime-benchmarks", + "pallet-session/runtime-benchmarks" ] try-runtime = [ @@ -179,4 +176,6 @@ try-runtime = [ "parachain-info/try-runtime", "polkadot-runtime-common/try-runtime", "sp-runtime/try-runtime", + "parachains-common/try-runtime", + "runtime-constants/try-runtime" ] diff --git a/runtime/common/src/impls.rs b/runtime/common/src/impls.rs index 30469279b..c68d3dfc5 100644 --- a/runtime/common/src/impls.rs +++ b/runtime/common/src/impls.rs @@ -16,13 +16,13 @@ //! Auxiliary struct/enums for parachain runtimes. //! Taken from polkadot/runtime/common (at a21cd64) and adapted for parachains. +use core::marker::PhantomData; use frame_support::traits::{ fungible::{DecreaseIssuance, IncreaseIssuance}, fungibles::{Balanced, Credit}, Currency, }; use pallet_asset_tx_payment::HandleCredit; -use sp_std::marker::PhantomData; /// Type alias to conveniently refer to `frame_system`'s `Config::AccountId`. pub type AccountIdOf = ::AccountId; diff --git a/runtime/kreivo/Cargo.toml b/runtime/kreivo/Cargo.toml index efa6f5dab..1f7c2ad99 100644 --- a/runtime/kreivo/Cargo.toml +++ b/runtime/kreivo/Cargo.toml @@ -6,7 +6,7 @@ homepage.workspace = true license.workspace = true name = "kreivo-runtime" repository.workspace = true -version = "0.15.1" +version = "0.16.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -21,13 +21,15 @@ parity-scale-codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["alloc"] } smallvec.workspace = true +schnorrkel = { workspace = true, optional = true, features = ["alloc"] } +rand_core = { workspace = true, optional = true } # Local kreivo-apis = { workspace = true, features = ["runtime"] } pallet-communities = { workspace = true, features = ["xcm"] } pallet-communities-manager.workspace = true -pallet-payments.workspace = true +pallet-contracts-store.workspace = true # Local: Common runtime-common.workspace = true @@ -44,9 +46,10 @@ frame-system.workspace = true frame-system-benchmarking = { workspace = true, optional = true } frame-system-rpc-runtime-api.workspace = true frame-try-runtime = { workspace = true, optional = true } -pallet-assets-freezer.workspace = true pallet-asset-tx-payment.workspace = true pallet-assets.workspace = true +pallet-assets-freezer.workspace = true +pallet-assets-holder.workspace = true pallet-aura.workspace = true pallet-authorship.workspace = true pallet-balances.workspace = true @@ -57,6 +60,7 @@ pallet-preimage.workspace = true pallet-proxy.workspace = true pallet-ranked-collective.workspace = true pallet-referenda.workspace = true +pallet-revive.workspace = true pallet-scheduler.workspace = true pallet-session.workspace = true pallet-skip-feeless-payment.workspace = true @@ -77,7 +81,6 @@ sp-offchain.workspace = true sp-runtime.workspace = true sp-session.workspace = true sp-io = { workspace = true, optional = true } -sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true sp-weights.workspace = true @@ -109,194 +112,233 @@ parachain-info.workspace = true parachains-common.workspace = true # Frame Contrib -fc-traits-authn.workspace = true -fc-traits-gas-tank.workspace = true -fc-traits-memberships.workspace = true +frame-contrib-traits.workspace = true +pallet-black-hole.workspace = true pallet-gas-transaction-payment.workspace = true +pallet-listings.workspace = true +pallet-orders.workspace = true pallet-pass.workspace = true +pallet-payments.workspace = true pallet-referenda-tracks.workspace = true pass-webauthn = { workspace = true, features = ["runtime"] } +pass-substrate-keys = { workspace = true, features = ["runtime"] } + +[dev-dependencies] +sp-io.workspace = true [features] default = ["std"] paseo = ["runtime-constants/paseo"] +zombienet = [] std = [ - "assets-common/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-aura/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "cumulus-primitives-utility/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system-benchmarking/std", - "frame-system-rpc-runtime-api/std", - "frame-try-runtime/std", - "frame-system/std", - "fc-traits-authn/std", - "fc-traits-gas-tank/std", - "fc-traits-memberships/std", - "kreivo-apis/std", - "log/std", - "runtime-constants/std", - "pallet-assets-freezer/std", - "pallet-asset-tx-payment/std", - "pallet-assets/std", - "pallet-aura/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-contracts/std", - "pallet-communities-manager/std", - "pallet-communities/std", - "pallet-collator-selection/std", - "pallet-gas-transaction-payment/std", - "pallet-message-queue/std", - "pallet-multisig/std", - "pallet-nfts/std", - "pallet-pass/std", - "pallet-payments/std", - "pallet-preimage/std", - "pallet-proxy/std", - "pallet-ranked-collective/std", - "pallet-referenda/std", - "pallet-referenda-tracks/std", - "pallet-scheduler/std", - "pallet-session/std", - "pallet-skip-feeless-payment/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-utility/std", - "pallet-xcm/std", - "pallet-xcm-benchmarks/std", - "parachain-info/std", - "parachains-common/std", - "parity-scale-codec/std", - "pass-webauthn/std", - "polkadot-core-primitives/std", - "polkadot-parachain-primitives/std", - "polkadot-runtime-common/std", - "runtime-common/std", - "scale-info/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-io?/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "sp-weights/std", - "virto-common/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", + "assets-common/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-benchmarking/std", + "frame-system-rpc-runtime-api/std", + "frame-try-runtime/std", + "frame-system/std", + "kreivo-apis/std", + "log/std", + "runtime-constants/std", + "pallet-assets-freezer/std", + "pallet-asset-tx-payment/std", + "pallet-assets/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-contracts/std", + "pallet-communities-manager/std", + "pallet-communities/std", + "pallet-collator-selection/std", + "pallet-gas-transaction-payment/std", + "pallet-message-queue/std", + "pallet-multisig/std", + "pallet-nfts/std", + "pallet-pass/std", + "pallet-payments/std", + "pallet-preimage/std", + "pallet-proxy/std", + "pallet-ranked-collective/std", + "pallet-referenda/std", + "pallet-referenda-tracks/std", + "pallet-revive/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-skip-feeless-payment/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-utility/std", + "pallet-xcm/std", + "pallet-xcm-benchmarks/std", + "parachain-info/std", + "parachains-common/std", + "parity-scale-codec/std", + "pass-webauthn/std", + "polkadot-core-primitives/std", + "polkadot-parachain-primitives/std", + "polkadot-runtime-common/std", + "runtime-common/std", + "scale-info/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-io?/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-transaction-pool/std", + "sp-version/std", + "sp-weights/std", + "virto-common/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + "pallet-listings/std", + "pallet-vesting/std", + "serde_json/std", + "pallet-assets-holder/std", + "pallet-orders/std", + "frame-contrib-traits/std", + "pallet-contracts-store/std", + "pass-substrate-keys/std", + "rand_core?/std", + "schnorrkel?/std", + "pallet-black-hole/std", ] runtime-benchmarks = [ - "assets-common/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", - "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "pallet-assets-freezer/runtime-benchmarks", - "pallet-asset-tx-payment/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-contracts/runtime-benchmarks", - "pallet-communities-manager/runtime-benchmarks", - "pallet-communities/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", - "pallet-gas-transaction-payment/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-nfts/runtime-benchmarks", - "pallet-payments/runtime-benchmarks", - "pallet-pass/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-ranked-collective/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-referenda-tracks/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-skip-feeless-payment/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-xcm-benchmarks/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "pass-webauthn/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "runtime-common/runtime-benchmarks", - "sp-io", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", + "assets-common/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "cumulus-primitives-utility/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "pallet-assets-freezer/runtime-benchmarks", + "pallet-asset-tx-payment/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-contracts/runtime-benchmarks", + "pallet-communities-manager/runtime-benchmarks", + "pallet-communities/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-gas-transaction-payment/runtime-benchmarks", + "pallet-message-queue/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-nfts/runtime-benchmarks", + "pallet-payments/runtime-benchmarks", + "pallet-pass/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-ranked-collective/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-referenda-tracks/runtime-benchmarks", + "pallet-revive/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-skip-feeless-payment/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", + "rand_core", + "runtime-common/runtime-benchmarks", + "schnorrkel", + "frame-contrib-traits/runtime-benchmarks", + "pallet-assets-holder/runtime-benchmarks", + "pallet-black-hole/runtime-benchmarks", + "pallet-contracts-store/runtime-benchmarks", + "pallet-listings/runtime-benchmarks", + "pallet-orders/runtime-benchmarks", + "pallet-transaction-payment/runtime-benchmarks", + "pallet-session/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", + "sp-io", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", + "xcm/runtime-benchmarks", + "virto-common/runtime-benchmarks", ] try-runtime = [ - "cumulus-pallet-aura-ext/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-support/try-runtime", - "frame-try-runtime/try-runtime", - "pallet-assets-freezer/try-runtime", - "pallet-asset-tx-payment/try-runtime", - "pallet-assets/try-runtime", - "pallet-aura/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-contracts/try-runtime", - "pallet-communities-manager/try-runtime", - "pallet-communities/try-runtime", - "pallet-collator-selection/try-runtime", - "pallet-gas-transaction-payment/try-runtime", - "pallet-message-queue/try-runtime", - "pallet-nfts/try-runtime", - "pallet-multisig/try-runtime", - "pallet-pass/try-runtime", - "pallet-payments/try-runtime", - "pallet-preimage/try-runtime", - "pallet-proxy/try-runtime", - "pallet-ranked-collective/try-runtime", - "pallet-referenda/try-runtime", - "pallet-referenda-tracks/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-session/try-runtime", - "pallet-skip-feeless-payment/try-runtime", - "pallet-sudo/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-treasury/try-runtime", - "pallet-utility/try-runtime", - "pallet-xcm/try-runtime", - "pass-webauthn/try-runtime", - "parachain-info/try-runtime", - "polkadot-runtime-common/try-runtime", - "runtime-common/try-runtime", - "sp-runtime/try-runtime", + "assets-common/try-runtime", + "cumulus-pallet-aura-ext/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-support/try-runtime", + "frame-try-runtime/try-runtime", + "pallet-assets-freezer/try-runtime", + "pallet-assets-holder/try-runtime", + "pallet-asset-tx-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-black-hole/try-runtime", + "pallet-contracts/try-runtime", + "pallet-contracts-store/try-runtime", + "pallet-communities-manager/try-runtime", + "pallet-communities/try-runtime", + "pallet-collator-selection/try-runtime", + "pallet-gas-transaction-payment/try-runtime", + "pallet-listings/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-nfts/try-runtime", + "pallet-multisig/try-runtime", + "pallet-orders/try-runtime", + "pallet-pass/try-runtime", + "pallet-payments/try-runtime", + "pallet-preimage/try-runtime", + "pallet-proxy/try-runtime", + "pallet-ranked-collective/try-runtime", + "pallet-referenda/try-runtime", + "pallet-referenda-tracks/try-runtime", + "pallet-revive/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-skip-feeless-payment/try-runtime", + "pallet-sudo/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-utility/try-runtime", + "pallet-vesting/try-runtime", + "pallet-xcm/try-runtime", + "parachains-common/try-runtime", + "parachain-info/try-runtime", + "pass-substrate-keys/try-runtime", + "pass-webauthn/try-runtime", + "polkadot-runtime-common/try-runtime", + "runtime-common/try-runtime", + "sp-runtime/try-runtime", + "runtime-constants/try-runtime" ] diff --git a/runtime/kreivo/src/apis.rs b/runtime/kreivo/src/apis.rs index 3a5c21212..49a4129c4 100644 --- a/runtime/kreivo/src/apis.rs +++ b/runtime/kreivo/src/apis.rs @@ -1,18 +1,55 @@ use super::*; - +use pallet_contracts::{CollectEvents, DebugInfo, Determinism}; +use pallet_revive::evm::runtime::EthExtra; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; use sp_runtime::{ - traits::Block as BlockT, - transaction_validity::{InvalidTransaction, TransactionSource, TransactionValidity}, + traits::{Block as BlockT, Get}, + transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, ExtrinsicInclusionMode, }; use sp_version::RuntimeVersion; -impl_runtime_apis! { +type EventRecord = + frame_system::EventRecord<::RuntimeEvent, ::Hash>; + +/// Default extensions applied to Ethereum transactions. +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct EthExtraImpl; + +impl EthExtra for EthExtraImpl { + type Config = Runtime; + type Extension = TransactionExtensions; + + fn get_eth_extension(nonce: u32, tip: Balance) -> Self::Extension { + #[cfg(feature = "zombienet")] + let _ = tip; + ( + #[cfg(not(feature = "zombienet"))] + PassAuthenticate::default(), + frame_system::CheckNonZeroSender::::new(), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::from(generic::Era::Immortal), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + #[cfg(not(feature = "zombienet"))] + SkipCheckIfFeeless::from(ChargeGasTxPayment::new(ChargeAssetTxPayment::from( + tip, + Default::default(), + ))), + ) + } +} + +pallet_revive::impl_runtime_apis_plus_revive! { + Runtime, + Executive, + EthExtraImpl, impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) + sp_consensus_aura::SlotDuration::from_millis(RELAY_CHAIN_SLOT_DURATION_MILLIS) } fn authorities() -> Vec { @@ -52,7 +89,7 @@ impl_runtime_apis! { Runtime::metadata_at_version(version) } - fn metadata_versions() -> sp_std::vec::Vec { + fn metadata_versions() -> Vec { Runtime::metadata_versions() } } @@ -84,13 +121,34 @@ impl_runtime_apis! { tx: ::Extrinsic, block_hash: ::Hash, ) -> TransactionValidity { - if !::BaseCallFilter::contains(&tx.function) { - return InvalidTransaction::Call.into(); - }; 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) -> Nonce { + System::account_nonce(account) + } + } + impl assets_common::runtime_api::FungiblesApi< Block, AccountId, @@ -119,30 +177,6 @@ impl_runtime_apis! { } } - 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) -> Nonce { - System::account_nonce(account) - } - } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { fn query_info( uxt: ::Extrinsic, @@ -193,6 +227,93 @@ impl_runtime_apis! { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(id: &Option) -> Option> { + get_preset::(id, &genesis_config_presets::get_preset) + } + + fn preset_names() -> Vec { + genesis_config_presets::preset_names() + } + } + + impl pallet_contracts::ContractsApi + for Runtime + { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + input_data: Vec, + ) -> pallet_contracts::ContractExecResult { + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_call( + origin, + dest, + value, + gas_limit, + storage_deposit_limit, + input_data, + DebugInfo::UnsafeDebug, + CollectEvents::UnsafeCollect, + Determinism::Relaxed + ) + } + + fn instantiate( + origin: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + code: pallet_contracts::Code, + data: Vec, + salt: Vec, + ) -> pallet_contracts::ContractInstantiateResult + { + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_instantiate( + origin, + value, + gas_limit, + storage_deposit_limit, + code, + data, + salt, + DebugInfo::UnsafeDebug, + CollectEvents::UnsafeCollect, + ) + } + + fn upload_code( + origin: AccountId, + code: Vec, + storage_deposit_limit: Option, + determinism: Determinism, + ) -> pallet_contracts::CodeUploadResult + { + Contracts::bare_upload_code(origin, code, storage_deposit_limit, determinism) + } + + fn get_storage( + address: AccountId, + key: Vec, + ) -> pallet_contracts::GetStorageResult { + Contracts::get_storage(address, key) + } + } + + impl cumulus_primitives_core::RelayParentOffsetApi for Runtime { + fn relay_parent_offset() -> u32 { + ::RelayParentOffset::get() + } + } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { @@ -223,22 +344,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { + ) -> Result, String> { benchmarking::dispatch_benchmark(config) } } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn build_state(json: Vec) -> Result<(), sp_runtime::RuntimeString> { - build_state::(json) - } - - fn get_preset(id: &Option) -> Option> { - get_preset::(id, &genesis_config_presets::get_preset) - } - - fn preset_names() -> Vec { - genesis_config_presets::preset_names() - } - } } diff --git a/runtime/kreivo/src/benchmarking/mod.rs b/runtime/kreivo/src/benchmarking.rs similarity index 83% rename from runtime/kreivo/src/benchmarking/mod.rs rename to runtime/kreivo/src/benchmarking.rs index b270a1c96..3c130918a 100644 --- a/runtime/kreivo/src/benchmarking/mod.rs +++ b/runtime/kreivo/src/benchmarking.rs @@ -1,11 +1,9 @@ -mod impls; - use super::*; -use frame_benchmarking::{BenchmarkBatch, BenchmarkConfig, BenchmarkList, Benchmarking}; +use frame_benchmarking::{BenchmarkBatch, BenchmarkConfig, BenchmarkList}; use frame_support::traits::{StorageInfo, StorageInfoTrait}; -use impls::{SessionBench, SystemBench}; -use sp_runtime::RuntimeString; +use cumulus_pallet_session_benchmarking::Pallet as SessionBench; +use frame_system_benchmarking::Pallet as SystemBench; type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet; type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet; @@ -19,8 +17,11 @@ frame_benchmarking::define_benchmarks!( // Monetary stuff [pallet_balances, Balances] + [pallet_transaction_payment, TransactionPayment] [pallet_assets, Assets] + [pallet_asset_tx_payment, AssetsTxPayment] [pallet_vesting, Vesting] + [pallet_gas_transaction_payment, GasTxPayment] // Collator support [pallet_collator_selection, CollatorSelection] @@ -28,10 +29,10 @@ frame_benchmarking::define_benchmarks!( // XCM [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_message_queue, MessageQueue] // NOTE: Make sure you point to the individual modules below. [pallet_xcm_benchmarks::fungible, XcmBalances] [pallet_xcm_benchmarks::generic, XcmGeneric] + [pallet_message_queue, MessageQueue] // Utils [pallet_multisig, Multisig] @@ -45,8 +46,11 @@ frame_benchmarking::define_benchmarks!( [pallet_ranked_collective, KreivoCollective] [pallet_referenda, KreivoReferenda] - // Virto Tooling + // Merchants [pallet_payments, Payments] + [pallet_listings, Listings] + [pallet_nfts, ListingsCatalog] + [pallet_orders, Orders] // Communities at Kreivo [pallet_communities, Communities] @@ -57,6 +61,7 @@ frame_benchmarking::define_benchmarks!( // Contracts [pallet_contracts, Contracts] + [pallet_contracts_store, ContractsStore] ); pub(crate) fn benchmark_metadata(extra: bool) -> (Vec, Vec) { @@ -70,7 +75,7 @@ pub(crate) fn benchmark_metadata(extra: bool) -> (Vec, Vec Result, RuntimeString> { +pub(crate) fn dispatch_benchmark(config: BenchmarkConfig) -> Result, String> { use frame_support::traits::WhitelistedStorageKeys; let whitelist = AllPalletsWithSystem::whitelisted_storage_keys(); diff --git a/runtime/kreivo/src/benchmarking/impls.rs b/runtime/kreivo/src/benchmarking/impls.rs deleted file mode 100644 index 77d1b7842..000000000 --- a/runtime/kreivo/src/benchmarking/impls.rs +++ /dev/null @@ -1,141 +0,0 @@ -use super::*; - -pub(super) use cumulus_pallet_session_benchmarking::Pallet as SessionBench; -pub(super) use frame_system_benchmarking::Pallet as SystemBench; - -use super::{xcm_config, Balances, PriceForParentDelivery, Runtime, UNITS}; -use crate::RuntimeCall; -use frame_benchmarking::BenchmarkError; -use frame_support::parameter_types; -use pallet_xcm_benchmarks::asset_instance_from; -use xcm::latest::prelude::{ - Asset, AssetId, Assets as XcmAssets, Fungible, GeneralIndex, Here, InteriorLocation, Junction, Location, NetworkId, - NonFungible, Response, -}; -use xcm_config::RelayLocation; - -impl frame_system_benchmarking::Config for Runtime { - fn setup_set_code_requirements(code: &Vec) -> Result<(), BenchmarkError> { - ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); - Ok(()) - } - - fn verify_set_code() { - System::assert_last_event(cumulus_pallet_parachain_system::Event::::ValidationFunctionStored.into()); - } -} - -impl cumulus_pallet_session_benchmarking::Config for Runtime {} - -parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - RelayLocation::get(), - ExistentialDeposit::get() - ).into()); -} - -impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = xcm_config::XcmConfig; - type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - PriceForParentDelivery, - >; - - fn valid_destination() -> Result { - Ok(RelayLocation::get()) - } - fn worst_case_holding(depositable_count: u32) -> XcmAssets { - // A mix of fungible, non-fungible, and concrete assets. - let holding_non_fungibles = xcm_config::MaxAssetsIntoHolding::get() / 2 - depositable_count; - let holding_fungibles = holding_non_fungibles.saturating_sub(1); - let fungibles_amount: u128 = 100; - let mut assets = (0..holding_fungibles) - .map(|i| (AssetId(GeneralIndex(i as u128).into()), fungibles_amount * i as u128).into()) - .chain(core::iter::once((AssetId(Here.into()), u128::MAX).into())) - .chain((0..holding_non_fungibles).map(|i| { - ( - AssetId(GeneralIndex(i as u128).into()), - NonFungible(asset_instance_from(i)), - ) - .into() - })) - .collect::>(); - - assets.push((RelayLocation::get(), 1_000_000 * UNITS).into()); - assets.into() - } -} - -parameter_types! { - pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( - RelayLocation::get(), - Asset { fun: Fungible(1 * UNITS), id: AssetId(RelayLocation::get()) }, - )); - pub const TrustedReserve: Option<(Location, Asset)> = None; - pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; - -} - -impl pallet_xcm_benchmarks::fungible::Config for Runtime { - type TransactAsset = Balances; - type CheckedAccount = CheckedAccount; - type TrustedTeleporter = TrustedTeleporter; - type TrustedReserve = TrustedReserve; - - fn get_asset() -> Asset { - (RelayLocation::get(), UNITS).into() - } -} - -impl pallet_xcm_benchmarks::generic::Config for Runtime { - type RuntimeCall = RuntimeCall; - type TransactAsset = Balances; - - fn worst_case_response() -> (u64, Response) { - (0u64, Response::Version(Default::default())) - } - - fn worst_case_asset_exchange() -> Result<(XcmAssets, XcmAssets), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok(( - RelayLocation::get(), - frame_system::Call::remark_with_event { remark: vec![] }.into(), - )) - } - - fn subscribe_origin() -> Result { - Ok(RelayLocation::get()) - } - - fn claimable_asset() -> Result<(Location, Location, XcmAssets), BenchmarkError> { - let origin = RelayLocation::get(); - let assets: XcmAssets = (AssetId(RelayLocation::get()), 1_000 * UNITS).into(); - let ticket = Here.into(); - Ok((origin, ticket, assets)) - } - - fn fee_asset() -> Result { - Ok((RelayLocation::get(), 1_000_000 * UNITS).into()) - } - - fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn export_message_origin_and_destination() -> Result<(Location, NetworkId, InteriorLocation), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn alias_origin() -> Result<(Location, Location), BenchmarkError> { - Err(BenchmarkError::Skip) - } -} diff --git a/runtime/kreivo/src/config/collator_support.rs b/runtime/kreivo/src/config/collator_support.rs index f7cf53dc3..9187ac81a 100644 --- a/runtime/kreivo/src/config/collator_support.rs +++ b/runtime/kreivo/src/config/collator_support.rs @@ -2,6 +2,7 @@ use super::*; use frame_support::traits::EitherOfDiverse; use pallet_xcm::IsVoiceOfBody; +pub use runtime_constants::async_backing_params::RELAY_CHAIN_SLOT_DURATION_MILLIS; // #[runtime::pallet_index(20)] // pub type Authorship @@ -47,6 +48,7 @@ impl pallet_collator_selection::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; + pub const KeyDeposit: u64 = 0; } impl pallet_session::Config for Runtime { @@ -60,7 +62,10 @@ impl pallet_session::Config for Runtime { // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; + type DisablingStrategy = (); type WeightInfo = weights::pallet_session::WeightInfo; + type Currency = pallet_balances::Pallet; + type KeyDeposit = KeyDeposit; } // #[runtime::pallet_index(23)] @@ -70,36 +75,27 @@ impl pallet_session::Config for Runtime { /// up by `pallet_aura` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -pub const MILLISECONDS_PER_BLOCK: u64 = 6_000; -pub const SLOT_DURATION: u64 = MILLISECONDS_PER_BLOCK; - impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type MaxAuthorities = ConstU32<100_000>; type DisabledValidators = (); type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = ConstU64; + type SlotDuration = ConstU64<{ RELAY_CHAIN_SLOT_DURATION_MILLIS }>; } // #[runtime::pallet_index(24)] // pub type AuraExt impl cumulus_pallet_aura_ext::Config for Runtime {} -mod async_backing_params { - /// Maximum number of blocks simultaneously accepted by the Runtime, not yet - /// included into the relay chain. - pub(crate) const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3; - /// How many parachain blocks are processed by the relay chain per parent. - /// Limits the number of blocks authored per slot. - pub(crate) const BLOCK_PROCESSING_VELOCITY: u32 = 1; - /// Relay chain slot duration, in milliseconds. - pub(crate) const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6_000; -} +pub(crate) use runtime_constants::async_backing_params::*; /// Aura consensus hook pub type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< Runtime, - { async_backing_params::RELAY_CHAIN_SLOT_DURATION_MILLIS }, - { async_backing_params::BLOCK_PROCESSING_VELOCITY }, - { async_backing_params::UNINCLUDED_SEGMENT_CAPACITY }, + { RELAY_CHAIN_SLOT_DURATION_MILLIS as u32 }, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, >; + +#[cfg(feature = "runtime-benchmarks")] +impl cumulus_pallet_session_benchmarking::Config for Runtime {} diff --git a/runtime/kreivo/src/config/collective/governance.rs b/runtime/kreivo/src/config/collective/governance.rs index 8a49c3d44..b6eb7912b 100644 --- a/runtime/kreivo/src/config/collective/governance.rs +++ b/runtime/kreivo/src/config/collective/governance.rs @@ -24,4 +24,5 @@ impl pallet_referenda::Config for Runtime { type AlarmInterval = ConstU32<1>; type Tracks = tracks::TracksInfo; type Preimages = Preimage; + type BlockNumberProvider = System; } diff --git a/runtime/kreivo/src/config/collective/mod.rs b/runtime/kreivo/src/config/collective/mod.rs index 3b12c34ff..8641eaa91 100644 --- a/runtime/kreivo/src/config/collective/mod.rs +++ b/runtime/kreivo/src/config/collective/mod.rs @@ -1,6 +1,6 @@ use super::*; -use frame_system::{EnsureNever, EnsureRootWithSuccess}; +use frame_system::EnsureRootWithSuccess; use pallet_ranked_collective::Rank; use sp_core::ConstU16; use sp_runtime::traits::Convert; @@ -18,44 +18,36 @@ impl Convert for AtLeastRank { pub type KreivoCollectiveInstance = pallet_ranked_collective::Instance1; impl pallet_ranked_collective::Config for Runtime { - type WeightInfo = pallet_ranked_collective::weights::SubstrateWeight; + type WeightInfo = weights::pallet_ranked_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; - - type AddOrigin = EnsureNever<()>; - - type RemoveOrigin = Self::DemoteOrigin; - - // Initially, members of kreivo collective are promoted via governance action - // In the future, it's expected to have an auxiliary pallet to observe the - // criteria for ranking - type PromoteOrigin = EnsureRootWithSuccess>; - - // Initially, members of kreivo collective are demoted via governance action + // Initially, members of kreivo collective are managed via governance action // In the future, it's expected to have an auxiliary pallet to observe the // criteria for ranking - type DemoteOrigin = EnsureRootWithSuccess>; - + type AddOrigin = EnsureRootWithSuccess>; + type RemoveOrigin = Self::AddOrigin; + type PromoteOrigin = Self::AddOrigin; + type DemoteOrigin = Self::AddOrigin; type ExchangeOrigin = EnsureRoot; type Polls = KreivoReferenda; - type MinRankOfClass = AtLeastRank<1>; type MemberSwappedHandler = (); type VoteWeight = pallet_ranked_collective::Linear; type MaxMemberCount = (); - #[cfg(feature = "runtime-benchmarks")] type BenchmarkSetup = CollectiveBenchmarkSetup; } #[cfg(feature = "runtime-benchmarks")] use frame_support::traits::RankedMembers; + #[cfg(feature = "runtime-benchmarks")] pub struct CollectiveBenchmarkSetup; #[cfg(feature = "runtime-benchmarks")] impl pallet_ranked_collective::BenchmarkSetup for CollectiveBenchmarkSetup { /// Ensure that this member is registered correctly. fn ensure_member(acc: &AccountId) { - as RankedMembers>::induct(acc) - .expect("Account exists"); + if KreivoCollective::rank_of(acc).is_none() { + KreivoCollective::induct(acc).expect("Account exists"); + } } } diff --git a/runtime/kreivo/src/config/collective/tracks.rs b/runtime/kreivo/src/config/collective/tracks.rs index 01c858a87..19403fac7 100644 --- a/runtime/kreivo/src/config/collective/tracks.rs +++ b/runtime/kreivo/src/config/collective/tracks.rs @@ -1,8 +1,8 @@ use super::*; -use pallet_referenda::{impl_tracksinfo_get, Track}; +use alloc::borrow::Cow; +use pallet_referenda::Track; use sp_runtime::{str_array as s, FixedI64}; -use sp_std::borrow::Cow; pub type TrackId = u16; @@ -16,7 +16,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { type RuntimeOrigin = ::PalletsOrigin; fn tracks() -> impl Iterator>> { - const DATA: [Track; 4] = [ + const DATA: [Track; 5] = [ Track { id: 0, info: pallet_referenda::TrackInfo { @@ -101,8 +101,26 @@ impl pallet_referenda::TracksInfo for TracksInfo { min_support: pallet_referenda::Curve::make_linear(28, 28, percent(50), percent(100)), }, }, + Track { + id: 4, + info: pallet_referenda::TrackInfo { + name: s("Black Hole Event Horizon"), + max_deciding: 1, + decision_deposit: UNITS, + prepare_period: 5 * MINUTES, + decision_period: 1 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::make_linear(28, 28, percent(50), percent(100)), + }, + }, ]; - DATA.iter().map(Cow::Borrowed) + DATA.iter().map(Borrowed) } fn track_for(id: &Self::RuntimeOrigin) -> Result { @@ -113,13 +131,13 @@ impl pallet_referenda::TracksInfo for TracksInfo { } } else if let Ok(custom_origin) = pallet_custom_origins::Origin::try_from(id.clone()) { match custom_origin { - pallet_custom_origins::Origin::ReferendumCanceller => Ok(1), - pallet_custom_origins::Origin::ReferendumKiller => Ok(2), - pallet_custom_origins::Origin::CreateMemberships => Ok(3), + Origin::ReferendumCanceller => Ok(1), + Origin::ReferendumKiller => Ok(2), + Origin::CreateMemberships => Ok(3), + Origin::BlackHoleEventHorizon => Ok(4), } } else { Err(()) } } } -impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); diff --git a/runtime/kreivo/src/config/communities/governance.rs b/runtime/kreivo/src/config/communities/governance.rs index 4babe5950..5ff2b678a 100644 --- a/runtime/kreivo/src/config/communities/governance.rs +++ b/runtime/kreivo/src/config/communities/governance.rs @@ -1,8 +1,8 @@ use super::*; +use core::marker::PhantomData; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRootWithSuccess}; use pallet_communities::RuntimeOriginFor; -use sp_std::marker::PhantomData; use pallet_referenda::{BalanceOf, PalletsOriginOf, TrackIdOf, TracksInfo}; @@ -32,14 +32,13 @@ impl EnsureOriginWithArg) -> Result { - Ok(pallet_communities::Origin::::new(id.clone()).into()) + Ok(pallet_communities::Origin::::new(*id).into()) } } impl pallet_referenda_tracks::Config for Runtime { type AdminOrigin = EnsureRoot; type UpdateOrigin = EnsureOriginToTrack; - type RuntimeEvent = RuntimeEvent; type TrackId = CommunityId; type MaxTracks = ConstU32<65536>; type WeightInfo = weights::pallet_referenda_tracks::WeightInfo; @@ -66,7 +65,7 @@ where o: RuntimeOriginFor, track_origin: &PalletsOriginOf, ) -> Result> { - use fc_traits_memberships::Inspect; + use frame_contrib_traits::memberships::Inspect; use frame_system::RawOrigin::Signed; let community_id = T::Tracks::track_for(track_origin).map_err(|_| o.clone())?; @@ -110,6 +109,7 @@ impl pallet_referenda::Config for Runtime { type AlarmInterval = AlarmInterval; type Tracks = CommunityTracks; type Preimages = Preimage; + type BlockNumberProvider = System; } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/kreivo/src/config/communities/memberships.rs b/runtime/kreivo/src/config/communities/memberships.rs index 7789b5995..4413806d8 100644 --- a/runtime/kreivo/src/config/communities/memberships.rs +++ b/runtime/kreivo/src/config/communities/memberships.rs @@ -1,7 +1,8 @@ use super::*; -use fc_traits_memberships::OnMembershipAssigned; +use frame_contrib_traits::memberships::OnMembershipAssigned; use frame_system::EnsureRootWithSuccess; +use parity_scale_codec::Encode; use sp_runtime::traits::Verify; use pallet_nfts::PalletFeatures; @@ -10,9 +11,6 @@ use virto_common::MembershipId; parameter_types! { pub MembershipsPalletFeatures: PalletFeatures = PalletFeatures::all_enabled(); pub const MaxDeadlineDuration: BlockNumber = 12 * 30 * DAYS; - pub const MetadataDepositBase: Balance = 0; - pub const AttributeDepositBase: Balance = 0; - pub const DepositPerByte: Balance = 0; } const WELL_KNOWN_ATTR_KEYS: [&[u8]; 3] = [b"membership_member_rank", b"membership_gas", b"membership_expiration"]; @@ -22,8 +20,9 @@ parameter_types! { Box::new(|_, group, m| { use frame_support::traits::nonfungibles_v2::{Inspect as NonFunsInspect, Mutate}; for key in WELL_KNOWN_ATTR_KEYS.into_iter() { - if let Some(value) = CommunityMemberships::system_attribute(&group, Some(&m), key) { - >::set_attribute(&group, &m, key, &value)?; + let key = key.to_vec(); + if let Some(value) = CommunityMemberships::system_attribute(&MembershipsCollectionId::get(), Some(&m), &key.encode()) { + >::set_attribute(&group, &m, &key.encode(), &value)?; } } @@ -33,25 +32,25 @@ parameter_types! { pub type CommunityMembershipsInstance = pallet_nfts::Instance2; -// From https://github.com/polkadot-fellows/runtimes/blob/main/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs#L810 impl pallet_nfts::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type CollectionId = CommunityId; type ItemId = MembershipId; - type Currency = Balances; type ForceOrigin = EnsureRoot; - // Ensure only root is allowed to executing `create` calls + // Ensure only root is allowed to issue new membership groups. type CreateOrigin = EnsureRootWithSuccess; type Locker = (); - type CollectionDeposit = (); + #[cfg(not(feature = "runtime-benchmarks"))] type ItemDeposit = (); - type MetadataDepositBase = MetadataDepositBase; - type AttributeDepositBase = AttributeDepositBase; - type DepositPerByte = DepositPerByte; - + #[cfg(feature = "runtime-benchmarks")] + // When benchmarking, items must have a deposit cost, in order for `redeposit` + // to work. + type ItemDeposit = sp_core::ConstU128; + type MetadataDepositBase = (); + type AttributeDepositBase = (); + type DepositPerByte = (); type StringLimit = ConstU32<256>; type KeyLimit = ConstU32<64>; type ValueLimit = ConstU32<256>; @@ -60,40 +59,14 @@ impl pallet_nfts::Config for Runtime { type MaxTips = ConstU32<10>; type MaxDeadlineDuration = MaxDeadlineDuration; type MaxAttributesPerCall = ConstU32<10>; - type Features = MembershipsPalletFeatures; - + type Features = (); type OffchainSignature = Signature; type OffchainPublic = ::Signer; #[cfg(feature = "runtime-benchmarks")] - type Helper = NftsBenchmarksHelper; - + type Helper = (); type WeightInfo = pallet_nfts::weights::SubstrateWeight; + type BlockNumberProvider = RelaychainData; } -#[cfg(feature = "runtime-benchmarks")] -pub struct NftsBenchmarksHelper; - -#[cfg(feature = "runtime-benchmarks")] -use sp_runtime::traits::IdentifyAccount; - -#[cfg(feature = "runtime-benchmarks")] -impl pallet_nfts::BenchmarkHelper::Signer, AccountId, Signature> - for NftsBenchmarksHelper -{ - fn collection(id: u16) -> CommunityId { - id.into() - } - fn item(i: u16) -> MembershipId { - i.into() - } - fn signer() -> (sp_runtime::MultiSigner, AccountId) { - let public = sp_io::crypto::sr25519_generate(0.into(), None); - let account = sp_runtime::MultiSigner::Sr25519(public).into_account(); - (public.into(), account) - } - fn sign(signer: &sp_runtime::MultiSigner, message: &[u8]) -> Signature { - sp_runtime::MultiSignature::Sr25519( - sp_io::crypto::sr25519_sign(0.into(), &signer.clone().try_into().unwrap(), message).unwrap(), - ) - } -} +pub type Memberships = + WithHooks, CopySystemAttributesOnAssign>; diff --git a/runtime/kreivo/src/config/communities/mod.rs b/runtime/kreivo/src/config/communities/mod.rs index abffc8007..d6377265b 100644 --- a/runtime/kreivo/src/config/communities/mod.rs +++ b/runtime/kreivo/src/config/communities/mod.rs @@ -1,39 +1,18 @@ use super::*; +use frame_contrib_traits::memberships::{NonFungiblesMemberships, WithHooks}; use frame_support::traits::TryMapSuccess; -#[cfg(not(feature = "runtime-benchmarks"))] -use frame_system::EnsureNever; use frame_system::{EnsureRootWithSuccess, EnsureSigned}; use pallet_communities::origin::{EnsureCommunity, EnsureSignedPays}; use sp_runtime::{morph_types, traits::AccountIdConversion}; use virto_common::{CommunityId, MembershipId}; -use fc_traits_memberships::{NonFungiblesMemberships, WithHooks}; -pub mod governance; -pub mod memberships; - -#[cfg(feature = "runtime-benchmarks")] -use self::{ - governance::{CommunityReferendaInstance, CommunityTracksInstance}, - memberships::CommunityMembershipsInstance, -}; +use memberships::CopySystemAttributesOnAssign; +pub use memberships::Memberships; use pallet_custom_origins::CreateMemberships; -#[cfg(feature = "runtime-benchmarks")] -use { - frame_benchmarking::BenchmarkError, - frame_support::traits::{schedule::DispatchTime, tokens::nonfungible_v2::Mutate}, - frame_system::pallet_prelude::{OriginFor, RuntimeCallFor}, - pallet_communities::{ - types::{CommunityIdOf, MembershipIdOf, PalletsOriginOf, PollIndexOf}, - BenchmarkHelper, - }, - pallet_nfts::Pallet as Nfts, - pallet_referenda::{BoundedCallOf, Curve, Pallet as Referenda, TrackInfo}, - pallet_referenda_tracks::Pallet as Tracks, - sp_core::Encode, - sp_runtime::Perbill, -}; +pub mod governance; +pub mod memberships; type CreationPayment = Option<(Balance, AccountId, AccountId)>; @@ -56,181 +35,186 @@ type RootCreatesCommunitiesForFree = EnsureRootWithSuccess; type AnyoneElsePays = EnsureSignedPays; impl pallet_communities::Config for Runtime { - type CommunityId = CommunityId; + type RuntimeFreezeReason = RuntimeFreezeReason; + type WeightInfo = weights::pallet_communities::WeightInfo; #[cfg(not(feature = "runtime-benchmarks"))] - type CreateOrigin = EnsureNever; + type CreateOrigin = frame_system::EnsureNever; + #[cfg(feature = "runtime-benchmarks")] type CreateOrigin = RootCreatesCommunitiesForFree; + type AdminOrigin = EitherOf, EnsureCommunityAccount>; type MemberMgmtOrigin = EitherOf, EnsureCommunityAccount>; - type MemberMgmt = - WithHooks, memberships::CopySystemAttributesOnAssign>; - type MembershipId = MembershipId; + type CommunityId = CommunityId; + type MembershipId = MembershipId; + type MemberMgmt = WithHooks; type Polls = CommunityReferenda; - type Assets = Assets; + type AssetsFreezer = AssetsFreezer; - type Balances = Balances; - type RuntimeCall = RuntimeCall; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = crate::weights::pallet_communities::WeightInfo; + type Balances = Balances; + type BlockNumberProvider = System; type PalletId = CommunityPalletId; - - type ItemConfig = pallet_nfts::ItemConfig; - type RuntimeFreezeReason = RuntimeFreezeReason; - #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = CommunityBenchmarkHelper; } impl pallet_communities_manager::Config for Runtime { - type RuntimeEvent = RuntimeEvent; type CreateCollection = CommunityMemberships; + type MakeTank = MembershipsGasTank; type Tracks = CommunityTracks; type RankedCollective = KreivoCollective; + type WeightInfo = weights::pallet_communities_manager::WeightInfo; type RegisterOrigin = EitherOf; - type CreateMembershipsOrigin = EitherOf, CreateMemberships>; - type MembershipId = MembershipId; - type MembershipsManagerOwner = TreasuryAccount; type MembershipsManagerCollectionId = MembershipsCollectionId; + type MembershipsManagerOwner = TreasuryAccount; + type ItemConfig = pallet_nfts::ItemConfig; type CreateMemberships = CommunityMemberships; - type MakeTank = MembershipsGasTank; - - type WeightInfo = crate::weights::pallet_communities_manager::WeightInfo; } #[cfg(feature = "runtime-benchmarks")] -pub struct CommunityBenchmarkHelper; - -#[cfg(feature = "runtime-benchmarks")] -type MembershipsManagementCollection = - frame_support::traits::nonfungible_v2::ItemOf; +pub use benchmarks::CommunityBenchmarkHelper; #[cfg(feature = "runtime-benchmarks")] -impl BenchmarkHelper for CommunityBenchmarkHelper { - fn community_id() -> CommunityIdOf { - 1 - } - fn community_asset_id() -> AssetIdOf { - 1u32.into() - } - fn community_desired_size() -> u32 { - u8::MAX.into() - } - fn initialize_memberships_collection() -> Result<(), BenchmarkError> { - let collection = MembershipsCollectionId::get(); - Nfts::::do_create_collection( - collection, - TreasuryAccount::get(), - TreasuryAccount::get(), - Default::default(), - 0, - pallet_nfts::Event::ForceCreated { - collection, - owner: TreasuryAccount::get(), - }, - )?; - - let community_id = Self::community_id(); - let community_account = pallet_communities::Pallet::::community_account(&community_id); - - Nfts::::do_create_collection( - community_id, - community_account.clone(), - community_account.clone(), - Default::default(), - 0, - pallet_nfts::Event::ForceCreated { - collection: community_id, - owner: community_account, - }, - )?; - - Ok(()) - } - - fn issue_membership( - community_id: CommunityIdOf, - membership_id: MembershipIdOf, - ) -> Result<(), BenchmarkError> { - let community_account = pallet_communities::Pallet::::community_account(&community_id); - - MembershipsManagementCollection::mint_into(&membership_id, &community_account, &Default::default(), true)?; +mod benchmarks { + use super::*; - Ok(()) - } - - fn prepare_track(pallet_origin: PalletsOriginOf) -> Result<(), BenchmarkError> { - let id = Self::community_id(); - let info = TrackInfo { - name: sp_runtime::str_array("Community"), - max_deciding: 1, - decision_deposit: 5, - prepare_period: 1, - decision_period: 5, - confirm_period: 1, - min_enactment_period: 1, - min_approval: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(50), - ceil: Perbill::from_percent(100), - }, - min_support: Curve::LinearDecreasing { - length: Perbill::from_percent(100), - floor: Perbill::from_percent(0), - ceil: Perbill::from_percent(100), - }, - }; - - Tracks::::insert(RuntimeOrigin::root(), id, info, pallet_origin)?; - - Ok(()) - } - - fn prepare_poll( - origin: OriginFor, - proposal_origin: PalletsOriginOf, - proposal_call: RuntimeCallFor, - ) -> Result, BenchmarkError> { - let bounded_call = BoundedVec::truncate_from(proposal_call.encode()); - let proposal_origin = Box::new(proposal_origin); - let proposal = BoundedCallOf::::Inline(bounded_call); - let enactment_moment = DispatchTime::After(1); - - let index = 0u32; - Referenda::::submit( - origin.clone(), - proposal_origin, - proposal, - enactment_moment, - )?; - Referenda::::place_decision_deposit(origin, index)?; - - System::set_block_number(2); - Referenda::::nudge_referendum(RuntimeOrigin::root(), 0)?; - - Ok(0) - } - - fn finish_poll(index: PollIndexOf) -> Result<(), BenchmarkError> { - System::set_block_number(8); - Referenda::::nudge_referendum(RuntimeOrigin::root(), index)?; - - frame_support::assert_ok!(Referenda::::ensure_ongoing(index)); + use governance::{CommunityReferendaInstance, CommunityTracksInstance}; - System::set_block_number(9); - Referenda::::nudge_referendum(RuntimeOrigin::root(), index)?; - - frame_support::assert_err!( - Referenda::::ensure_ongoing(index), - pallet_referenda::Error::::NotOngoing - ); - - Ok(()) + use frame_benchmarking::BenchmarkError; + use frame_support::traits::{ + nonfungible_v2::{ItemOf, Mutate}, + nonfungibles_v2::Create, + schedule::DispatchTime, + }; + use frame_system::pallet_prelude::{OriginFor, RuntimeCallFor}; + use pallet_communities::{ + types::{CommunityIdOf, MembershipIdOf, PalletsOriginOf, PollIndexOf}, + BenchmarkHelper, + }; + use pallet_referenda::{BoundedCallOf, Curve, Pallet as Referenda, TrackInfo}; + use pallet_referenda_tracks::Pallet as Tracks; + use parity_scale_codec::Encode; + use sp_runtime::Perbill; + + type MembershipsManagementCollection = ItemOf; + + pub struct CommunityBenchmarkHelper; + + impl BenchmarkHelper for CommunityBenchmarkHelper { + fn community_id() -> CommunityIdOf { + 1 + } + fn community_asset_id() -> AssetIdOf { + 1u32.into() + } + fn community_desired_size() -> u32 { + u8::MAX.into() + } + + fn initialize_memberships_collection() -> Result<(), BenchmarkError> { + let community_id = Self::community_id(); + let community_account = pallet_communities::Pallet::::community_account(&community_id); + + CommunityMemberships::create_collection_with_id( + MembershipsCollectionId::get(), + &community_account, + &community_account, + &Default::default(), + )?; + + CommunityMemberships::create_collection_with_id( + Self::community_id(), + &community_account, + &community_account, + &Default::default(), + )?; + + Ok(()) + } + + fn issue_membership( + community_id: CommunityIdOf, + membership_id: MembershipIdOf, + ) -> Result<(), BenchmarkError> { + let community_account = Communities::community_account(&community_id); + + MembershipsManagementCollection::mint_into(&membership_id, &community_account, &Default::default(), true)?; + + Ok(()) + } + + fn prepare_track(pallet_origin: PalletsOriginOf) -> Result<(), BenchmarkError> { + let id = Self::community_id(); + let info = TrackInfo { + name: sp_runtime::str_array("Community"), + max_deciding: 1, + decision_deposit: 5, + prepare_period: 1, + decision_period: 5, + confirm_period: 1, + min_enactment_period: 1, + min_approval: Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(100), + }, + }; + + Tracks::::insert(RuntimeOrigin::root(), id, info, pallet_origin)?; + + Ok(()) + } + + fn prepare_poll( + origin: OriginFor, + proposal_origin: PalletsOriginOf, + proposal_call: RuntimeCallFor, + ) -> Result, BenchmarkError> { + let bounded_call = BoundedVec::truncate_from(proposal_call.encode()); + let proposal_origin = Box::new(proposal_origin); + let proposal = BoundedCallOf::::Inline(bounded_call); + let enactment_moment = DispatchTime::After(1); + + let index = 0u32; + Referenda::::submit( + origin.clone(), + proposal_origin, + proposal, + enactment_moment, + )?; + Referenda::::place_decision_deposit(origin, index)?; + + System::set_block_number(2); + Referenda::::nudge_referendum(RuntimeOrigin::root(), 0)?; + + Ok(0) + } + + fn finish_poll(index: PollIndexOf) -> Result<(), BenchmarkError> { + System::set_block_number(8); + Referenda::::nudge_referendum(RuntimeOrigin::root(), index)?; + + frame_support::assert_ok!(Referenda::::ensure_ongoing(index)); + + System::set_block_number(9); + Referenda::::nudge_referendum(RuntimeOrigin::root(), index)?; + + frame_support::assert_err!( + Referenda::::ensure_ongoing(index), + pallet_referenda::Error::::NotOngoing + ); + + Ok(()) + } } } diff --git a/runtime/kreivo/src/config/contracts/mod.rs b/runtime/kreivo/src/config/contracts/mod.rs index dcccee1cc..5beafbb61 100644 --- a/runtime/kreivo/src/config/contracts/mod.rs +++ b/runtime/kreivo/src/config/contracts/mod.rs @@ -1,24 +1,23 @@ use super::*; + use frame_support::{ parameter_types, - traits::{ConstBool, ConstU32, Randomness}, + traits::{ConstBool, ConstU32, MapSuccess, Randomness}, }; use frame_system::pallet_prelude::BlockNumberFor; +use sp_runtime::morph_types; + use kreivo_apis::KreivoChainExtensions; use pallet_balances::Call as BalancesCall; +use virto_common::listings; #[cfg(not(feature = "runtime-benchmarks"))] -use { - frame_support::traits::EitherOf, frame_system::EnsureRootWithSuccess, - pallet_communities::origin::AsSignedByStaticCommunity, sp_core::ConstU16, -}; - +use {frame_system::EnsureNever, pallet_communities::origin::EnsureCommunity}; #[cfg(feature = "runtime-benchmarks")] -use frame_system::EnsureSigned; - -pub enum CallFilter {} +use {frame_system::EnsureSigned, sp_runtime::traits::Replace}; -impl frame_support::traits::Contains for CallFilter { +pub struct CallFilter; +impl Contains for CallFilter { fn contains(call: &RuntimeCall) -> bool { matches!( call, @@ -27,38 +26,67 @@ impl frame_support::traits::Contains for CallFilter { } } -fn schedule() -> pallet_contracts::Schedule { - const MB: u32 = 1024 * 1024; - pallet_contracts::Schedule { - limits: pallet_contracts::Limits { - validator_runtime_memory: 1024 * MB, - // Current `max_storage_size`: 138 MB - // Constraint: `runtime_memory <= validator_runtime_memory - 2 * max_storage_size` - runtime_memory: 748 * MB, - ..Default::default() - }, - ..Default::default() - } -} - // randomness-collective-flip is insecure. Provide dummy randomness as // placeholder for the deprecated trait. https://github.com/paritytech/polkadot-sdk/blob/9bf1a5e23884921498b381728bfddaae93f83744/substrate/frame/contracts/mock-network/src/parachain/contracts_config.rs#L45 -pub struct DummyRandomness(sp_std::marker::PhantomData); - +pub struct DummyRandomness(core::marker::PhantomData); impl Randomness> for DummyRandomness { fn random(_subject: &[u8]) -> (T::Hash, BlockNumberFor) { (Default::default(), Default::default()) } } +// Use Kreivo APIs for Chain Extensions +impl kreivo_apis::Config for Runtime { + type Balances = Balances; + type Assets = Assets; + type MerchantIdInfo = Self; + type Listings = Listings; + type GroupInfo = Self; + type Memberships = Memberships; +} + +impl kreivo_apis::GroupInfo for Runtime { + type Group = CommunityId; + + fn maybe_group(who: &AccountId) -> Option { + ContractsStore::maybe_merchant_id(who) + } +} + +impl kreivo_apis::MerchantIdInfo for Runtime { + type MerchantId = CommunityId; + + fn maybe_merchant_id(who: &AccountId) -> Option { + ContractsStore::maybe_merchant_id(who) + } +} + parameter_types! { pub const DepositPerItem: Balance = deposit(1, 0); pub const DepositPerByte: Balance = deposit(0, 1); - pub Schedule: pallet_contracts::Schedule = schedule::(); + pub Schedule: pallet_contracts::Schedule = { + const MB: u32 = 1024 * 1024; + pallet_contracts::Schedule { + limits: pallet_contracts::Limits { + validator_runtime_memory: 1024 * MB, + // Current `max_storage_size`: 138 MB + // Constraint: `runtime_memory <= validator_runtime_memory - 2 * max_storage_size` + runtime_memory: 748 * MB, + ..Default::default() + }, + ..Default::default() + } + }; pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); } +morph_types! { + pub type ReplaceWithCommunityAccount = |c: CommunityId| -> AccountId { + Communities::community_account(&c) + }; +} + impl pallet_contracts::Config for Runtime { type Time = Timestamp; type Randomness = DummyRandomness; @@ -69,7 +97,7 @@ impl pallet_contracts::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; /// The safest default is to allow no calls at all. /// - /// Runtimes should whitelist dispatchables that are allowed to be called + /// Runtimes should note which dispatchables are allowed to be called /// from contracts and make sure they are stable. Dispatchables exposed to /// contracts are not allowed to change because that would break already /// deployed contracts. The `RuntimeCall` structure itself is not allowed @@ -78,7 +106,7 @@ impl pallet_contracts::Config for Runtime { type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = weights::pallet_contracts::WeightInfo; - type ChainExtension = KreivoChainExtensions; + type ChainExtension = KreivoChainExtensions; type Schedule = Schedule; type CallStack = [pallet_contracts::Frame; 23]; type DepositPerByte = DepositPerByte; @@ -95,7 +123,7 @@ impl pallet_contracts::Config for Runtime { // Our reasoning is that the error code `CodeTooLarge` is thrown // if a too-large contract is uploaded. We noticed that it poses // less friction during development when the requirement here is - // just more lax. + // just laxer. type MaxCodeLen = ConstU32<{ 192 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; type MaxTransientStorageSize = ConstU32<{ 1024 * 1024 }>; @@ -103,17 +131,11 @@ impl pallet_contracts::Config for Runtime { type UnsafeUnstableInterface = ConstBool; type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; #[cfg(not(feature = "runtime-benchmarks"))] - type UploadOrigin = EnsureRootWithSuccess; + type UploadOrigin = MapSuccess, ReplaceWithCommunityAccount>; #[cfg(feature = "runtime-benchmarks")] type UploadOrigin = EnsureSigned; #[cfg(not(feature = "runtime-benchmarks"))] - type InstantiateOrigin = EitherOf< - EnsureRootWithSuccess, - EitherOf< - AsSignedByStaticCommunity>, // Virto - AsSignedByStaticCommunity>, // Kippu - >, - >; + type InstantiateOrigin = EnsureNever; #[cfg(feature = "runtime-benchmarks")] type InstantiateOrigin = EnsureSigned; #[cfg(not(feature = "runtime-benchmarks"))] @@ -129,3 +151,27 @@ impl pallet_contracts::Config for Runtime { type ApiVersion = (); type Xcm = pallet_xcm::Pallet; } + +parameter_types! { + pub ContractsStoreMerchantId: CommunityId = 0; +} + +morph_types! { + pub type AppInstantiationParams: Morph = |id: CommunityId| -> (AccountId, CommunityId) { + (Communities::community_account(&id), id) + }; +} + +#[cfg(not(feature = "runtime-benchmarks"))] +pub type EnsureInstantiator = EnsureCommunity; +#[cfg(feature = "runtime-benchmarks")] +pub type EnsureInstantiator = MapSuccess, Replace>; + +impl pallet_contracts_store::Config for Runtime { + type WeightInfo = weights::pallet_contracts_store::WeightInfo; + type InstantiateOrigin = MapSuccess; + type AppId = listings::InventoryId; + type LicenseId = listings::ItemId; + type Listings = Listings; + type ContractsStoreMerchantId = ContractsStoreMerchantId; +} diff --git a/runtime/kreivo/src/config/currency.rs b/runtime/kreivo/src/config/currency.rs index d3e2166ef..ea4098ea0 100644 --- a/runtime/kreivo/src/config/currency.rs +++ b/runtime/kreivo/src/config/currency.rs @@ -8,7 +8,7 @@ use frame_support::{ use polkadot_runtime_common::SlowAdjustingFeeUpdate; use runtime_common::impls::AssetsToBlockAuthor; -use fc_traits_gas_tank::{NonFungibleGasTank, SelectNonFungibleItem}; +use frame_contrib_traits::gas_tank::{NonFungibleGasTank, SelectNonFungibleItem}; use pallet_asset_tx_payment::FungiblesAdapter; use pallet_assets::BalanceToAssetBalance; use pallet_transaction_payment::FungibleAdapter; @@ -42,6 +42,7 @@ impl pallet_balances::Config for Runtime { type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type MaxFreezes = ConstU32<256>; + type DoneSlashHandler = (); } // #[runtime::pallet_index(11)] @@ -58,6 +59,7 @@ impl pallet_transaction_payment::Config for Runtime { type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; type OperationalFeeMultiplier = ConstU8<5>; + type WeightInfo = weights::pallet_transaction_payment::WeightInfo; } // #[runtime::pallet_index(12)] @@ -97,7 +99,6 @@ impl pallet_assets::Config for Runtime { type CreateOrigin = AsEnsureOriginWithArg>; #[cfg(feature = "runtime-benchmarks")] type CreateOrigin = EnsureSigned; - type RuntimeHoldReason = RuntimeHoldReason; type ForceOrigin = AssetsForceOrigin; type AssetDeposit = AssetDeposit; type AssetAccountDeposit = AssetAccountDeposit; @@ -105,8 +106,8 @@ impl pallet_assets::Config for Runtime { type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; type StringLimit = AssetsStringLimit; - type MaxHolds = frame_support::traits::ConstU32<50>; type Freezer = AssetsFreezer; + type Holder = AssetsHolder; type Extra = (); type CallbackHandle = (); type WeightInfo = weights::pallet_assets::WeightInfo; @@ -123,6 +124,9 @@ impl pallet_asset_tx_payment::Config for Runtime { BalanceToAssetBalance, AssetsToBlockAuthor, >; + type WeightInfo = weights::pallet_asset_tx_payment::WeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = benchmarks::AssetsTxPaymentBenchmarkHelper; } // #[runtime::pallet_index(15)] @@ -140,7 +144,7 @@ impl pallet_vesting::Config for Runtime { type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; - type BlockNumberProvider = System; + type BlockNumberProvider = RelaychainData; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -167,9 +171,73 @@ parameter_types! { } pub type MembershipsGasTank = - NonFungibleGasTank; + NonFungibleGasTank; impl pallet_gas_transaction_payment::Config for Runtime { + type WeightInfo = weights::pallet_gas_transaction_payment::WeightInfo; + type GasTank = MembershipsGasTank; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = benchmarks::GasTransactionPaymentBenchmarkHelper; +} + +impl pallet_assets_holder::Config for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; type RuntimeEvent = RuntimeEvent; - type GasBurner = MembershipsGasTank; +} + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarks { + use super::*; + use crate::config::communities::{CommunityBenchmarkHelper, MembershipsCollectionId}; + use frame_contrib_traits::gas_tank::MakeTank; + use frame_support::dispatch::DispatchResult; + use frame_support::traits::{ + fungible::Mutate as FnMutate, + fungibles::{Create, Inspect, Mutate}, + nonfungibles_v2::Mutate as NonTunsMutate, + }; + use pallet_communities::BenchmarkHelper; + use sp_runtime::DispatchError; + + pub struct AssetsTxPaymentBenchmarkHelper; + + impl pallet_asset_tx_payment::BenchmarkHelperTrait + for AssetsTxPaymentBenchmarkHelper + { + fn create_asset_id_parameter(id: u32) -> (FungibleAssetLocation, FungibleAssetLocation) { + let id = id.into(); + if !Assets::asset_exists(id) { + >::create(id, TreasuryAccount::get(), true, EXISTENTIAL_DEPOSIT) + .expect("create an asset class is expected to succeed; qed"); + } + (id, id) + } + + fn setup_balances_and_pool(asset_id: FungibleAssetLocation, account: AccountId) { + Balances::mint_into(&account, UNITS).expect("minting is expected to succeed; qed"); + Assets::set_balance(asset_id, &account, UNITS); + } + } + + pub struct GasTransactionPaymentBenchmarkHelper; + + impl pallet_gas_transaction_payment::BenchmarkHelper for GasTransactionPaymentBenchmarkHelper { + type Ext = ChargeAssetTxPayment; + + fn ext() -> ChargeGasTxPayment { + ChargeGasTxPayment::new(ChargeAssetTxPayment::::from(0, None)) + } + + fn setup_account(who: &AccountId, gas: Weight) -> DispatchResult { + CommunityBenchmarkHelper::initialize_memberships_collection().map_err(|_| DispatchError::Exhausted)?; + >::mint_into( + &MembershipsCollectionId::get(), + &0, + who, + &Default::default(), + true, + )?; + MembershipsGasTank::make_tank(&(MembershipsCollectionId::get(), 0), Some(gas), None) + } + } } diff --git a/runtime/kreivo/src/config/governance/mod.rs b/runtime/kreivo/src/config/governance/mod.rs index fcba1dfa6..b2e10a162 100644 --- a/runtime/kreivo/src/config/governance/mod.rs +++ b/runtime/kreivo/src/config/governance/mod.rs @@ -32,7 +32,7 @@ parameter_types! { impl pallet_treasury::Config for Runtime { type Currency = Balances; - type RejectOrigin = frame_system::EnsureRoot; + type RejectOrigin = EnsureRoot; type RuntimeEvent = RuntimeEvent; type SpendPeriod = SpendPeriod; type Burn = (); @@ -49,8 +49,22 @@ impl pallet_treasury::Config for Runtime { type BalanceConverter = UnityAssetBalanceConversion; type PayoutPeriod = PayoutSpendPeriod; #[cfg(feature = "runtime-benchmarks")] - /// TODO: fix this benchmark helper in next release. We can proceed with the - /// empty implementation. type BenchmarkHelper = - /// polkadot_runtime_common::impls::benchmarks::TreasuryArguments; type BenchmarkHelper = (); + type BlockNumberProvider = RelaychainData; +} + +// #[runtime::pallet_index(53)] +// pub type BlackHole + +parameter_types! { + pub const BlackHolePalletId: PalletId = PalletId(*b"py/bhole"); +} + +impl pallet_black_hole::Config for Runtime { + type WeightInfo = (); + type EventHorizonDispatchOrigin = EitherOf, pallet_custom_origins::BlackHoleEventHorizon>; + type Balances = Balances; + type BlockNumberProvider = RelaychainData; + type PalletId = BlackHolePalletId; + type BurnPeriod = ConstU32; } diff --git a/runtime/kreivo/src/config/governance/origins.rs b/runtime/kreivo/src/config/governance/origins.rs index 1d8155cd8..ee4e4de07 100644 --- a/runtime/kreivo/src/config/governance/origins.rs +++ b/runtime/kreivo/src/config/governance/origins.rs @@ -26,7 +26,7 @@ pub mod pallet_custom_origins { #[pallet::pallet] pub struct Pallet(_); - #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] + #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, RuntimeDebug)] #[pallet::origin] pub enum Origin { /// Origin for issuing new memberships. @@ -35,6 +35,8 @@ pub mod pallet_custom_origins { ReferendumCanceller, /// Origin able to kill referenda. ReferendumKiller, + /// Origin able to control the black hole event horizon + BlackHoleEventHorizon, } macro_rules! decl_unit_ensures { @@ -68,5 +70,10 @@ pub mod pallet_custom_origins { () => {} } - decl_unit_ensures!(CreateMemberships, ReferendumCanceller, ReferendumKiller); + decl_unit_ensures!( + CreateMemberships, + ReferendumCanceller, + ReferendumKiller, + BlackHoleEventHorizon + ); } diff --git a/runtime/kreivo/src/config/listings_orders.rs b/runtime/kreivo/src/config/listings_orders.rs new file mode 100644 index 000000000..5af2f662e --- /dev/null +++ b/runtime/kreivo/src/config/listings_orders.rs @@ -0,0 +1,224 @@ +use super::*; +use frame_support::traits::MapSuccess; + +use pallet_listings::{InventoryId, InventoryIdFor, ItemIdOf}; +use sp_runtime::traits::{AccountIdConversion, Verify}; + +#[cfg(not(feature = "runtime-benchmarks"))] +use frame_system::EnsureNever; +use frame_system::EnsureSigned; +#[cfg(feature = "runtime-benchmarks")] +use sp_core::ConstU128; +use sp_runtime::morph_types; +use virto_common::listings; + +parameter_types! { + pub KeyLimit: u32 = 64; + pub ValueLimit: u32 = 256; +} + +pub type ListingsInstance = pallet_listings::Instance1; + +// #[runtime::pallet_index(61)] +// pub type Listings +pub struct EnsureCommunity; + +impl EnsureOriginWithArg> for EnsureCommunity { + type Success = AccountId; + + fn try_origin( + o: RuntimeOrigin, + InventoryId(community_id, _): &InventoryId, + ) -> Result { + match o.clone().caller { + OriginCaller::Communities(origin) => (origin.id() == *community_id) + .then_some(Communities::community_account(community_id)) + .ok_or(o), + OriginCaller::system(frame_system::RawOrigin::Signed(ref who)) => { + let Some((_, id)) = PalletId::try_from_sub_account::(who) else { + return Err(o); + }; + ensure!(community_id == &id, o); + Ok(who.clone()) + } + _ => Err(o), + } + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin(InventoryId(community_id, _): &InventoryId) -> Result { + Ok(RuntimeOrigin::signed(Communities::community_account(community_id))) + } +} + +impl pallet_listings::Config for Runtime { + type WeightInfo = weights::pallet_listings::WeightInfo; + type CreateInventoryOrigin = EnsureCommunity; + type InventoryAdminOrigin = EnsureCommunity; + type MerchantId = CommunityId; + type InventoryId = listings::InventoryId; + type ItemSKU = listings::ItemId; + type CollectionConfig = + pallet_nfts::CollectionConfig, InventoryIdFor>; + type ItemConfig = pallet_nfts::ItemConfig; + type Balances = Balances; + type Assets = Assets; + type Nonfungibles = ListingsCatalog; + type NonfungiblesKeyLimit = KeyLimit; + type NonfungiblesValueLimit = ValueLimit; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = benchmarks::ListingsBenchmarkHelper; +} + +// #[runtime::pallet_index(62)] +// pub type ListingsCatalog +impl pallet_nfts::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CollectionId = InventoryIdFor; + type ItemId = ItemIdOf; + type Currency = Balances; + #[cfg(not(feature = "runtime-benchmarks"))] + type ForceOrigin = EnsureNever; + #[cfg(feature = "runtime-benchmarks")] + type ForceOrigin = EnsureRoot; + #[cfg(not(feature = "runtime-benchmarks"))] + type CreateOrigin = EnsureNever; + #[cfg(feature = "runtime-benchmarks")] + type CreateOrigin = frame_system::EnsureSigned; + type Locker = (); + type CollectionDeposit = (); + #[cfg(not(feature = "runtime-benchmarks"))] + type ItemDeposit = (); + #[cfg(feature = "runtime-benchmarks")] + type ItemDeposit = ConstU128; + type MetadataDepositBase = (); + type AttributeDepositBase = (); + type DepositPerByte = (); + type StringLimit = ValueLimit; + type KeyLimit = KeyLimit; + type ValueLimit = ValueLimit; + #[cfg(not(feature = "runtime-benchmarks"))] + type ApprovalsLimit = (); + #[cfg(feature = "runtime-benchmarks")] + type ApprovalsLimit = ConstU32<1>; + #[cfg(not(feature = "runtime-benchmarks"))] + type ItemAttributesApprovalsLimit = (); + #[cfg(feature = "runtime-benchmarks")] + type ItemAttributesApprovalsLimit = ConstU32<1>; + type MaxTips = (); + type MaxDeadlineDuration = (); + type MaxAttributesPerCall = (); + type Features = (); + type OffchainSignature = Signature; + type OffchainPublic = ::Signer; + #[cfg(feature = "runtime-benchmarks")] + type Helper = benchmarks::ListingsCatalogBenchmarkHelper; + type WeightInfo = (); + type BlockNumberProvider = RelaychainData; +} + +morph_types! { + pub type MaxCartsForRegularUsers = |id: AccountId| -> (AccountId, u32) { (id, 5) }; + pub type MaxItemsForRegularUsers = |id: AccountId| -> (AccountId, u32) { (id, 64) }; +} + +parameter_types! { + pub MaxLifetimeForCheckoutOrder: BlockNumber = 30 * MINUTES; + pub MaxCartLen: u32 = 5; + pub MaxItemLen: u32 = 64; +} + +impl pallet_orders::Config for Runtime { + type PalletsOrigin = OriginCaller; + type RuntimeCall = RuntimeCall; + type WeightInfo = weights::pallet_orders::WeightInfo; + type CreateOrigin = MapSuccess, MaxCartsForRegularUsers>; + type OrderAdminOrigin = MapSuccess, MaxItemsForRegularUsers>; + type PaymentOrigin = EnsureSigned; + type OrderId = u64; + type Listings = Listings; + type Payments = Payments; + type Scheduler = Scheduler; + type BlockNumberProvider = System; + type MaxLifetimeForCheckoutOrder = MaxLifetimeForCheckoutOrder; + type MaxCartLen = MaxCartLen; + type MaxItemLen = MaxItemLen; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = benchmarks::OrdersBenchmarkHelper; +} + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarks { + use super::*; + use pallet_orders::InventoryIdOf; + + pub struct ListingsBenchmarkHelper; + + impl pallet_listings::BenchmarkHelper> for ListingsBenchmarkHelper { + fn inventory_id() -> InventoryIdFor { + InventoryId(0, 1) + } + } + + pub struct ListingsCatalogBenchmarkHelper; + + impl + pallet_nfts::BenchmarkHelper< + InventoryIdFor, + ItemIdOf, + sp_runtime::MultiSigner, + sp_runtime::AccountId32, + sp_runtime::MultiSignature, + > for ListingsCatalogBenchmarkHelper + { + fn collection(i: u16) -> InventoryIdFor { + InventoryId(0, i.into()) + } + + fn item(i: u16) -> ItemIdOf { + i.into() + } + + fn signer() -> (sp_runtime::MultiSigner, sp_runtime::AccountId32) { + <() as pallet_nfts::BenchmarkHelper< + u16, + u16, + sp_runtime::MultiSigner, + sp_runtime::AccountId32, + sp_runtime::MultiSignature, + >>::signer() + } + + fn sign(signer: &sp_runtime::MultiSigner, message: &[u8]) -> sp_runtime::MultiSignature { + <() as pallet_nfts::BenchmarkHelper< + u16, + u16, + sp_runtime::MultiSigner, + sp_runtime::AccountId32, + sp_runtime::MultiSignature, + >>::sign(signer, message) + } + } + + type MerchantIdOf = >::MerchantId; + + pub struct OrdersBenchmarkHelper; + + impl pallet_orders::BenchmarkHelper for OrdersBenchmarkHelper { + type Balances = Balances; + type Assets = Assets; + type InventoryDeposit = >::CollectionDeposit; + type ItemDeposit = >::ItemDeposit; + + fn inventory_id() -> ( + MerchantIdOf, + InventoryIdOf, + ) { + (0, 0) + } + + fn item_id(i: usize) -> ItemIdOf { + i as u64 + } + } +} diff --git a/runtime/kreivo/src/config/mod.rs b/runtime/kreivo/src/config/mod.rs index 0f247489e..ee714820f 100644 --- a/runtime/kreivo/src/config/mod.rs +++ b/runtime/kreivo/src/config/mod.rs @@ -13,13 +13,21 @@ pub mod communities; pub mod governance; // Virto toolchain pub mod contracts; +mod listings_orders; pub mod payments; +pub mod revive; + +pub use { + collator_support::{ConsensusHook, RELAY_CHAIN_SLOT_DURATION_MILLIS}, + communities::Memberships, + currency::{KreivoAssetsCall, KreivoAssetsInstance, MembershipsGasTank}, + governance::{pallet_custom_origins, TreasuryAccount}, + payments::pallet_payment_indices, + system::{RelaychainData, RuntimeBlockWeights}, +}; -pub use collator_support::{ConsensusHook, SLOT_DURATION}; -#[cfg(feature = "runtime-benchmarks")] -pub use currency::{ExistentialDeposit, TransactionByteFee}; -pub use currency::{KreivoAssetsCall, KreivoAssetsInstance, MembershipsGasTank}; -pub use governance::{pallet_custom_origins, TreasuryAccount}; -pub use system::RuntimeBlockWeights; #[cfg(feature = "runtime-benchmarks")] -pub use xcm::PriceForParentDelivery; +pub use { + currency::{ExistentialDeposit, TransactionByteFee}, + xcm::PriceForParentDelivery, +}; diff --git a/runtime/kreivo/src/config/payments.rs b/runtime/kreivo/src/config/payments.rs index a488975e5..6e394208b 100644 --- a/runtime/kreivo/src/config/payments.rs +++ b/runtime/kreivo/src/config/payments.rs @@ -1,32 +1,20 @@ use super::*; +mod indices; + use frame_support::traits::EitherOf; use frame_system::EnsureSigned; use pallet_communities::origin::AsSignedByCommunity; -use parity_scale_codec::Encode; use sp_runtime::traits::AccountIdConversion; +pub use indices::pallet_payment_indices; + parameter_types! { pub const MaxRemarkLength: u8 = 50; pub const IncentivePercentage: Percent = Percent::from_percent(INCENTIVE_PERCENTAGE); pub const PaymentPalletId: PalletId = PalletId(*b"payments"); } -#[cfg(feature = "runtime-benchmarks")] -pub struct PaymentsBenchmarkHelper; -#[cfg(feature = "runtime-benchmarks")] -impl pallet_payments::BenchmarkHelper for PaymentsBenchmarkHelper { - fn create_asset(id: FungibleAssetLocation, admin: AccountId, is_sufficient: bool, min_balance: Balance) { - >::create( - id, - admin, - is_sufficient, - min_balance, - ) - .unwrap(); - } -} - pub struct KreivoFeeHandler; const MANDATORY_FEE: bool = true; @@ -43,7 +31,7 @@ impl FeeHandler for KreivoFeeHandler { _remark: Option<&[u8]>, ) -> Fees { let min = >::minimum_balance(*asset); - let pallet_id = crate::config::communities::CommunityPalletId::get(); + let pallet_id = communities::CommunityPalletId::get(); let default_fee = |fee: Percent| (TreasuryAccount::get(), min.max(fee.mul_floor(*amount)), MANDATORY_FEE); let is_community = |who| matches!(PalletId::try_from_sub_account::(who), Some((pid, _)) if pallet_id == pid ); @@ -64,35 +52,28 @@ impl FeeHandler for KreivoFeeHandler { } } -impl pallet_payments::PaymentId for virto_common::PaymentId { - fn next(_: &AccountId, beneficiary: &AccountId) -> Option { - let block: u32 = System::block_number(); - let idx = System::extrinsic_index()?; - Some((block, idx, beneficiary.encode().as_slice()).into()) - } -} +impl pallet_payment_indices::Config for Runtime {} impl pallet_payments::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Assets = Assets; - type AssetsBalance = Balance; - type PaymentId = virto_common::PaymentId; - type FeeHandler = KreivoFeeHandler; - type IncentivePercentage = IncentivePercentage; - type MaxRemarkLength = MaxRemarkLength; + type PalletsOrigin = OriginCaller; + type RuntimeHoldReason = RuntimeHoldReason; + type WeightInfo = weights::pallet_payments::WeightInfo; type SenderOrigin = EitherOf, EnsureSigned>; type BeneficiaryOrigin = EnsureSigned; type DisputeResolver = frame_system::EnsureRootWithSuccess; - type PalletId = PaymentPalletId; - type RuntimeHoldReason = RuntimeHoldReason; - type MaxDiscounts = ConstU32<10>; - type MaxFees = ConstU32<50>; - type RuntimeCall = RuntimeCall; + type PaymentId = virto_common::PaymentId; + type Assets = Assets; + type AssetsHold = AssetsHolder; + type BlockNumberProvider = System; + type FeeHandler = KreivoFeeHandler; type Scheduler = Scheduler; type Preimages = Preimage; - type CancelBufferBlockLength = ConstU32<14400>; // 2 days - type PalletsOrigin = OriginCaller; - type WeightInfo = crate::weights::pallet_payments::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = PaymentsBenchmarkHelper; + type OnPaymentStatusChanged = Orders; + type GeneratePaymentId = PaymentIndices; + type PalletId = PaymentPalletId; + type IncentivePercentage = IncentivePercentage; + type MaxRemarkLength = MaxRemarkLength; + type MaxFees = ConstU32<50>; + type MaxDiscounts = ConstU32<10>; + type CancelBufferBlockLength = ConstU32<{ 2 * DAYS }>; } diff --git a/runtime/kreivo/src/config/payments/indices.rs b/runtime/kreivo/src/config/payments/indices.rs new file mode 100644 index 000000000..ccb5800c1 --- /dev/null +++ b/runtime/kreivo/src/config/payments/indices.rs @@ -0,0 +1,54 @@ +// 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 . + +//! Temporary storage for payment indices. + +#[frame_support::pallet] +pub mod pallet_payment_indices { + use frame_support::{pallet_prelude::*, traits::Hooks}; + use frame_system::pallet_prelude::*; + use sp_core::U256; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::storage] + pub(crate) type Index = StorageValue<_, u32, ValueQuery>; + + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_finalize(_: BlockNumberFor) { + Index::::kill() + } + } + + impl pallet_payments::GeneratePaymentId for Pallet { + type PaymentId = virto_common::PaymentId; + + fn generate(_: &T::AccountId, beneficiary: &T::AccountId) -> Option { + let block: U256 = frame_system::Pallet::::block_number().into(); + let idx = Index::::mutate(|index| { + let ix = *index; + *index += 1; + ix + }); + Some((block.as_u32(), idx, beneficiary.encode().as_slice()).into()) + } + } +} diff --git a/runtime/kreivo/src/config/revive/mod.rs b/runtime/kreivo/src/config/revive/mod.rs new file mode 100644 index 000000000..e193a295b --- /dev/null +++ b/runtime/kreivo/src/config/revive/mod.rs @@ -0,0 +1,44 @@ +use super::*; + +#[cfg(not(feature = "zombienet"))] +use frame_system::EnsureRootWithSuccess; +#[cfg(feature = "zombienet")] +use frame_system::EnsureSigned; + +parameter_types! { + pub const DepositPerItem: Balance = deposit(1, 0); + pub const DepositPerByte: Balance = deposit(0, 1); + pub CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30); + pub const ChainId: u64 = 2281; +} + +impl pallet_revive::Config for Runtime { + type Time = Timestamp; + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type DepositPerItem = DepositPerItem; + type DepositPerByte = DepositPerByte; + type WeightPrice = pallet_transaction_payment::Pallet; + type WeightInfo = pallet_revive::weights::SubstrateWeight; + type Precompiles = (); + type AddressMapper = pallet_revive::AccountId32Mapper; + type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; + type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type UnsafeUnstableInterface = ConstBool; + #[cfg(not(feature = "zombienet"))] + type UploadOrigin = EnsureRootWithSuccess; + #[cfg(not(feature = "zombienet"))] + type InstantiateOrigin = EnsureRootWithSuccess; + #[cfg(feature = "zombienet")] + type UploadOrigin = EnsureSigned; + #[cfg(feature = "zombienet")] + type InstantiateOrigin = EnsureSigned; + type RuntimeHoldReason = RuntimeHoldReason; + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type ChainId = ChainId; + type NativeToEthRatio = ConstU32<1_000_000>; // 10^(18 - 12) Eth is 10^18, Native is 10^12. + type EthGasEncoder = (); + type FindAuthor = ::FindAuthor; + type AllowEVMBytecode = ConstBool; // Virto accepts EVM Bytecode (?) +} diff --git a/runtime/kreivo/src/config/system.rs b/runtime/kreivo/src/config/system.rs index eb22798ab..c0dc1448b 100644 --- a/runtime/kreivo/src/config/system.rs +++ b/runtime/kreivo/src/config/system.rs @@ -2,23 +2,33 @@ use super::*; -use frame_support::{derive_impl, dispatch::DispatchClass, traits::EnsureOrigin, PalletId}; -use frame_system::{limits::BlockLength, EnsureRootWithSuccess}; -use sp_runtime::traits::{LookupError, StaticLookup}; - use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; +use frame_contrib_traits::authn::{composite_authenticator, util::AuthorityFromPalletId, Challenge, Challenger}; +use frame_support::traits::{AsEnsureOriginWithArg, LinearStoragePrice}; +use frame_support::{ + derive_impl, + dispatch::DispatchClass, + traits::{fungible::HoldConsideration, Consideration, Footprint}, + weights::constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, + PalletId, +}; +use frame_system::{limits::BlockLength, EnsureRootWithSuccess, EnsureSigned}; +use pallet_communities::origin::AsSignedByCommunity; +use pallet_pass::FirstItemIsFree; use parachains_common::{AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO}; use polkadot_runtime_common::BlockHashCount; +pub use runtime_constants::async_backing_params::RELAY_PARENT_OFFSET; +use sp_core::{blake2_256, ConstU128}; +use sp_runtime::{ + traits::{AccountIdConversion, LookupError, StaticLookup}, + DispatchError, +}; -use fc_traits_authn::{composite_authenticator, util::AuthorityFromPalletId, Challenge, Challenger}; -use pallet_communities::origin::AsSignedByCommunity; +const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; // #[runtime::pallet_index(0)] // pub type System -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( - sp_weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), - cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, -); +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), MAX_POV_SIZE); parameter_types! { pub const Version: RuntimeVersion = VERSION; @@ -66,7 +76,7 @@ impl StaticLookup for CommunityLookup { } } -#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)] impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; @@ -93,7 +103,7 @@ impl frame_system::Config for Runtime { 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>; + type MaxConsumers = ConstU32<16>; type SystemWeightInfo = weights::frame_system::WeightInfo; } @@ -105,6 +115,8 @@ parameter_types! { pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } +pub type RelaychainData = cumulus_pallet_parachain_system::RelaychainDataProvider; + impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); @@ -117,6 +129,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; type ConsensusHook = ConsensusHook; + type RelayParentOffset = ConstU32; } // #[runtime::pallet_index(2)] @@ -144,116 +157,302 @@ parameter_types! { pub NeverPays: Option> = None; } -/// A [`Challenger`][`fc_traits_authn::Challenger`] which verifies the -/// block hash of a block of a given block that's within the last `PAST_BLOCKS`. +/// A [`Challenger`][`frame_contrib_traits::authn::Challenger`] which verifies +/// the block hash of a block of a given block that's within the last +/// `PAST_BLOCKS`. pub struct BlockHashChallenger; impl Challenger for BlockHashChallenger { type Context = BlockNumber; - fn generate(cx: &Self::Context) -> Challenge { - System::block_hash(cx).0 + fn generate(cx: &Self::Context, xtc: &impl ExtrinsicContext) -> Challenge { + log::trace!(target: "authn", "BlockHashChallenger::generate({cx:?}, {:?})", xtc.as_ref()); + log::trace!(target: "authn", "\t -> ({:?}", + blake2_256(&[&System::block_hash(cx).0, xtc.as_ref()].concat())); + blake2_256(&[&System::block_hash(cx).0, xtc.as_ref()].concat()) } - fn check_challenge(cx: &Self::Context, challenge: &[u8]) -> Option<()> { + fn check_challenge(cx: &Self::Context, xtc: &impl ExtrinsicContext, challenge: &[u8]) -> Option<()> { (*cx >= System::block_number().saturating_sub(PAST_BLOCKS)).then_some(())?; - Self::generate(cx).eq(challenge).then_some(()) + Self::generate(cx, xtc).eq(challenge).then_some(()) } } -pub type WebAuthn = - pass_webauthn::Authenticator, AuthorityFromPalletId>; -#[cfg(feature = "runtime-benchmarks")] -pub type Dummy = fc_traits_authn::util::dummy::Dummy>; +pub type KreivoChallenger = BlockHashChallenger<{ 30 * MINUTES }>; +pub type WebAuthn = pass_webauthn::Authenticator>; +pub type SubstrateKey = pass_substrate_keys::Authenticator>; -#[cfg(not(feature = "runtime-benchmarks"))] composite_authenticator!( pub Pass> { WebAuthn, + SubstrateKey, } ); -#[cfg(feature = "runtime-benchmarks")] -composite_authenticator!( - pub Pass> { - WebAuthn, - Dummy, - } -); +#[derive(Debug, Eq, PartialEq, Clone, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo)] +pub struct SkipConsideration(Option); -/// Communities don't need to pay deposit fees to create a `pass` account -pub struct CommunitiesDontDeposit; +const ACCOUNT_IS_ROOT: fn(&AccountId) -> bool = |acct| acct == &TreasuryAccount::get(); +const ACCOUNT_IS_COMMUNITY: fn(&AccountId) -> bool = |acct| { + PalletId::try_from_sub_account::(acct) + .is_some_and(|(id, _)| id == communities::CommunityPalletId::get()) +}; -impl EnsureOriginWithArg for CommunitiesDontDeposit +impl Consideration for SkipConsideration where - OuterOrigin: frame_support::traits::OriginTrait - + From> - + From> - + Clone - + Into, OuterOrigin>> - + Into, OuterOrigin>>, + C: Consideration, { - type Success = Option>; + fn new(who: &AccountId, new: Footprint) -> Result { + if ACCOUNT_IS_ROOT(who) || ACCOUNT_IS_COMMUNITY(who) { + Ok(Self(None)) + } else { + C::new(who, new).map(Some).map(Self) + } + } + + fn update(self, who: &AccountId, new: Footprint) -> Result { + if let Some(c) = self.0 { + c.update(who, new).map(Some).map(Self) + } else { + Ok(self) + } + } - fn try_origin(o: OuterOrigin, _: &HashedUserId) -> Result { - AsSignedByCommunity::::try_origin(o)?; - Ok(None) + fn drop(self, who: &AccountId) -> Result<(), DispatchError> { + if let Some(c) = self.0 { + c.drop(who) + } else { + Ok(()) + } } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin(_: &HashedUserId) -> Result { - use pallet_communities::BenchmarkHelper; - let community_id = crate::communities::CommunityBenchmarkHelper::community_id(); - Ok( - frame_system::RawOrigin::Signed(pallet_communities::Pallet::::community_account(&community_id)) - .into(), - ) + fn ensure_successful(who: &AccountId, new: Footprint) { + C::ensure_successful(who, new); } } +parameter_types! { + pub AccountRegistrationReason: RuntimeHoldReason = RuntimeHoldReason::Pass(pallet_pass::HoldReason::AccountRegistration); + pub AccountDevicesReason: RuntimeHoldReason = RuntimeHoldReason::Pass(pallet_pass::HoldReason::AccountDevices); + pub SessionKeysReason: RuntimeHoldReason = RuntimeHoldReason::Pass(pallet_pass::HoldReason::SessionKeys); +} impl pallet_pass::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type WeightInfo = weights::pallet_pass::WeightInfo; - type Authenticator = PassAuthenticator; // WebAuthn; type PalletsOrigin = OriginCaller; - type PalletId = PassPalletId; - type MaxSessionDuration = ConstU32<{ 15 * MINUTES }>; + type WeightInfo = weights::pallet_pass::WeightInfo; type RegisterOrigin = EitherOf< - // Root never pays - EnsureRootWithSuccess, + // Root can create pass accounts. + EnsureRootWithSuccess, EitherOf< - // // Communities never pay - CommunitiesDontDeposit, - // Signed users must deposit ED for creating a pass account - pallet_pass::EnsureSignedPays< - Runtime, - ::ExistentialDeposit, - TreasuryAccount, - >, + // Communities can create pass accounts. + AsEnsureOriginWithArg>, + // Anyone can create pass accounts. + AsEnsureOriginWithArg>, >, >; + type AddressGenerator = (); + type Balances = Balances; + type Authenticator = PassAuthenticator; type Scheduler = Scheduler; - + type BlockNumberProvider = System; + type RegistrarConsideration = SkipConsideration< + HoldConsideration< + AccountId, + Balances, + AccountRegistrationReason, + LinearStoragePrice, ConstU128, Balance>, + >, + >; + type DeviceConsideration = FirstItemIsFree< + HoldConsideration< + AccountId, + Balances, + AccountDevicesReason, + LinearStoragePrice, ConstU128<{ MILLICENTS / 10 }>, Balance>, + >, + >; + type SessionKeyConsideration = FirstItemIsFree< + HoldConsideration< + AccountId, + Balances, + SessionKeysReason, + LinearStoragePrice, ConstU128<{ MILLICENTS / 10 }>, Balance>, + >, + >; + type PalletId = PassPalletId; + type MaxSessionDuration = ConstU32<{ 15 * MINUTES }>; + type MaxDevicesPerAccount = ConstU32<100>; + type MaxSessionsPerAccount = ConstU32<10>; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = PassBenchmarkHelper; + type BenchmarkHelper = benchmarks::PassBenchmarkHelper; } #[cfg(feature = "runtime-benchmarks")] -pub struct PassBenchmarkHelper; +pub mod benchmarks { + use super::*; + use frame_benchmarking::BenchmarkError; + use frame_support::Blake2_256; + use pass_substrate_keys::SignedMessage; + use rand_core::{CryptoRng, Error, RngCore}; + use schnorrkel::{context::SigningContext, Keypair, SecretKey}; + use sp_core::U256; + use sp_runtime::MultiSignature; + + impl frame_system_benchmarking::Config for Runtime { + fn setup_set_code_requirements(code: &Vec) -> Result<(), BenchmarkError> { + ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); + Ok(()) + } -#[cfg(feature = "runtime-benchmarks")] -impl pallet_pass::BenchmarkHelper for PassBenchmarkHelper { - fn register_origin() -> frame_system::pallet_prelude::OriginFor { - RuntimeOrigin::root() + fn verify_set_code() { + System::assert_last_event( + cumulus_pallet_parachain_system::Event::::ValidationFunctionStored.into(), + ); + } } - fn device_attestation(_: fc_traits_authn::DeviceId) -> pallet_pass::DeviceAttestationOf { - PassDeviceAttestation::Dummy(fc_traits_authn::util::dummy::DummyAttestation::new(true)) + /// This is a map of secret keys, grouped by its derived [`DeviceId`] + #[frame_support::storage_alias] + type BenchmarkDeviceIdSecretKey = + StorageMap; + + #[frame_support::storage_alias] + type Rng = StorageValue; + + /// A hash-based _(not really random)_ "RNG". Marked as [`CryptoRng`] (even + /// though it is clearly not) because these are benchmarking tests, and + /// don't aim to test for security issues. + #[derive(Debug, Eq, PartialEq, Clone, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, Default)] + pub struct BenchRng([u8; 32], u8); + impl BenchRng { + fn rotate(&mut self) { + if self.1 == 31 { + self.0 = blake2_256(&self.0); + self.1 = 0; + } else { + self.1 += 1 + } + } + } + impl From for BenchRng { + fn from(u256: U256) -> Self { + Self(blake2_256(&u256.to_little_endian()), 0) + } } + impl CryptoRng for BenchRng {} + impl RngCore for BenchRng { + fn next_u32(&mut self) -> u32 { + let mut b = [0u8; 4]; + for i in 0..4 { + b[i] = self.0[i]; + self.rotate(); + } + u32::from_le_bytes(b) + } + + fn next_u64(&mut self) -> u64 { + let mut b = [0u8; 8]; + for i in 0..8 { + b[i] = self.0[i]; + self.rotate(); + } + u64::from_le_bytes(b) + } - fn credential(_: HashedUserId) -> pallet_pass::CredentialOf { - PassCredential::Dummy(fc_traits_authn::util::dummy::DummyCredential::new(true)) + fn fill_bytes(&mut self, dest: &mut [u8]) { + for byte in dest.iter_mut() { + *byte = self.0[self.1 as usize]; + self.rotate(); + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + for byte in dest.iter_mut() { + *byte = self.0[self.1 as usize]; + self.rotate(); + } + Ok(()) + } + } + + pub struct PassBenchmarkHelper; + + impl PassBenchmarkHelper { + fn sign(pair: &Keypair, msg: &SignedMessage) -> MultiSignature { + Rng::mutate(|rng| { + let msg = msg.message(); + let t = { + // The context must be b"substrate", otherwise it'll fail validation. + let t = SigningContext::new(b"substrate").bytes(msg.as_ref()); + schnorrkel::context::attach_rng(t, rng) + }; + + MultiSignature::Sr25519(pair.sign(t).to_bytes().into()) + }) + } + + fn derive() -> Keypair { + Rng::mutate(|rng| { + let secret = SecretKey::generate_with(rng); + secret.to_keypair() + }) + } + + fn pair(id: DeviceId) -> Keypair { + let bytes = BenchmarkDeviceIdSecretKey::get(id).expect("pairs handled by benchmarks are saved here; qed"); + SecretKey::from_bytes(&bytes) + .expect("saved using `to_bytes`; qed") + .to_keypair() + } + + fn set_pair(device_id: DeviceId, keypair: Keypair) { + BenchmarkDeviceIdSecretKey::insert(device_id, keypair.secret.to_bytes()); + } + } + + impl pallet_pass::BenchmarkHelper for PassBenchmarkHelper { + fn device_attestation(xtc: &impl ExtrinsicContext) -> pallet_pass::DeviceAttestationOf { + let pair = Self::derive(); + + let context = System::block_number(); + let message = SignedMessage { + context, + challenge: KreivoChallenger::generate(&context, xtc), + authority_id: AuthorityFromPalletId::::get(), + }; + let public = AccountId::new(pair.public.to_bytes()); + let signature = Self::sign(&pair, &message); + + let attestation = PassDeviceAttestation::SubstrateKey(pass_substrate_keys::KeyRegistration { + message, + public, + signature, + }); + + Self::set_pair(*attestation.device_id(), pair); + attestation + } + + fn credential( + user_id: HashedUserId, + device_id: DeviceId, + xtc: &impl ExtrinsicContext, + ) -> pallet_pass::CredentialOf { + let pair = Self::pair(device_id); + + let context = System::block_number(); + let message = SignedMessage { + context, + challenge: KreivoChallenger::generate(&context, xtc), + authority_id: AuthorityFromPalletId::::get(), + }; + let signature = Self::sign(&pair, &message); + + PassCredential::SubstrateKey(pass_substrate_keys::KeySignature { + user_id, + message, + signature, + }) + } } } diff --git a/runtime/kreivo/src/config/utilities.rs b/runtime/kreivo/src/config/utilities.rs index 8a0c78393..453258f24 100644 --- a/runtime/kreivo/src/config/utilities.rs +++ b/runtime/kreivo/src/config/utilities.rs @@ -1,7 +1,8 @@ use super::*; -use frame_support::traits::{fungible::HoldConsideration, LinearStoragePrice}; -use sp_runtime::traits::BlakeTwo256; +use frame_support::traits::{fungible::HoldConsideration, LinearStoragePrice, MapSuccess}; +use pallet_communities::origin::AsSignedByCommunity; +use sp_runtime::traits::{BlakeTwo256, ReplaceWithDefault}; // #[runtime::pallet_index(42)] // pub type Multisig @@ -20,6 +21,7 @@ impl pallet_multisig::Config for Runtime { type DepositFactor = DepositFactor; type MaxSignatories = ConstU32<100>; type WeightInfo = weights::pallet_multisig::WeightInfo; + type BlockNumberProvider = RelaychainData; } // #[runtime::pallet_index(43)] @@ -35,7 +37,7 @@ impl pallet_utility::Config for Runtime { // pub type Proxy parameter_types! { // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = deposit(1, 40); + pub const ProxyDepositBase: Balance = deposit(0, 100); // Additional storage item size of 33 bytes. pub const ProxyDepositFactor: Balance = deposit(0, 33); pub const MaxProxies: u16 = 32; @@ -58,6 +60,7 @@ impl pallet_proxy::Config for Runtime { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; type AnnouncementDepositFactor = AnnouncementDepositFactor; + type BlockNumberProvider = RelaychainData; } // #[runtime::pallet_index(45)] @@ -82,11 +85,13 @@ impl pallet_scheduler::Config for Runtime { type PalletsOrigin = OriginCaller; type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureRoot; + type ScheduleOrigin = + EitherOf, MapSuccess, ReplaceWithDefault<()>>>; type OriginPrivilegeCmp = EqualOrGreatestRootCmp; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type Preimages = Preimage; + type BlockNumberProvider = System; } // #[runtime::pallet_index(46)] diff --git a/runtime/kreivo/src/config/xcm.rs b/runtime/kreivo/src/config/xcm.rs index 1b24712d8..369eda87e 100644 --- a/runtime/kreivo/src/config/xcm.rs +++ b/runtime/kreivo/src/config/xcm.rs @@ -12,7 +12,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type VersionWrapper = (); // Enqueue XCMP messages from siblings for later processing. type XcmpQueue = TransformOrigin; - type MaxInboundSuspended = sp_core::ConstU32<1_000>; + type MaxInboundSuspended = ConstU32<1_000>; type MaxActiveOutboundChannels = ConstU32<128>; // From https://github.com/polkadot-fellows/runtimes/blob/88da7d0abb9edbff027e57bc998a97c6ff10c18c/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs#L783: // @@ -34,7 +34,7 @@ parameter_types! { impl pallet_message_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); + type WeightInfo = weights::pallet_message_queue::WeightInfo; #[cfg(not(feature = "runtime-benchmarks"))] type MessageProcessor = xcm_builder::ProcessXcmMessage< AggregateMessageOrigin, @@ -48,8 +48,8 @@ impl pallet_message_queue::Config for Runtime { // origin: type QueueChangeHandler = NarrowOriginToSibling; type QueuePausedQuery = NarrowOriginToSibling; - type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; - type MaxStale = sp_core::ConstU32<8>; + type HeapSize = ConstU32<{ 64 * 1024 }>; + type MaxStale = ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; type IdleMaxServiceWeight = (); } diff --git a/runtime/kreivo/src/genesis_config_presets.rs b/runtime/kreivo/src/genesis_config_presets.rs index 1f2d18be2..2c20a42ef 100644 --- a/runtime/kreivo/src/genesis_config_presets.rs +++ b/runtime/kreivo/src/genesis_config_presets.rs @@ -1,51 +1,91 @@ use crate::*; use runtime_constants::genesis_presets::*; use sp_genesis_builder::PresetId; -use sp_std::vec::Vec; -fn local_genesis( - id: ParaId, - invulnerables: Vec<(AccountId, AuraId)>, - endowed_accounts: Vec, -) -> serde_json::Value { - serde_json::json!({ - "balances": BalancesConfig { - balances: endowed_accounts - .iter() - .cloned() - .map(|k| (k, EXISTENTIAL_DEPOSIT * 4096 * 4096)) - .collect(), - }, - "parachainInfo": ParachainInfoConfig { - parachain_id: id, - ..Default::default() - }, - "collatorSelection": CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: EXISTENTIAL_DEPOSIT * 16, - ..Default::default() - }, - "session": SessionConfig { - keys: invulnerables - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys - ) - }) - .collect(), - ..Default::default() - }, - "polkadotXcm": { - "safeXcmVersion": Some(SAFE_XCM_VERSION), - }, - }) +mod dev { + use super::*; + + pub fn genesis( + id: ParaId, + invulnerables: Vec<(AccountId, AuraId)>, + endowed_accounts: Vec, + ) -> serde_json::Value { + serde_json::json!({ + "balances": BalancesConfig { + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, EXISTENTIAL_DEPOSIT * 4096 * 4096)) + .collect(), + dev_accounts: None, + }, + "parachainInfo": ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, + "collatorSelection": CollatorSelectionConfig { + invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: EXISTENTIAL_DEPOSIT * 16, + ..Default::default() + }, + "session": SessionConfig { + keys: invulnerables + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + SessionKeys { aura }, // session keys + ) + }) + .collect(), + ..Default::default() + }, + "polkadotXcm": { + "safeXcmVersion": Some(SAFE_XCM_VERSION), + }, + }) + } +} + +mod local { + use super::*; + + pub fn genesis( + sudo: AccountId, + id: ParaId, + invulnerables: Vec<(AccountId, AuraId)>, + endowed_accounts: Vec, + ) -> serde_json::Value { + let mut genesis = dev::genesis(id, invulnerables, endowed_accounts) + .as_object() + .cloned() + .expect("genesis is a json object"); + + let mut community_manager = serde_json::json!({ + "communitiesManager": CommunitiesManagerConfig { + // A community to cover a sudo-ish management. + communities: vec![(1, String::from("root"), sudo, None, Some(1))], + memberships: vec![(1, 10, UNITS, (None, None), None)], + }, + }); + + genesis.append( + community_manager + .as_object_mut() + .expect("communities manager is a json object"), + ); + + serde_json::Value::Object(genesis.clone()) + } } pub fn local_testnet_genesis(para_id: ParaId) -> serde_json::Value { - local_genesis(para_id, invulnerables(), testnet_accounts()) + local::genesis(alice(), para_id, invulnerables(), testnet_accounts()) +} + +pub fn dev_genesis(para_id: ParaId) -> serde_json::Value { + dev::genesis(para_id, invulnerables(), testnet_accounts()) } pub fn preset_names() -> Vec { @@ -53,9 +93,9 @@ pub fn preset_names() -> Vec { } pub fn get_preset(id: &PresetId) -> Option> { - let patch = match id.try_into() { - Ok("development") => local_testnet_genesis(2281.into()), - Ok("local") => local_testnet_genesis(2281.into()), + let patch = match id.as_ref() { + sp_genesis_builder::DEV_RUNTIME_PRESET => dev_genesis(2281.into()), + sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => local_testnet_genesis(2281.into()), _ => return None, }; diff --git a/runtime/kreivo/src/impls.rs b/runtime/kreivo/src/impls.rs index c9a664094..0bf44de11 100644 --- a/runtime/kreivo/src/impls.rs +++ b/runtime/kreivo/src/impls.rs @@ -19,7 +19,7 @@ use super::*; use core::cmp::Ordering; use frame_support::traits::{Contains, InstanceFilter, PrivilegeCmp}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use sp_runtime::RuntimeDebug; pub struct RuntimeBlackListedCalls; @@ -38,7 +38,18 @@ impl Contains for RuntimeBlackListedCalls { /// The type used to represent the kinds of proxying allowed. #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, scale_info::TypeInfo, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + MaxEncodedLen, + scale_info::TypeInfo, )] pub enum ProxyType { /// Fully permissioned proxy. Can execute any call on behalf of _proxied_. diff --git a/runtime/kreivo/src/lib.rs b/runtime/kreivo/src/lib.rs index 8c09bf96e..78e28f982 100644 --- a/runtime/kreivo/src/lib.rs +++ b/runtime/kreivo/src/lib.rs @@ -7,6 +7,9 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +extern crate alloc; +extern crate core; + #[cfg(test)] mod tests; @@ -24,13 +27,12 @@ mod xcm_config; use apis::*; use config::*; -use sp_std::prelude::*; - +use alloc::{borrow::Cow::Borrowed, boxed::Box, string::String, vec, vec::Vec}; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use sp_core::crypto::KeyTypeId; pub use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + generic, impl_opaque_keys, traits::{Block as BlockT, ConvertInto}, MultiAddress, Perbill, Percent, }; @@ -60,12 +62,13 @@ use xcm_config::{LocationConvertedConcreteId, RelayLocation, XcmOriginToTransact #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -// Polkadot imports -pub use weights::{BlockExecutionWeight, ExtrinsicBaseWeight}; - use pallet_asset_tx_payment::ChargeAssetTxPayment; use pallet_gas_transaction_payment::ChargeTransactionPayment as ChargeGasTxPayment; -use pallet_pass::ChargeTransactionToPassAccount as ChargeTxToPassAccount; + +#[cfg(not(feature = "zombienet"))] +use pallet_pass::PassAuthenticate; + +#[cfg(not(feature = "zombienet"))] use pallet_skip_feeless_payment::SkipCheckIfFeeless; // XCM Imports @@ -91,29 +94,68 @@ pub type SignedBlock = generic::SignedBlock; pub type ChargeTransaction = ChargeGasTxPayment>; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( +/// The TransactionExtensions to the basic transaction logic. +#[cfg(not(feature = "zombienet"))] +pub type TransactionExtensions = ( + PassAuthenticate, + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + SkipCheckIfFeeless, +); + +/// The TransactionExtensions to the basic transaction logic. +#[cfg(feature = "zombienet")] +pub type TransactionExtensions = ( frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, frame_system::CheckGenesis, frame_system::CheckEra, - SkipCheckIfFeeless>, + frame_system::CheckNonce, frame_system::CheckWeight, - SkipCheckIfFeeless>, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// A list of migrations that need to undergo. +pub type Migrations = ( + // Unreleased + pallet_collator_selection::migration::v2::MigrationToV2, + pallet_session::migrations::v1::MigrateV0ToV1< + Runtime, + pallet_session::migrations::v1::InitOffenceSeverity, + >, + cumulus_pallet_aura_ext::migration::MigrateV0ToV1, + cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + // Permanent + pallet_xcm::migration::MigrateToLatestXcmVersion, +); + +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + type ChannelList = ParachainSystem; +} /// Executive: handles dispatch to the various modules. -pub type Executive = - frame_executive::Executive, Runtime, AllPalletsWithSystem>; +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, + Migrations, +>; impl_opaque_keys! { pub struct SessionKeys { @@ -123,14 +165,14 @@ impl_opaque_keys! { #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("kreivo-parachain"), - impl_name: create_runtime_str!("kreivo-parachain"), + spec_name: Borrowed("kreivo-parachain"), + impl_name: Borrowed("kreivo-parachain"), authoring_version: 1, - spec_version: 116, + spec_version: 122, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 10, - state_version: 1, + transaction_version: 12, + system_version: 1, }; /// The version information used to identify this runtime when compiled @@ -190,6 +232,8 @@ mod runtime { pub type SkipFeeless = pallet_skip_feeless_payment; #[runtime::pallet_index(17)] pub type GasTxPayment = pallet_gas_transaction_payment; + #[runtime::pallet_index(18)] + pub type AssetsHolder = pallet_assets_holder; // Collator support. The order of these 4 are important and shall not change. #[runtime::pallet_index(20)] @@ -228,6 +272,8 @@ mod runtime { // Governance #[runtime::pallet_index(50)] pub type Treasury = pallet_treasury; + #[runtime::pallet_index(53)] + pub type BlackHole = pallet_black_hole; // Governance: Collective #[runtime::pallet_index(51)] @@ -238,6 +284,14 @@ mod runtime { // Virto Tooling #[runtime::pallet_index(60)] pub type Payments = pallet_payments; + #[runtime::pallet_index(61)] + pub type Listings = pallet_listings; + #[runtime::pallet_index(62)] + pub type ListingsCatalog = pallet_nfts; + #[runtime::pallet_index(63)] + pub type Orders = pallet_orders; + #[runtime::pallet_index(64)] + pub type PaymentIndices = pallet_payment_indices; // Communities at Kreivo #[runtime::pallet_index(71)] @@ -254,6 +308,10 @@ mod runtime { // Contracts #[runtime::pallet_index(80)] pub type Contracts = pallet_contracts; + #[runtime::pallet_index(81)] + pub type ContractsStore = pallet_contracts_store; + #[runtime::pallet_index(82)] + pub type Revive = pallet_revive; } cumulus_pallet_parachain_system::register_validate_block! { diff --git a/runtime/kreivo/src/tests.rs b/runtime/kreivo/src/tests.rs index 55bb73609..ea10cc8ac 100644 --- a/runtime/kreivo/src/tests.rs +++ b/runtime/kreivo/src/tests.rs @@ -1,20 +1,34 @@ -use super::Runtime; +use super::{Balances, Communities, CommunitiesManager, CommunityMemberships, Runtime, RuntimeOrigin, CENTS, UNITS}; +use crate::config::communities::memberships::CommunityMembershipsInstance; +use crate::config::system::CommunityLookup; +use crate::config::TreasuryAccount; +use crate::constants::currency::EXISTENTIAL_DEPOSIT; +use frame_support::assert_ok; +use frame_support::traits::fungible::Mutate; +use frame_support::traits::nonfungibles_v2::Inspect; +use pallet_communities_manager::TankConfig; +use parity_scale_codec::Encode; +use runtime_constants::time::WEEKS; +use sp_core::crypto::AccountId32; +use sp_io::TestExternalities; +use sp_runtime::traits::StaticLookup; +use sp_runtime::BoundedVec; macro_rules! assert_call_size { ($pallet: ident) => { println!( "size_of<{}::Call>: {}", stringify!($pallet), - &sp_std::mem::size_of::<$pallet::Call>(), + &core::mem::size_of::<$pallet::Call>(), ); - assert!(sp_std::mem::size_of::<$pallet::Call>() as u32 <= 1024); + assert!(core::mem::size_of::<$pallet::Call>() as u32 <= 1024); }; ($pallet: ident, $instance: path) => { println!( "size_of<$pallet::Call>: {}", - &sp_std::mem::size_of::<$pallet::Call>(), + &core::mem::size_of::<$pallet::Call>(), ); - assert!(sp_std::mem::size_of::<$pallet::Call>() as u32 <= 1024); + assert!(core::mem::size_of::<$pallet::Call>() as u32 <= 1024); }; } @@ -75,3 +89,65 @@ fn runtime_sanity_call_does_not_exceed_1kb() { // Payments: pallet_payments = 60 assert_call_size!(pallet_payments); } + +#[test] +fn ensure_copying_membership_attributes_works() { + TestExternalities::default().execute_with(|| { + if cfg!(feature = "runtime-benchmarks") { + // Note: Need to cover the deposit when the `runtime-benchmarks` feature is set. + assert_ok!(Balances::mint_into( + &TreasuryAccount::get(), + EXISTENTIAL_DEPOSIT + 10 * CENTS + )); + } + + // Create some memberships. + assert_ok!(CommunitiesManager::create_memberships( + RuntimeOrigin::root(), + 10, + 0, + CENTS, // Any price works + TankConfig::default(), // default means unlimited tank โ€” also, the only publicly exposed constructor ;) + Some(8 * WEEKS), // expires in + )); + + const ALICE: AccountId32 = AccountId32::new([1; 32]); + const BOB: AccountId32 = AccountId32::new([2; 32]); + assert_ok!(Balances::mint_into(&ALICE, UNITS)); + assert_ok!(Balances::mint_into(&BOB, UNITS)); + + assert_ok!(CommunitiesManager::register( + RuntimeOrigin::root(), + 1, + BoundedVec::try_from(b"First Community".to_vec()).expect("meets max length; qed"), + CommunityLookup::unlookup(ALICE), + // Use default values for decision method and track info + None, + None, + )); + + // Let's load some amount to the community, so the community can buy memberships + // itself. + assert_ok!(Balances::mint_into(&Communities::community_account(&1), UNITS)); + + assert_ok!(Communities::dispatch_as_account( + RuntimeOrigin::signed(ALICE), + Box::new( + pallet_nfts::Call::::buy_item { + collection: 0, + item: 0, + bid_price: CENTS + } + .into() + ) + )); + + assert_ok!(Communities::add_member( + RuntimeOrigin::signed(ALICE), + CommunityLookup::unlookup(BOB) + )); + + let key: Vec = b"membership_gas".to_vec(); + assert!(CommunityMemberships::system_attribute(&1, Some(&0), &key.encode()).is_some()); + }) +} diff --git a/runtime/kreivo/src/weights/cumulus_pallet_parachain_system.rs b/runtime/kreivo/src/weights/cumulus_pallet_parachain_system.rs index a320d2274..d7a5ef108 100644 --- a/runtime/kreivo/src/weights/cumulus_pallet_parachain_system.rs +++ b/runtime/kreivo/src/weights/cumulus_pallet_parachain_system.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `cumulus_pallet_parachain_system` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -51,11 +51,11 @@ impl cumulus_pallet_parachain_system::WeightInfo for We // Proof Size summary in bytes: // Measured: `152` // Estimated: `3517` - // Minimum execution time: 10_901_000 picoseconds. - Weight::from_parts(11_282_000, 0) + // Minimum execution time: 4_076_000 picoseconds. + Weight::from_parts(4_206_000, 0) .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 682_622 - .saturating_add(Weight::from_parts(411_319_777, 0).saturating_mul(n.into())) + // Standard Error: 9_968 + .saturating_add(Weight::from_parts(114_047_586, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) diff --git a/runtime/kreivo/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/kreivo/src/weights/cumulus_pallet_xcmp_queue.rs index 4ef2aa113..9ce25b974 100644 --- a/runtime/kreivo/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/kreivo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,8 +42,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `142` // Estimated: `1497` - // Minimum execution time: 13_471_000 picoseconds. - Weight::from_parts(15_720_000, 0) + // Minimum execution time: 7_714_000 picoseconds. + Weight::from_parts(8_017_000, 0) .saturating_add(Weight::from_parts(0, 1497)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -58,24 +58,63 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) /// Storage: `MessageQueue::Pages` (r:0 w:1) /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) - fn enqueue_xcmp_message() -> Weight { + /// The range of component `n` is `[1, 65531]`. + fn enqueue_n_bytes_xcmp_message(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `218` // Estimated: `5487` - // Minimum execution time: 35_039_000 picoseconds. - Weight::from_parts(40_059_000, 0) + // Minimum execution time: 18_687_000 picoseconds. + Weight::from_parts(20_003_027, 0) .saturating_add(Weight::from_parts(0, 5487)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(492, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } + + fn enqueue_n_empty_xcmp_messages(n: u32) -> Weight { + Weight::from_parts(10_003_027, 0) + .saturating_add(Weight::from_parts(0, 5487)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(492, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + + fn enqueue_empty_xcmp_message_at(n: u32) -> Weight { + Weight::from_parts(10_003_027, 0) + .saturating_add(Weight::from_parts(0, 5487)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(492, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + + fn enqueue_n_full_pages(n: u32) -> Weight { + Weight::from_parts(10_003_027, 0) + .saturating_add(Weight::from_parts(0, 5487)) + // Standard Error: 1 + .saturating_add(Weight::from_parts(492, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + + fn enqueue_1000_small_xcmp_messages() -> Weight { + Weight::from_parts(10_003_027, 0) + .saturating_add(Weight::from_parts(0, 5487)) + // Standard Error: 1 + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) fn suspend_channel() -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `2767` - // Minimum execution time: 11_586_000 picoseconds. - Weight::from_parts(12_151_000, 0) + // Minimum execution time: 4_736_000 picoseconds. + Weight::from_parts(5_075_000, 0) .saturating_add(Weight::from_parts(0, 2767)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -86,18 +125,18 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `177` // Estimated: `2767` - // Minimum execution time: 20_228_000 picoseconds. - Weight::from_parts(22_462_000, 0) + // Minimum execution time: 6_188_000 picoseconds. + Weight::from_parts(6_405_000, 0) .saturating_add(Weight::from_parts(0, 2767)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - fn take_first_concatenated_xcm() -> Weight { + fn take_first_concatenated_xcm(_n: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 26_267_000 picoseconds. - Weight::from_parts(28_243_000, 0) + // Minimum execution time: 5_729_000 picoseconds. + Weight::from_parts(5_935_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) @@ -118,8 +157,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65847` // Estimated: `69312` - // Minimum execution time: 248_385_000 picoseconds. - Weight::from_parts(279_052_000, 0) + // Minimum execution time: 97_387_000 picoseconds. + Weight::from_parts(98_676_000, 0) .saturating_add(Weight::from_parts(0, 69312)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -132,8 +171,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65776` // Estimated: `69241` - // Minimum execution time: 175_232_000 picoseconds. - Weight::from_parts(190_076_000, 0) + // Minimum execution time: 57_726_000 picoseconds. + Weight::from_parts(59_086_000, 0) .saturating_add(Weight::from_parts(0, 69241)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/kreivo/src/weights/frame_system.rs b/runtime/kreivo/src/weights/frame_system.rs index bf310df43..876cdd22c 100644 --- a/runtime/kreivo/src/weights/frame_system.rs +++ b/runtime/kreivo/src/weights/frame_system.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `frame_system` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -41,36 +41,33 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_408_000 picoseconds. - Weight::from_parts(37_805_625, 0) + // Minimum execution time: 3_934_000 picoseconds. + Weight::from_parts(4_022_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 8 - .saturating_add(Weight::from_parts(1_009, 0).saturating_mul(b.into())) + // Standard Error: 7 + .saturating_add(Weight::from_parts(987, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 24_190_000 picoseconds. - Weight::from_parts(27_584_000, 0) + // Minimum execution time: 8_711_000 picoseconds. + Weight::from_parts(8_951_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 10 - .saturating_add(Weight::from_parts(2_770, 0).saturating_mul(b.into())) + // Standard Error: 7 + .saturating_add(Weight::from_parts(2_005, 0).saturating_mul(b.into())) } - /// Storage: `System::Digest` (r:1 w:1) - /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) fn set_heap_pages() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 19_680_000 picoseconds. - Weight::from_parts(22_425_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `0` + // Minimum execution time: 5_804_000 picoseconds. + Weight::from_parts(5_972_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -88,8 +85,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `198` // Estimated: `1683` - // Minimum execution time: 308_068_524_000 picoseconds. - Weight::from_parts(353_698_774_000, 0) + // Minimum execution time: 125_595_359_000 picoseconds. + Weight::from_parts(125_914_918_000, 0) .saturating_add(Weight::from_parts(0, 1683)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -101,11 +98,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_558_000 picoseconds. - Weight::from_parts(12_615_000, 0) + // Minimum execution time: 3_905_000 picoseconds. + Weight::from_parts(3_987_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 14_779 - .saturating_add(Weight::from_parts(2_664_344, 0).saturating_mul(i.into())) + // Standard Error: 756 + .saturating_add(Weight::from_parts(904_234, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -115,11 +112,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_643_000 picoseconds. - Weight::from_parts(10_901_000, 0) + // Minimum execution time: 3_972_000 picoseconds. + Weight::from_parts(4_053_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9_640 - .saturating_add(Weight::from_parts(2_039_085, 0).saturating_mul(i.into())) + // Standard Error: 994 + .saturating_add(Weight::from_parts(693_800, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -127,13 +124,13 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `90 + p * (69 ยฑ0)` - // Estimated: `95 + p * (70 ยฑ0)` - // Minimum execution time: 22_016_000 picoseconds. - Weight::from_parts(22_317_000, 0) - .saturating_add(Weight::from_parts(0, 95)) - // Standard Error: 19_788 - .saturating_add(Weight::from_parts(4_569_520, 0).saturating_mul(p.into())) + // Measured: `98 + p * (69 ยฑ0)` + // Estimated: `104 + p * (70 ยฑ0)` + // Minimum execution time: 6_732_000 picoseconds. + Weight::from_parts(6_790_000, 0) + .saturating_add(Weight::from_parts(0, 104)) + // Standard Error: 1_332 + .saturating_add(Weight::from_parts(1_537_315, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) @@ -144,8 +141,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 38_177_000 picoseconds. - Weight::from_parts(49_705_000, 0) + // Minimum execution time: 13_401_000 picoseconds. + Weight::from_parts(14_055_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -167,8 +164,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `220` // Estimated: `1705` - // Minimum execution time: 322_325_426_000 picoseconds. - Weight::from_parts(382_494_175_000, 0) + // Minimum execution time: 132_382_208_000 picoseconds. + Weight::from_parts(132_906_223_000, 0) .saturating_add(Weight::from_parts(0, 1705)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtime/kreivo/src/weights/mod.rs b/runtime/kreivo/src/weights/mod.rs index c27abe031..0a26bf8a9 100644 --- a/runtime/kreivo/src/weights/mod.rs +++ b/runtime/kreivo/src/weights/mod.rs @@ -22,22 +22,30 @@ pub mod cumulus_pallet_parachain_system; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; +pub mod pallet_asset_tx_payment; pub mod pallet_assets; pub mod pallet_balances; pub mod pallet_collator_selection; pub mod pallet_communities; pub mod pallet_communities_manager; pub mod pallet_contracts; +pub mod pallet_contracts_store; +pub mod pallet_gas_transaction_payment; +pub mod pallet_listings; +pub mod pallet_message_queue; pub mod pallet_multisig; +pub mod pallet_orders; pub mod pallet_pass; pub mod pallet_payments; pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_ranked_collective; pub mod pallet_referenda; pub mod pallet_referenda_tracks; pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; +pub mod pallet_transaction_payment; pub mod pallet_treasury; pub mod pallet_utility; pub mod pallet_vesting; @@ -45,7 +53,5 @@ pub mod paritydb_weights; pub mod rocksdb_weights; pub mod xcm; -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/runtime/kreivo/src/weights/pallet_asset_tx_payment.rs b/runtime/kreivo/src/weights/pallet_asset_tx_payment.rs new file mode 100644 index 000000000..a7b00bdea --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_asset_tx_payment.rs @@ -0,0 +1,77 @@ + +//! Autogenerated weights for `pallet_asset_tx_payment` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_asset_tx_payment +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_asset_tx_payment`. +pub struct WeightInfo(PhantomData); +impl pallet_asset_tx_payment::WeightInfo for WeightInfo { + fn charge_asset_tx_payment_zero() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_020_000 picoseconds. + Weight::from_parts(1_087_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn charge_asset_tx_payment_native() -> Weight { + // Proof Size summary in bytes: + // Measured: `204` + // Estimated: `6196` + // Minimum execution time: 55_635_000 picoseconds. + Weight::from_parts(57_375_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:1 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:0) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) + /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + fn charge_asset_tx_payment_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `508` + // Estimated: `3689` + // Minimum execution time: 88_632_000 picoseconds. + Weight::from_parts(89_828_000, 0) + .saturating_add(Weight::from_parts(0, 3689)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_assets.rs b/runtime/kreivo/src/weights/pallet_assets.rs index f49b45710..0a2c7df52 100644 --- a/runtime/kreivo/src/weights/pallet_assets.rs +++ b/runtime/kreivo/src/weights/pallet_assets.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_assets` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -46,8 +46,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `216` // Estimated: `3689` - // Minimum execution time: 103_953_000 picoseconds. - Weight::from_parts(120_087_000, 0) + // Minimum execution time: 37_217_000 picoseconds. + Weight::from_parts(38_635_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -60,49 +60,57 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3689` - // Minimum execution time: 47_268_000 picoseconds. - Weight::from_parts(56_071_000, 0) + // Minimum execution time: 15_900_000 picoseconds. + Weight::from_parts(16_579_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:0) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:0) + /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) fn start_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `349` - // Estimated: `3689` - // Minimum execution time: 50_488_000 picoseconds. - Weight::from_parts(55_512_000, 0) - .saturating_add(Weight::from_parts(0, 3689)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `445` + // Estimated: `3692` + // Minimum execution time: 28_740_000 picoseconds. + Weight::from_parts(30_204_000, 0) + .saturating_add(Weight::from_parts(0, 3692)) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:1001 w:1000) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1000 w:1000) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::FrozenBalances` (r:1000 w:1000) + /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1000 w:1000) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::FrozenBalances` (r:0 w:1000) - /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1000) + /// Storage: `AssetsFreezer::Freezes` (r:1000 w:1000) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1000 w:1000) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `190 + c * (208 ยฑ0)` - // Estimated: `3689 + c * (2623 ยฑ0)` - // Minimum execution time: 62_356_000 picoseconds. - Weight::from_parts(439_291_235, 0) + // Measured: `307 + c * (208 ยฑ0)` + // Estimated: `3689 + c * (2702 ยฑ0)` + // Minimum execution time: 21_414_000 picoseconds. + Weight::from_parts(21_751_000, 0) .saturating_add(Weight::from_parts(0, 3689)) - // Standard Error: 1_425_963 - .saturating_add(Weight::from_parts(90_017_327, 0).saturating_mul(c.into())) + // Standard Error: 45_208 + .saturating_add(Weight::from_parts(46_285_704, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) + .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2623).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 2702).saturating_mul(c.into())) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) @@ -113,11 +121,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `487 + a * (86 ยฑ0)` // Estimated: `3689 + a * (2637 ยฑ0)` - // Minimum execution time: 43_043_000 picoseconds. - Weight::from_parts(62_502_000, 0) + // Minimum execution time: 21_859_000 picoseconds. + Weight::from_parts(22_480_000, 0) .saturating_add(Weight::from_parts(0, 3689)) - // Standard Error: 542_134 - .saturating_add(Weight::from_parts(77_878_096, 0).saturating_mul(a.into())) + // Standard Error: 7_028 + .saturating_add(Weight::from_parts(19_416_376, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -132,8 +140,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 50_513_000 picoseconds. - Weight::from_parts(59_815_000, 0) + // Minimum execution time: 17_538_000 picoseconds. + Weight::from_parts(18_240_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,8 +154,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 57_944_000 picoseconds. - Weight::from_parts(85_461_000, 0) + // Minimum execution time: 30_720_000 picoseconds. + Weight::from_parts(31_696_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -156,77 +164,91 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:1 w:1) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn burn() -> Weight { // Proof Size summary in bytes: - // Measured: `466` - // Estimated: `3689` - // Minimum execution time: 144_965_000 picoseconds. - Weight::from_parts(148_381_000, 0) - .saturating_add(Weight::from_parts(0, 3689)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `508` + // Estimated: `3692` + // Minimum execution time: 84_293_000 picoseconds. + Weight::from_parts(86_587_000, 0) + .saturating_add(Weight::from_parts(0, 3692)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `547` // Estimated: `6236` - // Minimum execution time: 185_713_000 picoseconds. - Weight::from_parts(187_793_000, 0) + // Minimum execution time: 102_625_000 picoseconds. + Weight::from_parts(104_429_000, 0) .saturating_add(Weight::from_parts(0, 6236)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:0) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `547` // Estimated: `6236` - // Minimum execution time: 159_405_000 picoseconds. - Weight::from_parts(162_584_000, 0) + // Minimum execution time: 68_827_000 picoseconds. + Weight::from_parts(70_303_000, 0) .saturating_add(Weight::from_parts(0, 6236)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `547` // Estimated: `6236` - // Minimum execution time: 187_322_000 picoseconds. - Weight::from_parts(190_655_000, 0) + // Minimum execution time: 102_426_000 picoseconds. + Weight::from_parts(104_147_000, 0) .saturating_add(Weight::from_parts(0, 6236)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) @@ -236,8 +258,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `424` // Estimated: `3689` - // Minimum execution time: 59_845_000 picoseconds. - Weight::from_parts(65_859_000, 0) + // Minimum execution time: 23_810_000 picoseconds. + Weight::from_parts(24_764_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -250,8 +272,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `424` // Estimated: `3689` - // Minimum execution time: 60_788_000 picoseconds. - Weight::from_parts(64_575_000, 0) + // Minimum execution time: 23_440_000 picoseconds. + Weight::from_parts(24_792_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -262,8 +284,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `349` // Estimated: `3689` - // Minimum execution time: 44_320_000 picoseconds. - Weight::from_parts(53_750_000, 0) + // Minimum execution time: 16_318_000 picoseconds. + Weight::from_parts(16_841_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -274,8 +296,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `349` // Estimated: `3689` - // Minimum execution time: 33_459_000 picoseconds. - Weight::from_parts(57_157_000, 0) + // Minimum execution time: 15_987_000 picoseconds. + Weight::from_parts(16_823_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -288,8 +310,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 60_158_000 picoseconds. - Weight::from_parts(68_526_000, 0) + // Minimum execution time: 18_346_000 picoseconds. + Weight::from_parts(18_892_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -300,8 +322,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 42_022_000 picoseconds. - Weight::from_parts(44_636_000, 0) + // Minimum execution time: 16_225_000 picoseconds. + Weight::from_parts(16_848_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -312,15 +334,17 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(154), added: 2629, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(n: u32, _s: u32, ) -> Weight { + fn set_metadata(n: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 68_295_000 picoseconds. - Weight::from_parts(108_230_356, 0) + // Minimum execution time: 36_136_000 picoseconds. + Weight::from_parts(38_185_545, 0) .saturating_add(Weight::from_parts(0, 3689)) - // Standard Error: 24_837 - .saturating_add(Weight::from_parts(47_008, 0).saturating_mul(n.into())) + // Standard Error: 1_095 + .saturating_add(Weight::from_parts(1_369, 0).saturating_mul(n.into())) + // Standard Error: 1_095 + .saturating_add(Weight::from_parts(299, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -332,8 +356,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `480` // Estimated: `3689` - // Minimum execution time: 99_788_000 picoseconds. - Weight::from_parts(101_497_000, 0) + // Minimum execution time: 38_523_000 picoseconds. + Weight::from_parts(39_698_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -348,13 +372,13 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `154` // Estimated: `3689` - // Minimum execution time: 33_918_000 picoseconds. - Weight::from_parts(47_217_746, 0) + // Minimum execution time: 17_085_000 picoseconds. + Weight::from_parts(17_936_645, 0) .saturating_add(Weight::from_parts(0, 3689)) - // Standard Error: 17_320 - .saturating_add(Weight::from_parts(111_674, 0).saturating_mul(n.into())) - // Standard Error: 17_320 - .saturating_add(Weight::from_parts(74_023, 0).saturating_mul(s.into())) + // Standard Error: 569 + .saturating_add(Weight::from_parts(4_622, 0).saturating_mul(n.into())) + // Standard Error: 569 + .saturating_add(Weight::from_parts(2_233, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -366,8 +390,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `480` // Estimated: `3689` - // Minimum execution time: 71_334_000 picoseconds. - Weight::from_parts(99_915_000, 0) + // Minimum execution time: 38_028_000 picoseconds. + Weight::from_parts(39_238_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -378,8 +402,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 46_558_000 picoseconds. - Weight::from_parts(52_196_000, 0) + // Minimum execution time: 15_675_000 picoseconds. + Weight::from_parts(16_228_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -392,8 +416,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `349` // Estimated: `3689` - // Minimum execution time: 84_396_000 picoseconds. - Weight::from_parts(128_766_000, 0) + // Minimum execution time: 42_267_000 picoseconds. + Weight::from_parts(43_320_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -404,21 +428,25 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(162), added: 2637, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn transfer_approved() -> Weight { // Proof Size summary in bytes: - // Measured: `676` + // Measured: `718` // Estimated: `6236` - // Minimum execution time: 170_562_000 picoseconds. - Weight::from_parts(260_517_000, 0) + // Minimum execution time: 129_179_000 picoseconds. + Weight::from_parts(132_723_000, 0) .saturating_add(Weight::from_parts(0, 6236)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(9)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) @@ -428,8 +456,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `520` // Estimated: `3689` - // Minimum execution time: 81_267_000 picoseconds. - Weight::from_parts(124_966_000, 0) + // Minimum execution time: 46_131_000 picoseconds. + Weight::from_parts(47_344_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -442,8 +470,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `520` // Estimated: `3689` - // Minimum execution time: 81_061_000 picoseconds. - Weight::from_parts(142_594_000, 0) + // Minimum execution time: 45_306_000 picoseconds. + Weight::from_parts(47_862_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -454,8 +482,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 55_460_000 picoseconds. - Weight::from_parts(58_032_000, 0) + // Minimum execution time: 16_980_000 picoseconds. + Weight::from_parts(17_659_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -470,8 +498,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `455` // Estimated: `3689` - // Minimum execution time: 126_087_000 picoseconds. - Weight::from_parts(145_577_000, 0) + // Minimum execution time: 46_769_000 picoseconds. + Weight::from_parts(48_223_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -484,8 +512,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `3689` - // Minimum execution time: 125_058_000 picoseconds. - Weight::from_parts(133_763_000, 0) + // Minimum execution time: 41_461_000 picoseconds. + Weight::from_parts(42_847_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -494,39 +522,47 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) + /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::FrozenBalances` (r:0 w:1) - /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn refund() -> Weight { // Proof Size summary in bytes: - // Measured: `582` - // Estimated: `3689` - // Minimum execution time: 128_542_000 picoseconds. - Weight::from_parts(130_314_000, 0) - .saturating_add(Weight::from_parts(0, 3689)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(5)) + // Measured: `666` + // Estimated: `3692` + // Minimum execution time: 75_891_000 picoseconds. + Weight::from_parts(78_008_000, 0) + .saturating_add(Weight::from_parts(0, 3692)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `Assets::Account` (r:1 w:1) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::FrozenBalances` (r:0 w:1) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) fn refund_other() -> Weight { // Proof Size summary in bytes: - // Measured: `475` - // Estimated: `3689` - // Minimum execution time: 120_581_000 picoseconds. - Weight::from_parts(123_469_000, 0) - .saturating_add(Weight::from_parts(0, 3689)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `559` + // Estimated: `3692` + // Minimum execution time: 73_177_000 picoseconds. + Weight::from_parts(74_682_000, 0) + .saturating_add(Weight::from_parts(0, 3692)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `Assets::Asset` (r:1 w:0) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) @@ -536,8 +572,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `424` // Estimated: `3689` - // Minimum execution time: 60_243_000 picoseconds. - Weight::from_parts(62_571_000, 0) + // Minimum execution time: 23_832_000 picoseconds. + Weight::from_parts(24_589_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -546,20 +582,57 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) + /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `AssetsFreezer::Freezes` (r:0 w:1) - /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `505` + // Measured: `547` // Estimated: `6236` - // Minimum execution time: 237_411_000 picoseconds. - Weight::from_parts(240_257_000, 0) + // Minimum execution time: 124_486_000 picoseconds. + Weight::from_parts(126_779_000, 0) .saturating_add(Weight::from_parts(0, 6236)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } + + fn total_issuance() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `6236` + // Minimum execution time: 124_486_000 picoseconds. + Weight::from_parts(10_779_000, 0) + .saturating_add(Weight::from_parts(0, 6236)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } + + fn balance() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `6236` + // Minimum execution time: 124_486_000 picoseconds. + Weight::from_parts(10_779_000, 0) + .saturating_add(Weight::from_parts(0, 6236)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } + + fn allowance() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `6236` + // Minimum execution time: 124_486_000 picoseconds. + Weight::from_parts(10_779_000, 0) + .saturating_add(Weight::from_parts(0, 6236)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) } } diff --git a/runtime/kreivo/src/weights/pallet_balances.rs b/runtime/kreivo/src/weights/pallet_balances.rs index 5f29cc207..48bb02ac2 100644 --- a/runtime/kreivo/src/weights/pallet_balances.rs +++ b/runtime/kreivo/src/weights/pallet_balances.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,8 +42,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 166_836_000 picoseconds. - Weight::from_parts(175_097_000, 0) + // Minimum execution time: 67_369_000 picoseconds. + Weight::from_parts(68_479_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -54,8 +54,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 128_248_000 picoseconds. - Weight::from_parts(136_959_000, 0) + // Minimum execution time: 53_358_000 picoseconds. + Weight::from_parts(54_589_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 54_774_000 picoseconds. - Weight::from_parts(62_899_000, 0) + // Minimum execution time: 20_548_000 picoseconds. + Weight::from_parts(21_093_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 78_062_000 picoseconds. - Weight::from_parts(80_855_000, 0) + // Minimum execution time: 30_374_000 picoseconds. + Weight::from_parts(31_167_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 169_444_000 picoseconds. - Weight::from_parts(180_999_000, 0) + // Minimum execution time: 69_424_000 picoseconds. + Weight::from_parts(70_631_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -102,8 +102,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 155_711_000 picoseconds. - Weight::from_parts(168_776_000, 0) + // Minimum execution time: 66_245_000 picoseconds. + Weight::from_parts(67_640_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -114,8 +114,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 64_656_000 picoseconds. - Weight::from_parts(69_578_000, 0) + // Minimum execution time: 24_528_000 picoseconds. + Weight::from_parts(25_066_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -127,11 +127,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ยฑ0)` // Estimated: `990 + u * (2603 ยฑ0)` - // Minimum execution time: 59_652_000 picoseconds. - Weight::from_parts(60_935_000, 0) + // Minimum execution time: 22_977_000 picoseconds. + Weight::from_parts(23_789_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 838_837 - .saturating_add(Weight::from_parts(70_997_416, 0).saturating_mul(u.into())) + // Standard Error: 7_976 + .saturating_add(Weight::from_parts(18_028_879, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -140,24 +140,24 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_867_000 picoseconds. - Weight::from_parts(33_002_000, 0) + // Minimum execution time: 9_638_000 picoseconds. + Weight::from_parts(10_021_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn burn_allow_death() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 108_143_000 picoseconds. - Weight::from_parts(114_828_000, 0) + // Minimum execution time: 41_916_000 picoseconds. + Weight::from_parts(42_750_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn burn_keep_alive() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 79_051_000 picoseconds. - Weight::from_parts(86_104_000, 0) + // Minimum execution time: 28_607_000 picoseconds. + Weight::from_parts(29_598_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/runtime/kreivo/src/weights/pallet_collator_selection.rs b/runtime/kreivo/src/weights/pallet_collator_selection.rs index cb84c9b56..cd5bc0c3c 100644 --- a/runtime/kreivo/src/weights/pallet_collator_selection.rs +++ b/runtime/kreivo/src/weights/pallet_collator_selection.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_collator_selection` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -45,11 +45,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `215 + b * (78 ยฑ0)` // Estimated: `1204 + b * (2554 ยฑ0)` - // Minimum execution time: 43_009_000 picoseconds. - Weight::from_parts(45_990_992, 0) + // Minimum execution time: 17_463_000 picoseconds. + Weight::from_parts(17_574_691, 0) .saturating_add(Weight::from_parts(0, 1204)) - // Standard Error: 110_947 - .saturating_add(Weight::from_parts(13_087_044, 0).saturating_mul(b.into())) + // Standard Error: 4_887 + .saturating_add(Weight::from_parts(4_409_539, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -66,15 +66,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 999]`. fn add_invulnerable(b: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1356 + b * (32 ยฑ0) + c * (48 ยฑ0)` + // Measured: `1393 + b * (32 ยฑ0) + c * (48 ยฑ0)` // Estimated: `49487 + b * (33 ยฑ0) + c * (49 ยฑ0)` - // Minimum execution time: 172_234_000 picoseconds. - Weight::from_parts(227_769_899, 0) + // Minimum execution time: 71_191_000 picoseconds. + Weight::from_parts(70_817_799, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 40_600 - .saturating_add(Weight::from_parts(162_994, 0).saturating_mul(b.into())) - // Standard Error: 3_984 - .saturating_add(Weight::from_parts(163_962, 0).saturating_mul(c.into())) + // Standard Error: 421 + .saturating_add(Weight::from_parts(73_228, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 33).saturating_mul(b.into())) @@ -87,13 +85,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `b` is `[2, 100]`. fn remove_invulnerable(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `119 + b * (32 ยฑ0)` + // Measured: `153 + b * (32 ยฑ0)` // Estimated: `49487` - // Minimum execution time: 36_454_000 picoseconds. - Weight::from_parts(70_280_399, 0) + // Minimum execution time: 16_432_000 picoseconds. + Weight::from_parts(19_431_795, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 32_873 - .saturating_add(Weight::from_parts(471_291, 0).saturating_mul(b.into())) + // Standard Error: 1_964 + .saturating_add(Weight::from_parts(83_035, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -103,8 +101,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_428_000 picoseconds. - Weight::from_parts(28_403_000, 0) + // Minimum execution time: 7_832_000 picoseconds. + Weight::from_parts(8_062_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -122,13 +120,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0 + c * (184 ยฑ0) + k * (116 ยฑ0)` // Estimated: `53050 + c * (906 ยฑ29) + k * (906 ยฑ29)` - // Minimum execution time: 40_865_000 picoseconds. - Weight::from_parts(48_192_000, 0) + // Minimum execution time: 14_667_000 picoseconds. + Weight::from_parts(14_998_000, 0) .saturating_add(Weight::from_parts(0, 53050)) - // Standard Error: 1_139_963 - .saturating_add(Weight::from_parts(20_993_572, 0).saturating_mul(c.into())) - // Standard Error: 1_139_963 - .saturating_add(Weight::from_parts(44_104_485, 0).saturating_mul(k.into())) + // Standard Error: 229_302 + .saturating_add(Weight::from_parts(7_453_973, 0).saturating_mul(c.into())) + // Standard Error: 229_302 + .saturating_add(Weight::from_parts(7_131_071, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) @@ -143,13 +141,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 1000]`. fn update_bond(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `529 + c * (48 ยฑ0)` + // Measured: `563 + c * (48 ยฑ0)` // Estimated: `49487` - // Minimum execution time: 70_574_000 picoseconds. - Weight::from_parts(161_905_041, 0) + // Minimum execution time: 37_953_000 picoseconds. + Weight::from_parts(45_665_189, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 2_251 - .saturating_add(Weight::from_parts(138_101, 0).saturating_mul(c.into())) + // Standard Error: 381 + .saturating_add(Weight::from_parts(61_314, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -166,13 +164,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 999]`. fn register_as_candidate(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1129 + c * (48 ยฑ0)` + // Measured: `1163 + c * (48 ยฑ0)` // Estimated: `49487 + c * (49 ยฑ0)` - // Minimum execution time: 98_108_000 picoseconds. - Weight::from_parts(227_852_684, 0) + // Minimum execution time: 51_878_000 picoseconds. + Weight::from_parts(56_551_491, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 3_206 - .saturating_add(Weight::from_parts(166_988, 0).saturating_mul(c.into())) + // Standard Error: 770 + .saturating_add(Weight::from_parts(89_296, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -192,13 +190,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 1000]`. fn take_candidate_slot(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1253 + c * (48 ยฑ0)` + // Measured: `1287 + c * (48 ยฑ0)` // Estimated: `49487 + c * (49 ยฑ0)` - // Minimum execution time: 131_440_000 picoseconds. - Weight::from_parts(274_170_716, 0) + // Minimum execution time: 72_800_000 picoseconds. + Weight::from_parts(84_575_830, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 3_251 - .saturating_add(Weight::from_parts(172_984, 0).saturating_mul(c.into())) + // Standard Error: 471 + .saturating_add(Weight::from_parts(76_598, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 49).saturating_mul(c.into())) @@ -212,13 +210,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 1000]`. fn leave_intent(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `404 + c * (48 ยฑ0)` + // Measured: `438 + c * (48 ยฑ0)` // Estimated: `49487` - // Minimum execution time: 69_038_000 picoseconds. - Weight::from_parts(175_865_327, 0) + // Minimum execution time: 41_211_000 picoseconds. + Weight::from_parts(49_560_102, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 2_989 - .saturating_add(Weight::from_parts(134_276, 0).saturating_mul(c.into())) + // Standard Error: 379 + .saturating_add(Weight::from_parts(71_145, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -230,8 +228,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `192` // Estimated: `6196` - // Minimum execution time: 108_053_000 picoseconds. - Weight::from_parts(194_392_000, 0) + // Minimum execution time: 58_283_000 picoseconds. + Weight::from_parts(59_484_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -250,13 +248,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `c` is `[1, 1000]`. fn new_session(r: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `21973 + c * (97 ยฑ0) + r * (118 ยฑ0)` + // Measured: `22040 + c * (97 ยฑ0) + r * (118 ยฑ0)` // Estimated: `49487 + c * (2519 ยฑ0) + r * (2603 ยฑ0)` - // Minimum execution time: 120_185_000 picoseconds. - Weight::from_parts(129_913_000, 0) + // Minimum execution time: 34_971_000 picoseconds. + Weight::from_parts(35_649_000, 0) .saturating_add(Weight::from_parts(0, 49487)) - // Standard Error: 2_411_353 - .saturating_add(Weight::from_parts(95_926_600, 0).saturating_mul(c.into())) + // Standard Error: 660_683 + .saturating_add(Weight::from_parts(27_074_797, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) diff --git a/runtime/kreivo/src/weights/pallet_communities.rs b/runtime/kreivo/src/weights/pallet_communities.rs index 5b58f880e..d0372a2c3 100644 --- a/runtime/kreivo/src/weights/pallet_communities.rs +++ b/runtime/kreivo/src/weights/pallet_communities.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_communities` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -44,10 +44,10 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `94` + // Measured: `182` // Estimated: `4087` - // Minimum execution time: 71_539_000 picoseconds. - Weight::from_parts(73_261_000, 0) + // Minimum execution time: 25_683_000 picoseconds. + Weight::from_parts(26_565_000, 0) .saturating_add(Weight::from_parts(0, 4087)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -60,8 +60,8 @@ impl pallet_communities::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `160` // Estimated: `4087` - // Minimum execution time: 67_495_000 picoseconds. - Weight::from_parts(69_555_000, 0) + // Minimum execution time: 25_520_000 picoseconds. + Weight::from_parts(26_598_000, 0) .saturating_add(Weight::from_parts(0, 4087)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -78,8 +78,8 @@ impl pallet_communities::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `229` // Estimated: `3689` - // Minimum execution time: 51_255_000 picoseconds. - Weight::from_parts(53_101_000, 0) + // Minimum execution time: 27_733_000 picoseconds. + Weight::from_parts(29_187_000, 0) .saturating_add(Weight::from_parts(0, 3689)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -98,19 +98,21 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Item` (r:2 w:2) /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1) /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::PendingSwapOf` (r:0 w:1) /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn add_member() -> Weight { // Proof Size summary in bytes: - // Measured: `928` + // Measured: `995` // Estimated: `18702` - // Minimum execution time: 446_351_000 picoseconds. - Weight::from_parts(544_610_000, 0) + // Minimum execution time: 193_344_000 picoseconds. + Weight::from_parts(197_421_000, 0) .saturating_add(Weight::from_parts(0, 18702)) - .saturating_add(T::DbWeight::get().reads(16)) - .saturating_add(T::DbWeight::get().writes(11)) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(12)) } /// Storage: `Communities::Info` (r:1 w:0) /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) @@ -124,6 +126,8 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Item` (r:2 w:2) /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::ItemMetadataOf` (r:1 w:0) /// Proof: `CommunityMemberships::ItemMetadataOf` (`max_values`: None, `max_size`: Some(345), added: 2820, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::CollectionConfigOf` (r:1 w:0) @@ -136,13 +140,13 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `CommunityMemberships::PendingSwapOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn remove_member() -> Weight { // Proof Size summary in bytes: - // Measured: `1389` + // Measured: `1456` // Estimated: `15750` - // Minimum execution time: 552_210_000 picoseconds. - Weight::from_parts(666_901_000, 0) + // Minimum execution time: 232_170_000 picoseconds. + Weight::from_parts(240_695_000, 0) .saturating_add(Weight::from_parts(0, 15750)) - .saturating_add(T::DbWeight::get().reads(15)) - .saturating_add(T::DbWeight::get().writes(15)) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(16)) } /// Storage: `Communities::Info` (r:1 w:0) /// Proof: `Communities::Info` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) @@ -152,10 +156,10 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn promote() -> Weight { // Proof Size summary in bytes: - // Measured: `755` + // Measured: `682` // Estimated: `6894` - // Minimum execution time: 180_116_000 picoseconds. - Weight::from_parts(292_475_000, 0) + // Minimum execution time: 88_834_000 picoseconds. + Weight::from_parts(91_582_000, 0) .saturating_add(Weight::from_parts(0, 6894)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -168,10 +172,10 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn demote() -> Weight { // Proof Size summary in bytes: - // Measured: `793` + // Measured: `720` // Estimated: `6894` - // Minimum execution time: 170_118_000 picoseconds. - Weight::from_parts(235_429_000, 0) + // Minimum execution time: 90_555_000 picoseconds. + Weight::from_parts(92_392_000, 0) .saturating_add(Weight::from_parts(0, 6894)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -188,18 +192,22 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `Communities::CommunityVoteLocks` (`max_values`: None, `max_size`: Some(104), added: 2579, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:1 w:0) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:0) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::Freezes` (r:1 w:1) /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(101), added: 2576, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:1) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn vote() -> Weight { // Proof Size summary in bytes: - // Measured: `2494` + // Measured: `2606` // Estimated: `6148` - // Minimum execution time: 314_045_000 picoseconds. - Weight::from_parts(458_108_000, 0) + // Minimum execution time: 164_702_000 picoseconds. + Weight::from_parts(168_924_000, 0) .saturating_add(Weight::from_parts(0, 6148)) - .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `CommunityMemberships::Account` (r:1 w:0) @@ -212,14 +220,16 @@ impl pallet_communities::WeightInfo for WeightInfo { /// Proof: `Communities::CommunityVotes` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Attribute` (r:1 w:0) /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn remove_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `2970` - // Estimated: `4365` - // Minimum execution time: 204_186_000 picoseconds. - Weight::from_parts(299_085_000, 0) - .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `3040` + // Estimated: `4525` + // Minimum execution time: 90_432_000 picoseconds. + Weight::from_parts(94_661_000, 0) + .saturating_add(Weight::from_parts(0, 4525)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `CommunityReferenda::ReferendumInfoFor` (r:1 w:0) @@ -236,8 +246,8 @@ impl pallet_communities::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1154` // Estimated: `8123` - // Minimum execution time: 198_655_000 picoseconds. - Weight::from_parts(275_426_000, 0) + // Minimum execution time: 87_121_000 picoseconds. + Weight::from_parts(89_892_000, 0) .saturating_add(Weight::from_parts(0, 8123)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -248,8 +258,8 @@ impl pallet_communities::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `3484` - // Minimum execution time: 37_320_000 picoseconds. - Weight::from_parts(45_762_000, 0) + // Minimum execution time: 19_760_000 picoseconds. + Weight::from_parts(20_751_000, 0) .saturating_add(Weight::from_parts(0, 3484)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtime/kreivo/src/weights/pallet_communities_manager.rs b/runtime/kreivo/src/weights/pallet_communities_manager.rs index 30df78c71..951a679f7 100644 --- a/runtime/kreivo/src/weights/pallet_communities_manager.rs +++ b/runtime/kreivo/src/weights/pallet_communities_manager.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_communities_manager` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -66,56 +66,70 @@ impl pallet_communities_manager::WeightInfo for WeightI /// Proof: `CommunityMemberships::CollectionAccount` (`max_values`: None, `max_size`: Some(66), added: 2541, mode: `MaxEncodedLen`) fn register() -> Weight { // Proof Size summary in bytes: - // Measured: `316` + // Measured: `331` // Estimated: `132561` - // Minimum execution time: 209_662_000 picoseconds. - Weight::from_parts(232_840_000, 0) + // Minimum execution time: 77_157_000 picoseconds. + Weight::from_parts(79_827_000, 0) .saturating_add(Weight::from_parts(0, 132561)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(14)) } - /// Storage: `CommunityMemberships::Item` (r:1023 w:1023) - /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Collection` (r:1 w:1) /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) - /// Storage: `CommunityMemberships::CollectionConfigOf` (r:1 w:0) - /// Proof: `CommunityMemberships::CollectionConfigOf` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `CommunityMemberships::Item` (r:1023 w:1023) + /// Proof: `CommunityMemberships::Item` (`max_values`: None, `max_size`: Some(859), added: 3334, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::ItemConfigOf` (r:1023 w:1023) /// Proof: `CommunityMemberships::ItemConfigOf` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `CommunityMemberships::Attribute` (r:2046 w:2046) /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) + /// Storage: `CommunityMemberships::CollectionRoleOf` (r:0 w:1) + /// Proof: `CommunityMemberships::CollectionRoleOf` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) + /// Storage: `CommunityMemberships::CollectionConfigOf` (r:0 w:1) + /// Proof: `CommunityMemberships::CollectionConfigOf` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Account` (r:0 w:1023) /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `CommunityMemberships::CollectionAccount` (r:0 w:1) + /// Proof: `CommunityMemberships::CollectionAccount` (`max_values`: None, `max_size`: Some(66), added: 2541, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::ItemPriceOf` (r:0 w:1023) /// Proof: `CommunityMemberships::ItemPriceOf` (`max_values`: None, `max_size`: Some(87), added: 2562, mode: `MaxEncodedLen`) /// The range of component `q` is `[1, 1024]`. fn create_memberships(q: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `368` - // Estimated: `3547 + q * (5904 ยฑ0)` - // Minimum execution time: 253_216_000 picoseconds. - Weight::from_parts(145_162_991_820, 0) - .saturating_add(Weight::from_parts(0, 3547)) - // Standard Error: 14_973_566 - .saturating_add(Weight::from_parts(203_648_192, 0).saturating_mul(q.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `182` + // Estimated: `3593 + q * (5904 ยฑ0)` + // Minimum execution time: 128_464_000 picoseconds. + Weight::from_parts(131_672_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + // Standard Error: 33_838 + .saturating_add(Weight::from_parts(85_814_825, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(q.into()))) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(q.into()))) .saturating_add(Weight::from_parts(0, 5904).saturating_mul(q.into())) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `CommunityMemberships::Collection` (r:1 w:1) /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) /// Storage: `CommunityMemberships::Attribute` (r:1 w:1) /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) fn set_gas_tank() -> Weight { // Proof Size summary in bytes: - // Measured: `488` + // Measured: `491` // Estimated: `3942` - // Minimum execution time: 67_355_000 picoseconds. - Weight::from_parts(108_204_000, 0) + // Minimum execution time: 37_896_000 picoseconds. + Weight::from_parts(38_657_000, 0) .saturating_add(Weight::from_parts(0, 3942)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/kreivo/src/weights/pallet_contracts.rs b/runtime/kreivo/src/weights/pallet_contracts.rs index 5f8a35619..57877d5cf 100644 --- a/runtime/kreivo/src/weights/pallet_contracts.rs +++ b/runtime/kreivo/src/weights/pallet_contracts.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_contracts` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,8 +42,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 6_164_000 picoseconds. - Weight::from_parts(6_652_000, 0) + // Minimum execution time: 2_899_000 picoseconds. + Weight::from_parts(3_072_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -54,11 +54,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `391 + k * (69 ยฑ0)` // Estimated: `381 + k * (70 ยฑ0)` - // Minimum execution time: 57_910_000 picoseconds. - Weight::from_parts(61_412_000, 0) + // Minimum execution time: 19_558_000 picoseconds. + Weight::from_parts(19_982_000, 0) .saturating_add(Weight::from_parts(0, 381)) - // Standard Error: 78_369 - .saturating_add(Weight::from_parts(4_176_612, 0).saturating_mul(k.into())) + // Standard Error: 2_017 + .saturating_add(Weight::from_parts(1_512_627, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -72,11 +72,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `145 + c * (1 ยฑ0)` // Estimated: `6083 + c * (1 ยฑ0)` - // Minimum execution time: 20_217_000 picoseconds. - Weight::from_parts(25_582_328, 0) + // Minimum execution time: 11_243_000 picoseconds. + Weight::from_parts(7_223_184, 0) .saturating_add(Weight::from_parts(0, 6083)) - // Standard Error: 23 - .saturating_add(Weight::from_parts(3_133, 0).saturating_mul(c.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_354, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -89,8 +89,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `482` // Estimated: `6422` - // Minimum execution time: 64_326_000 picoseconds. - Weight::from_parts(68_769_000, 0) + // Minimum execution time: 25_436_000 picoseconds. + Weight::from_parts(26_176_000, 0) .saturating_add(Weight::from_parts(0, 6422)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -104,11 +104,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `105 + k * (1 ยฑ0)` // Estimated: `3569 + k * (1 ยฑ0)` - // Minimum execution time: 11_639_000 picoseconds. - Weight::from_parts(15_607_000, 0) + // Minimum execution time: 5_409_000 picoseconds. + Weight::from_parts(3_902_227, 0) .saturating_add(Weight::from_parts(0, 3569)) - // Standard Error: 26_750 - .saturating_add(Weight::from_parts(4_518_926, 0).saturating_mul(k.into())) + // Standard Error: 1_386 + .saturating_add(Weight::from_parts(1_541_963, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) @@ -127,11 +127,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `259 + c * (1 ยฑ0)` // Estimated: `6197 + c * (1 ยฑ0)` - // Minimum execution time: 42_092_000 picoseconds. - Weight::from_parts(60_502_904, 0) + // Minimum execution time: 20_820_000 picoseconds. + Weight::from_parts(16_856_317, 0) .saturating_add(Weight::from_parts(0, 6197)) - // Standard Error: 12 - .saturating_add(Weight::from_parts(1_166, 0).saturating_mul(c.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(618, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -142,8 +142,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `374` // Estimated: `6314` - // Minimum execution time: 42_216_000 picoseconds. - Weight::from_parts(49_725_000, 0) + // Minimum execution time: 18_268_000 picoseconds. + Weight::from_parts(19_400_000, 0) .saturating_add(Weight::from_parts(0, 6314)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -153,13 +153,13 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:0) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) fn v14_migration_step() -> Weight { // Proof Size summary in bytes: // Measured: `286` // Estimated: `6226` - // Minimum execution time: 189_034_000 picoseconds. - Weight::from_parts(229_724_000, 0) + // Minimum execution time: 69_044_000 picoseconds. + Weight::from_parts(71_292_000, 0) .saturating_add(Weight::from_parts(0, 6226)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -172,8 +172,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `566` // Estimated: `6506` - // Minimum execution time: 186_262_000 picoseconds. - Weight::from_parts(259_777_000, 0) + // Minimum execution time: 76_866_000 picoseconds. + Weight::from_parts(78_263_000, 0) .saturating_add(Weight::from_parts(0, 6506)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -184,8 +184,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `6283` - // Minimum execution time: 28_460_000 picoseconds. - Weight::from_parts(41_186_000, 0) + // Minimum execution time: 18_133_000 picoseconds. + Weight::from_parts(18_894_000, 0) .saturating_add(Weight::from_parts(0, 6283)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -196,8 +196,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `1561` - // Minimum execution time: 7_028_000 picoseconds. - Weight::from_parts(7_558_000, 0) + // Minimum execution time: 4_003_000 picoseconds. + Weight::from_parts(4_252_000, 0) .saturating_add(Weight::from_parts(0, 1561)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -212,8 +212,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3566` - // Minimum execution time: 81_725_000 picoseconds. - Weight::from_parts(123_823_000, 0) + // Minimum execution time: 31_479_000 picoseconds. + Weight::from_parts(32_666_000, 0) .saturating_add(Weight::from_parts(0, 3566)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -224,8 +224,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3541` - // Minimum execution time: 45_600_000 picoseconds. - Weight::from_parts(52_879_000, 0) + // Minimum execution time: 10_422_000 picoseconds. + Weight::from_parts(10_881_000, 0) .saturating_add(Weight::from_parts(0, 3541)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -237,8 +237,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3566` - // Minimum execution time: 55_065_000 picoseconds. - Weight::from_parts(66_441_000, 0) + // Minimum execution time: 12_576_000 picoseconds. + Weight::from_parts(13_038_000, 0) .saturating_add(Weight::from_parts(0, 3566)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -250,8 +250,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3541` - // Minimum execution time: 60_306_000 picoseconds. - Weight::from_parts(72_096_000, 0) + // Minimum execution time: 13_491_000 picoseconds. + Weight::from_parts(14_021_000, 0) .saturating_add(Weight::from_parts(0, 3541)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -272,12 +272,12 @@ impl pallet_contracts::WeightInfo for WeightInfo { fn call_with_code_per_byte(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `595 + c * (1 ยฑ0)` - // Estimated: `4047 + c * (1 ยฑ0)` - // Minimum execution time: 598_279_000 picoseconds. - Weight::from_parts(940_211_510, 0) - .saturating_add(Weight::from_parts(0, 4047)) - // Standard Error: 69 - .saturating_add(Weight::from_parts(2_891, 0).saturating_mul(c.into())) + // Estimated: `4049 + c * (1 ยฑ0)` + // Minimum execution time: 296_582_000 picoseconds. + Weight::from_parts(303_877_543, 0) + .saturating_add(Weight::from_parts(0, 4049)) + // Standard Error: 7 + .saturating_add(Weight::from_parts(1_040, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -287,7 +287,7 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) /// Storage: `Contracts::Nonce` (r:1 w:1) /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) @@ -301,17 +301,19 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 196608]`. /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. - fn instantiate_with_code(c: u32, _i: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `6040` - // Minimum execution time: 7_750_332_000 picoseconds. - Weight::from_parts(9_144_163_000, 0) - .saturating_add(Weight::from_parts(0, 6040)) - // Standard Error: 3_511 - .saturating_add(Weight::from_parts(193_350, 0).saturating_mul(c.into())) - // Standard Error: 658 - .saturating_add(Weight::from_parts(2_722, 0).saturating_mul(s.into())) + fn instantiate_with_code(c: u32, i: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `133` + // Estimated: `6041` + // Minimum execution time: 4_512_009_000 picoseconds. + Weight::from_parts(509_968_426, 0) + .saturating_add(Weight::from_parts(0, 6041)) + // Standard Error: 50 + .saturating_add(Weight::from_parts(49_768, 0).saturating_mul(c.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_917, 0).saturating_mul(i.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_853, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -330,20 +332,20 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate(i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `358` - // Estimated: `3829` - // Minimum execution time: 3_628_780_000 picoseconds. - Weight::from_parts(1_132_580_028, 0) - .saturating_add(Weight::from_parts(0, 3829)) - // Standard Error: 73 - .saturating_add(Weight::from_parts(3_080, 0).saturating_mul(i.into())) - // Standard Error: 73 - .saturating_add(Weight::from_parts(3_687, 0).saturating_mul(s.into())) + // Estimated: `3832` + // Minimum execution time: 2_265_891_000 picoseconds. + Weight::from_parts(504_827_274, 0) + .saturating_add(Weight::from_parts(0, 3832)) + // Standard Error: 20 + .saturating_add(Weight::from_parts(2_060, 0).saturating_mul(i.into())) + // Standard Error: 20 + .saturating_add(Weight::from_parts(1_641, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -363,8 +365,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `662` // Estimated: `4127` - // Minimum execution time: 413_814_000 picoseconds. - Weight::from_parts(540_444_000, 0) + // Minimum execution time: 210_670_000 picoseconds. + Weight::from_parts(214_220_000, 0) .saturating_add(Weight::from_parts(0, 4127)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -374,7 +376,7 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(196644), added: 199119, mode: `Measured`) /// The range of component `c` is `[0, 196608]`. @@ -382,11 +384,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3541` - // Minimum execution time: 731_106_000 picoseconds. - Weight::from_parts(173_087_578, 0) + // Minimum execution time: 275_923_000 picoseconds. + Weight::from_parts(290_951_940, 0) .saturating_add(Weight::from_parts(0, 3541)) - // Standard Error: 3_413 - .saturating_add(Weight::from_parts(173_810, 0).saturating_mul(c.into())) + // Standard Error: 28 + .saturating_add(Weight::from_parts(46_787, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -395,7 +397,7 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(196644), added: 199119, mode: `Measured`) /// The range of component `c` is `[0, 196608]`. @@ -403,11 +405,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3541` - // Minimum execution time: 905_352_000 picoseconds. - Weight::from_parts(978_396_000, 0) + // Minimum execution time: 274_931_000 picoseconds. + Weight::from_parts(311_164_124, 0) .saturating_add(Weight::from_parts(0, 3541)) - // Standard Error: 1_888 - .saturating_add(Weight::from_parts(178_935, 0).saturating_mul(c.into())) + // Standard Error: 34 + .saturating_add(Weight::from_parts(46_631, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -416,16 +418,16 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(196644), added: 199119, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `246` - // Estimated: `3711` - // Minimum execution time: 143_284_000 picoseconds. - Weight::from_parts(150_686_000, 0) - .saturating_add(Weight::from_parts(0, 3711)) + // Measured: `245` + // Estimated: `3710` + // Minimum execution time: 59_364_000 picoseconds. + Weight::from_parts(61_080_000, 0) + .saturating_add(Weight::from_parts(0, 3710)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -439,8 +441,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `486` // Estimated: `6426` - // Minimum execution time: 61_206_000 picoseconds. - Weight::from_parts(70_907_000, 0) + // Minimum execution time: 35_665_000 picoseconds. + Weight::from_parts(38_187_000, 0) .saturating_add(Weight::from_parts(0, 6426)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -450,18 +452,18 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_308_000 picoseconds. - Weight::from_parts(29_001_522, 0) + // Minimum execution time: 10_593_000 picoseconds. + Weight::from_parts(11_845_420, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_785 - .saturating_add(Weight::from_parts(159_093, 0).saturating_mul(r.into())) + // Standard Error: 31 + .saturating_add(Weight::from_parts(49_811, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_976_000 picoseconds. - Weight::from_parts(3_997_000, 0) + // Minimum execution time: 918_000 picoseconds. + Weight::from_parts(1_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Contracts::ContractInfoOf` (r:1 w:0) @@ -470,8 +472,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `288` // Estimated: `3753` - // Minimum execution time: 27_910_000 picoseconds. - Weight::from_parts(29_381_000, 0) + // Minimum execution time: 9_475_000 picoseconds. + Weight::from_parts(9_998_000, 0) .saturating_add(Weight::from_parts(0, 3753)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -481,8 +483,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `381` // Estimated: `3846` - // Minimum execution time: 30_641_000 picoseconds. - Weight::from_parts(36_411_000, 0) + // Minimum execution time: 11_410_000 picoseconds. + Weight::from_parts(11_786_000, 0) .saturating_add(Weight::from_parts(0, 3846)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -490,114 +492,111 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_119_000 picoseconds. - Weight::from_parts(2_463_000, 0) + // Minimum execution time: 1_207_000 picoseconds. + Weight::from_parts(1_270_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_177_000 picoseconds. - Weight::from_parts(1_695_000, 0) + // Minimum execution time: 523_000 picoseconds. + Weight::from_parts(575_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 878_000 picoseconds. - Weight::from_parts(1_209_000, 0) + // Minimum execution time: 420_000 picoseconds. + Weight::from_parts(458_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_864_000 picoseconds. - Weight::from_parts(2_786_000, 0) + // Minimum execution time: 925_000 picoseconds. + Weight::from_parts(949_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_gas_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_784_000 picoseconds. - Weight::from_parts(3_501_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(1_071_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `140` // Estimated: `0` - // Minimum execution time: 13_124_000 picoseconds. - Weight::from_parts(18_815_000, 0) + // Minimum execution time: 6_881_000 picoseconds. + Weight::from_parts(7_212_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_991_000 picoseconds. - Weight::from_parts(2_912_000, 0) + // Minimum execution time: 925_000 picoseconds. + Weight::from_parts(1_001_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_275_000 picoseconds. - Weight::from_parts(3_106_000, 0) + // Minimum execution time: 913_000 picoseconds. + Weight::from_parts(979_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_967_000 picoseconds. - Weight::from_parts(2_929_000, 0) + // Minimum execution time: 915_000 picoseconds. + Weight::from_parts(965_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_106_000 picoseconds. - Weight::from_parts(4_013_000, 0) + // Minimum execution time: 911_000 picoseconds. + Weight::from_parts(957_000, 0) .saturating_add(Weight::from_parts(0, 0)) } - /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) - /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: - // Measured: `67` - // Estimated: `1552` - // Minimum execution time: 14_190_000 picoseconds. - Weight::from_parts(23_309_000, 0) - .saturating_add(Weight::from_parts(0, 1552)) - .saturating_add(T::DbWeight::get().reads(1)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_462_000 picoseconds. + Weight::from_parts(2_602_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `n` is `[0, 1048572]`. fn seal_input(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_650_000 picoseconds. - Weight::from_parts(1_870_000, 0) + // Minimum execution time: 749_000 picoseconds. + Weight::from_parts(780_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(369, 0).saturating_mul(n.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(289, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048572]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_017_000 picoseconds. - Weight::from_parts(1_685_000, 0) + // Minimum execution time: 528_000 picoseconds. + Weight::from_parts(559_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2 - .saturating_add(Weight::from_parts(577, 0).saturating_mul(n.into())) + // Standard Error: 8 + .saturating_add(Weight::from_parts(403, 0).saturating_mul(n.into())) } /// Storage: `Contracts::DeletionQueueCounter` (r:1 w:1) /// Proof: `Contracts::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) @@ -610,11 +609,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `253 + n * (78 ยฑ0)` // Estimated: `3718 + n * (2553 ยฑ0)` - // Minimum execution time: 37_801_000 picoseconds. - Weight::from_parts(69_730_406, 0) + // Minimum execution time: 22_963_000 picoseconds. + Weight::from_parts(24_817_115, 0) .saturating_add(Weight::from_parts(0, 3718)) - // Standard Error: 146_532 - .saturating_add(Weight::from_parts(13_327_145, 0).saturating_mul(n.into())) + // Standard Error: 6_408 + .saturating_add(Weight::from_parts(4_920_494, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -625,23 +624,25 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_592_000 picoseconds. - Weight::from_parts(4_938_000, 0) + // Minimum execution time: 1_334_000 picoseconds. + Weight::from_parts(1_434_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `System::EventTopics` (r:4 w:4) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `t` is `[0, 4]`. /// The range of component `n` is `[0, 16384]`. - fn seal_deposit_event(t: u32, _n: u32, ) -> Weight { + fn seal_deposit_event(t: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `990 + t * (2475 ยฑ0)` - // Minimum execution time: 10_120_000 picoseconds. - Weight::from_parts(22_063_877, 0) + // Minimum execution time: 6_332_000 picoseconds. + Weight::from_parts(6_575_172, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 161_285 - .saturating_add(Weight::from_parts(7_830_971, 0).saturating_mul(t.into())) + // Standard Error: 8_440 + .saturating_add(Weight::from_parts(2_971_644, 0).saturating_mul(t.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(31, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) .saturating_add(Weight::from_parts(0, 2475).saturating_mul(t.into())) @@ -651,11 +652,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_459_000 picoseconds. - Weight::from_parts(2_393_000, 0) + // Minimum execution time: 658_000 picoseconds. + Weight::from_parts(680_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 5 - .saturating_add(Weight::from_parts(1_958, 0).saturating_mul(i.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_176, 0).saturating_mul(i.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -663,8 +664,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `16623` // Estimated: `16623` - // Minimum execution time: 35_471_000 picoseconds. - Weight::from_parts(49_182_000, 0) + // Minimum execution time: 17_676_000 picoseconds. + Weight::from_parts(18_453_000, 0) .saturating_add(Weight::from_parts(0, 16623)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -674,8 +675,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26633` // Estimated: `26633` - // Minimum execution time: 116_966_000 picoseconds. - Weight::from_parts(180_109_000, 0) + // Minimum execution time: 56_929_000 picoseconds. + Weight::from_parts(58_746_000, 0) .saturating_add(Weight::from_parts(0, 26633)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -685,8 +686,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `16623` // Estimated: `16623` - // Minimum execution time: 55_840_000 picoseconds. - Weight::from_parts(64_704_000, 0) + // Minimum execution time: 20_576_000 picoseconds. + Weight::from_parts(21_413_000, 0) .saturating_add(Weight::from_parts(0, 16623)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -697,8 +698,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26633` // Estimated: `26633` - // Minimum execution time: 135_084_000 picoseconds. - Weight::from_parts(192_111_000, 0) + // Minimum execution time: 60_672_000 picoseconds. + Weight::from_parts(61_921_000, 0) .saturating_add(Weight::from_parts(0, 26633)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -711,13 +712,13 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `255 + o * (1 ยฑ0)` // Estimated: `254 + o * (1 ยฑ0)` - // Minimum execution time: 28_272_000 picoseconds. - Weight::from_parts(41_511_367, 0) + // Minimum execution time: 14_785_000 picoseconds. + Weight::from_parts(14_955_688, 0) .saturating_add(Weight::from_parts(0, 254)) - // Standard Error: 46 - .saturating_add(Weight::from_parts(563, 0).saturating_mul(n.into())) - // Standard Error: 46 - .saturating_add(Weight::from_parts(175, 0).saturating_mul(o.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(267, 0).saturating_mul(n.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(80, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) @@ -729,11 +730,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `253 + n * (1 ยฑ0)` // Estimated: `253 + n * (1 ยฑ0)` - // Minimum execution time: 23_832_000 picoseconds. - Weight::from_parts(33_324_710, 0) + // Minimum execution time: 12_267_000 picoseconds. + Weight::from_parts(14_181_848, 0) .saturating_add(Weight::from_parts(0, 253)) - // Standard Error: 41 - .saturating_add(Weight::from_parts(724, 0).saturating_mul(n.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(108, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -745,11 +746,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `253 + n * (1 ยฑ0)` // Estimated: `253 + n * (1 ยฑ0)` - // Minimum execution time: 24_635_000 picoseconds. - Weight::from_parts(38_963_011, 0) + // Minimum execution time: 10_717_000 picoseconds. + Weight::from_parts(13_546_935, 0) .saturating_add(Weight::from_parts(0, 253)) - // Standard Error: 53 - .saturating_add(Weight::from_parts(1_484, 0).saturating_mul(n.into())) + // Standard Error: 4 + .saturating_add(Weight::from_parts(594, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -760,11 +761,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `253 + n * (1 ยฑ0)` // Estimated: `253 + n * (1 ยฑ0)` - // Minimum execution time: 21_265_000 picoseconds. - Weight::from_parts(33_392_946, 0) + // Minimum execution time: 10_186_000 picoseconds. + Weight::from_parts(12_543_395, 0) .saturating_add(Weight::from_parts(0, 253)) - // Standard Error: 32 - .saturating_add(Weight::from_parts(189, 0).saturating_mul(n.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(102, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -775,11 +776,11 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `253 + n * (1 ยฑ0)` // Estimated: `253 + n * (1 ยฑ0)` - // Minimum execution time: 23_106_000 picoseconds. - Weight::from_parts(34_693_243, 0) + // Minimum execution time: 13_093_000 picoseconds. + Weight::from_parts(15_488_719, 0) .saturating_add(Weight::from_parts(0, 253)) - // Standard Error: 58 - .saturating_add(Weight::from_parts(2_231, 0).saturating_mul(n.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(577, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -788,40 +789,40 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_236_000 picoseconds. - Weight::from_parts(8_026_000, 0) + // Minimum execution time: 2_147_000 picoseconds. + Weight::from_parts(2_251_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_977_000 picoseconds. - Weight::from_parts(15_511_000, 0) + // Minimum execution time: 3_423_000 picoseconds. + Weight::from_parts(3_678_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_950_000 picoseconds. - Weight::from_parts(10_463_000, 0) + // Minimum execution time: 4_315_000 picoseconds. + Weight::from_parts(4_395_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_633_000 picoseconds. - Weight::from_parts(18_971_000, 0) + // Minimum execution time: 5_249_000 picoseconds. + Weight::from_parts(5_514_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_228_000 picoseconds. - Weight::from_parts(8_008_000, 0) + // Minimum execution time: 1_724_000 picoseconds. + Weight::from_parts(1_875_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `n` is `[0, 16384]`. @@ -830,62 +831,62 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_269_000 picoseconds. - Weight::from_parts(7_071_746, 0) + // Minimum execution time: 6_793_000 picoseconds. + Weight::from_parts(3_321_030, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 20 - .saturating_add(Weight::from_parts(696, 0).saturating_mul(n.into())) - // Standard Error: 20 - .saturating_add(Weight::from_parts(745, 0).saturating_mul(o.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(235, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(291, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 16384]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_691_000 picoseconds. - Weight::from_parts(8_805_636, 0) + // Minimum execution time: 2_757_000 picoseconds. + Weight::from_parts(3_167_046, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 17 - .saturating_add(Weight::from_parts(777, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(294, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 16384]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_096_000 picoseconds. - Weight::from_parts(7_130_899, 0) + // Minimum execution time: 2_652_000 picoseconds. + Weight::from_parts(2_917_086, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 17 - .saturating_add(Weight::from_parts(793, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(291, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 16384]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_030_000 picoseconds. - Weight::from_parts(8_009_175, 0) + // Minimum execution time: 2_339_000 picoseconds. + Weight::from_parts(2_655_617, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 14 - .saturating_add(Weight::from_parts(308, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(146, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 16384]`. fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_453_000 picoseconds. - Weight::from_parts(26_210_061, 0) + // Minimum execution time: 10_269_000 picoseconds. + Weight::from_parts(10_566_282, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_transfer() -> Weight { // Proof Size summary in bytes: // Measured: `140` // Estimated: `0` - // Minimum execution time: 22_788_000 picoseconds. - Weight::from_parts(33_489_000, 0) + // Minimum execution time: 12_641_000 picoseconds. + Weight::from_parts(13_046_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) @@ -898,15 +899,17 @@ impl pallet_contracts::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `t` is `[0, 1]`. /// The range of component `i` is `[0, 1048576]`. - fn seal_call(t: u32, _i: u32, ) -> Weight { + fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `554 + t * (280 ยฑ0)` // Estimated: `4019 + t * (2150 ยฑ0)` - // Minimum execution time: 264_355_000 picoseconds. - Weight::from_parts(456_785_979, 0) + // Minimum execution time: 151_637_000 picoseconds. + Weight::from_parts(148_196_981, 0) .saturating_add(Weight::from_parts(0, 4019)) - // Standard Error: 5_057_234 - .saturating_add(Weight::from_parts(130_955_597, 0).saturating_mul(t.into())) + // Standard Error: 209_335 + .saturating_add(Weight::from_parts(56_092_632, 0).saturating_mul(t.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(8, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -921,8 +924,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `364` // Estimated: `3829` - // Minimum execution time: 266_346_000 picoseconds. - Weight::from_parts(351_536_000, 0) + // Minimum execution time: 134_320_000 picoseconds. + Weight::from_parts(138_742_000, 0) .saturating_add(Weight::from_parts(0, 3829)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -941,14 +944,14 @@ impl pallet_contracts::WeightInfo for WeightInfo { fn seal_instantiate(i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `610` - // Estimated: `4065` - // Minimum execution time: 2_854_785_000 picoseconds. - Weight::from_parts(432_225_809, 0) - .saturating_add(Weight::from_parts(0, 4065)) - // Standard Error: 60 - .saturating_add(Weight::from_parts(3_091, 0).saturating_mul(i.into())) - // Standard Error: 60 - .saturating_add(Weight::from_parts(3_827, 0).saturating_mul(s.into())) + // Estimated: `4062` + // Minimum execution time: 1_771_578_000 picoseconds. + Weight::from_parts(232_556_818, 0) + .saturating_add(Weight::from_parts(0, 4062)) + // Standard Error: 13 + .saturating_add(Weight::from_parts(1_502, 0).saturating_mul(i.into())) + // Standard Error: 13 + .saturating_add(Weight::from_parts(1_792, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -957,70 +960,70 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_884_000 picoseconds. - Weight::from_parts(5_267_000, 0) + // Minimum execution time: 1_431_000 picoseconds. + Weight::from_parts(1_525_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 84 - .saturating_add(Weight::from_parts(9_670, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_418, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_796_000 picoseconds. - Weight::from_parts(4_493_000, 0) + // Minimum execution time: 1_703_000 picoseconds. + Weight::from_parts(1_802_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 69 - .saturating_add(Weight::from_parts(7_929, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(3_162, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_907_000 picoseconds. - Weight::from_parts(3_520_000, 0) + // Minimum execution time: 1_159_000 picoseconds. + Weight::from_parts(1_181_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_016, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_230, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_663_000 picoseconds. - Weight::from_parts(4_299_000, 0) + // Minimum execution time: 996_000 picoseconds. + Weight::from_parts(1_065_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_043, 0).saturating_mul(n.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_231, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 196353]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 93_472_000 picoseconds. - Weight::from_parts(115_092_569, 0) + // Minimum execution time: 48_553_000 picoseconds. + Weight::from_parts(31_808_174, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 114 - .saturating_add(Weight::from_parts(9_288, 0).saturating_mul(n.into())) + // Standard Error: 16 + .saturating_add(Weight::from_parts(4_903, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 74_298_000 picoseconds. - Weight::from_parts(105_614_000, 0) + // Minimum execution time: 46_257_000 picoseconds. + Weight::from_parts(47_563_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 33_386_000 picoseconds. - Weight::from_parts(35_232_000, 0) + // Minimum execution time: 13_050_000 picoseconds. + Weight::from_parts(13_201_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) @@ -1031,8 +1034,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `364` // Estimated: `3829` - // Minimum execution time: 74_867_000 picoseconds. - Weight::from_parts(78_867_000, 0) + // Minimum execution time: 29_290_000 picoseconds. + Weight::from_parts(30_325_000, 0) .saturating_add(Weight::from_parts(0, 3829)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -1043,8 +1046,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `3754` - // Minimum execution time: 35_571_000 picoseconds. - Weight::from_parts(37_257_000, 0) + // Minimum execution time: 13_339_000 picoseconds. + Weight::from_parts(13_785_000, 0) .saturating_add(Weight::from_parts(0, 3754)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -1055,8 +1058,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `3558` - // Minimum execution time: 21_226_000 picoseconds. - Weight::from_parts(34_769_000, 0) + // Minimum execution time: 11_808_000 picoseconds. + Weight::from_parts(12_330_000, 0) .saturating_add(Weight::from_parts(0, 3558)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -1065,16 +1068,16 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_241_000, 0) + // Minimum execution time: 461_000 picoseconds. + Weight::from_parts(521_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn seal_account_reentrance_count() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_746_000 picoseconds. - Weight::from_parts(2_199_000, 0) + // Minimum execution time: 469_000 picoseconds. + Weight::from_parts(529_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Contracts::Nonce` (r:1 w:0) @@ -1083,8 +1086,8 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `1638` - // Minimum execution time: 8_152_000 picoseconds. - Weight::from_parts(14_024_000, 0) + // Minimum execution time: 4_619_000 picoseconds. + Weight::from_parts(4_894_000, 0) .saturating_add(Weight::from_parts(0, 1638)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -1093,10 +1096,10 @@ impl pallet_contracts::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_803_000 picoseconds. - Weight::from_parts(1_010_834, 0) + // Minimum execution time: 1_089_000 picoseconds. + Weight::from_parts(1_229_416, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 753 - .saturating_add(Weight::from_parts(65_093, 0).saturating_mul(r.into())) + // Standard Error: 22 + .saturating_add(Weight::from_parts(7_227, 0).saturating_mul(r.into())) } } diff --git a/runtime/kreivo/src/weights/pallet_contracts_store.rs b/runtime/kreivo/src/weights/pallet_contracts_store.rs new file mode 100644 index 000000000..a92b3f75e --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_contracts_store.rs @@ -0,0 +1,117 @@ + +//! Autogenerated weights for `pallet_contracts_store` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_contracts_store +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_contracts_store`. +pub struct WeightInfo(PhantomData); +impl pallet_contracts_store::WeightInfo for WeightInfo { + /// Storage: `ContractsStore::NextAppId` (r:1 w:1) + /// Proof: `ContractsStore::NextAppId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ContractsStore::Apps` (r:1 w:1) + /// Proof: `ContractsStore::Apps` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionRoleOf` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionRoleOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionAccount` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionAccount` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + fn publish() -> Weight { + // Proof Size summary in bytes: + // Measured: `82` + // Estimated: `3605` + // Minimum execution time: 28_020_000 picoseconds. + Weight::from_parts(29_005_000, 0) + .saturating_add(Weight::from_parts(0, 3605)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `ContractsStore::Apps` (r:1 w:1) + /// Proof: `ContractsStore::Apps` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn set_parameters() -> Weight { + // Proof Size summary in bytes: + // Measured: `225` + // Estimated: `3605` + // Minimum execution time: 17_015_000 picoseconds. + Weight::from_parts(17_572_000, 0) + .saturating_add(Weight::from_parts(0, 3605)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ContractsStore::Apps` (r:1 w:1) + /// Proof: `ContractsStore::Apps` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn publish_upgrade() -> Weight { + // Proof Size summary in bytes: + // Measured: `225` + // Estimated: `3605` + // Minimum execution time: 14_232_000 picoseconds. + Weight::from_parts(14_800_000, 0) + .saturating_add(Weight::from_parts(0, 3605)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ContractsStore::Apps` (r:1 w:1) + /// Proof: `ContractsStore::Apps` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + /// Storage: `ContractsStore::NextLicenseId` (r:1 w:1) + /// Proof: `ContractsStore::NextLicenseId` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:1) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:1 w:0) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemConfigOf` (r:1 w:1) + /// Proof: `ListingsCatalog::ItemConfigOf` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:3 w:2) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Account` (r:0 w:2) + /// Proof: `ListingsCatalog::Account` (`max_values`: None, `max_size`: Some(94), added: 2569, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemPriceOf` (r:0 w:1) + /// Proof: `ListingsCatalog::ItemPriceOf` (`max_values`: None, `max_size`: Some(95), added: 2570, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::PendingSwapOf` (r:0 w:1) + /// Proof: `ListingsCatalog::PendingSwapOf` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + fn request_license() -> Weight { + // Proof Size summary in bytes: + // Measured: `674` + // Estimated: `9870` + // Minimum execution time: 163_486_000 picoseconds. + Weight::from_parts(167_996_000, 0) + .saturating_add(Weight::from_parts(0, 9870)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(12)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_gas_transaction_payment.rs b/runtime/kreivo/src/weights/pallet_gas_transaction_payment.rs new file mode 100644 index 000000000..15b8758d6 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_gas_transaction_payment.rs @@ -0,0 +1,59 @@ + +//! Autogenerated weights for `pallet_gas_transaction_payment` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_gas_transaction_payment +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_gas_transaction_payment`. +pub struct WeightInfo(PhantomData); +impl pallet_gas_transaction_payment::WeightInfo for WeightInfo { + /// Storage: `CommunityMemberships::Account` (r:1 w:0) + /// Proof: `CommunityMemberships::Account` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `CommunityMemberships::Attribute` (r:3 w:2) + /// Proof: `CommunityMemberships::Attribute` (`max_values`: None, `max_size`: Some(477), added: 2952, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `CommunityMemberships::Collection` (r:1 w:1) + /// Proof: `CommunityMemberships::Collection` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) + fn charge_transaction_payment() -> Weight { + // Proof Size summary in bytes: + // Measured: `709` + // Estimated: `9846` + // Minimum execution time: 151_170_000 picoseconds. + Weight::from_parts(153_179_000, 0) + .saturating_add(Weight::from_parts(0, 9846)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_listings.rs b/runtime/kreivo/src/weights/pallet_listings.rs new file mode 100644 index 000000000..3c4c181b7 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_listings.rs @@ -0,0 +1,202 @@ + +//! Autogenerated weights for `pallet_listings` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_listings +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_listings`. +pub struct WeightInfo(PhantomData); +impl pallet_listings::WeightInfo for WeightInfo { + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionRoleOf` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionRoleOf` (`max_values`: None, `max_size`: Some(71), added: 2546, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionAccount` (r:0 w:1) + /// Proof: `ListingsCatalog::CollectionAccount` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + fn create_inventory() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `3551` + // Minimum execution time: 27_359_000 picoseconds. + Weight::from_parts(28_328_000, 0) + .saturating_add(Weight::from_parts(0, 3551)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:1 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + fn archive_inventory() -> Weight { + // Proof Size summary in bytes: + // Measured: `219` + // Estimated: `3950` + // Minimum execution time: 40_324_000 picoseconds. + Weight::from_parts(42_295_000, 0) + .saturating_add(Weight::from_parts(0, 3950)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:3 w:2) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:1) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:1 w:0) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemConfigOf` (r:1 w:1) + /// Proof: `ListingsCatalog::ItemConfigOf` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Account` (r:0 w:1) + /// Proof: `ListingsCatalog::Account` (`max_values`: None, `max_size`: Some(94), added: 2569, mode: `MaxEncodedLen`) + /// The range of component `q` is `[1, 216]`. + fn publish_item(q: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `410` + // Estimated: `9870` + // Minimum execution time: 116_758_000 picoseconds. + Weight::from_parts(120_516_367, 0) + .saturating_add(Weight::from_parts(0, 9870)) + // Standard Error: 1_501 + .saturating_add(Weight::from_parts(5_289, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:2 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + fn set_item_price() -> Weight { + // Proof Size summary in bytes: + // Measured: `533` + // Estimated: `6910` + // Minimum execution time: 68_375_000 picoseconds. + Weight::from_parts(70_371_000, 0) + .saturating_add(Weight::from_parts(0, 6910)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + + fn clear_item_price() -> Weight { + // Proof Size summary in bytes: + // Measured: `533` + // Estimated: `6910` + // Minimum execution time: 68_375_000 picoseconds. + Weight::from_parts(70_371_000, 0) + .saturating_add(Weight::from_parts(0, 6910)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:2 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + fn mark_item_can_transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `524` + // Estimated: `6910` + // Minimum execution time: 52_472_000 picoseconds. + Weight::from_parts(53_629_000, 0) + .saturating_add(Weight::from_parts(0, 6910)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:3 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + fn mark_item_not_for_resale() -> Weight { + // Proof Size summary in bytes: + // Measured: `533` + // Estimated: `9870` + // Minimum execution time: 61_894_000 picoseconds. + Weight::from_parts(63_441_000, 0) + .saturating_add(Weight::from_parts(0, 9870)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:3 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// The range of component `p` is `[1, 59]`. + /// The range of component `q` is `[1, 251]`. + fn set_item_attribute(p: u32, q: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `533` + // Estimated: `9870` + // Minimum execution time: 58_392_000 picoseconds. + Weight::from_parts(59_944_382, 0) + .saturating_add(Weight::from_parts(0, 9870)) + // Standard Error: 1_215 + .saturating_add(Weight::from_parts(12_741, 0).saturating_mul(p.into())) + // Standard Error: 284 + .saturating_add(Weight::from_parts(2_035, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:3 w:1) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:1 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// The range of component `p` is `[1, 59]`. + /// The range of component `q` is `[1, 251]`. + fn clear_item_attribute(p: u32, q: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `579 + p * (1 ยฑ0) + q * (1 ยฑ0)` + // Estimated: `9870` + // Minimum execution time: 54_111_000 picoseconds. + Weight::from_parts(55_681_786, 0) + .saturating_add(Weight::from_parts(0, 9870)) + // Standard Error: 1_226 + .saturating_add(Weight::from_parts(22_803, 0).saturating_mul(p.into())) + // Standard Error: 286 + .saturating_add(Weight::from_parts(1_275, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_message_queue.rs b/runtime/kreivo/src/weights/pallet_message_queue.rs new file mode 100644 index 000000000..be4955661 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_message_queue.rs @@ -0,0 +1,186 @@ + +//! Autogenerated weights for `pallet_message_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_message_queue +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_message_queue`. +pub struct WeightInfo(PhantomData); +impl pallet_message_queue::WeightInfo for WeightInfo { + /// Storage: `MessageQueue::ServiceHead` (r:1 w:0) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn ready_ring_knit() -> Weight { + // Proof Size summary in bytes: + // Measured: `294` + // Estimated: `6044` + // Minimum execution time: 20_667_000 picoseconds. + Weight::from_parts(21_506_000, 0) + .saturating_add(Weight::from_parts(0, 6044)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + fn ready_ring_unknit() -> Weight { + // Proof Size summary in bytes: + // Measured: `289` + // Estimated: `6044` + // Minimum execution time: 18_833_000 picoseconds. + Weight::from_parts(19_575_000, 0) + .saturating_add(Weight::from_parts(0, 6044)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn service_queue_base() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3517` + // Minimum execution time: 7_146_000 picoseconds. + Weight::from_parts(7_520_000, 0) + .saturating_add(Weight::from_parts(0, 3517)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn service_page_base_completion() -> Weight { + // Proof Size summary in bytes: + // Measured: `143` + // Estimated: `69050` + // Minimum execution time: 9_630_000 picoseconds. + Weight::from_parts(10_055_000, 0) + .saturating_add(Weight::from_parts(0, 69050)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn service_page_base_no_completion() -> Weight { + // Proof Size summary in bytes: + // Measured: `143` + // Estimated: `69050` + // Minimum execution time: 10_156_000 picoseconds. + Weight::from_parts(10_485_000, 0) + .saturating_add(Weight::from_parts(0, 69050)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `MessageQueue::BookStateFor` (r:0 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:0 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn service_page_item() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 124_192_000 picoseconds. + Weight::from_parts(125_092_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn bump_service_head() -> Weight { + // Proof Size summary in bytes: + // Measured: `242` + // Estimated: `3517` + // Minimum execution time: 10_857_000 picoseconds. + Weight::from_parts(11_414_000, 0) + .saturating_add(Weight::from_parts(0, 3517)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::ServiceHead` (r:0 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + fn set_service_head() -> Weight { + // Proof Size summary in bytes: + // Measured: `232` + // Estimated: `3517` + // Minimum execution time: 9_135_000 picoseconds. + Weight::from_parts(9_650_000, 0) + .saturating_add(Weight::from_parts(0, 3517)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn reap_page() -> Weight { + // Proof Size summary in bytes: + // Measured: `65738` + // Estimated: `69050` + // Minimum execution time: 62_362_000 picoseconds. + Weight::from_parts(63_470_000, 0) + .saturating_add(Weight::from_parts(0, 69050)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn execute_overweight_page_removed() -> Weight { + // Proof Size summary in bytes: + // Measured: `65738` + // Estimated: `69050` + // Minimum execution time: 80_367_000 picoseconds. + Weight::from_parts(81_982_000, 0) + .saturating_add(Weight::from_parts(0, 69050)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::Pages` (r:1 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn execute_overweight_page_updated() -> Weight { + // Proof Size summary in bytes: + // Measured: `65738` + // Estimated: `69050` + // Minimum execution time: 94_715_000 picoseconds. + Weight::from_parts(95_864_000, 0) + .saturating_add(Weight::from_parts(0, 69050)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_multisig.rs b/runtime/kreivo/src/weights/pallet_multisig.rs index b5906dba0..ac2b2da84 100644 --- a/runtime/kreivo/src/weights/pallet_multisig.rs +++ b/runtime/kreivo/src/weights/pallet_multisig.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_multisig` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -41,29 +41,34 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 37_618_000 picoseconds. - Weight::from_parts(60_101_621, 0) + // Minimum execution time: 18_734_000 picoseconds. + Weight::from_parts(19_180_111, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 88 - .saturating_add(Weight::from_parts(1_839, 0).saturating_mul(z.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(450, 0).saturating_mul(z.into())) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `329 + s * (2 ยฑ0)` - // Estimated: `6811` - // Minimum execution time: 98_967_000 picoseconds. - Weight::from_parts(137_307_320, 0) + // Measured: `405 + s * (2 ยฑ0)` + // Estimated: `6811 + s * (2 ยฑ0)` + // Minimum execution time: 61_732_000 picoseconds. + Weight::from_parts(50_898_965, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 23_122 - .saturating_add(Weight::from_parts(516_251, 0).saturating_mul(s.into())) - // Standard Error: 226 - .saturating_add(Weight::from_parts(2_516, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 994 + .saturating_add(Weight::from_parts(135_898, 0).saturating_mul(s.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_904, 0).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2).saturating_mul(s.into())) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) @@ -73,13 +78,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `6811` - // Minimum execution time: 66_848_000 picoseconds. - Weight::from_parts(68_256_595, 0) + // Minimum execution time: 35_095_000 picoseconds. + Weight::from_parts(24_917_142, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 15_025 - .saturating_add(Weight::from_parts(553_835, 0).saturating_mul(s.into())) - // Standard Error: 147 - .saturating_add(Weight::from_parts(2_772, 0).saturating_mul(z.into())) + // Standard Error: 514 + .saturating_add(Weight::from_parts(118_077, 0).saturating_mul(s.into())) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_890, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,30 +98,35 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (33 ยฑ0)` // Estimated: `6811` - // Minimum execution time: 109_526_000 picoseconds. - Weight::from_parts(118_879_159, 0) + // Minimum execution time: 64_296_000 picoseconds. + Weight::from_parts(50_255_454, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 19_168 - .saturating_add(Weight::from_parts(759_217, 0).saturating_mul(s.into())) - // Standard Error: 187 - .saturating_add(Weight::from_parts(4_186, 0).saturating_mul(z.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_parts(154_640, 0).saturating_mul(s.into())) + // Standard Error: 9 + .saturating_add(Weight::from_parts(1_951, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `329 + s * (2 ยฑ0)` - // Estimated: `6811` - // Minimum execution time: 76_299_000 picoseconds. - Weight::from_parts(124_299_912, 0) + // Measured: `405 + s * (2 ยฑ0)` + // Estimated: `6811 + s * (2 ยฑ0)` + // Minimum execution time: 46_750_000 picoseconds. + Weight::from_parts(48_852_424, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 26_563 - .saturating_add(Weight::from_parts(492_672, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1_092 + .saturating_add(Weight::from_parts(140_306, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2).saturating_mul(s.into())) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) @@ -125,11 +135,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `6811` - // Minimum execution time: 40_936_000 picoseconds. - Weight::from_parts(62_932_046, 0) + // Minimum execution time: 21_657_000 picoseconds. + Weight::from_parts(23_326_146, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 15_231 - .saturating_add(Weight::from_parts(494_711, 0).saturating_mul(s.into())) + // Standard Error: 653 + .saturating_add(Weight::from_parts(118_020, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -140,11 +150,26 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `520 + s * (1 ยฑ0)` // Estimated: `6811` - // Minimum execution time: 75_927_000 picoseconds. - Weight::from_parts(119_773_947, 0) + // Minimum execution time: 42_393_000 picoseconds. + Weight::from_parts(44_814_364, 0) + .saturating_add(Weight::from_parts(0, 6811)) + // Standard Error: 950 + .saturating_add(Weight::from_parts(129_833, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) + /// The range of component `s` is `[2, 100]`. + fn poke_deposit(s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `520 + s * (1 ยฑ0)` + // Estimated: `6811` + // Minimum execution time: 40_832_000 picoseconds. + Weight::from_parts(42_597_760, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 20_671 - .saturating_add(Weight::from_parts(559_233, 0).saturating_mul(s.into())) + // Standard Error: 851 + .saturating_add(Weight::from_parts(129_542, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/kreivo/src/weights/pallet_orders.rs b/runtime/kreivo/src/weights/pallet_orders.rs new file mode 100644 index 000000000..b94d6b472 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_orders.rs @@ -0,0 +1,192 @@ + +//! Autogenerated weights for `pallet_orders` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_orders +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_orders`. +pub struct WeightInfo(PhantomData); +impl pallet_orders::WeightInfo for WeightInfo { + /// Storage: `Orders::Cart` (r:1 w:1) + /// Proof: `Orders::Cart` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) + /// Storage: `Orders::NextOrderId` (r:1 w:1) + /// Proof: `Orders::NextOrderId` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:64 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:64 w:0) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `Orders::Order` (r:0 w:1) + /// Proof: `Orders::Order` (`max_values`: None, `max_size`: Some(5819), added: 8294, mode: `MaxEncodedLen`) + /// The range of component `p` is `[1, 5]`. + /// The range of component `q` is `[1, 64]`. + fn create_cart(p: u32, q: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `479 + q * (260 ยฑ0)` + // Estimated: `3554 + q * (2960 ยฑ0)` + // Minimum execution time: 48_289_000 picoseconds. + Weight::from_parts(39_755_946, 0) + .saturating_add(Weight::from_parts(0, 3554)) + // Standard Error: 92_670 + .saturating_add(Weight::from_parts(51_674, 0).saturating_mul(p.into())) + // Standard Error: 6_687 + .saturating_add(Weight::from_parts(13_691_754, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(q.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 2960).saturating_mul(q.into())) + } + /// Storage: `Orders::Order` (r:1 w:1) + /// Proof: `Orders::Order` (`max_values`: None, `max_size`: Some(5819), added: 8294, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:64 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:64 w:0) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// The range of component `q` is `[1, 64]`. + fn set_cart_items(q: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `596 + q * (260 ยฑ0)` + // Estimated: `9284 + q * (2960 ยฑ0)` + // Minimum execution time: 36_150_000 picoseconds. + Weight::from_parts(27_660_112, 0) + .saturating_add(Weight::from_parts(0, 9284)) + // Standard Error: 9_456 + .saturating_add(Weight::from_parts(13_602_505, 0).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(q.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2960).saturating_mul(q.into())) + } + /// Storage: `Orders::Order` (r:1 w:1) + /// Proof: `Orders::Order` (`max_values`: None, `max_size`: Some(5819), added: 8294, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:64 w:0) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:128 w:64) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:1 w:0) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemConfigOf` (r:64 w:0) + /// Proof: `ListingsCatalog::ItemConfigOf` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `Orders::Cart` (r:1 w:1) + /// Proof: `Orders::Cart` (`max_values`: None, `max_size`: Some(89), added: 2564, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn checkout() -> Weight { + // Proof Size summary in bytes: + // Measured: `23076` + // Estimated: `379870` + // Minimum execution time: 3_267_966_000 picoseconds. + Weight::from_parts(3_280_710_000, 0) + .saturating_add(Weight::from_parts(0, 379870)) + .saturating_add(T::DbWeight::get().reads(264)) + .saturating_add(T::DbWeight::get().writes(69)) + } + /// Storage: `Orders::Order` (r:1 w:1) + /// Proof: `Orders::Order` (`max_values`: None, `max_size`: Some(5819), added: 8294, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:64 w:64) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn cancel() -> Weight { + // Proof Size summary in bytes: + // Measured: `13928` + // Estimated: `190430` + // Minimum execution time: 1_392_284_000 picoseconds. + Weight::from_parts(1_403_799_000, 0) + .saturating_add(Weight::from_parts(0, 190430)) + .saturating_add(T::DbWeight::get().reads(68)) + .saturating_add(T::DbWeight::get().writes(68)) + } + /// Storage: `Orders::Order` (r:1 w:1) + /// Proof: `Orders::Order` (`max_values`: None, `max_size`: Some(5819), added: 8294, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Item` (r:64 w:64) + /// Proof: `ListingsCatalog::Item` (`max_values`: None, `max_size`: Some(164), added: 2639, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Attribute` (r:128 w:64) + /// Proof: `ListingsCatalog::Attribute` (`max_values`: None, `max_size`: Some(485), added: 2960, mode: `MaxEncodedLen`) + /// Storage: `PaymentIndices::Index` (r:1 w:1) + /// Proof: `PaymentIndices::Index` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Payments::Payment` (r:64 w:64) + /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:1) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:2) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) + /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:2 w:2) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Collection` (r:1 w:1) + /// Proof: `ListingsCatalog::Collection` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::CollectionConfigOf` (r:1 w:0) + /// Proof: `ListingsCatalog::CollectionConfigOf` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemConfigOf` (r:64 w:0) + /// Proof: `ListingsCatalog::ItemConfigOf` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `Orders::Payment` (r:0 w:64) + /// Proof: `Orders::Payment` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::Account` (r:0 w:128) + /// Proof: `ListingsCatalog::Account` (`max_values`: None, `max_size`: Some(94), added: 2569, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::ItemPriceOf` (r:0 w:64) + /// Proof: `ListingsCatalog::ItemPriceOf` (`max_values`: None, `max_size`: Some(95), added: 2570, mode: `MaxEncodedLen`) + /// Storage: `ListingsCatalog::PendingSwapOf` (r:0 w:64) + /// Proof: `ListingsCatalog::PendingSwapOf` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + /// Storage: `Payments::PaymentParties` (r:0 w:64) + /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + fn pay() -> Weight { + // Proof Size summary in bytes: + // Measured: `28521` + // Estimated: `482782` + // Minimum execution time: 13_331_609_000 picoseconds. + Weight::from_parts(13_373_345_000, 0) + .saturating_add(Weight::from_parts(0, 482782)) + .saturating_add(T::DbWeight::get().reads(335)) + .saturating_add(T::DbWeight::get().writes(587)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_pass.rs b/runtime/kreivo/src/weights/pallet_pass.rs index 032f7fe04..8fdbddf81 100644 --- a/runtime/kreivo/src/weights/pallet_pass.rs +++ b/runtime/kreivo/src/weights/pallet_pass.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_pass` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -36,60 +36,117 @@ use core::marker::PhantomData; /// Weight functions for `pallet_pass`. pub struct WeightInfo(PhantomData); impl pallet_pass::WeightInfo for WeightInfo { + /// Storage: `Pass::RegistrarConsiderations` (r:1 w:1) + /// Proof: `Pass::RegistrarConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Pass::DeviceConsiderations` (r:1 w:1) + /// Proof: `Pass::DeviceConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// Storage: `Pass::Devices` (r:0 w:1) /// Proof: `Pass::Devices` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`) fn register() -> Weight { // Proof Size summary in bytes: - // Measured: `0` + // Measured: `76` // Estimated: `3593` - // Minimum execution time: 41_325_000 picoseconds. - Weight::from_parts(53_969_000, 0) + // Minimum execution time: 31_066_000 picoseconds. + Weight::from_parts(31_859_000, 0) .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) } - - fn claim() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - - fn unreserve_uninitialized_account() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - + /// Storage: `Pass::Devices` (r:2 w:0) + /// Proof: `Pass::Devices` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`) fn authenticate() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + // Proof Size summary in bytes: + // Measured: `281` + // Estimated: `6380` + // Minimum execution time: 15_127_000 picoseconds. + Weight::from_parts(15_802_000, 0) + .saturating_add(Weight::from_parts(0, 6380)) + .saturating_add(T::DbWeight::get().reads(2)) } - + /// Storage: `Pass::Devices` (r:1 w:1) + /// Proof: `Pass::Devices` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`) + /// Storage: `Pass::DeviceConsiderations` (r:1 w:1) + /// Proof: `Pass::DeviceConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `MaxEncodedLen`) fn add_device() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + // Proof Size summary in bytes: + // Measured: `448` + // Estimated: `3685` + // Minimum execution time: 75_329_000 picoseconds. + Weight::from_parts(76_512_000, 0) + .saturating_add(Weight::from_parts(0, 3685)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } - - fn dispatch() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + /// Storage: `Pass::Devices` (r:2 w:1) + /// Proof: `Pass::Devices` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`) + /// Storage: `Pass::DeviceConsiderations` (r:1 w:1) + /// Proof: `Pass::DeviceConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `MaxEncodedLen`) + fn remove_device() -> Weight { + // Proof Size summary in bytes: + // Measured: `559` + // Estimated: `6380` + // Minimum execution time: 74_552_000 picoseconds. + Weight::from_parts(76_402_000, 0) + .saturating_add(Weight::from_parts(0, 6380)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) } - + /// Storage: `Pass::Devices` (r:1 w:0) + /// Proof: `Pass::Devices` (`max_values`: None, `max_size`: Some(220), added: 2695, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Pass::SessionKeyConsiderations` (r:1 w:1) + /// Proof: `Pass::SessionKeyConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `Pass::SessionKeys` (r:1 w:1) + /// Proof: `Pass::SessionKeys` (`max_values`: None, `max_size`: Some(84), added: 2559, mode: `MaxEncodedLen`) + /// Storage: `Pass::CounterForSessionKeys` (r:1 w:1) + /// Proof: `Pass::CounterForSessionKeys` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn add_session_key() -> Weight { + // Proof Size summary in bytes: + // Measured: `355` + // Estimated: `159279` + // Minimum execution time: 57_380_000 picoseconds. + Weight::from_parts(58_728_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `Pass::SessionKeys` (r:1 w:1) + /// Proof: `Pass::SessionKeys` (`max_values`: None, `max_size`: Some(84), added: 2559, mode: `MaxEncodedLen`) + /// Storage: `Pass::SessionKeyConsiderations` (r:1 w:1) + /// Proof: `Pass::SessionKeyConsiderations` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `Pass::CounterForSessionKeys` (r:1 w:1) + /// Proof: `Pass::CounterForSessionKeys` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn remove_session_key() -> Weight { - Weight::from_parts(53_969_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + // Proof Size summary in bytes: + // Measured: `564` + // Estimated: `159279` + // Minimum execution time: 51_806_000 picoseconds. + Weight::from_parts(53_146_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } } diff --git a/runtime/kreivo/src/weights/pallet_payments.rs b/runtime/kreivo/src/weights/pallet_payments.rs index e02f0d463..92be7aaf3 100644 --- a/runtime/kreivo/src/weights/pallet_payments.rs +++ b/runtime/kreivo/src/weights/pallet_payments.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_payments` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -36,30 +36,32 @@ use core::marker::PhantomData; /// Weight functions for `pallet_payments`. pub struct WeightInfo(PhantomData); impl pallet_payments::WeightInfo for WeightInfo { + /// Storage: `PaymentIndices::Index` (r:1 w:1) + /// Proof: `PaymentIndices::Index` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `Payments::Payment` (r:1 w:1) /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:1) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:2) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:2 w:2) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) /// Storage: `Payments::PaymentParties` (r:0 w:1) /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) /// The range of component `q` is `[1, 50]`. - fn pay(q: u32, ) -> Weight { + fn pay(_q: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `620` + // Measured: `738` // Estimated: `8518` - // Minimum execution time: 204_990_000 picoseconds. - Weight::from_parts(308_057_654, 0) + // Minimum execution time: 142_106_000 picoseconds. + Weight::from_parts(147_369_645, 0) .saturating_add(Weight::from_parts(0, 8518)) - // Standard Error: 116_331 - .saturating_add(Weight::from_parts(285_557, 0).saturating_mul(q.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) } /// Storage: `Payments::Payment` (r:1 w:1) /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) @@ -67,21 +69,23 @@ impl pallet_payments::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:3 w:3) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:2 w:2) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:2) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:2 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn release() -> Weight { // Proof Size summary in bytes: - // Measured: `1229` + // Measured: `1438` // Estimated: `8859` - // Minimum execution time: 354_357_000 picoseconds. - Weight::from_parts(524_251_000, 0) + // Minimum execution time: 223_591_000 picoseconds. + Weight::from_parts(228_991_000, 0) .saturating_add(Weight::from_parts(0, 8859)) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(8)) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) } /// Storage: `Payments::PaymentParties` (r:1 w:1) /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) @@ -91,61 +95,73 @@ impl pallet_payments::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:2 w:2) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:2 w:2) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:2) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) fn cancel() -> Weight { // Proof Size summary in bytes: - // Measured: `1196` + // Measured: `1405` // Estimated: `8518` - // Minimum execution time: 251_516_000 picoseconds. - Weight::from_parts(395_621_000, 0) + // Minimum execution time: 168_260_000 picoseconds. + Weight::from_parts(172_952_000, 0) .saturating_add(Weight::from_parts(0, 8518)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) } /// Storage: `Payments::Payment` (r:1 w:1) /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Lookup` (r:1 w:1) /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn request_refund() -> Weight { // Proof Size summary in bytes: - // Measured: `377` + // Measured: `453` // Estimated: `159279` - // Minimum execution time: 69_640_000 picoseconds. - Weight::from_parts(100_550_000, 0) + // Minimum execution time: 42_614_000 picoseconds. + Weight::from_parts(44_009_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Payments::PaymentParties` (r:1 w:0) /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) /// Storage: `Payments::Payment` (r:1 w:1) /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:1 w:1) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:1 w:1) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:1 w:1) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:1 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:1 w:1) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Lookup` (r:1 w:1) /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn dispute_refund() -> Weight { // Proof Size summary in bytes: - // Measured: `1297` + // Measured: `1567` // Estimated: `159279` - // Minimum execution time: 206_820_000 picoseconds. - Weight::from_parts(279_372_000, 0) + // Minimum execution time: 126_391_000 picoseconds. + Weight::from_parts(129_637_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `Payments::PaymentParties` (r:1 w:0) /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) @@ -155,22 +171,26 @@ impl pallet_payments::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:3 w:3) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `Assets::Holds` (r:2 w:2) - /// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(983), added: 3458, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::Holds` (r:2 w:2) + /// Proof: `AssetsHolder::Holds` (`max_values`: None, `max_size`: Some(227), added: 2702, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:2) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:2 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn resolve_dispute() -> Weight { // Proof Size summary in bytes: - // Measured: `1299` + // Measured: `1508` // Estimated: `8859` - // Minimum execution time: 726_120_000 picoseconds. - Weight::from_parts(901_819_000, 0) + // Minimum execution time: 321_259_000 picoseconds. + Weight::from_parts(330_384_000, 0) .saturating_add(Weight::from_parts(0, 8859)) - .saturating_add(T::DbWeight::get().reads(11)) - .saturating_add(T::DbWeight::get().writes(8)) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(10)) } + /// Storage: `PaymentIndices::Index` (r:1 w:1) + /// Proof: `PaymentIndices::Index` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `Payments::Payment` (r:1 w:1) /// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5053), added: 7528, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:0) @@ -179,13 +199,13 @@ impl pallet_payments::WeightInfo for WeightInfo { /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn request_payment() -> Weight { // Proof Size summary in bytes: - // Measured: `425` + // Measured: `501` // Estimated: `8518` - // Minimum execution time: 76_053_000 picoseconds. - Weight::from_parts(84_390_000, 0) + // Minimum execution time: 31_766_000 picoseconds. + Weight::from_parts(33_223_000, 0) .saturating_add(Weight::from_parts(0, 8518)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Payments::PaymentParties` (r:1 w:0) /// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) @@ -195,18 +215,20 @@ impl pallet_payments::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(224), added: 2699, mode: `MaxEncodedLen`) /// Storage: `Assets::Account` (r:3 w:3) /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + /// Storage: `AssetsHolder::BalancesOnHold` (r:2 w:0) + /// Proof: `AssetsHolder::BalancesOnHold` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `AssetsFreezer::FrozenBalances` (r:2 w:0) /// Proof: `AssetsFreezer::FrozenBalances` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn accept_and_pay() -> Weight { // Proof Size summary in bytes: - // Measured: `1090` + // Measured: `1132` // Estimated: `8859` - // Minimum execution time: 444_034_000 picoseconds. - Weight::from_parts(474_516_000, 0) + // Minimum execution time: 205_814_000 picoseconds. + Weight::from_parts(213_074_000, 0) .saturating_add(Weight::from_parts(0, 8859)) - .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(6)) } } diff --git a/runtime/kreivo/src/weights/pallet_preimage.rs b/runtime/kreivo/src/weights/pallet_preimage.rs index ab66e4ff3..6b99c8693 100644 --- a/runtime/kreivo/src/weights/pallet_preimage.rs +++ b/runtime/kreivo/src/weights/pallet_preimage.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_preimage` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -41,19 +41,19 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Storage: `Preimage::RequestStatusFor` (r:1 w:1) /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `MaxEncodedLen`) /// Storage: `Preimage::PreimageFor` (r:0 w:1) /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `3586` - // Minimum execution time: 112_863_000 picoseconds. - Weight::from_parts(120_580_000, 0) - .saturating_add(Weight::from_parts(0, 3586)) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_017, 0).saturating_mul(s.into())) + // Measured: `3` + // Estimated: `3658` + // Minimum execution time: 64_012_000 picoseconds. + Weight::from_parts(65_073_000, 0) + .saturating_add(Weight::from_parts(0, 3658)) + // Standard Error: 6 + .saturating_add(Weight::from_parts(2_310, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -66,13 +66,13 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `67` // Estimated: `3556` - // Minimum execution time: 61_127_000 picoseconds. - Weight::from_parts(63_606_000, 0) + // Minimum execution time: 20_582_000 picoseconds. + Weight::from_parts(21_286_000, 0) .saturating_add(Weight::from_parts(0, 3556)) - // Standard Error: 46 - .saturating_add(Weight::from_parts(4_271, 0).saturating_mul(s.into())) + // Standard Error: 6 + .saturating_add(Weight::from_parts(2_307, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -85,13 +85,13 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `67` // Estimated: `3556` - // Minimum execution time: 74_440_000 picoseconds. - Weight::from_parts(78_305_000, 0) + // Minimum execution time: 20_157_000 picoseconds. + Weight::from_parts(20_614_000, 0) .saturating_add(Weight::from_parts(0, 3556)) - // Standard Error: 44 - .saturating_add(Weight::from_parts(4_253, 0).saturating_mul(s.into())) + // Standard Error: 6 + .saturating_add(Weight::from_parts(2_304, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -100,16 +100,16 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Storage: `Preimage::RequestStatusFor` (r:1 w:1) /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `MaxEncodedLen`) /// Storage: `Preimage::PreimageFor` (r:0 w:1) /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unnote_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `277` - // Estimated: `3586` - // Minimum execution time: 174_981_000 picoseconds. - Weight::from_parts(223_958_000, 0) - .saturating_add(Weight::from_parts(0, 3586)) + // Measured: `204` + // Estimated: `3658` + // Minimum execution time: 62_202_000 picoseconds. + Weight::from_parts(64_865_000, 0) + .saturating_add(Weight::from_parts(0, 3658)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -121,10 +121,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unnote_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `178` + // Measured: `105` // Estimated: `3556` - // Minimum execution time: 89_008_000 picoseconds. - Weight::from_parts(124_145_000, 0) + // Minimum execution time: 27_764_000 picoseconds. + Weight::from_parts(28_824_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -135,10 +135,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `222` + // Measured: `149` // Estimated: `3556` - // Minimum execution time: 75_606_000 picoseconds. - Weight::from_parts(100_313_000, 0) + // Minimum execution time: 23_127_000 picoseconds. + Weight::from_parts(24_105_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -149,10 +149,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `178` + // Measured: `105` // Estimated: `3556` - // Minimum execution time: 57_074_000 picoseconds. - Weight::from_parts(76_389_000, 0) + // Minimum execution time: 16_480_000 picoseconds. + Weight::from_parts(17_089_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -163,10 +163,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_unnoted_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `76` + // Measured: `3` // Estimated: `3556` - // Minimum execution time: 60_343_000 picoseconds. - Weight::from_parts(80_541_000, 0) + // Minimum execution time: 18_184_000 picoseconds. + Weight::from_parts(18_764_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -177,10 +177,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_requested_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `67` // Estimated: `3556` - // Minimum execution time: 46_234_000 picoseconds. - Weight::from_parts(58_908_000, 0) + // Minimum execution time: 13_533_000 picoseconds. + Weight::from_parts(14_072_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -193,10 +193,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unrequest_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `178` + // Measured: `105` // Estimated: `3556` - // Minimum execution time: 89_656_000 picoseconds. - Weight::from_parts(103_592_000, 0) + // Minimum execution time: 24_295_000 picoseconds. + Weight::from_parts(26_356_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -207,10 +207,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn unrequest_unnoted_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `67` // Estimated: `3556` - // Minimum execution time: 46_094_000 picoseconds. - Weight::from_parts(48_319_000, 0) + // Minimum execution time: 13_342_000 picoseconds. + Weight::from_parts(13_689_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -221,10 +221,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn unrequest_multi_referenced_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `67` // Estimated: `3556` - // Minimum execution time: 35_088_000 picoseconds. - Weight::from_parts(54_232_000, 0) + // Minimum execution time: 13_245_000 picoseconds. + Weight::from_parts(13_728_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -234,21 +234,21 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Storage: `System::Account` (r:1023 w:1023) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Balances::Holds` (r:1023 w:1023) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(121), added: 2596, mode: `MaxEncodedLen`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(193), added: 2668, mode: `MaxEncodedLen`) /// Storage: `Preimage::RequestStatusFor` (r:0 w:1023) /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 1024]`. fn ensure_updated(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + n * (227 ยฑ0)` - // Estimated: `990 + n * (2603 ยฑ0)` - // Minimum execution time: 184_369_000 picoseconds. - Weight::from_parts(202_566_000, 0) + // Estimated: `990 + n * (2668 ยฑ0)` + // Minimum execution time: 70_545_000 picoseconds. + Weight::from_parts(72_779_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_172_071 - .saturating_add(Weight::from_parts(496_739_127, 0).saturating_mul(n.into())) + // Standard Error: 35_280 + .saturating_add(Weight::from_parts(66_253_309, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 2668).saturating_mul(n.into())) } } diff --git a/runtime/kreivo/src/weights/pallet_proxy.rs b/runtime/kreivo/src/weights/pallet_proxy.rs index 835140a39..60da8f553 100644 --- a/runtime/kreivo/src/weights/pallet_proxy.rs +++ b/runtime/kreivo/src/weights/pallet_proxy.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_proxy` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -41,17 +41,21 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `127 + p * (37 ยฑ0)` + // Measured: `161 + p * (37 ยฑ0)` // Estimated: `4706` - // Minimum execution time: 35_039_000 picoseconds. - Weight::from_parts(50_800_265, 0) + // Minimum execution time: 19_029_000 picoseconds. + Weight::from_parts(19_840_896, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 35_602 - .saturating_add(Weight::from_parts(678_547, 0).saturating_mul(p.into())) + // Standard Error: 1_718 + .saturating_add(Weight::from_parts(45_897, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Proxy::Proxies` (r:1 w:0) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Proxy::Announcements` (r:1 w:1) /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -60,17 +64,19 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy_announced(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `454 + a * (68 ยฑ0) + p * (37 ยฑ0)` - // Estimated: `5698` - // Minimum execution time: 90_437_000 picoseconds. - Weight::from_parts(133_814_454, 0) + // Measured: `564 + a * (68 ยฑ0) + p * (37 ยฑ0)` + // Estimated: `5698 + a * (68 ยฑ0) + p * (37 ยฑ0)` + // Minimum execution time: 54_957_000 picoseconds. + Weight::from_parts(55_575_153, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 49_998 - .saturating_add(Weight::from_parts(864_176, 0).saturating_mul(a.into())) - // Standard Error: 51_657 - .saturating_add(Weight::from_parts(489_066, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Standard Error: 2_771 + .saturating_add(Weight::from_parts(179_014, 0).saturating_mul(a.into())) + // Standard Error: 2_863 + .saturating_add(Weight::from_parts(39_736, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Proxy::Announcements` (r:1 w:1) /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) @@ -78,15 +84,17 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, _p: u32, ) -> Weight { + fn remove_announcement(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `369 + a * (68 ยฑ0)` + // Measured: `403 + a * (68 ยฑ0)` // Estimated: `5698` - // Minimum execution time: 66_374_000 picoseconds. - Weight::from_parts(121_734_381, 0) + // Minimum execution time: 36_391_000 picoseconds. + Weight::from_parts(37_206_491, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 50_897 - .saturating_add(Weight::from_parts(594_970, 0).saturating_mul(a.into())) + // Standard Error: 1_984 + .saturating_add(Weight::from_parts(196_954, 0).saturating_mul(a.into())) + // Standard Error: 2_050 + .saturating_add(Weight::from_parts(11_354, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -98,20 +106,24 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn reject_announcement(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `369 + a * (68 ยฑ0)` + // Measured: `403 + a * (68 ยฑ0)` // Estimated: `5698` - // Minimum execution time: 65_197_000 picoseconds. - Weight::from_parts(100_723_628, 0) + // Minimum execution time: 36_165_000 picoseconds. + Weight::from_parts(37_056_195, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 48_964 - .saturating_add(Weight::from_parts(744_955, 0).saturating_mul(a.into())) - // Standard Error: 50_589 - .saturating_add(Weight::from_parts(259_110, 0).saturating_mul(p.into())) + // Standard Error: 2_105 + .saturating_add(Weight::from_parts(195_953, 0).saturating_mul(a.into())) + // Standard Error: 2_175 + .saturating_add(Weight::from_parts(15_838, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Proxy::Proxies` (r:1 w:0) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Proxy::Announcements` (r:1 w:1) /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -120,30 +132,32 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn announce(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `386 + a * (68 ยฑ0) + p * (37 ยฑ0)` - // Estimated: `5698` - // Minimum execution time: 84_993_000 picoseconds. - Weight::from_parts(110_148_980, 0) + // Measured: `496 + a * (68 ยฑ0) + p * (37 ยฑ0)` + // Estimated: `5698 + a * (68 ยฑ0) + p * (37 ยฑ0)` + // Minimum execution time: 49_712_000 picoseconds. + Weight::from_parts(50_203_077, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 60_043 - .saturating_add(Weight::from_parts(1_053_694, 0).saturating_mul(a.into())) - // Standard Error: 62_037 - .saturating_add(Weight::from_parts(696_805, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Standard Error: 2_466 + .saturating_add(Weight::from_parts(196_630, 0).saturating_mul(a.into())) + // Standard Error: 2_548 + .saturating_add(Weight::from_parts(50_135, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 68).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(p.into())) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `127 + p * (37 ยฑ0)` + // Measured: `161 + p * (37 ยฑ0)` // Estimated: `4706` - // Minimum execution time: 55_904_000 picoseconds. - Weight::from_parts(86_722_088, 0) + // Minimum execution time: 32_093_000 picoseconds. + Weight::from_parts(33_321_906, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 46_106 - .saturating_add(Weight::from_parts(513_087, 0).saturating_mul(p.into())) + // Standard Error: 1_883 + .saturating_add(Weight::from_parts(73_309, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -152,13 +166,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `127 + p * (37 ยฑ0)` + // Measured: `161 + p * (37 ยฑ0)` // Estimated: `4706` - // Minimum execution time: 58_559_000 picoseconds. - Weight::from_parts(93_881_053, 0) + // Minimum execution time: 32_351_000 picoseconds. + Weight::from_parts(33_510_182, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 55_411 - .saturating_add(Weight::from_parts(322_504, 0).saturating_mul(p.into())) + // Standard Error: 1_877 + .saturating_add(Weight::from_parts(62_667, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -167,29 +181,33 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `127 + p * (37 ยฑ0)` + // Measured: `161 + p * (37 ยฑ0)` // Estimated: `4706` - // Minimum execution time: 52_927_000 picoseconds. - Weight::from_parts(81_498_864, 0) + // Minimum execution time: 29_394_000 picoseconds. + Weight::from_parts(30_260_522, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 40_648 - .saturating_add(Weight::from_parts(303_721, 0).saturating_mul(p.into())) + // Standard Error: 1_747 + .saturating_add(Weight::from_parts(35_919, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn create_pure(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `139` + // Measured: `249` // Estimated: `4706` - // Minimum execution time: 58_686_000 picoseconds. - Weight::from_parts(96_234_848, 0) + // Minimum execution time: 39_681_000 picoseconds. + Weight::from_parts(41_385_256, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 58_854 - .saturating_add(Weight::from_parts(500_122, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1_875 + .saturating_add(Weight::from_parts(22_325, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Proxy::Proxies` (r:1 w:1) @@ -197,14 +215,30 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 30]`. fn kill_pure(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `164 + p * (37 ยฑ0)` + // Measured: `198 + p * (37 ยฑ0)` // Estimated: `4706` - // Minimum execution time: 51_983_000 picoseconds. - Weight::from_parts(87_051_598, 0) + // Minimum execution time: 30_148_000 picoseconds. + Weight::from_parts(31_319_955, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 44_747 - .saturating_add(Weight::from_parts(246_042, 0).saturating_mul(p.into())) + // Standard Error: 1_739 + .saturating_add(Weight::from_parts(45_365, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Proxy::Announcements` (r:1 w:1) + /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) + fn poke_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `524` + // Estimated: `5698` + // Minimum execution time: 61_858_000 picoseconds. + Weight::from_parts(63_061_000, 0) + .saturating_add(Weight::from_parts(0, 5698)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } } diff --git a/runtime/kreivo/src/weights/pallet_ranked_collective.rs b/runtime/kreivo/src/weights/pallet_ranked_collective.rs new file mode 100644 index 000000000..133271990 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_ranked_collective.rs @@ -0,0 +1,186 @@ + +//! Autogenerated weights for `pallet_ranked_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_ranked_collective +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_ranked_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_ranked_collective::WeightInfo for WeightInfo { + /// Storage: `KreivoCollective::Members` (r:1 w:1) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::MemberCount` (r:1 w:1) + /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IndexToId` (r:0 w:1) + /// Proof: `KreivoCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IdToIndex` (r:0 w:1) + /// Proof: `KreivoCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn add_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `3507` + // Minimum execution time: 22_600_000 picoseconds. + Weight::from_parts(23_603_000, 0) + .saturating_add(Weight::from_parts(0, 3507)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `KreivoCollective::Members` (r:1 w:1) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::MemberCount` (r:11 w:11) + /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IdToIndex` (r:11 w:22) + /// Proof: `KreivoCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IndexToId` (r:11 w:22) + /// Proof: `KreivoCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + fn remove_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `514 + r * (213 ยฑ0)` + // Estimated: `3519 + r * (2529 ยฑ0)` + // Minimum execution time: 43_854_000 picoseconds. + Weight::from_parts(47_032_930, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 31_360 + .saturating_add(Weight::from_parts(22_264_442, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2529).saturating_mul(r.into())) + } + /// Storage: `KreivoCollective::Members` (r:1 w:1) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::MemberCount` (r:1 w:1) + /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IndexToId` (r:0 w:1) + /// Proof: `KreivoCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IdToIndex` (r:0 w:1) + /// Proof: `KreivoCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + fn promote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `314 + r * (17 ยฑ0)` + // Estimated: `3507` + // Minimum execution time: 26_390_000 picoseconds. + Weight::from_parts(28_033_029, 0) + .saturating_add(Weight::from_parts(0, 3507)) + // Standard Error: 6_938 + .saturating_add(Weight::from_parts(467_081, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `KreivoCollective::Members` (r:1 w:1) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::MemberCount` (r:1 w:1) + /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IdToIndex` (r:1 w:2) + /// Proof: `KreivoCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IndexToId` (r:1 w:2) + /// Proof: `KreivoCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + fn demote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `530 + r * (72 ยฑ0)` + // Estimated: `3519` + // Minimum execution time: 43_056_000 picoseconds. + Weight::from_parts(47_685_288, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 24_172 + .saturating_add(Weight::from_parts(936_083, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `KreivoCollective::Members` (r:1 w:0) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::Voting` (r:1 w:1) + /// Proof: `KreivoCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Retries` (r:0 w:1) + /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `667` + // Estimated: `317568` + // Minimum execution time: 61_562_000 picoseconds. + Weight::from_parts(63_734_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::VotingCleanup` (r:1 w:0) + /// Proof: `KreivoCollective::VotingCleanup` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::Voting` (r:100 w:100) + /// Proof: `KreivoCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 100]`. + fn cleanup_poll(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `461 + n * (50 ยฑ0)` + // Estimated: `4365 + n * (2540 ยฑ0)` + // Minimum execution time: 19_872_000 picoseconds. + Weight::from_parts(27_749_992, 0) + .saturating_add(Weight::from_parts(0, 4365)) + // Standard Error: 3_151 + .saturating_add(Weight::from_parts(1_456_113, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 2540).saturating_mul(n.into())) + } + /// Storage: `KreivoCollective::Members` (r:2 w:2) + /// Proof: `KreivoCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::MemberCount` (r:2 w:2) + /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IdToIndex` (r:2 w:4) + /// Proof: `KreivoCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `KreivoCollective::IndexToId` (r:0 w:2) + /// Proof: `KreivoCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn exchange_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `437` + // Estimated: `6048` + // Minimum execution time: 67_954_000 picoseconds. + Weight::from_parts(69_324_000, 0) + .saturating_add(Weight::from_parts(0, 6048)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(10)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_referenda.rs b/runtime/kreivo/src/weights/pallet_referenda.rs index 45d85dd79..eb1274243 100644 --- a/runtime/kreivo/src/weights/pallet_referenda.rs +++ b/runtime/kreivo/src/weights/pallet_referenda.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_referenda` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -38,38 +38,48 @@ pub struct WeightInfo(PhantomData); impl pallet_referenda::WeightInfo for WeightInfo { /// Storage: `KreivoReferenda::ReferendumCount` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:0 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) fn submit() -> Weight { // Proof Size summary in bytes: - // Measured: `148` + // Measured: `223` // Estimated: `159279` - // Minimum execution time: 134_650_000 picoseconds. - Weight::from_parts(162_354_000, 0) + // Minimum execution time: 51_904_000 picoseconds. + Weight::from_parts(53_963_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Agenda` (r:2 w:2) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Retries` (r:0 w:1) /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn place_decision_deposit_preparing() -> Weight { // Proof Size summary in bytes: - // Measured: `365` + // Measured: `440` // Estimated: `317568` - // Minimum execution time: 161_902_000 picoseconds. - Weight::from_parts(185_978_000, 0) + // Minimum execution time: 67_734_000 picoseconds. + Weight::from_parts(69_550_000, 0) .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:0) /// Proof: `KreivoReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:1) @@ -80,16 +90,18 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn place_decision_deposit_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `880` + // Measured: `1022` // Estimated: `159279` - // Minimum execution time: 246_010_000 picoseconds. - Weight::from_parts(331_043_000, 0) + // Minimum execution time: 93_451_000 picoseconds. + Weight::from_parts(102_973_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:0) /// Proof: `KreivoReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:1) @@ -100,16 +112,18 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn place_decision_deposit_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `921` + // Measured: `1063` // Estimated: `159279` - // Minimum execution time: 274_683_000 picoseconds. - Weight::from_parts(322_476_000, 0) + // Minimum execution time: 100_560_000 picoseconds. + Weight::from_parts(107_080_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:1) /// Proof: `KreivoReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -120,16 +134,18 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn place_decision_deposit_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `666` + // Measured: `808` // Estimated: `317568` - // Minimum execution time: 267_263_000 picoseconds. - Weight::from_parts(396_333_000, 0) + // Minimum execution time: 106_690_000 picoseconds. + Weight::from_parts(113_185_000, 0) .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:1) /// Proof: `KreivoReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -140,22 +156,22 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn place_decision_deposit_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `507` + // Measured: `649` // Estimated: `317568` - // Minimum execution time: 200_421_000 picoseconds. - Weight::from_parts(210_350_000, 0) + // Minimum execution time: 81_818_000 picoseconds. + Weight::from_parts(84_026_000, 0) .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) fn refund_decision_deposit() -> Weight { // Proof Size summary in bytes: - // Measured: `279` + // Measured: `278` // Estimated: `4365` - // Minimum execution time: 94_950_000 picoseconds. - Weight::from_parts(103_943_000, 0) + // Minimum execution time: 36_545_000 picoseconds. + Weight::from_parts(37_451_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -164,10 +180,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) fn refund_submission_deposit() -> Weight { // Proof Size summary in bytes: - // Measured: `269` + // Measured: `268` // Estimated: `4365` - // Minimum execution time: 97_829_000 picoseconds. - Weight::from_parts(108_379_000, 0) + // Minimum execution time: 36_605_000 picoseconds. + Weight::from_parts(38_006_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -176,22 +192,30 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:2 w:2) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Retries` (r:0 w:1) /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn cancel() -> Weight { // Proof Size summary in bytes: - // Measured: `273` + // Measured: `348` // Estimated: `317568` - // Minimum execution time: 113_299_000 picoseconds. - Weight::from_parts(128_067_000, 0) + // Minimum execution time: 48_671_000 picoseconds. + Weight::from_parts(50_370_000, 0) .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:2 w:2) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::MetadataOf` (r:1 w:0) @@ -200,12 +224,12 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`) fn kill() -> Weight { // Proof Size summary in bytes: - // Measured: `617` + // Measured: `692` // Estimated: `317568` - // Minimum execution time: 296_711_000 picoseconds. - Weight::from_parts(313_813_000, 0) + // Minimum execution time: 121_975_000 picoseconds. + Weight::from_parts(124_411_000, 0) .saturating_add(Weight::from_parts(0, 317568)) - .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:0) @@ -214,10 +238,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) fn one_fewer_deciding_queue_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `102` + // Measured: `101` // Estimated: `3556` - // Minimum execution time: 38_397_000 picoseconds. - Weight::from_parts(47_986_000, 0) + // Minimum execution time: 14_296_000 picoseconds. + Weight::from_parts(14_685_000, 0) .saturating_add(Weight::from_parts(0, 3556)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -226,66 +250,76 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn one_fewer_deciding_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `1021` + // Measured: `1163` // Estimated: `159279` - // Minimum execution time: 218_476_000 picoseconds. - Weight::from_parts(259_440_000, 0) + // Minimum execution time: 73_500_000 picoseconds. + Weight::from_parts(76_250_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:1) /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) /// Proof: `KreivoCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn one_fewer_deciding_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `1021` + // Measured: `1163` // Estimated: `159279` - // Minimum execution time: 175_973_000 picoseconds. - Weight::from_parts(311_365_000, 0) + // Minimum execution time: 76_247_000 picoseconds. + Weight::from_parts(79_665_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:0) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:1) /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn nudge_referendum_requeued_insertion() -> Weight { // Proof Size summary in bytes: - // Measured: `652` + // Measured: `794` // Estimated: `4365` - // Minimum execution time: 80_669_000 picoseconds. - Weight::from_parts(119_408_000, 0) + // Minimum execution time: 37_654_000 picoseconds. + Weight::from_parts(39_030_000, 0) .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:0) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::TrackQueue` (r:1 w:1) /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn nudge_referendum_requeued_slide() -> Weight { // Proof Size summary in bytes: - // Measured: `619` + // Measured: `761` // Estimated: `4365` - // Minimum execution time: 86_824_000 picoseconds. - Weight::from_parts(116_099_000, 0) + // Minimum execution time: 36_947_000 picoseconds. + Weight::from_parts(38_212_000, 0) .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:0) @@ -294,14 +328,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn nudge_referendum_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `635` + // Measured: `777` // Estimated: `4365` - // Minimum execution time: 128_264_000 picoseconds. - Weight::from_parts(141_294_000, 0) + // Minimum execution time: 44_985_000 picoseconds. + Weight::from_parts(46_555_000, 0) .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:0) @@ -310,54 +346,64 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn nudge_referendum_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `676` + // Measured: `818` // Estimated: `4365` - // Minimum execution time: 127_480_000 picoseconds. - Weight::from_parts(142_781_000, 0) + // Minimum execution time: 45_166_000 picoseconds. + Weight::from_parts(49_079_000, 0) .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_no_deposit() -> Weight { // Proof Size summary in bytes: - // Measured: `225` + // Measured: `367` // Estimated: `159279` - // Minimum execution time: 53_969_000 picoseconds. - Weight::from_parts(83_194_000, 0) + // Minimum execution time: 34_211_000 picoseconds. + Weight::from_parts(35_451_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_preparing() -> Weight { // Proof Size summary in bytes: - // Measured: `273` + // Measured: `348` // Estimated: `159279` - // Minimum execution time: 74_973_000 picoseconds. - Weight::from_parts(89_883_000, 0) + // Minimum execution time: 33_914_000 picoseconds. + Weight::from_parts(35_409_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) fn nudge_referendum_timed_out() -> Weight { // Proof Size summary in bytes: - // Measured: `170` + // Measured: `312` // Estimated: `4365` - // Minimum execution time: 48_442_000 picoseconds. - Weight::from_parts(61_859_000, 0) + // Minimum execution time: 24_443_000 picoseconds. + Weight::from_parts(25_975_000, 0) .saturating_add(Weight::from_parts(0, 4365)) - .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:1) @@ -368,14 +414,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_begin_deciding_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `415` + // Measured: `557` // Estimated: `159279` - // Minimum execution time: 76_422_000 picoseconds. - Weight::from_parts(132_746_000, 0) + // Minimum execution time: 48_200_000 picoseconds. + Weight::from_parts(49_622_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoReferenda::DecidingCount` (r:1 w:1) @@ -386,14 +434,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_begin_deciding_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `716` // Estimated: `159279` - // Minimum execution time: 196_231_000 picoseconds. - Weight::from_parts(233_242_000, 0) + // Minimum execution time: 69_049_000 picoseconds. + Weight::from_parts(72_905_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -402,14 +452,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_begin_confirming() -> Weight { // Proof Size summary in bytes: - // Measured: `627` + // Measured: `769` // Estimated: `159279` - // Minimum execution time: 175_213_000 picoseconds. - Weight::from_parts(241_673_000, 0) + // Minimum execution time: 61_920_000 picoseconds. + Weight::from_parts(66_045_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -418,14 +470,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_end_confirming() -> Weight { // Proof Size summary in bytes: - // Measured: `610` + // Measured: `752` // Estimated: `159279` - // Minimum execution time: 189_292_000 picoseconds. - Weight::from_parts(228_883_000, 0) + // Minimum execution time: 62_353_000 picoseconds. + Weight::from_parts(66_460_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -434,14 +488,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_continue_not_confirming() -> Weight { // Proof Size summary in bytes: - // Measured: `627` + // Measured: `769` // Estimated: `159279` - // Minimum execution time: 177_102_000 picoseconds. - Weight::from_parts(235_471_000, 0) + // Minimum execution time: 59_858_000 picoseconds. + Weight::from_parts(62_413_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -450,14 +506,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_continue_confirming() -> Weight { // Proof Size summary in bytes: - // Measured: `631` + // Measured: `773` // Estimated: `159279` - // Minimum execution time: 169_273_000 picoseconds. - Weight::from_parts(196_791_000, 0) + // Minimum execution time: 57_342_000 picoseconds. + Weight::from_parts(59_096_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -468,14 +526,16 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nudge_referendum_approved() -> Weight { // Proof Size summary in bytes: - // Measured: `631` + // Measured: `773` // Estimated: `159279` - // Minimum execution time: 246_600_000 picoseconds. - Weight::from_parts(290_601_000, 0) + // Minimum execution time: 77_339_000 picoseconds. + Weight::from_parts(79_666_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:1) /// Proof: `KreivoReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) /// Storage: `KreivoCollective::MemberCount` (r:1 w:0) @@ -484,12 +544,12 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) fn nudge_referendum_rejected() -> Weight { // Proof Size summary in bytes: - // Measured: `627` + // Measured: `769` // Estimated: `159279` - // Minimum execution time: 192_753_000 picoseconds. - Weight::from_parts(289_148_000, 0) + // Minimum execution time: 60_847_000 picoseconds. + Weight::from_parts(61_535_000, 0) .saturating_add(Weight::from_parts(0, 159279)) - .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `KreivoReferenda::ReferendumInfoFor` (r:1 w:0) @@ -502,10 +562,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) fn set_some_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `348` + // Measured: `274` // Estimated: `4365` - // Minimum execution time: 72_729_000 picoseconds. - Weight::from_parts(115_786_000, 0) + // Minimum execution time: 26_178_000 picoseconds. + Weight::from_parts(27_176_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -516,10 +576,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `KreivoReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) fn clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `247` + // Measured: `246` // Estimated: `4365` - // Minimum execution time: 63_319_000 picoseconds. - Weight::from_parts(87_256_000, 0) + // Minimum execution time: 21_334_000 picoseconds. + Weight::from_parts(22_048_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/kreivo/src/weights/pallet_referenda_tracks.rs b/runtime/kreivo/src/weights/pallet_referenda_tracks.rs index 914fe731f..b0240341d 100644 --- a/runtime/kreivo/src/weights/pallet_referenda_tracks.rs +++ b/runtime/kreivo/src/weights/pallet_referenda_tracks.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_referenda_tracks` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -46,8 +46,8 @@ impl pallet_referenda_tracks::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `133107` // Estimated: `132561` - // Minimum execution time: 251_158_000 picoseconds. - Weight::from_parts(313_484_000, 0) + // Minimum execution time: 123_784_000 picoseconds. + Weight::from_parts(141_861_000, 0) .saturating_add(Weight::from_parts(0, 132561)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -60,8 +60,8 @@ impl pallet_referenda_tracks::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `2192` // Estimated: `4087` - // Minimum execution time: 152_016_000 picoseconds. - Weight::from_parts(182_244_000, 0) + // Minimum execution time: 69_790_000 picoseconds. + Weight::from_parts(74_267_000, 0) .saturating_add(Weight::from_parts(0, 4087)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -76,8 +76,8 @@ impl pallet_referenda_tracks::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `133201` // Estimated: `132561` - // Minimum execution time: 570_161_000 picoseconds. - Weight::from_parts(694_862_000, 0) + // Minimum execution time: 272_473_000 picoseconds. + Weight::from_parts(285_903_000, 0) .saturating_add(Weight::from_parts(0, 132561)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/kreivo/src/weights/pallet_scheduler.rs b/runtime/kreivo/src/weights/pallet_scheduler.rs index 9cdb344c4..4ff6824c0 100644 --- a/runtime/kreivo/src/weights/pallet_scheduler.rs +++ b/runtime/kreivo/src/weights/pallet_scheduler.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_scheduler` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,8 +42,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `31` // Estimated: `1489` - // Minimum execution time: 13_178_000 picoseconds. - Weight::from_parts(16_748_000, 0) + // Minimum execution time: 8_402_000 picoseconds. + Weight::from_parts(8_828_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -55,11 +55,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `77 + s * (177 ยฑ0)` // Estimated: `159279` - // Minimum execution time: 16_595_000 picoseconds. - Weight::from_parts(26_630_125, 0) + // Minimum execution time: 5_599_000 picoseconds. + Weight::from_parts(8_696_536, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 11_146 - .saturating_add(Weight::from_parts(1_409_611, 0).saturating_mul(s.into())) + // Standard Error: 1_167 + .saturating_add(Weight::from_parts(380_656, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -67,12 +67,12 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_514_000 picoseconds. - Weight::from_parts(16_710_000, 0) + // Minimum execution time: 5_176_000 picoseconds. + Weight::from_parts(5_374_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Preimage::PreimageFor` (r:1 w:1) - /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`) /// Storage: `Preimage::StatusFor` (r:1 w:0) /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// Storage: `Preimage::RequestStatusFor` (r:1 w:1) @@ -80,15 +80,16 @@ impl pallet_scheduler::WeightInfo for WeightInfo { /// The range of component `s` is `[128, 4194304]`. fn service_task_fetched(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `213 + s * (1 ยฑ0)` - // Estimated: `4197809` - // Minimum execution time: 47_320_000 picoseconds. - Weight::from_parts(69_930_000, 0) - .saturating_add(Weight::from_parts(0, 4197809)) - // Standard Error: 204 - .saturating_add(Weight::from_parts(6_103, 0).saturating_mul(s.into())) + // Measured: `140 + s * (1 ยฑ0)` + // Estimated: `3605 + s * (1 ยฑ0)` + // Minimum execution time: 24_197_000 picoseconds. + Weight::from_parts(24_479_000, 0) + .saturating_add(Weight::from_parts(0, 3605)) + // Standard Error: 7 + .saturating_add(Weight::from_parts(1_731, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) } /// Storage: `Scheduler::Lookup` (r:0 w:1) /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) @@ -96,8 +97,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_255_000 picoseconds. - Weight::from_parts(20_664_000, 0) + // Minimum execution time: 7_436_000 picoseconds. + Weight::from_parts(7_683_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,40 +106,45 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_720_000 picoseconds. - Weight::from_parts(17_363_000, 0) + // Minimum execution time: 5_096_000 picoseconds. + Weight::from_parts(5_254_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_signed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_032_000 picoseconds. - Weight::from_parts(17_027_000, 0) + // Minimum execution time: 4_001_000 picoseconds. + Weight::from_parts(4_248_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn execute_dispatch_unsigned() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_104_000 picoseconds. - Weight::from_parts(10_757_000, 0) + // Minimum execution time: 3_992_000 picoseconds. + Weight::from_parts(4_126_000, 0) .saturating_add(Weight::from_parts(0, 0)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 199]`. fn schedule(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `77 + s * (177 ยฑ0)` - // Estimated: `159279` - // Minimum execution time: 39_769_000 picoseconds. - Weight::from_parts(63_570_348, 0) + // Measured: `153 + s * (177 ยฑ0)` + // Estimated: `159279 + s * (177 ยฑ0)` + // Minimum execution time: 17_597_000 picoseconds. + Weight::from_parts(20_706_475, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 35_948 - .saturating_add(Weight::from_parts(1_694_666, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) + // Standard Error: 1_013 + .saturating_add(Weight::from_parts(414_935, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 177).saturating_mul(s.into())) } /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) @@ -151,30 +157,35 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `77 + s * (177 ยฑ0)` // Estimated: `159279` - // Minimum execution time: 64_637_000 picoseconds. - Weight::from_parts(64_608_256, 0) + // Minimum execution time: 22_436_000 picoseconds. + Weight::from_parts(20_741_392, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 58_479 - .saturating_add(Weight::from_parts(2_660_601, 0).saturating_mul(s.into())) + // Standard Error: 1_920 + .saturating_add(Weight::from_parts(626_365, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Scheduler::Lookup` (r:1 w:1) /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Scheduler::Agenda` (r:1 w:1) /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 199]`. fn schedule_named(s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `468 + s * (179 ยฑ0)` - // Estimated: `159279` - // Minimum execution time: 62_448_000 picoseconds. - Weight::from_parts(95_098_581, 0) + // Measured: `544 + s * (179 ยฑ0)` + // Estimated: `159279 + s * (180 ยฑ0)` + // Minimum execution time: 22_403_000 picoseconds. + Weight::from_parts(30_088_876, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 26_503 - .saturating_add(Weight::from_parts(1_689_486, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Standard Error: 1_319 + .saturating_add(Weight::from_parts(432_660, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 180).saturating_mul(s.into())) } /// Storage: `Scheduler::Lookup` (r:1 w:1) /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) @@ -187,11 +198,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `509 + s * (179 ยฑ0)` // Estimated: `159279` - // Minimum execution time: 75_966_000 picoseconds. - Weight::from_parts(102_203_054, 0) + // Minimum execution time: 25_121_000 picoseconds. + Weight::from_parts(25_875_706, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 55_161 - .saturating_add(Weight::from_parts(2_466_225, 0).saturating_mul(s.into())) + // Standard Error: 1_554 + .saturating_add(Weight::from_parts(634_663, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -204,11 +215,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `159279` - // Minimum execution time: 26_237_000 picoseconds. - Weight::from_parts(52_062_890, 0) + // Minimum execution time: 13_785_000 picoseconds. + Weight::from_parts(14_571_553, 0) .saturating_add(Weight::from_parts(0, 159279)) - // Standard Error: 5_738 - .saturating_add(Weight::from_parts(137_203, 0).saturating_mul(s.into())) + // Standard Error: 176 + .saturating_add(Weight::from_parts(24_320, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -220,8 +231,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `35481` // Estimated: `159279` - // Minimum execution time: 207_752_000 picoseconds. - Weight::from_parts(298_581_000, 0) + // Minimum execution time: 75_023_000 picoseconds. + Weight::from_parts(76_190_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -236,8 +247,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `36253` // Estimated: `159279` - // Minimum execution time: 197_532_000 picoseconds. - Weight::from_parts(336_921_000, 0) + // Minimum execution time: 83_392_000 picoseconds. + Weight::from_parts(84_538_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -250,8 +261,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `35493` // Estimated: `159279` - // Minimum execution time: 179_090_000 picoseconds. - Weight::from_parts(293_857_000, 0) + // Minimum execution time: 73_334_000 picoseconds. + Weight::from_parts(75_072_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -266,8 +277,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `36265` // Estimated: `159279` - // Minimum execution time: 196_385_000 picoseconds. - Weight::from_parts(337_437_000, 0) + // Minimum execution time: 82_122_000 picoseconds. + Weight::from_parts(83_643_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/kreivo/src/weights/pallet_session.rs b/runtime/kreivo/src/weights/pallet_session.rs index 043b1a181..e47ed9868 100644 --- a/runtime/kreivo/src/weights/pallet_session.rs +++ b/runtime/kreivo/src/weights/pallet_session.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_session` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -44,8 +44,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `298` // Estimated: `3763` - // Minimum execution time: 66_459_000 picoseconds. - Weight::from_parts(71_135_000, 0) + // Minimum execution time: 26_920_000 picoseconds. + Weight::from_parts(28_367_000, 0) .saturating_add(Weight::from_parts(0, 3763)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -58,8 +58,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3745` - // Minimum execution time: 32_875_000 picoseconds. - Weight::from_parts(48_691_000, 0) + // Minimum execution time: 20_086_000 picoseconds. + Weight::from_parts(21_007_000, 0) .saturating_add(Weight::from_parts(0, 3745)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/kreivo/src/weights/pallet_timestamp.rs b/runtime/kreivo/src/weights/pallet_timestamp.rs index 96861d7aa..9daf2b994 100644 --- a/runtime/kreivo/src/weights/pallet_timestamp.rs +++ b/runtime/kreivo/src/weights/pallet_timestamp.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_timestamp` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,10 +42,10 @@ impl pallet_timestamp::WeightInfo for WeightInfo { /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn set() -> Weight { // Proof Size summary in bytes: - // Measured: `86` + // Measured: `120` // Estimated: `1493` - // Minimum execution time: 24_011_000 picoseconds. - Weight::from_parts(27_661_000, 0) + // Minimum execution time: 11_393_000 picoseconds. + Weight::from_parts(12_020_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -54,8 +54,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 11_516_000 picoseconds. - Weight::from_parts(12_835_000, 0) + // Minimum execution time: 5_173_000 picoseconds. + Weight::from_parts(5_527_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/runtime/kreivo/src/weights/pallet_transaction_payment.rs b/runtime/kreivo/src/weights/pallet_transaction_payment.rs new file mode 100644 index 000000000..ec50dc333 --- /dev/null +++ b/runtime/kreivo/src/weights/pallet_transaction_payment.rs @@ -0,0 +1,51 @@ + +//! Autogenerated weights for `pallet_transaction_payment` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 +// benchmark +// pallet +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_transaction_payment +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_transaction_payment`. +pub struct WeightInfo(PhantomData); +impl pallet_transaction_payment::WeightInfo for WeightInfo { + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn charge_transaction_payment() -> Weight { + // Proof Size summary in bytes: + // Measured: `204` + // Estimated: `6196` + // Minimum execution time: 54_672_000 picoseconds. + Weight::from_parts(55_991_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/kreivo/src/weights/pallet_treasury.rs b/runtime/kreivo/src/weights/pallet_treasury.rs index 1ae8ce046..da12b893d 100644 --- a/runtime/kreivo/src/weights/pallet_treasury.rs +++ b/runtime/kreivo/src/weights/pallet_treasury.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_treasury` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -48,31 +48,36 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn remove_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `6` + // Measured: `42` // Estimated: `1887` - // Minimum execution time: 15_384_000 picoseconds. - Weight::from_parts(16_720_000, 0) + // Minimum execution time: 6_559_000 picoseconds. + Weight::from_parts(7_124_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) } + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Treasury::Deactivated` (r:1 w:1) /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `Treasury::Approvals` (r:1 w:1) - /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::LastSpendPeriod` (r:1 w:1) + /// Proof: `Treasury::LastSpendPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. fn on_initialize_proposals(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `122 + p * (1 ยฑ0)` - // Estimated: `3593` - // Minimum execution time: 54_413_000 picoseconds. - Weight::from_parts(85_833_788, 0) + // Measured: `234 + p * (1 ยฑ0)` + // Estimated: `3593 + p * (1 ยฑ0)` + // Minimum execution time: 20_958_000 picoseconds. + Weight::from_parts(24_973_895, 0) .saturating_add(Weight::from_parts(0, 3593)) - // Standard Error: 15_596 - .saturating_add(Weight::from_parts(212_478, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Standard Error: 1_341 + .saturating_add(Weight::from_parts(36_237, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(p.into())) } fn spend() -> Weight { // Proof Size summary in bytes: @@ -86,10 +91,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `6` + // Measured: `42` // Estimated: `3534` - // Minimum execution time: 21_564_000 picoseconds. - Weight::from_parts(26_942_000, 0) + // Minimum execution time: 8_588_000 picoseconds. + Weight::from_parts(9_047_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -97,10 +102,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn check_status() -> Weight { // Proof Size summary in bytes: - // Measured: `6` + // Measured: `42` // Estimated: `3534` - // Minimum execution time: 20_983_000 picoseconds. - Weight::from_parts(25_603_000, 0) + // Minimum execution time: 8_743_000 picoseconds. + Weight::from_parts(9_158_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -108,10 +113,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn void_spend() -> Weight { // Proof Size summary in bytes: - // Measured: `6` + // Measured: `42` // Estimated: `3534` - // Minimum execution time: 13_970_000 picoseconds. - Weight::from_parts(24_191_000, 0) + // Minimum execution time: 8_172_000 picoseconds. + Weight::from_parts(8_513_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtime/kreivo/src/weights/pallet_utility.rs b/runtime/kreivo/src/weights/pallet_utility.rs index b30d0e169..f0bef20b2 100644 --- a/runtime/kreivo/src/weights/pallet_utility.rs +++ b/runtime/kreivo/src/weights/pallet_utility.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_utility` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -41,18 +41,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 19_892_000 picoseconds. - Weight::from_parts(21_380_000, 0) + // Minimum execution time: 7_898_000 picoseconds. + Weight::from_parts(9_484_210, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 82_722 - .saturating_add(Weight::from_parts(11_635_072, 0).saturating_mul(c.into())) + // Standard Error: 1_696 + .saturating_add(Weight::from_parts(4_190_639, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_422_000 picoseconds. - Weight::from_parts(20_120_000, 0) + // Minimum execution time: 7_349_000 picoseconds. + Weight::from_parts(7_543_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -60,18 +60,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 20_146_000 picoseconds. - Weight::from_parts(22_201_000, 0) + // Minimum execution time: 7_830_000 picoseconds. + Weight::from_parts(9_627_400, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 84_547 - .saturating_add(Weight::from_parts(12_872_219, 0).saturating_mul(c.into())) + // Standard Error: 2_079 + .saturating_add(Weight::from_parts(4_437_714, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 22_340_000 picoseconds. - Weight::from_parts(23_533_000, 0) + // Minimum execution time: 10_424_000 picoseconds. + Weight::from_parts(10_668_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -79,10 +79,26 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 21_487_000 picoseconds. - Weight::from_parts(405_839_498, 0) + // Minimum execution time: 7_827_000 picoseconds. + Weight::from_parts(6_872_057, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 4_505 + .saturating_add(Weight::from_parts(4_112_730, 0).saturating_mul(c.into())) + } + fn dispatch_as_fallible() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_404_000 picoseconds. + Weight::from_parts(10_788_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn if_else() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_531_000 picoseconds. + Weight::from_parts(12_889_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 218_494 - .saturating_add(Weight::from_parts(11_876_474, 0).saturating_mul(c.into())) } } diff --git a/runtime/kreivo/src/weights/pallet_vesting.rs b/runtime/kreivo/src/weights/pallet_vesting.rs index b25414352..1eb1dc2a9 100644 --- a/runtime/kreivo/src/weights/pallet_vesting.rs +++ b/runtime/kreivo/src/weights/pallet_vesting.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_vesting` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -38,6 +38,8 @@ pub struct WeightInfo(PhantomData); impl pallet_vesting::WeightInfo for WeightInfo { /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -46,20 +48,24 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 28]`. fn vest_locked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `205 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 83_240_000 picoseconds. - Weight::from_parts(127_044_307, 0) + // Measured: `382 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 49_244_000 picoseconds. + Weight::from_parts(48_620_128, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 31_518 - .saturating_add(Weight::from_parts(148_458, 0).saturating_mul(l.into())) - // Standard Error: 56_077 - .saturating_add(Weight::from_parts(714_701, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Standard Error: 1_494 + .saturating_add(Weight::from_parts(56_983, 0).saturating_mul(l.into())) + // Standard Error: 2_658 + .saturating_add(Weight::from_parts(63_150, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -68,20 +74,24 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 28]`. fn vest_unlocked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `205 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 84_033_000 picoseconds. - Weight::from_parts(140_188_748, 0) + // Measured: `382 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 51_843_000 picoseconds. + Weight::from_parts(51_842_164, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 34_176 - .saturating_add(Weight::from_parts(225_224, 0).saturating_mul(l.into())) - // Standard Error: 60_805 - .saturating_add(Weight::from_parts(425_122, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Standard Error: 1_259 + .saturating_add(Weight::from_parts(49_362, 0).saturating_mul(l.into())) + // Standard Error: 2_241 + .saturating_add(Weight::from_parts(49_670, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -92,20 +102,24 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 28]`. fn vest_other_locked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `308 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 83_855_000 picoseconds. - Weight::from_parts(148_984_334, 0) + // Measured: `485 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 51_282_000 picoseconds. + Weight::from_parts(51_203_789, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 34_398 - .saturating_add(Weight::from_parts(17_313, 0).saturating_mul(l.into())) - // Standard Error: 61_200 - .saturating_add(Weight::from_parts(294_210, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Standard Error: 1_209 + .saturating_add(Weight::from_parts(52_952, 0).saturating_mul(l.into())) + // Standard Error: 2_152 + .saturating_add(Weight::from_parts(56_641, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -116,44 +130,54 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 28]`. fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `308 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 90_104_000 picoseconds. - Weight::from_parts(143_014_078, 0) + // Measured: `485 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 53_807_000 picoseconds. + Weight::from_parts(53_944_021, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 35_305 - .saturating_add(Weight::from_parts(280_981, 0).saturating_mul(l.into())) - // Standard Error: 62_813 - .saturating_add(Weight::from_parts(583_979, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Standard Error: 1_682 + .saturating_add(Weight::from_parts(59_327, 0).saturating_mul(l.into())) + // Standard Error: 2_992 + .saturating_add(Weight::from_parts(45_727, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(4658), added: 7133, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[0, 27]`. - fn vested_transfer(_l: u32, s: u32, ) -> Weight { + fn vested_transfer(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `379 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 166_745_000 picoseconds. - Weight::from_parts(288_219_170, 0) + // Measured: `556 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (37 ยฑ0)` + // Minimum execution time: 100_678_000 picoseconds. + Weight::from_parts(102_134_972, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 135_114 - .saturating_add(Weight::from_parts(488_726, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Standard Error: 2_028 + .saturating_add(Weight::from_parts(65_620, 0).saturating_mul(l.into())) + // Standard Error: 3_608 + .saturating_add(Weight::from_parts(102_047, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:2 w:2) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -162,68 +186,76 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 27]`. fn force_vested_transfer(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `482 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 170_009_000 picoseconds. - Weight::from_parts(252_122_151, 0) + // Measured: `659 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (37 ยฑ0)` + // Minimum execution time: 103_813_000 picoseconds. + Weight::from_parts(105_221_449, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 65_671 - .saturating_add(Weight::from_parts(503_665, 0).saturating_mul(l.into())) - // Standard Error: 116_840 - .saturating_add(Weight::from_parts(1_356_825, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Standard Error: 2_567 + .saturating_add(Weight::from_parts(60_718, 0).saturating_mul(l.into())) + // Standard Error: 4_567 + .saturating_add(Weight::from_parts(79_260, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(4658), added: 7133, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[2, 28]`. fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `306 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 88_388_000 picoseconds. - Weight::from_parts(147_316_554, 0) + // Measured: `382 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 49_710_000 picoseconds. + Weight::from_parts(48_874_069, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 33_926 - .saturating_add(Weight::from_parts(112_220, 0).saturating_mul(l.into())) - // Standard Error: 62_653 - .saturating_add(Weight::from_parts(395_613, 0).saturating_mul(s.into())) + // Standard Error: 1_357 + .saturating_add(Weight::from_parts(63_973, 0).saturating_mul(l.into())) + // Standard Error: 2_506 + .saturating_add(Weight::from_parts(70_466, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(4658), added: 7133, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[2, 28]`. fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `306 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 91_047_000 picoseconds. - Weight::from_parts(153_956_970, 0) + // Measured: `382 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 52_947_000 picoseconds. + Weight::from_parts(52_763_931, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 37_302 - .saturating_add(Weight::from_parts(179_792, 0).saturating_mul(l.into())) - // Standard Error: 68_888 - .saturating_add(Weight::from_parts(303_397, 0).saturating_mul(s.into())) + // Standard Error: 1_508 + .saturating_add(Weight::from_parts(56_552, 0).saturating_mul(l.into())) + // Standard Error: 2_786 + .saturating_add(Weight::from_parts(61_082, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } /// Storage: `Vesting::Vesting` (r:1 w:1) /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Balances::Locks` (r:1 w:1) /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) /// Storage: `Balances::Freezes` (r:1 w:0) @@ -234,16 +266,18 @@ impl pallet_vesting::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 28]`. fn force_remove_vesting_schedule(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `379 + l * (25 ยฑ0) + s * (36 ยฑ0)` - // Estimated: `8123` - // Minimum execution time: 102_620_000 picoseconds. - Weight::from_parts(166_846_437, 0) + // Measured: `556 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Estimated: `8123 + l * (25 ยฑ0) + s * (36 ยฑ0)` + // Minimum execution time: 57_518_000 picoseconds. + Weight::from_parts(58_175_776, 0) .saturating_add(Weight::from_parts(0, 8123)) - // Standard Error: 37_159 - .saturating_add(Weight::from_parts(6_289, 0).saturating_mul(l.into())) - // Standard Error: 68_623 - .saturating_add(Weight::from_parts(261_818, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Standard Error: 1_546 + .saturating_add(Weight::from_parts(53_680, 0).saturating_mul(l.into())) + // Standard Error: 2_855 + .saturating_add(Weight::from_parts(49_642, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 25).saturating_mul(l.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(s.into())) } } diff --git a/runtime/kreivo/src/weights/pallet_xcm_benchmarks_fungible.rs b/runtime/kreivo/src/weights/pallet_xcm_benchmarks_fungible.rs deleted file mode 100644 index 20f54ae7d..000000000 --- a/runtime/kreivo/src/weights/pallet_xcm_benchmarks_fungible.rs +++ /dev/null @@ -1,165 +0,0 @@ - -//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher -// v1 -// benchmark -// pallet -// --runtime -// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm -// --pallet -// pallet_xcm_benchmarks::fungible -// --extrinsic -// * -// --steps -// 50 -// --repeat -// 20 -// --output -// ./runtime/kreivo/src/weights/ - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_xcm_benchmarks::fungible`. -pub struct WeightInfo(PhantomData); -impl pallet_xcm_benchmarks::fungible::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn withdraw_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3593` - // Minimum execution time: 114_012_000 picoseconds. - Weight::from_parts(121_413_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `153` - // Estimated: `6196` - // Minimum execution time: 149_432_000 picoseconds. - Weight::from_parts(162_281_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn transfer_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `298` - // Estimated: `6196` - // Minimum execution time: 195_177_000 picoseconds. - Weight::from_parts(222_089_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn reserve_asset_deposited() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn initiate_reserve_withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `145` - // Estimated: `1630` - // Minimum execution time: 112_841_000 picoseconds. - Weight::from_parts(181_249_000, 0) - .saturating_add(Weight::from_parts(0, 1630)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn receive_teleported_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn deposit_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `3593` - // Minimum execution time: 94_820_000 picoseconds. - Weight::from_parts(98_335_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn deposit_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `197` - // Estimated: `3593` - // Minimum execution time: 126_259_000 picoseconds. - Weight::from_parts(192_819_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn initiate_teleport() -> Weight { - // Proof Size summary in bytes: - // Measured: `145` - // Estimated: `3593` - // Minimum execution time: 140_056_000 picoseconds. - Weight::from_parts(158_474_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/runtime/kreivo/src/weights/xcm/mod.rs b/runtime/kreivo/src/weights/xcm/mod.rs index 35112709b..38248e684 100644 --- a/runtime/kreivo/src/weights/xcm/mod.rs +++ b/runtime/kreivo/src/weights/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -18,23 +18,26 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use frame_support::weights::Weight; +use alloc::vec::Vec; +use frame_support::BoundedVec; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; -use sp_std::prelude::*; -use xcm::{latest::prelude::*, DoubleEncoded}; +use xcm::{ + latest::{prelude::*, AssetTransferFilter}, + DoubleEncoded, +}; trait WeighAssets { - fn weigh_multi_assets(&self, weight: Weight) -> Weight; + fn weigh_assets(&self, weight: Weight) -> Weight; } const MAX_ASSETS: u64 = 100; impl WeighAssets for AssetFilter { - fn weigh_multi_assets(&self, weight: Weight) -> Weight { + fn weigh_assets(&self, weight: Weight) -> Weight { match self { - Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64), - Self::Wild(asset) => match asset { + Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64), + Wild(asset) => match asset { All => weight.saturating_mul(MAX_ASSETS), AllOf { fun, .. } => match fun { WildFungibility::Fungible => weight, @@ -42,15 +45,15 @@ impl WeighAssets for AssetFilter { // MaxAssetsIntoHolding in the worst-case scenario. WildFungibility::NonFungible => weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), + AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min((*count as u64).max(1))), + AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min((*count as u64).max(1))), }, } } } impl WeighAssets for Assets { - fn weigh_multi_assets(&self, weight: Weight) -> Weight { + fn weigh_assets(&self, weight: Weight) -> Weight { weight.saturating_mul(self.inner().iter().count() as u64) } } @@ -58,13 +61,13 @@ impl WeighAssets for Assets { pub struct KreivoXcmWeight(core::marker::PhantomData); impl XcmWeightInfo for KreivoXcmWeight { fn withdraw_asset(assets: &Assets) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) + assets.weigh_assets(XcmFungibleWeight::::withdraw_asset()) } - fn reserve_asset_deposited(_assets: &Assets) -> Weight { - Weight::from_parts(10_000_u64, 0) + fn reserve_asset_deposited(assets: &Assets) -> Weight { + assets.weigh_assets(XcmFungibleWeight::::reserve_asset_deposited()) } fn receive_teleported_asset(assets: &Assets) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) + assets.weigh_assets(XcmFungibleWeight::::receive_teleported_asset()) } fn query_response( _query_id: &u64, @@ -75,12 +78,16 @@ impl XcmWeightInfo for KreivoXcmWeight { XcmGeneric::::query_response() } fn transfer_asset(assets: &Assets, _dest: &Location) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) + assets.weigh_assets(XcmFungibleWeight::::transfer_asset()) } fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) + assets.weigh_assets(XcmFungibleWeight::::transfer_reserve_asset()) } - fn transact(_origin_type: &OriginKind, _require_weight_at_most: &Weight, _call: &DoubleEncoded) -> Weight { + fn transact( + _origin_type: &OriginKind, + _fallback_max_weight: &Option, + _call: &DoubleEncoded, + ) -> Weight { XcmGeneric::::transact() } fn hrmp_new_channel_open_request(_sender: &u32, _max_message_size: &u32, _max_capacity: &u32) -> Weight { @@ -98,7 +105,7 @@ impl XcmWeightInfo for KreivoXcmWeight { fn clear_origin() -> Weight { XcmGeneric::::clear_origin() } - fn descend_origin(_who: &Junctions) -> Weight { + fn descend_origin(_who: &InteriorLocation) -> Weight { XcmGeneric::::descend_origin() } fn report_error(_query_response_info: &QueryResponseInfo) -> Weight { @@ -106,22 +113,22 @@ impl XcmWeightInfo for KreivoXcmWeight { } fn deposit_asset(assets: &AssetFilter, _dest: &Location) -> Weight { - // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0); - let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); - hardcoded_weight.min(weight) + assets.weigh_assets(XcmFungibleWeight::::deposit_asset()) } fn deposit_reserve_asset(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) + assets.weigh_assets(XcmFungibleWeight::::deposit_reserve_asset()) } - fn exchange_asset(_give: &AssetFilter, _receive: &Assets, _maximal: &bool) -> Weight { - Weight::MAX + fn exchange_asset(give: &AssetFilter, receive: &Assets, _maximal: &bool) -> Weight { + let base_weight = XcmGeneric::::exchange_asset(); + let give_weight = give.weigh_assets(base_weight); + let receive_weight = receive.weigh_assets(base_weight); + give_weight.max(receive_weight) } fn initiate_reserve_withdraw(assets: &AssetFilter, _reserve: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) + assets.weigh_assets(XcmFungibleWeight::::initiate_reserve_withdraw()) } fn initiate_teleport(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + assets.weigh_assets(XcmFungibleWeight::::initiate_teleport()) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &AssetFilter) -> Weight { XcmGeneric::::report_holding() @@ -154,10 +161,10 @@ impl XcmWeightInfo for KreivoXcmWeight { XcmGeneric::::unsubscribe_version() } fn burn_asset(assets: &Assets) -> Weight { - assets.weigh_multi_assets(XcmGeneric::::burn_asset()) + assets.weigh_assets(XcmGeneric::::burn_asset()) } fn expect_asset(assets: &Assets) -> Weight { - assets.weigh_multi_assets(XcmGeneric::::expect_asset()) + assets.weigh_assets(XcmGeneric::::expect_asset()) } fn expect_origin(_origin: &Option) -> Weight { XcmGeneric::::expect_origin() @@ -187,7 +194,7 @@ impl XcmWeightInfo for KreivoXcmWeight { XcmGeneric::::clear_transact_status() } fn universal_origin(_: &Junction) -> Weight { - Weight::MAX + XcmGeneric::::universal_origin() } fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { Weight::MAX @@ -214,10 +221,48 @@ impl XcmWeightInfo for KreivoXcmWeight { XcmGeneric::::clear_topic() } fn alias_origin(_: &Location) -> Weight { - // XCM Executor does not currently support alias origin operations - Weight::MAX + XcmGeneric::::alias_origin() } fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { XcmGeneric::::unpaid_execution() } + fn pay_fees(_asset: &Asset) -> Weight { + XcmGeneric::::pay_fees() + } + fn initiate_transfer( + _dest: &Location, + remote_fees: &Option, + _preserve_origin: &bool, + assets: &BoundedVec, + _xcm: &Xcm<()>, + ) -> Weight { + let base_weight = XcmFungibleWeight::::initiate_transfer(); + let mut weight = if let Some(remote_fees) = remote_fees { + let fees = remote_fees.inner(); + fees.weigh_assets(base_weight) + } else { + base_weight + }; + + for asset_filter in assets { + let assets = asset_filter.inner(); + let extra = assets.weigh_assets(XcmFungibleWeight::::initiate_transfer()); + weight = weight.saturating_add(extra); + } + weight + } + fn execute_with_origin(_descendant_origin: &Option, _xcm: &Xcm) -> Weight { + XcmGeneric::::execute_with_origin() + } + fn set_hints(hints: &BoundedVec) -> Weight { + let mut weight = Weight::zero(); + for hint in hints { + match hint { + AssetClaimer { .. } => { + weight = weight.saturating_add(XcmGeneric::::asset_claimer()); + } + } + } + weight + } } diff --git a/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 9447f1888..54b84cac7 100644 --- a/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,14 +1,14 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 45.0.0 -//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `virto-us3`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz` +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// /home/devops/.cargo/bin/frame-omni-bencher +// /home/runner/.cargo/bin/frame-omni-bencher // v1 // benchmark // pallet @@ -42,8 +42,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `101` // Estimated: `3593` - // Minimum execution time: 114_012_000 picoseconds. - Weight::from_parts(121_413_000, 0) + // Minimum execution time: 44_686_000 picoseconds. + Weight::from_parts(46_250_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -52,10 +52,10 @@ impl WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn transfer_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `153` + // Measured: `140` // Estimated: `6196` - // Minimum execution time: 149_432_000 picoseconds. - Weight::from_parts(162_281_000, 0) + // Minimum execution time: 59_330_000 picoseconds. + Weight::from_parts(60_434_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -70,16 +70,42 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn transfer_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `298` + // Measured: `319` // Estimated: `6196` - // Minimum execution time: 195_177_000 picoseconds. - Weight::from_parts(222_089_000, 0) + // Minimum execution time: 82_253_000 picoseconds. + Weight::from_parts(84_415_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Benchmark::Override` (r:0 w:0) /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + pub fn reserve_asset_deposited() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `179` + // Estimated: `1664` + // Minimum execution time: 65_575_000 picoseconds. + Weight::from_parts(67_584_000, 0) + .saturating_add(Weight::from_parts(0, 1664)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn receive_teleported_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` @@ -92,10 +118,10 @@ impl WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) pub fn deposit_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `52` + // Measured: `39` // Estimated: `3593` - // Minimum execution time: 94_820_000 picoseconds. - Weight::from_parts(98_335_000, 0) + // Minimum execution time: 37_056_000 picoseconds. + Weight::from_parts(38_370_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -110,10 +136,28 @@ impl WeightInfo { /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn deposit_reserve_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `197` + // Measured: `218` // Estimated: `3593` - // Minimum execution time: 126_259_000 picoseconds. - Weight::from_parts(192_819_000, 0) + // Minimum execution time: 61_815_000 picoseconds. + Weight::from_parts(64_194_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + pub fn initiate_teleport() -> Weight { + // Proof Size summary in bytes: + // Measured: `179` + // Estimated: `3593` + // Minimum execution time: 64_167_000 picoseconds. + Weight::from_parts(66_372_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -126,12 +170,12 @@ impl WeightInfo { /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - pub fn initiate_teleport() -> Weight { + pub fn initiate_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `145` + // Measured: `218` // Estimated: `3593` - // Minimum execution time: 140_056_000 picoseconds. - Weight::from_parts(158_474_000, 0) + // Minimum execution time: 81_636_000 picoseconds. + Weight::from_parts(83_818_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 836094a89..2e3900304 100644 --- a/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/runtime/kreivo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,169 +1,220 @@ -// Copyright Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus 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. - -// Cumulus 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 Cumulus. If not, see . //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.1.0 +//! DATE: 2025-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! HOSTNAME: `gh-vm-15255853159`, CPU: `Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/runner/.cargo/bin/frame-omni-bencher +// v1 // benchmark // pallet -// --template=./templates/xcm-bench-template.hbs -// --chain=statemine-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet_xcm_benchmarks::generic -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +// --runtime +// target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm +// --pallet +// pallet_xcm_benchmarks::generic +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/kreivo/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weights for `pallet_xcm_benchmarks::generic`. pub struct WeightInfo(PhantomData); impl WeightInfo { - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 340_875_000 picoseconds. - Weight::from_parts(349_790_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `179` + // Estimated: `1664` + // Minimum execution time: 59_087_000 picoseconds. + Weight::from_parts(60_386_000, 0) + .saturating_add(Weight::from_parts(0, 1664)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } pub fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_898_000 picoseconds. - Weight::from_parts(3_994_000, 0) + // Minimum execution time: 902_000 picoseconds. + Weight::from_parts(950_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + pub fn pay_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 10_181_000 picoseconds. + Weight::from_parts(10_724_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + pub fn exchange_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 986_000 picoseconds. + Weight::from_parts(1_072_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } - // Storage: PolkadotXcm Queries (r:1 w:0) - // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + pub fn asset_claimer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 986_000 picoseconds. + Weight::from_parts(1_072_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `PolkadotXcm::Queries` (r:1 w:0) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn query_response() -> Weight { // Proof Size summary in bytes: - // Measured: `69` - // Estimated: `3534` - // Minimum execution time: 10_760_000 picoseconds. - Weight::from_parts(11_070_000, 3534) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 8_320_000 picoseconds. + Weight::from_parts(8_603_000, 0) + .saturating_add(Weight::from_parts(0, 3465)) .saturating_add(T::DbWeight::get().reads(1)) } pub fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_340_000 picoseconds. - Weight::from_parts(13_787_000, 0) + // Minimum execution time: 10_416_000 picoseconds. + Weight::from_parts(10_823_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_205_000 picoseconds. - Weight::from_parts(4_328_000, 0) + // Minimum execution time: 3_869_000 picoseconds. + Weight::from_parts(3_869_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + #[allow(dead_code)] + pub fn initiate_reserve_withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_944_000 picoseconds. + Weight::from_parts(3_944_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_675_000 picoseconds. - Weight::from_parts(2_761_000, 0) + // Minimum execution time: 927_000 picoseconds. + Weight::from_parts(973_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_648_000 picoseconds. - Weight::from_parts(2_723_000, 0) + // Minimum execution time: 951_000 picoseconds. + Weight::from_parts(984_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_675_000 picoseconds. - Weight::from_parts(2_866_000, 0) + // Minimum execution time: 934_000 picoseconds. + Weight::from_parts(959_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + pub fn alias_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 931_000 picoseconds. + Weight::from_parts(996_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + pub fn universal_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 931_000 picoseconds. + Weight::from_parts(996_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_584_000 picoseconds. - Weight::from_parts(3_679_000, 0) + // Minimum execution time: 931_000 picoseconds. + Weight::from_parts(996_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + pub fn execute_with_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_750_000, 0) - } - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + // Minimum execution time: 930_000 picoseconds. + Weight::from_parts(973_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 24_994_000 picoseconds. - Weight::from_parts(25_553_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `179` + // Estimated: `1664` + // Minimum execution time: 22_358_000 picoseconds. + Weight::from_parts(23_399_000, 0) + .saturating_add(Weight::from_parts(0, 1664)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: PolkadotXcm AssetTraps (r:1 w:1) - // Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured) + /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) + /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn claim_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `126` - // Estimated: `3591` - // Minimum execution time: 15_960_000 picoseconds. - Weight::from_parts(16_240_000, 3591) + // Measured: `23` + // Estimated: `3488` + // Minimum execution time: 12_385_000 picoseconds. + Weight::from_parts(12_813_000, 0) + .saturating_add(Weight::from_parts(0, 3488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,178 +222,155 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_659_000 picoseconds. - Weight::from_parts(2_732_000, 0) - } - // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + // Minimum execution time: 5_215_000 picoseconds. + Weight::from_parts(5_569_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 28_083_000 picoseconds. - Weight::from_parts(28_531_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 21_646_000 picoseconds. + Weight::from_parts(22_508_000, 0) + .saturating_add(Weight::from_parts(0, 3541)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) - // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) pub fn unsubscribe_version() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_884_000 picoseconds. - Weight::from_parts(4_996_000, 0) + // Minimum execution time: 4_514_000 picoseconds. + Weight::from_parts(4_812_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) - pub fn initiate_reserve_withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 383_046_000 picoseconds. - Weight::from_parts(397_796_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } pub fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 118_811_000 picoseconds. - Weight::from_parts(121_240_000, 0) + // Minimum execution time: 22_577_000 picoseconds. + Weight::from_parts(22_981_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_406_000 picoseconds. - Weight::from_parts(12_637_000, 0) + // Minimum execution time: 5_674_000 picoseconds. + Weight::from_parts(5_843_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_758_000 picoseconds. - Weight::from_parts(2_831_000, 0) + // Minimum execution time: 5_259_000 picoseconds. + Weight::from_parts(5_460_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_703_000 picoseconds. - Weight::from_parts(2_798_000, 0) + // Minimum execution time: 5_240_000 picoseconds. + Weight::from_parts(5_512_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_892_000 picoseconds. - Weight::from_parts(2_930_000, 0) - } - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + // Minimum execution time: 1_028_000 picoseconds. + Weight::from_parts(1_129_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 28_960_000 picoseconds. - Weight::from_parts(29_596_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `179` + // Estimated: `1664` + // Minimum execution time: 30_980_000 picoseconds. + Weight::from_parts(32_166_000, 0) + .saturating_add(Weight::from_parts(0, 1664)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } pub fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_303_000 picoseconds. - Weight::from_parts(5_444_000, 0) - } - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: PolkadotXcm SupportedVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) - // Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured) - // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) - // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem HostConfiguration (r:1 w:0) - // Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) + // Minimum execution time: 7_891_000 picoseconds. + Weight::from_parts(7_979_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) pub fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `75` - // Estimated: `3540` - // Minimum execution time: 25_221_000 picoseconds. - Weight::from_parts(25_842_000, 3540) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `179` + // Estimated: `1664` + // Minimum execution time: 22_998_000 picoseconds. + Weight::from_parts(24_062_000, 0) + .saturating_add(Weight::from_parts(0, 1664)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } pub fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_734_000 picoseconds. - Weight::from_parts(2_787_000, 0) + // Minimum execution time: 957_000 picoseconds. + Weight::from_parts(1_069_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_625_000 picoseconds. - Weight::from_parts(2_692_000, 0) + // Minimum execution time: 908_000 picoseconds. + Weight::from_parts(949_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_638_000 picoseconds. - Weight::from_parts(2_705_000, 0) + // Minimum execution time: 904_000 picoseconds. + Weight::from_parts(970_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_666_000 picoseconds. - Weight::from_parts(2_738_000, 0) + // Minimum execution time: 920_000 picoseconds. + Weight::from_parts(986_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } pub fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_857_000 picoseconds. - Weight::from_parts(2_966_000, 0) + // Minimum execution time: 926_000 picoseconds. + Weight::from_parts(983_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/runtime/kreivo/src/xcm_config.rs b/runtime/kreivo/src/xcm_config.rs index b2c2b4460..e6b35d46a 100644 --- a/runtime/kreivo/src/xcm_config.rs +++ b/runtime/kreivo/src/xcm_config.rs @@ -1,11 +1,14 @@ use super::{ AccountId, AllPalletsWithSystem, Assets, Balance, Balances, FungibleAssetLocation, KreivoAssetsInstance, - ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, - TreasuryAccount, WeightToFee, XcmpQueue, + ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, + Treasury, TreasuryAccount, WeightToFee, XcmpQueue, }; use virto_common::AsFungibleAssetLocation; use crate::constants::locations::ASSET_HUB_ID; +use core::marker::PhantomData; +use frame_support::traits::fungible::HoldConsideration; +use frame_support::traits::LinearStoragePrice; use frame_support::{ parameter_types, traits::{ @@ -18,7 +21,6 @@ use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::AssetFeeAsExistentialDepositMultiplier; use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::ConvertInto; -use sp_std::marker::PhantomData; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, @@ -33,17 +35,25 @@ use xcm_executor::XcmExecutor; mod communities; use communities::*; +#[cfg(not(feature = "paseo"))] +parameter_types! { + pub const RelayNetwork: Option = Some(Kusama); +} +#[cfg(feature = "paseo")] +parameter_types! { + pub const RelayNetwork: Option = Some(Polkadot); +} + parameter_types! { pub const RelayLocation: Location = Location::parent(); - pub const RelayNetwork: Option = Some(NetworkId::Kusama); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub CheckAccount: (AccountId, MintLocation) = (PolkadotXcm::check_account(), MintLocation::Local); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub AssetsPalletLocation: Location = PalletInstance(::index() as u8).into(); pub UniversalLocation: InteriorLocation = [ - GlobalConsensus(NetworkId::Polkadot), - GlobalConsensus(NetworkId::Kusama), + GlobalConsensus(Polkadot), + GlobalConsensus(Kusama), Parachain(ParachainInfo::parachain_id().into()), ].into(); @@ -56,6 +66,8 @@ parameter_types! { pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, + // Here (Parachain) origin converts to a given `AccountId`. + HereConvertsTo, // Sibling parachain origins convert to AccountId via the `ParaId::into`. SiblingParachainConvertsVia, // Plurality origins convert to community AccountId via the `Communities::community_account`. @@ -74,6 +86,20 @@ pub type LocationConvertedConcreteId = xcm_builder::MatchedConvertedConcreteId< JustTry, >; +/// Means for transacting the native currency on this chain. +pub type FungibleTransactor = FungibleAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + IsConcrete, + // Convert an XCM Location into a local 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 of `Balances`. + CheckAccount, +>; + /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: @@ -92,20 +118,6 @@ pub type FungiblesTransactor = FungiblesAdapter< CheckingAccount, >; -/// Means for transacting the native currency on this chain. -pub type FungibleTransactor = FungibleAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Convert an XCM Location into a local 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 of `Balances`. - CheckAccount, ->; - /// 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 @@ -229,30 +241,31 @@ pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; + type XcmEventEmitter = PolkadotXcm; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; type IsReserve = Reserves; // Teleporting is disabled. type IsTeleporter = (); + type Aliasers = Nothing; type UniversalLocation = UniversalLocation; type Barrier = Barrier; type Weigher = WeightInfoBounds, RuntimeCall, MaxInstructions>; type Trader = Traders; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; + type AssetLocker = (); + type AssetExchanger = (); 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; - type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; type HrmpNewChannelOpenRequestHandler = (); type HrmpChannelAcceptedHandler = (); @@ -281,36 +294,190 @@ pub type XcmRouter = ( XcmpQueue, ); +parameter_types! { + pub const DepositPerItem: Balance = crate::deposit(1, 0); + pub const DepositPerByte: Balance = crate::deposit(0, 1); + pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::PolkadotXcm(pallet_xcm::HoldReason::AuthorizeAlias); +} + impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type CurrencyMatcher = (); + type AuthorizedAliasConsideration = HoldConsideration< + AccountId, + Balances, + AuthorizeAliasHoldReason, + LinearStoragePrice, + >; type SendXcmOrigin = EnsureXcmOrigin; - type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; type Weigher = WeightInfoBounds, RuntimeCall, MaxInstructions>; + 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 = Balances; - type CurrencyMatcher = (); + type AdminOrigin = EnsureRoot; type TrustedLockers = (); type SovereignAccountOf = LocationToAccountId; type MaxLockers = ConstU32<8>; - type WeightInfo = pallet_xcm::TestWeightInfo; - type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type WeightInfo = pallet_xcm::TestWeightInfo; } impl cumulus_pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarks { + use super::*; + + use crate::{ + config::{ExistentialDeposit, PriceForParentDelivery}, + vec, Vec, UNITS, + }; + use frame_benchmarking::BenchmarkError; + use pallet_xcm_benchmarks::asset_instance_from; + use xcm::prelude::Assets as XcmAssets; + + parameter_types! { + pub ExistentialDepositAsset: Option = Some(( + RelayLocation::get(), + ExistentialDeposit::get() + ).into()); + } + + impl pallet_xcm_benchmarks::Config for Runtime { + type XcmConfig = XcmConfig; + type AccountIdConverter = LocationToAccountId; + type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper< + XcmConfig, + ExistentialDepositAsset, + PriceForParentDelivery, + >; + + fn valid_destination() -> Result { + Ok(RelayLocation::get()) + } + + fn worst_case_holding(depositable_count: u32) -> XcmAssets { + // A mix of fungible, non-fungible, and concrete assets. + let holding_non_fungibles = MaxAssetsIntoHolding::get() / 2 - depositable_count; + let holding_fungibles = holding_non_fungibles.saturating_sub(1); + let fungibles_amount: u128 = 100; + + (0..holding_fungibles) + .map(|i| { + Asset { + id: AssetId(GeneralIndex(i as u128).into()), + fun: Fungible(fungibles_amount * (i + 1) as u128), // non-zero amount + } + }) + .chain(core::iter::once(Asset { + id: AssetId(Here.into()), + fun: Fungible(u128::MAX), + })) + .chain(core::iter::once(Asset { + id: AssetId(RelayLocation::get()), + fun: Fungible(1_000_000 * UNITS), + })) + .chain((0..holding_non_fungibles).map(|i| Asset { + id: AssetId(GeneralIndex(i as u128).into()), + fun: NonFungible(asset_instance_from(i)), + })) + .collect::>() + .into() + } + } + + parameter_types! { + pub const TrustedTeleporter: Option<(Location, Asset)> = Some(( + RelayLocation::get(), + Asset { fun: Fungible(UNITS), id: AssetId(RelayLocation::get()) }, + )); + pub const CheckedAccount: Option<(AccountId, MintLocation)> = None; + pub const TrustedReserve: Option<(Location, Asset)> = None; + + } + + impl pallet_xcm_benchmarks::fungible::Config for Runtime { + type TransactAsset = Balances; + + type CheckedAccount = CheckedAccount; + type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; + + fn get_asset() -> Asset { + (RelayLocation::get(), UNITS).into() + } + } + + impl pallet_xcm_benchmarks::generic::Config for Runtime { + type RuntimeCall = RuntimeCall; + type TransactAsset = Balances; + + fn worst_case_response() -> (u64, Response) { + (0u64, Response::Version(Default::default())) + } + + fn worst_case_asset_exchange() -> Result<(XcmAssets, XcmAssets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { + Ok(( + RelayLocation::get(), + frame_system::Call::remark_with_event { remark: vec![] }.into(), + )) + } + + fn subscribe_origin() -> Result { + Ok(RelayLocation::get()) + } + + fn claimable_asset() -> Result<(Location, Location, XcmAssets), BenchmarkError> { + let origin = RelayLocation::get(); + let assets: XcmAssets = (AssetId(RelayLocation::get()), 1_000 * UNITS).into(); + let ticket = Here.into(); + Ok((origin, ticket, assets)) + } + + fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn export_message_origin_and_destination() -> Result<(Location, NetworkId, InteriorLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn alias_origin() -> Result<(Location, Location), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> { + Ok(( + Asset { + id: AssetId(RelayLocation::get()), + fun: Fungible(1_000 * UNITS), + }, + Limited(Weight::from_parts(5000, 5000)), + )) + } + } +} diff --git a/runtime/kreivo/src/xcm_config/communities.rs b/runtime/kreivo/src/xcm_config/communities.rs index 7410bc843..88f694e09 100644 --- a/runtime/kreivo/src/xcm_config/communities.rs +++ b/runtime/kreivo/src/xcm_config/communities.rs @@ -26,14 +26,25 @@ impl ConvertLocation for PluralityConvertsToCommunityAccountId { } } +pub struct HereConvertsTo(PhantomData); +impl, AccountId: From<[u8; 32]>> ConvertLocation for HereConvertsTo { + fn convert_location(location: &Location) -> Option { + if location.is_here() { + Some(Account::get()) + } else { + None + } + } +} + pub struct AccountId32FromRelay(PhantomData<(Network, AccountId)>); impl>, AccountId: From<[u8; 32]> + Into<[u8; 32]> + Clone> ConvertLocation for AccountId32FromRelay { fn convert_location(location: &Location) -> Option { let id = match location.unpack() { - (1, [AccountId32 { id, network: None }]) => id, (1, [AccountId32 { id, network }]) if *network == Network::get() => id, + (1, [AccountId32 { id, .. }]) => id, _ => return None, }; diff --git a/runtime/runtime-constants/Cargo.toml b/runtime/runtime-constants/Cargo.toml index 85c9f2fc7..58435b62f 100644 --- a/runtime/runtime-constants/Cargo.toml +++ b/runtime/runtime-constants/Cargo.toml @@ -16,19 +16,26 @@ polkadot-runtime-common.workspace = true sp-runtime.workspace = true sp-weights.workspace = true sp-core.workspace = true -sp-std.workspace = true xcm.workspace = true xcm-builder.workspace = true [features] default = ["std"] paseo = [] +try-runtime = [ + "frame-support/try-runtime", + "parachains-common/try-runtime", + "polkadot-runtime-common/try-runtime", + "sp-runtime/try-runtime" +] std = [ - "frame-support/std", - "polkadot-primitives/std", - "polkadot-runtime-common/std", - "sp-core/std", - "sp-runtime/std", - "sp-weights/std", - "xcm-builder/std", + "frame-support/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", + "sp-core/std", + "sp-runtime/std", + "sp-weights/std", + "xcm-builder/std", + "parachains-common/std", + "xcm/std", ] diff --git a/runtime/runtime-constants/src/genesis_presets.rs b/runtime/runtime-constants/src/genesis_presets.rs index 644716d67..f343cd8b2 100644 --- a/runtime/runtime-constants/src/genesis_presets.rs +++ b/runtime/runtime-constants/src/genesis_presets.rs @@ -15,13 +15,18 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +#[cfg(not(feature = "std"))] +use alloc::format; +use alloc::vec::Vec; use parachains_common::AuraId; use polkadot_primitives::{AccountId, AccountPublic}; +use sp_core::crypto::Ss58Codec; use sp_core::{sr25519, Pair, Public}; use sp_runtime::traits::IdentifyAccount; -#[cfg(not(feature = "std"))] -use sp_std::alloc::format; -use sp_std::vec::Vec; + +pub fn alice() -> parachains_common::AccountId { + get_account_id_from_seed::("Alice") +} /// Invulnerable Collators pub fn invulnerables() -> Vec<(parachains_common::AccountId, AuraId)> { @@ -52,6 +57,7 @@ pub fn testnet_accounts() -> Vec { get_account_id_from_seed::("Dave//stash"), get_account_id_from_seed::("Eve//stash"), get_account_id_from_seed::("Ferdie//stash"), + AccountId::from_ss58check("F3opxRaMqPWKwA5yup6vZy2GLA28aJ3XSEX31Uf8qrhmaQt").expect("address is correct"), ]) } diff --git a/runtime/runtime-constants/src/lib.rs b/runtime/runtime-constants/src/lib.rs index 0d1d73549..ca711e380 100644 --- a/runtime/runtime-constants/src/lib.rs +++ b/runtime/runtime-constants/src/lib.rs @@ -16,6 +16,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + pub mod genesis_presets; pub mod weights; @@ -51,13 +53,34 @@ pub mod currency { } } +pub mod async_backing_params { + use polkadot_primitives::Moment; + + /// Build with an offset of 1 behind the relay chain best block. + #[cfg(not(feature = "try-runtime"))] + pub const RELAY_PARENT_OFFSET: u32 = 1; + #[cfg(feature = "try-runtime")] + pub const RELAY_PARENT_OFFSET: u32 = 0; + /// Maximum number of blocks simultaneously accepted by the Runtime, not yet + /// included into the relay chain. + pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = (2 + RELAY_PARENT_OFFSET) * BLOCK_PROCESSING_VELOCITY + 1; + /// The upper limit of how many parachain blocks are processed by the relay chain per + /// parent. Limits the number of blocks authored per slot. This determines the minimum + /// block time of the parachain: + #[cfg(feature = "paseo")] + pub const BLOCK_PROCESSING_VELOCITY: u32 = 3; + #[cfg(not(feature = "paseo"))] + pub const BLOCK_PROCESSING_VELOCITY: u32 = 12; + /// Relay chain slot duration, in milliseconds. + pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: Moment = 6_000; +} + /// Time and blocks. pub mod time { + use crate::async_backing_params::{BLOCK_PROCESSING_VELOCITY, RELAY_CHAIN_SLOT_DURATION_MILLIS}; use polkadot_primitives::{BlockNumber, Moment}; - use polkadot_runtime_common::prod_or_fast; - pub const MILLISECS_PER_BLOCK: Moment = 6000; - pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(HOURS, MINUTES); + + pub const MILLISECS_PER_BLOCK: Moment = RELAY_CHAIN_SLOT_DURATION_MILLIS / BLOCK_PROCESSING_VELOCITY as u64; // These time units are defined in number of blocks. pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const HOURS: BlockNumber = MINUTES * 60; diff --git a/templates/xcm-bench-template.hbs b/templates/xcm-bench-template.hbs index f8be6140c..d8b0ea0c5 100644 --- a/templates/xcm-bench-template.hbs +++ b/templates/xcm-bench-template.hbs @@ -19,7 +19,7 @@ RANGE: `{{cmd.highest_range_values}}` #![allow(unused_imports)] use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weights for `{{pallet}}`. pub struct WeightInfo(PhantomData); diff --git a/zombienet/kreivo-kusama-local.toml b/zombienet/kreivo-kusama-local.toml index 1b38b25a4..28bab97a1 100644 --- a/zombienet/kreivo-kusama-local.toml +++ b/zombienet/kreivo-kusama-local.toml @@ -6,49 +6,67 @@ chain = "kusama-local" chain_spec_command = "./bin/runtimes/polkadot/chain-spec-generator {% raw %} {{chainName}} {% endraw %}" default_args = ["-lparachain=debug", "-lxcm=trace"] default_command = "./bin/polkadot" -scheduling_lookahead = 2 -[relaychain.async_backing_params] -max_candidate_depth = 3 -allowed_ancestry_len = 2 +[relaychain.genesis.runtimeGenesis.patch.configuration] +config = { async_backing_params = { max_candidate_depth = 3, allowed_ancestry_len = 2 }, scheduler_params = { num_cores = 1, lookahead = 3 } } [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring", + "-lparachain=debug", + "--unsafe-rpc-external", + "--rpc-cors=all", +] name = "alice" validator = true -ws_port = 10000 +rpc_port = 10000 [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring", + "-lparachain=debug", + "--unsafe-rpc-external", + "--rpc-cors=all", +] name = "bob" validator = true +rpc_port = 11000 [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring", + "-lparachain=debug", + "--unsafe-rpc-external", + "--rpc-cors=all", +] name = "charlie" validator = true +rpc_port = 12000 [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring", + "-lparachain=debug", + "--unsafe-rpc-external", + "--rpc-cors=all", +] name = "dave" validator = true +rpc_port = 13000 [[parachains]] id = 2281 chain = "local" -chain_spec_command = "./target/release/chain-spec-generator {% raw %} {{chainName}} {% endraw %}" +chain_spec_command = "./target/production/chain-spec-generator {% raw %} {{chainName}} {% endraw %}" cumulus_based = true add_to_genesis = true onboard_as_parachain = true [[parachains.collators]] command = "./bin/polkadot-parachain" -args = ["--force-authoring --log=xcm=trace,parachain=trace"] +args = [ + "--log=xcm=trace", + "--authoring slot-based", +] name = "kreivo1" -ws_port = 20000 - -[[parachains.collators]] -command = "./bin/polkadot-parachain" -args = ["--force-authoring --log=xcm=trace,parachain=trace"] -name = "kreivo2" -ws_port = 21000 +rpc_port = 20000 diff --git a/zombienet/kreivo-paseo-local.toml b/zombienet/kreivo-paseo-local.toml index 0b313587b..e66c262d8 100644 --- a/zombienet/kreivo-paseo-local.toml +++ b/zombienet/kreivo-paseo-local.toml @@ -13,23 +13,31 @@ max_candidate_depth = 3 allowed_ancestry_len = 2 [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all", +] name = "alice" validator = true -ws_port = 10000 +rpc_port = 10000 [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all", +] name = "bob" validator = true [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all", +] name = "charlie" validator = true [[relaychain.nodes]] -extra_args = ["--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all"] +extra_args = [ + "--force-authoring -lparachain=debug --unsafe-rpc-external --rpc-cors=all", +] name = "dave" validator = true @@ -45,10 +53,22 @@ onboard_as_parachain = true command = "./bin/polkadot-parachain" args = ["--force-authoring --log=xcm=trace,parachain=trace"] name = "kreivo1" -ws_port = 20000 +rpc_port = 20000 [[parachains.collators]] command = "./bin/polkadot-parachain" args = ["--force-authoring --log=xcm=trace,parachain=trace"] name = "kreivo2" -ws_port = 21000 +rpc_port = 21000 + +[[parachains.collators]] +command = "./bin/polkadot-parachain" +args = ["--force-authoring --log=xcm=trace,parachain=trace"] +name = "kreivo3" +rpc_port = 22000 + +[[parachains.collators]] +command = "./bin/polkadot-parachain" +args = ["--force-authoring --log=xcm=trace,parachain=trace"] +name = "kreivo4" +rpc_port = 23000