diff --git a/.gitguardian.yaml b/.gitguardian.yaml new file mode 100644 index 000000000..dd1ee3e4e --- /dev/null +++ b/.gitguardian.yaml @@ -0,0 +1,7 @@ +# Required, otherwise ggshield considers the file to use the deprecated v1 format +version: 2 + +secret: + # Exclude files and paths by globbing + ignored-paths: + - node/service/chain-specs/example.json diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml deleted file mode 100644 index 04af2420e..000000000 --- a/.github/workflows/check.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Check Set-Up & Build - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ '**' ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check: - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - - name: Install linux dependencies - run: sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler - - - name: Install Rust - run: | - rustup update stable --no-self-update - rustup target add wasm32-unknown-unknown - - - name: Check TOML - uses: dprint/check@v2.2 - - - name: Check Format - run: | - cargo fmt -- --check - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - - name: Check with Clippy - run: | - cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings - - - name: Check Build - run: | - SKIP_WASM_BUILD=1 cargo check --release - - - name: Check Build for Benchmarking - run: > - pushd node && - cargo check --features=runtime-benchmarks --release diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 969c0f124..1fd160065 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,58 +1,109 @@ -name: CI +name: PR +# Controls when the action will run. on: - pull_request: - branches: - - dev - - master - - 'feature/**' - - 'release/**' - - 'hotfix/**' - types: - - opened - - synchronize - - edited - -env: - PROFILE: release + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ '**' ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + id-token: write + contents: read + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: - runs-on: ubuntu-latest - concurrency: dev + format: + name: Check Lints + runs-on: ubuntu-22.04 steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - - name: Cache cargo registry - uses: actions/cache@v3 - continue-on-error: false + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - - name: Configure AWS credentials ORG - uses: aws-actions/configure-aws-credentials@v1 + toolchain: nightly-2022-10-09 + override: true + components: rustfmt + - name: Check TOML + uses: dprint/check@v2.2 + - name: Check Format + run: | + cargo fmt -- --check + + check: + name: Cargo check + needs: format + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install linux dependencies + run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 with: - aws-access-key-id: ${{ secrets.ORG_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.ORG_AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 + toolchain: nightly-2022-10-09 + override: true + target: wasm32-unknown-unknown + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Check Build + run: | + SKIP_WASM_BUILD=1 cargo check --release + - name: Check Build for Benchmarking + run: > + pushd node && + cargo check --features=runtime-benchmarks --release - - name: Login to Amazon ECR ORG - id: login-ecr-org - uses: aws-actions/amazon-ecr-login@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + clippy: + name: Run Clippy + needs: format + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install linux dependencies + run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly-2022-10-09 + override: true + target: wasm32-unknown-unknown + components: clippy + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Check with Clippy + run: | + cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings - - name: Build and push docker image to ECR Docker - uses: docker/build-push-action@v4 + tests: + name: Run tests + needs: format + # The type of runner that the job will run on + runs-on: ["self-hosted", "cere-network-memory-large"] + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - name: Install linux dependencies + run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly-2022-10-09 + override: true + target: wasm32-unknown-unknown + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.22.0' + args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' + - name: Upload coverage report + uses: actions/upload-artifact@v3 with: - context: . - file: Dockerfile.tests - push: false - build-args: | - "ECR_REGISTRY=${{ steps.login-ecr-org.outputs.registry }}" + name: tarpaulin coverage + path: ./tarpaulin-report.xml diff --git a/.github/workflows/dev.yaml b/.github/workflows/e2e.yaml similarity index 95% rename from .github/workflows/dev.yaml rename to .github/workflows/e2e.yaml index 3c43d54af..8eefae485 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/e2e.yaml @@ -1,9 +1,8 @@ -name: Release to dev +name: E2E on: push: branches: - 'dev' - - 'deployment-0.9.30' workflow_dispatch: env: @@ -69,7 +68,7 @@ jobs: tags: | ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }} - ${{ steps.login-ecr.outputs.registry }}/pos-network-node:deployment-0.9.30-latest + ${{ steps.login-ecr.outputs.registry }}/pos-network-node:dev-latest - name: Copy wasm artifacts from the image run: | @@ -92,6 +91,9 @@ jobs: trigger-e2e-tests: runs-on: ubuntu-latest + # e2e tests are in migration process. Disable the tests as recommended in this slack message: + # https://cere-network.slack.com/archives/C04LRGSLWG0/p1699892758049319 + if: false needs: build steps: - name: Get short SHA diff --git a/.github/workflows/ecr.yaml b/.github/workflows/ecr.yaml new file mode 100644 index 000000000..a75c755e9 --- /dev/null +++ b/.github/workflows/ecr.yaml @@ -0,0 +1,57 @@ +name: ECR + +on: + pull_request: + branches: + - dev + - master + - 'release/**' + - 'hotfix/**' + types: + - opened + - synchronize + - edited + +env: + PROFILE: release + +jobs: + build: + runs-on: ubuntu-latest + concurrency: dev + steps: + - uses: actions/checkout@v3 + + - name: Cache cargo registry + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Configure AWS credentials ORG + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.ORG_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.ORG_AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Login to Amazon ECR ORG + id: login-ecr-org + uses: aws-actions/amazon-ecr-login@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push docker image to ECR Docker + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile.tests + push: false + build-args: | + "ECR_REGISTRY=${{ steps.login-ecr-org.outputs.registry }}" diff --git a/.github/workflows/stage.yaml b/.github/workflows/stage.yaml index 700d7d937..02959cc64 100644 --- a/.github/workflows/stage.yaml +++ b/.github/workflows/stage.yaml @@ -68,7 +68,6 @@ jobs: "SCCACHE_BUCKET=cere-blockchain-sccache" tags: | - ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ github.sha }} ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }} ${{ steps.login-ecr.outputs.registry }}/pos-network-node:dev-latest diff --git a/.gitignore b/.gitignore index ac9d585fc..339fc5fda 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,3 @@ .direnv .idea - -# ddc-metrics-offchain-worker mock files -pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc.contract diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 000000000..d9f213a06 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,30 @@ +edition = "2021" + +# Basic +hard_tabs = true +max_width = 100 +use_small_heuristics = "Max" + +# Imports +imports_granularity = "Crate" +reorder_imports = true +group_imports = "StdExternalCrate" + +# Consistency +newline_style = "Unix" + +# Format comments +comment_width = 100 +wrap_comments = true + +# Misc +chain_width = 80 +spaces_around_ranges = false +binop_separator = "Back" +reorder_impl_items = false +match_arm_leading_pipes = "Preserve" +match_arm_blocks = false +match_block_trailing_comma = true +trailing_comma = "Vertical" +trailing_semicolon = false +use_field_init_shorthand = true diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdcf856c..2bf2e0a62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,29 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Legend - -[C] Cere Runtime -[D] Cere Dev Runtime +- [C] Changes is `Cere` Runtime +- [D] Changes is `Cere Dev` Runtime ## [vNext] -### Added +- ... + +## [4.8.3] ### Changed -- ... +- [C,D] Updated Substrate to polkadot-v0.9.31 ## [4.8.2] ### Added -- [C,D] New `pallet-ddc-nodes` is added which allows registering a DDC node within the network with specific settings. -- [C,D] New `pallet-ddc-clusters` is added which allows launching a DDC cluster in the network and managing it. -- [C,D] New `pallet-ddc-staking` is added which allows making bonds for DDC nodes before joining a DDC cluster. -- [C,D] New `pallet-ddc-customers` is added which allows depositing tokens and creating buckets for DDC customers. -- [C,D] New `pallet-ddc-payouts` is added which allows processing payouts to DDC nodes providers based on DAC validation results. -- New `ddc-primitives` crate with DDC common types definition. -- New `ddc-traits` crate with DDC common traits definition. +- [D] New `pallet-ddc-validator` which implements DDC CDN nodes validation and rewarding. You can enable DDC validation providing `--enable-ddc-validation` argument and `--dac-url` argument to specify DAC endpoint. It will only work on the nodes with validation and offchain workers enabled as well. +- [D] Several calls for `pallet-ddc-staking` to distribute rewards. +- [D] Third kind of account in DDC Staking for DDC nodes (along with stash and controller). +- [D] DDC cluster managers access control list in `pallet-ddc-staking` managed by governance. +- [Zombienet](https://github.com/paritytech/zombienet) configurations to test block building and spawn a network for DDC validation debugging. +- New `ddc-primitives` crate with DDC common types definition + +### Changed ## [4.8.1] diff --git a/Cargo.lock b/Cargo.lock index b107eb30d..dcc785f1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.1", + "gimli 0.28.0", ] [[package]] @@ -91,26 +91,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alt_serde" -version = "1.0.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbdd08f26bc9972e3597a32bb7fe2b0de4e85ccfb4214acec94165b940aa537e" -dependencies = [ - "alt_serde_derive", -] - -[[package]] -name = "alt_serde_derive" -version = "1.0.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629ddaf5b2675d9a27e9521a88870f8edea113e4a83d6d5178268b0d70e9a9a3" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -126,15 +106,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - [[package]] name = "ansi_term" version = "0.12.1" @@ -211,12 +182,12 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" dependencies = [ "concurrent-queue", - "event-listener 4.0.0", + "event-listener 3.1.0", "event-listener-strategy", "futures-core", "pin-project-lite 0.2.13", @@ -224,30 +195,30 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.8.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "fc5ea910c42e5ab19012bab31f53cb4d63d54c3a27730f9a833a88efcf4bb52d" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.1.1", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.1.0", + "futures-lite 2.0.1", "slab", ] [[package]] name = "async-global-executor" -version = "2.4.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4353121d5644cdf2beb5726ab752e79a8db1ebb52031770ec47db31d245526" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" dependencies = [ - "async-channel 2.1.1", + "async-channel 1.9.0", "async-executor", - "async-io 2.2.1", - "async-lock 3.2.0", + "async-io 1.13.0", + "async-lock 2.8.0", "blocking", - "futures-lite 2.1.0", + "futures-lite 1.13.0", "once_cell", ] @@ -273,21 +244,22 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d3b15875ba253d1110c740755e246537483f152fa334f91abd7fe84c88b3ff" +checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.1.1", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.0.1", "parking", - "polling 3.3.1", - "rustix 0.38.27", + "polling 3.3.0", + "rustix 0.38.25", "slab", "tracing", - "windows-sys 0.52.0", + "waker-fn", + "windows-sys 0.48.0", ] [[package]] @@ -301,11 +273,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.2.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +checksum = "655b9c7fe787d3b25cc0f804a1a8401790f0c5bc395beb5a64dc77d8de079105" dependencies = [ - "event-listener 4.0.0", + "event-listener 3.1.0", "event-listener-strategy", "pin-project-lite 0.2.13", ] @@ -323,7 +295,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.27", + "rustix 0.38.25", "windows-sys 0.48.0", ] @@ -333,13 +305,13 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.2.1", + "async-io 2.2.0", "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.27", + "rustix 0.38.25", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -374,9 +346,9 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" +checksum = "6ba50e24d9ee0a8950d3d03fc6d0dd10aa14b5de3b101949b4e160f7fee7c723" dependencies = [ "async-std", "async-trait", @@ -500,12 +472,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bimap" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" - [[package]] name = "bincode" version = "1.3.3" @@ -517,9 +483,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.65.1" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ "bitflags 1.3.2", "cexpr", @@ -527,13 +493,12 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 1.0.109", ] [[package]] @@ -659,12 +624,12 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.2.0", + "async-channel 2.1.0", + "async-lock 3.1.1", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.0.1", "piper", "tracing", ] @@ -772,7 +737,7 @@ dependencies = [ "cargo-platform", "semver 1.0.20", "serde", - "serde_json 1.0.108", + "serde_json", ] [[package]] @@ -787,7 +752,7 @@ dependencies = [ [[package]] name = "cere" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-cli", "sc-cli", @@ -796,7 +761,7 @@ dependencies = [ [[package]] name = "cere-cli" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-client", "cere-service", @@ -806,11 +771,12 @@ dependencies = [ "sc-service", "substrate-build-script-utils", "try-runtime-cli", + "url", ] [[package]] name = "cere-client" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-dev-runtime", "cere-runtime", @@ -818,7 +784,6 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "node-primitives", - "pallet-contracts-rpc", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "sc-client-api", @@ -842,7 +807,7 @@ dependencies = [ [[package]] name = "cere-dev-runtime" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-dev-runtime-constants", "cere-runtime-common", @@ -864,16 +829,13 @@ dependencies = [ "pallet-bags-list", "pallet-balances", "pallet-bounties", - "pallet-cere-ddc", "pallet-chainbridge", "pallet-child-bounties", "pallet-collective", "pallet-contracts", "pallet-contracts-primitives", - "pallet-contracts-rpc-runtime-api", "pallet-ddc-clusters", "pallet-ddc-customers", - "pallet-ddc-metrics-offchain-worker", "pallet-ddc-nodes", "pallet-ddc-payouts", "pallet-ddc-staking", @@ -934,18 +896,18 @@ dependencies = [ [[package]] name = "cere-dev-runtime-constants" -version = "4.8.2" +version = "4.8.3" dependencies = [ "node-primitives", + "sp-runtime", ] [[package]] name = "cere-rpc" -version = "4.8.2" +version = "4.8.3" dependencies = [ "jsonrpsee", "node-primitives", - "pallet-contracts-rpc", "pallet-transaction-payment-rpc", "sc-chain-spec", "sc-client-api", @@ -971,7 +933,7 @@ dependencies = [ [[package]] name = "cere-runtime" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-runtime-common", "cere-runtime-constants", @@ -993,16 +955,13 @@ dependencies = [ "pallet-bags-list", "pallet-balances", "pallet-bounties", - "pallet-cere-ddc", "pallet-chainbridge", "pallet-child-bounties", "pallet-collective", "pallet-contracts", "pallet-contracts-primitives", - "pallet-contracts-rpc-runtime-api", "pallet-ddc-clusters", "pallet-ddc-customers", - "pallet-ddc-metrics-offchain-worker", "pallet-ddc-nodes", "pallet-ddc-payouts", "pallet-ddc-staking", @@ -1063,7 +1022,7 @@ dependencies = [ [[package]] name = "cere-runtime-common" -version = "4.8.2" +version = "4.8.3" dependencies = [ "frame-support", "node-primitives", @@ -1073,14 +1032,14 @@ dependencies = [ [[package]] name = "cere-runtime-constants" -version = "4.8.2" +version = "4.8.3" dependencies = [ "node-primitives", ] [[package]] name = "cere-service" -version = "4.8.2" +version = "4.8.3" dependencies = [ "cere-client", "cere-dev-runtime", @@ -1189,7 +1148,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -1224,31 +1183,29 @@ checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading", ] [[package]] name = "clap" -version = "3.2.25" +version = "4.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0" dependencies = [ "atty", "bitflags 1.3.2", "clap_derive", "clap_lex", - "indexmap 1.9.3", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b" dependencies = [ "heck", "proc-macro-error", @@ -1259,22 +1216,13 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "comfy-table" version = "6.2.0" @@ -1288,9 +1236,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -1315,9 +1263,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -1325,9 +1273,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core2" @@ -1545,16 +1493,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ctr" version = "0.9.2" @@ -1564,17 +1502,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - [[package]] name = "curve25519-dalek" version = "2.1.3" @@ -1630,15 +1557,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1646,9 +1573,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", "syn 1.0.109", @@ -1656,7 +1583,7 @@ dependencies = [ [[package]] name = "ddc-primitives" -version = "0.1.0" +version = "4.8.3" dependencies = [ "parity-scale-codec", "scale-info", @@ -1667,7 +1594,7 @@ dependencies = [ [[package]] name = "ddc-traits" -version = "0.1.0" +version = "4.8.3" dependencies = [ "ddc-primitives", "frame-support", @@ -1675,6 +1602,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", + "sp-std", ] [[package]] @@ -1698,10 +1626,10 @@ dependencies = [ ] [[package]] -name = "difference" -version = "2.0.0" +name = "difflib" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" @@ -1783,6 +1711,12 @@ dependencies = [ "quick-error", ] +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "downcast-rs" version = "1.2.0" @@ -1897,9 +1831,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck", "proc-macro2", @@ -1978,12 +1912,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -2013,24 +1947,13 @@ dependencies = [ "pin-project-lite 0.2.13", ] -[[package]] -name = "event-listener" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.13", -] - [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" dependencies = [ - "event-listener 4.0.0", + "event-listener 3.1.0", "pin-project-lite 0.2.13", ] @@ -2107,14 +2030,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] @@ -2135,9 +2058,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", "rand 0.8.5", @@ -2162,6 +2085,15 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2171,24 +2103,30 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -2211,7 +2149,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", "array-bytes", @@ -2241,7 +2179,7 @@ dependencies = [ "sc-service", "sc-sysinfo", "serde", - "serde_json 1.0.108", + "serde_json", "serde_nanos", "sp-api", "sp-blockchain", @@ -2262,9 +2200,9 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -2273,7 +2211,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2289,7 +2227,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -2318,7 +2256,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bitflags 1.3.2", "frame-metadata", @@ -2350,7 +2288,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", "cfg-expr", @@ -2364,10 +2302,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -2376,7 +2314,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -2386,7 +2324,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "log", @@ -2404,7 +2342,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -2419,7 +2357,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -2428,7 +2366,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "parity-scale-codec", @@ -2437,18 +2375,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - [[package]] name = "fs2" version = "0.4.3" @@ -2459,12 +2385,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "funty" version = "2.0.0" @@ -2537,13 +2457,14 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" dependencies = [ "fastrand 2.0.1", "futures-core", "futures-io", + "memchr", "parking", "pin-project-lite 0.2.13", ] @@ -2691,9 +2612,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -2703,15 +2624,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", "bstr", + "fnv", "log", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex", ] [[package]] @@ -2766,7 +2687,7 @@ dependencies = [ "pest", "pest_derive", "serde", - "serde_json 1.0.108", + "serde_json", "thiserror", ] @@ -2796,9 +2717,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -2833,12 +2754,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" - [[package]] name = "hmac" version = "0.8.1" @@ -2898,7 +2813,7 @@ checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", - "itoa 1.0.9", + "itoa", ] [[package]] @@ -2945,7 +2860,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.9", + "itoa", "pin-project-lite 0.2.13", "socket2 0.4.10", "tokio", @@ -3005,9 +2920,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3025,9 +2940,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "1.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" +checksum = "065c008e570a43c00de6aed9714035e5ea6a498c255323db9091722af6ee67dd" dependencies = [ "async-io 1.13.0", "core-foundation", @@ -3052,9 +2967,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ "serde", ] @@ -3088,7 +3003,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.2", ] [[package]] @@ -3166,7 +3081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.27", + "rustix 0.38.25", "windows-sys 0.48.0", ] @@ -3179,12 +3094,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.9" @@ -3202,9 +3111,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -3268,7 +3177,7 @@ dependencies = [ "rand 0.8.5", "rustc-hash", "serde", - "serde_json 1.0.108", + "serde_json", "soketto", "thiserror", "tokio", @@ -3289,7 +3198,7 @@ dependencies = [ "jsonrpsee-core", "jsonrpsee-types", "serde", - "serde_json 1.0.108", + "serde_json", "tokio", "tracing", "tracing-futures", @@ -3301,7 +3210,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -3316,7 +3225,7 @@ dependencies = [ "anyhow", "beef", "serde", - "serde_json 1.0.108", + "serde_json", "thiserror", "tracing", ] @@ -3344,7 +3253,7 @@ dependencies = [ "http", "jsonrpsee-core", "jsonrpsee-types", - "serde_json 1.0.108", + "serde_json", "soketto", "tokio", "tokio-stream", @@ -3385,9 +3294,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" dependencies = [ "parity-util-mem", "smallvec", @@ -3395,9 +3304,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" dependencies = [ "kvdb", "parity-util-mem", @@ -3406,15 +3315,13 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" dependencies = [ - "fs-swap", "kvdb", "log", "num_cpus", - "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3440,16 +3347,6 @@ version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libloading" version = "0.7.4" @@ -3468,9 +3365,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.46.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" +checksum = "ec878fda12ebec479186b3914ebc48ff180fa4c51847e11a1a68bf65249e02c1" dependencies = [ "bytes", "futures", @@ -3478,12 +3375,8 @@ dependencies = [ "getrandom 0.2.11", "instant", "lazy_static", - "libp2p-autonat", "libp2p-core", - "libp2p-deflate", "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-mdns", @@ -3491,49 +3384,24 @@ dependencies = [ "libp2p-mplex", "libp2p-noise", "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-swarm-derive", "libp2p-tcp", - "libp2p-uds", "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr", "parking_lot 0.12.1", "pin-project", - "rand 0.7.3", "smallvec", ] -[[package]] -name = "libp2p-autonat" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-request-response", - "libp2p-swarm", - "log", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.8.5", -] - [[package]] name = "libp2p-core" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" +checksum = "799676bb0807c788065e57551c6527d461ad572162b0519d1958946ff9e0539d" dependencies = [ "asn1_der", "bs58", @@ -3544,17 +3412,15 @@ dependencies = [ "futures-timer", "instant", "lazy_static", - "libsecp256k1", "log", "multiaddr", "multihash", "multistream-select", "parking_lot 0.12.1", "pin-project", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.8.5", - "ring 0.16.20", "rw-stream-sink", "sha2 0.10.8", "smallvec", @@ -3564,22 +3430,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-deflate" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" -dependencies = [ - "flate2", - "futures", - "libp2p-core", -] - [[package]] name = "libp2p-dns" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" +checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720" dependencies = [ "async-std-resolver", "futures", @@ -3590,57 +3445,11 @@ dependencies = [ "trust-dns-resolver", ] -[[package]] -name = "libp2p-floodsub" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" -dependencies = [ - "cuckoofilter", - "fnv", - "futures", - "libp2p-core", - "libp2p-swarm", - "log", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.7.3", - "smallvec", -] - -[[package]] -name = "libp2p-gossipsub" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" -dependencies = [ - "asynchronous-codec", - "base64 0.13.1", - "byteorder", - "bytes", - "fnv", - "futures", - "hex_fmt", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prometheus-client", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.7.3", - "regex", - "sha2 0.10.8", - "smallvec", - "unsigned-varint", - "wasm-timer", -] - [[package]] name = "libp2p-identify" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" +checksum = "dcf9a121f699e8719bda2e6e9e9b6ddafc6cff4602471d6481c1067930ccb29b" dependencies = [ "asynchronous-codec", "futures", @@ -3648,9 +3457,9 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru", - "prost 0.10.4", - "prost-build 0.10.4", + "lru 0.8.1", + "prost", + "prost-build", "prost-codec", "smallvec", "thiserror", @@ -3659,9 +3468,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" +checksum = "6721c200e2021f6c3fab8b6cf0272ead8912d871610ee194ebd628cecf428f22" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", @@ -3674,9 +3483,9 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.7.3", + "prost", + "prost-build", + "rand 0.8.5", "sha2 0.10.8", "smallvec", "thiserror", @@ -3687,16 +3496,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" +checksum = "761704e727f7d68d58d7bc2231eafae5fc1b9814de24290f126df09d4bd37a15" dependencies = [ "async-io 1.13.0", "data-encoding", "dns-parser", "futures", "if-watch", - "lazy_static", "libp2p-core", "libp2p-swarm", "log", @@ -3708,25 +3516,23 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" +checksum = "9ee31b08e78b7b8bfd1c4204a9dd8a87b4fcdf6dafc57eb51701c1c264a81cb9" dependencies = [ "libp2p-core", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-ping", - "libp2p-relay", "libp2p-swarm", "prometheus-client", ] [[package]] name = "libp2p-mplex" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" +checksum = "692664acfd98652de739a8acbb0a0d670f1d67190a49be6b4395e22c37337d89" dependencies = [ "asynchronous-codec", "bytes", @@ -3735,16 +3541,16 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-noise" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" +checksum = "048155686bd81fe6cb5efdef0c6290f25ad32a0a42e8f4f72625cf6a505a206f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -3752,8 +3558,8 @@ dependencies = [ "lazy_static", "libp2p-core", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.8.5", "sha2 0.10.8", "snow", @@ -3764,105 +3570,25 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" -dependencies = [ - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "log", - "prost 0.10.4", - "prost-build 0.10.4", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.22.3" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6468f382568da936b4fa1cff273ce59b1debf873ff5f4ca412c3b91d0b37442c" +checksum = "7228b9318d34689521349a86eb39a3c3a802c9efc99a0568062ffb80913e3f91" dependencies = [ - "futures", - "log", - "pin-project", - "rand 0.8.5", - "salsa20", - "sha3", -] - -[[package]] -name = "libp2p-relay" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" -dependencies = [ - "asynchronous-codec", - "bytes", - "either", "futures", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "pin-project", - "prost 0.10.4", - "prost-build 0.10.4", - "prost-codec", "rand 0.8.5", - "smallvec", - "static_assertions", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-rendezvous" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" -dependencies = [ - "asynchronous-codec", - "bimap", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", - "unsigned-varint", "void", ] [[package]] name = "libp2p-request-response" -version = "0.19.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" +checksum = "8827af16a017b65311a410bb626205a9ad92ec0473967618425039fa5231adc1" dependencies = [ "async-trait", "bytes", @@ -3871,16 +3597,16 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.37.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" +checksum = "46d13df7c37807965d82930c0e4b04a659efcb6cca237373b206043db5398ecf" dependencies = [ "either", "fnv", @@ -3890,7 +3616,7 @@ dependencies = [ "libp2p-core", "log", "pin-project", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "thiserror", "void", @@ -3898,48 +3624,36 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.28.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" +checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" dependencies = [ + "heck", "quote", "syn 1.0.109", ] [[package]] name = "libp2p-tcp" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" +checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92" dependencies = [ "async-io 1.13.0", "futures", "futures-timer", "if-watch", - "ipnet", "libc", "libp2p-core", "log", "socket2 0.4.10", ] -[[package]] -name = "libp2p-uds" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" -dependencies = [ - "async-std", - "futures", - "libp2p-core", - "log", -] - [[package]] name = "libp2p-wasm-ext" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" +checksum = "a17b5b8e7a73e379e47b1b77f8a82c4721e97eca01abcd18e9cd91a23ca6ce97" dependencies = [ "futures", "js-sys", @@ -3951,9 +3665,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.36.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" +checksum = "3758ae6f89b2531a24b6d9f5776bda6a626b60a57600d7185d43dfa75ca5ecc4" dependencies = [ "either", "futures", @@ -3970,12 +3684,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.38.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" +checksum = "0d6874d66543c4f7e26e3b8ca9a6bead351563a13ab4fafd43c7927f7c0d6c12" dependencies = [ "futures", "libp2p-core", + "log", "parking_lot 0.12.1", "thiserror", "yamux", @@ -3994,9 +3709,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.6.3+6.28.2" +version = "0.8.3+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184ce2a189a817be2731070775ad053b6804a340fee05c6686d711db27455917" +checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" dependencies = [ "bindgen", "bzip2-sys", @@ -4105,9 +3820,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -4137,6 +3852,15 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "lru" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +dependencies = [ + "hashbrown 0.12.3", +] + [[package]] name = "lru-cache" version = "0.1.2" @@ -4218,7 +3942,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.27", + "rustix 0.38.25", ] [[package]] @@ -4250,9 +3974,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" dependencies = [ "hash-db", "hashbrown 0.12.3", @@ -4294,15 +4018,42 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "multiaddr" version = "0.14.0" @@ -4355,7 +4106,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", @@ -4371,9 +4122,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ "bytes", "futures", @@ -4501,7 +4252,7 @@ dependencies = [ [[package]] name = "node-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-system", "parity-scale-codec", @@ -4533,6 +4284,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "num-bigint" version = "0.2.6" @@ -4571,7 +4328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ "arrayvec 0.7.4", - "itoa 1.0.9", + "itoa", ] [[package]] @@ -4651,9 +4408,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -4679,28 +4436,10 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" -[[package]] -name = "output_vt100" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi", -] - -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -4716,7 +4455,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -4731,7 +4470,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4755,7 +4494,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4775,7 +4514,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4790,7 +4529,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4805,24 +4544,9 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-cere-ddc" -version = "4.8.2" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-chainbridge" -version = "4.8.2" +version = "4.8.3" dependencies = [ "frame-support", "frame-system", @@ -4838,7 +4562,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4857,7 +4581,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -4874,7 +4598,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bitflags 1.3.2", "frame-benchmarking", @@ -4890,80 +4614,47 @@ dependencies = [ "scale-info", "serde", "smallvec", + "sp-api", "sp-core", "sp-io", "sp-runtime", "sp-sandbox", "sp-std", "wasm-instrument", - "wasmi-validation", -] - -[[package]] -name = "pallet-contracts-primitives" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" -dependencies = [ - "bitflags 1.3.2", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-contracts-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "wasmi-validation", ] [[package]] -name = "pallet-contracts-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +name = "pallet-contracts-primitives" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "jsonrpsee", - "pallet-contracts-primitives", - "pallet-contracts-rpc-runtime-api", + "bitflags 1.3.2", "parity-scale-codec", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", "sp-runtime", + "sp-std", + "sp-weights", ] [[package]] -name = "pallet-contracts-rpc-runtime-api" +name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "pallet-contracts-primitives", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-runtime", - "sp-std", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "pallet-ddc-clusters" -version = "4.8.2" +version = "4.8.3" dependencies = [ "ddc-primitives", "ddc-traits", "frame-benchmarking", "frame-support", "frame-system", - "hex", "hex-literal", "pallet-balances", "pallet-contracts", @@ -4983,7 +4674,7 @@ dependencies = [ [[package]] name = "pallet-ddc-customers" -version = "0.1.0" +version = "4.8.3" dependencies = [ "ddc-primitives", "ddc-traits", @@ -5004,33 +4695,9 @@ dependencies = [ "substrate-test-utils", ] -[[package]] -name = "pallet-ddc-metrics-offchain-worker" -version = "4.8.2" -dependencies = [ - "alt_serde", - "frame-support", - "frame-system", - "hex", - "hex-literal", - "pallet-balances", - "pallet-contracts", - "pallet-randomness-collective-flip", - "pallet-timestamp", - "parity-scale-codec", - "pretty_assertions", - "scale-info", - "serde_json 1.0.44", - "sp-core", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-ddc-nodes" -version = "4.8.2" +version = "4.8.3" dependencies = [ "ddc-primitives", "ddc-traits", @@ -5052,7 +4719,7 @@ dependencies = [ [[package]] name = "pallet-ddc-payouts" -version = "4.8.2" +version = "4.8.3" dependencies = [ "byte-unit", "ddc-primitives", @@ -5076,7 +4743,7 @@ dependencies = [ [[package]] name = "pallet-ddc-staking" -version = "4.8.2" +version = "4.8.3" dependencies = [ "ddc-primitives", "ddc-traits", @@ -5100,14 +4767,16 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5116,7 +4785,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5140,7 +4809,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5153,7 +4822,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5170,7 +4839,7 @@ dependencies = [ [[package]] name = "pallet-erc20" -version = "4.8.2" +version = "4.8.3" dependencies = [ "frame-support", "frame-system", @@ -5188,7 +4857,7 @@ dependencies = [ [[package]] name = "pallet-erc721" -version = "4.8.2" +version = "4.8.3" dependencies = [ "frame-support", "frame-system", @@ -5205,7 +4874,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5226,7 +4895,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5249,7 +4918,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5265,7 +4934,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5285,7 +4954,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5302,7 +4971,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5319,11 +4988,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5334,7 +5004,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5351,7 +5021,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5371,7 +5041,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -5381,7 +5051,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5398,7 +5068,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5421,7 +5091,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5436,7 +5106,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5450,7 +5120,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5465,7 +5135,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5481,7 +5151,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5502,7 +5172,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5518,7 +5188,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5532,7 +5202,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5555,9 +5225,9 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -5566,7 +5236,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5580,7 +5250,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5598,7 +5268,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5617,7 +5287,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-support", "frame-system", @@ -5633,7 +5303,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5648,7 +5318,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5659,7 +5329,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5676,7 +5346,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5692,7 +5362,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-benchmarking", "frame-support", @@ -5725,9 +5395,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -5740,11 +5410,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate 2.0.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -5758,9 +5428,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" dependencies = [ "cfg-if", "hashbrown 0.12.3", @@ -5849,7 +5519,7 @@ dependencies = [ "libc", "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -5884,9 +5554,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -6039,16 +5709,16 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite 0.2.13", - "rustix 0.38.27", + "rustix 0.38.25", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6081,42 +5751,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "pretty_assertions" -version = "0.6.1" +name = "predicates" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ - "ansi_term 0.11.0", - "ctor", - "difference", - "output_vt100", + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", ] [[package]] -name = "prettyplease" -version = "0.1.25" +name = "predicates-core" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ - "proc-macro2", - "syn 1.0.109", + "predicates-core", + "termtree", ] [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 1.0.109", ] [[package]] name = "primitive-types" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -6135,16 +5813,6 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" -dependencies = [ - "toml_datetime", - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -6171,9 +5839,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -6194,37 +5862,27 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" +checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" dependencies = [ "dtoa", - "itoa 1.0.9", - "owning_ref", + "itoa", + "parking_lot 0.12.1", "prometheus-client-derive-text-encode", ] [[package]] name = "prometheus-client-derive-text-encode" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "prost" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" -dependencies = [ - "bytes", - "prost-derive 0.10.1", -] - [[package]] name = "prost" version = "0.11.9" @@ -6232,29 +5890,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive 0.11.9", -] - -[[package]] -name = "prost-build" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" -dependencies = [ - "bytes", - "cfg-if", - "cmake", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost 0.10.4", - "prost-types 0.10.1", - "regex", - "tempfile", - "which", + "prost-derive", ] [[package]] @@ -6270,9 +5906,9 @@ dependencies = [ "log", "multimap", "petgraph", - "prettyplease 0.1.25", - "prost 0.11.9", - "prost-types 0.11.9", + "prettyplease", + "prost", + "prost-types", "regex", "syn 1.0.109", "tempfile", @@ -6281,30 +5917,17 @@ dependencies = [ [[package]] name = "prost-codec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" +checksum = "011ae9ff8359df7915f97302d591cdd9e0e27fbd5a4ddc5bd13b71079bb20987" dependencies = [ "asynchronous-codec", "bytes", - "prost 0.10.4", + "prost", "thiserror", "unsigned-varint", ] -[[package]] -name = "prost-derive" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -6318,23 +5941,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "prost-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" -dependencies = [ - "bytes", - "prost 0.10.4", -] - [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost 0.11.9", + "prost", ] [[package]] @@ -6513,6 +6126,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -6612,18 +6234,18 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "env_logger 0.9.3", - "jsonrpsee", "log", "parity-scale-codec", "serde", - "serde_json 1.0.108", + "serde_json", "sp-core", "sp-io", "sp-runtime", "sp-version", + "substrate-rpc-client", ] [[package]] @@ -6664,9 +6286,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", "getrandom 0.2.11", @@ -6678,9 +6300,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -6779,7 +6401,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", - "errno 0.3.8", + "errno 0.3.7", "io-lifetimes 1.0.11", "libc", "linux-raw-sys 0.3.8", @@ -6788,15 +6410,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.27" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", - "errno 0.3.8", + "errno 0.3.7", "libc", - "linux-raw-sys 0.4.12", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.11", + "windows-sys 0.48.0", ] [[package]] @@ -6864,15 +6486,6 @@ dependencies = [ "rustc_version 0.2.3", ] -[[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" @@ -6885,7 +6498,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "sp-core", @@ -6896,7 +6509,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -6905,8 +6518,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -6923,7 +6536,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "futures-timer", @@ -6946,7 +6559,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6962,7 +6575,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -6971,7 +6584,7 @@ dependencies = [ "sc-network-common", "sc-telemetry", "serde", - "serde_json 1.0.108", + "serde_json", "sp-core", "sp-runtime", ] @@ -6979,9 +6592,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -6990,7 +6603,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "chrono", @@ -7014,7 +6627,7 @@ dependencies = [ "sc-tracing", "sc-utils", "serde", - "serde_json 1.0.108", + "serde_json", "sp-blockchain", "sp-core", "sp-keyring", @@ -7030,7 +6643,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "fnv", "futures", @@ -7058,7 +6671,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "kvdb", @@ -7083,7 +6696,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -7107,7 +6720,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "fork-tree", @@ -7149,7 +6762,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", @@ -7171,7 +6784,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7184,7 +6797,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -7208,7 +6821,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sc-client-api", "sp-authorship", @@ -7219,10 +6832,10 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "lazy_static", - "lru", + "lru 0.7.8", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", @@ -7246,7 +6859,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "environmental", "parity-scale-codec", @@ -7262,7 +6875,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -7277,7 +6890,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "cfg-if", "libc", @@ -7297,7 +6910,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "array-bytes", @@ -7321,7 +6934,7 @@ dependencies = [ "sc-network-gossip", "sc-telemetry", "sc-utils", - "serde_json 1.0.108", + "serde_json", "sp-api", "sp-application-crypto", "sp-arithmetic", @@ -7338,7 +6951,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "finality-grandpa", "futures", @@ -7349,7 +6962,7 @@ dependencies = [ "sc-finality-grandpa", "sc-rpc", "serde", - "serde_json 1.0.108", + "serde_json", "sp-blockchain", "sp-core", "sp-runtime", @@ -7359,9 +6972,9 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "futures", "futures-timer", "log", @@ -7376,12 +6989,12 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "async-trait", "parking_lot 0.12.1", - "serde_json 1.0.108", + "serde_json", "sp-application-crypto", "sp-core", "sp-keystore", @@ -7391,7 +7004,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "async-trait", @@ -7409,11 +7022,11 @@ dependencies = [ "linked-hash-map", "linked_hash_set", "log", - "lru", + "lru 0.7.8", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.10.4", + "prost", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -7422,7 +7035,7 @@ dependencies = [ "sc-peerset", "sc-utils", "serde", - "serde_json 1.0.108", + "serde_json", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -7438,14 +7051,14 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "cid", "futures", "libp2p", "log", - "prost 0.11.9", - "prost-build 0.11.9", + "prost", + "prost-build", "sc-client-api", "sc-network-common", "sp-blockchain", @@ -7458,7 +7071,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7468,7 +7081,7 @@ dependencies = [ "libp2p", "linked_hash_set", "parity-scale-codec", - "prost-build 0.10.4", + "prost-build", "sc-consensus", "sc-peerset", "serde", @@ -7484,14 +7097,14 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "futures", "futures-timer", "libp2p", "log", - "lru", + "lru 0.7.8", "sc-network-common", "sc-peerset", "sp-runtime", @@ -7502,15 +7115,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "sc-client-api", "sc-network-common", "sc-peerset", @@ -7523,21 +7136,23 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "fork-tree", "futures", "libp2p", "log", - "lru", + "lru 0.7.8", + "mockall", "parity-scale-codec", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "sc-client-api", "sc-consensus", "sc-network-common", "sc-peerset", + "sc-utils", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -7551,7 +7166,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "futures", @@ -7570,7 +7185,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "bytes", @@ -7600,20 +7215,20 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "libp2p", "log", "sc-utils", - "serde_json 1.0.108", + "serde_json", "wasm-timer", ] [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7622,7 +7237,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "hash-db", @@ -7637,7 +7252,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool-api", "sc-utils", - "serde_json 1.0.108", + "serde_json", "sp-api", "sp-blockchain", "sp-core", @@ -7652,7 +7267,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", @@ -7663,7 +7278,7 @@ dependencies = [ "sc-transaction-pool-api", "scale-info", "serde", - "serde_json 1.0.108", + "serde_json", "sp-core", "sp-rpc", "sp-runtime", @@ -7675,20 +7290,39 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "jsonrpsee", "log", - "serde_json 1.0.108", + "serde_json", "substrate-prometheus-endpoint", "tokio", ] +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +dependencies = [ + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "directories", @@ -7720,6 +7354,7 @@ dependencies = [ "sc-offchain", "sc-rpc", "sc-rpc-server", + "sc-rpc-spec-v2", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -7727,7 +7362,7 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde", - "serde_json 1.0.108", + "serde_json", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -7758,7 +7393,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -7772,7 +7407,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7782,7 +7417,7 @@ dependencies = [ "sc-consensus-epochs", "sc-finality-grandpa", "serde", - "serde_json 1.0.108", + "serde_json", "sp-blockchain", "sp-runtime", "thiserror", @@ -7791,7 +7426,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "libc", @@ -7801,7 +7436,7 @@ dependencies = [ "regex", "sc-telemetry", "serde", - "serde_json 1.0.108", + "serde_json", "sp-core", "sp-io", "sp-std", @@ -7810,7 +7445,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "chrono", "futures", @@ -7820,7 +7455,7 @@ dependencies = [ "pin-project", "rand 0.7.3", "serde", - "serde_json 1.0.108", + "serde_json", "thiserror", "wasm-timer", ] @@ -7828,9 +7463,9 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "atty", "chrono", "lazy_static", @@ -7859,9 +7494,9 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -7870,8 +7505,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ + "async-trait", "futures", "futures-timer", "linked-hash-map", @@ -7896,8 +7532,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ + "async-trait", "futures", "log", "serde", @@ -7909,7 +7546,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "futures-timer", @@ -7939,7 +7576,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -7984,7 +7621,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.5", "untrusted 0.9.0", ] @@ -8086,41 +7723,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", "syn 2.0.39", ] -[[package]] -name = "serde_json" -version = "1.0.44" -source = "git+https://github.com/Cerebellum-Network/json?branch=no-std-cere#17b8b39421fb94ffb1ddb8fe65630542b0679ada" -dependencies = [ - "alt_serde", - "itoa 0.4.8", - "ryu", -] - [[package]] name = "serde_json" version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ - "itoa 1.0.9", + "itoa", "ryu", "serde", ] @@ -8262,9 +7889,9 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snap" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" @@ -8277,7 +7904,7 @@ dependencies = [ "chacha20poly1305", "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring 0.17.7", + "ring 0.17.5", "rustc_version 0.4.0", "sha2 0.10.8", "subtle", @@ -8322,7 +7949,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "log", @@ -8340,10 +7967,10 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "blake2", - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -8352,7 +7979,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8365,7 +7992,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "integer-sqrt", "num-traits", @@ -8380,7 +8007,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8393,7 +8020,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "parity-scale-codec", @@ -8405,7 +8032,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-api", @@ -8417,11 +8044,11 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "log", - "lru", + "lru 0.7.8", "parity-scale-codec", "parking_lot 0.12.1", "sp-api", @@ -8435,7 +8062,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -8454,7 +8081,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "merlin", @@ -8477,7 +8104,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8491,7 +8118,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8504,7 +8131,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "array-bytes", "base58", @@ -8550,7 +8177,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "blake2", "byteorder", @@ -8564,7 +8191,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -8575,7 +8202,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8584,7 +8211,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "proc-macro2", "quote", @@ -8594,7 +8221,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "environmental", "parity-scale-codec", @@ -8605,7 +8232,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "finality-grandpa", "log", @@ -8623,7 +8250,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8637,7 +8264,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bytes", "futures", @@ -8663,7 +8290,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "lazy_static", "sp-core", @@ -8674,7 +8301,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures", @@ -8691,7 +8318,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "thiserror", "zstd", @@ -8700,7 +8327,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8714,7 +8341,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sp-api", "sp-core", @@ -8724,7 +8351,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "backtrace", "lazy_static", @@ -8734,7 +8361,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "rustc-hash", "serde", @@ -8744,7 +8371,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "either", "hash256-std-hasher", @@ -8767,7 +8394,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8785,10 +8412,10 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "Inflector", - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -8797,7 +8424,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "parity-scale-codec", @@ -8811,7 +8438,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8825,7 +8452,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "scale-info", @@ -8836,7 +8463,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "hash-db", "log", @@ -8858,12 +8485,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8876,7 +8503,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "log", "sp-core", @@ -8889,7 +8516,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "futures-timer", @@ -8905,7 +8532,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "sp-std", @@ -8917,7 +8544,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "sp-api", "sp-runtime", @@ -8926,7 +8553,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "async-trait", "log", @@ -8942,13 +8569,13 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "ahash", "hash-db", "hashbrown 0.12.3", "lazy_static", - "lru", + "lru 0.7.8", "memory-db", "nohash-hasher", "parity-scale-codec", @@ -8965,7 +8592,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8982,7 +8609,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8993,7 +8620,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "log", @@ -9006,7 +8633,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9052,7 +8679,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "serde_json 1.0.108", + "serde_json", "unicode-xid", ] @@ -9153,7 +8780,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "platforms 2.0.0", ] @@ -9161,7 +8788,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -9171,7 +8798,7 @@ dependencies = [ "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", - "serde_json 1.0.108", + "serde_json", "sp-api", "sp-block-builder", "sp-blockchain", @@ -9182,7 +8809,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures-util", "hyper", @@ -9192,10 +8819,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-rpc-client" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" +dependencies = [ + "async-trait", + "jsonrpsee", + "log", + "sc-rpc-api", + "serde", + "sp-runtime", +] + [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "jsonrpsee", "log", @@ -9216,7 +8856,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "futures", "substrate-test-utils-derive", @@ -9226,9 +8866,9 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -9237,9 +8877,9 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "build-helper", "cargo_metadata", "filetime", @@ -9333,7 +8973,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.27", + "rustix 0.38.25", "windows-sys 0.48.0", ] @@ -9347,10 +8987,10 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.16.0" +name = "termtree" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" @@ -9399,12 +9039,11 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.3+5.2.1-patched.2" +version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ "cc", - "fs_extra", "libc", ] @@ -9518,23 +9157,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", -] - [[package]] name = "tower-service" version = "0.3.2" @@ -9610,14 +9232,14 @@ version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "chrono", "lazy_static", "matchers", "parking_lot 0.11.2", "regex", "serde", - "serde_json 1.0.108", + "serde_json", "sharded-slab", "smallvec", "thread_local", @@ -9651,9 +9273,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", "cfg-if", @@ -9665,47 +9287,46 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "log", "rand 0.8.5", "smallvec", "thiserror", "tinyvec", + "tracing", "url", ] [[package]] name = "trust-dns-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ "cfg-if", "futures-util", "ipconfig", "lazy_static", - "log", "lru-cache", "parking_lot 0.12.1", "resolv-conf", "smallvec", "thiserror", + "tracing", "trust-dns-proto", ] [[package]] name = "try-lock" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ "clap", "frame-try-runtime", - "jsonrpsee", "log", "parity-scale-codec", "remote-externalities", @@ -9721,6 +9342,8 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-version", + "sp-weights", + "substrate-rpc-client", "zstd", ] @@ -9777,9 +9400,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -9844,20 +9467,20 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 0.4.0", "percent-encoding", ] [[package]] name = "utf8-width" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" [[package]] name = "valuable" @@ -9928,9 +9551,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -9938,9 +9561,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -9953,9 +9576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -9965,9 +9588,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9975,9 +9598,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -9988,9 +9611,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-gc-api" @@ -10241,9 +9864,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -10255,7 +9878,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.5", "untrusted 0.9.0", ] @@ -10277,7 +9900,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.27", + "rustix 0.38.25", ] [[package]] @@ -10336,7 +9959,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -10373,16 +9996,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.0", + "windows-targets", ] [[package]] @@ -10400,21 +10014,6 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -10427,12 +10026,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - [[package]] name = "windows_aarch64_msvc" version = "0.34.0" @@ -10457,12 +10050,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - [[package]] name = "windows_i686_gnu" version = "0.34.0" @@ -10487,12 +10074,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - [[package]] name = "windows_i686_msvc" version = "0.34.0" @@ -10517,12 +10098,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - [[package]] name = "windows_x86_64_gnu" version = "0.34.0" @@ -10547,12 +10122,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -10565,12 +10134,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - [[package]] name = "windows_x86_64_msvc" version = "0.34.0" @@ -10595,21 +10158,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - -[[package]] -name = "winnow" -version = "0.5.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" diff --git a/Cargo.toml b/Cargo.toml index 9a8187b28..bf3d9b5d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,17 +4,17 @@ path = "src/main.rs" [package] name = "cere" -version = "4.8.2" +version = "4.8.3" build = "build.rs" edition = "2021" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] cere-cli = { path = "cli", features = ["cere-dev-native"] } -sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [workspace] members = [ @@ -25,15 +25,12 @@ members = [ "runtime/cere", "runtime/cere-dev", "pallets/chainbridge", - "pallets/ddc", "pallets/ddc-staking", "pallets/erc721", "pallets/erc20", - "pallets/ddc-metrics-offchain-worker", "pallets/ddc-customers", "pallets/ddc-nodes", "pallets/ddc-clusters", - "pallets/ddc-payouts", "primitives", ] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index bc9d350dd..bcb94e01e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cere-cli" -version = "4.8.2" +version = "4.8.3" edition = "2021" [package.metadata.wasm-pack.profile.release] @@ -12,18 +12,19 @@ wasm-opt = false crate-type = ["cdylib", "rlib"] [dependencies] -clap = { version = "3.1", features = ["derive"], optional = true } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" } -sc-cli = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" } -sc-service = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" } +clap = { version = "4.0.9", features = ["derive"], optional = true } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.31" } +sc-cli = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.31" } +sc-service = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.31" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.31" } +url = "2.4.1" # Local cere-client = { path = "../node/client", optional = true } cere-service = { path = "../node/service", default-features = false, optional = true } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } [features] default = ["cli", "cere-native"] diff --git a/cli/src/cli.rs b/cli/src/cli.rs index b9759c047..7dc8c42f2 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -1,7 +1,7 @@ #[allow(missing_docs)] #[derive(Debug, clap::Parser)] pub struct Cli { - #[clap(subcommand)] + #[command(subcommand)] pub subcommand: Option, #[clap(flatten)] pub run: RunCmd, @@ -9,12 +9,13 @@ pub struct Cli { #[allow(missing_docs)] #[derive(Debug, clap::Parser)] +#[group(skip)] pub struct RunCmd { #[clap(flatten)] pub base: sc_cli::RunCmd, /// Force using Cere Dev runtime. - #[clap(long = "force-cere-dev")] + #[arg(long = "force-cere-dev")] pub force_cere_dev: bool, /// Disable automatic hardware benchmarks. @@ -24,7 +25,7 @@ pub struct RunCmd { /// /// The results are then printed out in the logs, and also sent as part of /// telemetry, if telemetry is enabled. - #[clap(long)] + #[arg(long)] pub no_hardware_benchmarks: bool, } @@ -32,7 +33,7 @@ pub struct RunCmd { #[derive(Debug, clap::Subcommand)] pub enum Subcommand { /// Key management cli utilities - #[clap(subcommand)] + #[command(subcommand)] Key(sc_cli::KeySubcommand), /// Build a chain specification. @@ -57,7 +58,7 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Sub-commands concerned with benchmarking. - #[clap(subcommand)] + #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), /// Try some command against runtime state. diff --git a/cli/src/command.rs b/cli/src/command.rs index 065394cc0..e327ff1df 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -1,10 +1,10 @@ -use crate::cli::{Cli, Subcommand}; - use cere_service::{self, IdentifyVariant}; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use sc_cli::{Error, RuntimeVersion, SubstrateCli}; use sc_service::error::Error as ServiceError; +use crate::cli::{Cli, Subcommand}; + impl SubstrateCli for Cli { fn impl_name() -> String { "Cere Node".into() diff --git a/cli/src/lib.rs b/cli/src/lib.rs index e480f49c7..d25b1d6e8 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -9,9 +9,7 @@ mod command; #[cfg(feature = "cli")] pub use cli::*; - #[cfg(feature = "cli")] pub use command::*; - #[cfg(feature = "cli")] pub use sc_cli::{Error, Result}; diff --git a/node/client/Cargo.toml b/node/client/Cargo.toml index 9e233fbb5..24e6b391e 100644 --- a/node/client/Cargo.toml +++ b/node/client/Cargo.toml @@ -1,33 +1,32 @@ [package] name = "cere-client" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-service = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-service = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # Local cere-dev-runtime = { path = "../../runtime/cere-dev", optional = true } diff --git a/node/client/src/lib.rs b/node/client/src/lib.rs index 8ff812c93..240894e91 100644 --- a/node/client/src/lib.rs +++ b/node/client/src/lib.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + pub use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index, Signature}; use sc_client_api::{AuxStore, Backend as BackendT, BlockchainEvents, KeyIterator, UsageProvider}; pub use sc_executor::NativeElseWasmExecutor; @@ -10,7 +12,6 @@ use sp_runtime::{ Justifications, }; use sp_storage::{ChildInfo, StorageData, StorageKey}; -use std::sync::Arc; pub type FullBackend = sc_service::TFullBackend; pub type FullClient = @@ -257,63 +258,63 @@ impl sc_client_api::BlockBackend for Client { impl sc_client_api::StorageProvider for Client { fn storage( &self, - id: &BlockId, + hash: &::Hash, key: &StorageKey, ) -> sp_blockchain::Result> { with_client! { self, client, { - client.storage(id, key) + client.storage(hash, key) } } } fn storage_keys( &self, - id: &BlockId, + hash: &::Hash, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { with_client! { self, client, { - client.storage_keys(id, key_prefix) + client.storage_keys(hash, key_prefix) } } } fn storage_hash( &self, - id: &BlockId, + hash: &::Hash, key: &StorageKey, ) -> sp_blockchain::Result::Hash>> { with_client! { self, client, { - client.storage_hash(id, key) + client.storage_hash(hash, key) } } } fn storage_pairs( &self, - id: &BlockId, + hash: &::Hash, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { with_client! { self, client, { - client.storage_pairs(id, key_prefix) + client.storage_pairs(hash, key_prefix) } } } fn storage_keys_iter<'a>( &self, - id: &BlockId, + hash: &::Hash, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< @@ -323,14 +324,14 @@ impl sc_client_api::StorageProvider for Client { self, client, { - client.storage_keys_iter(id, prefix, start_key) + client.storage_keys_iter(hash, prefix, start_key) } } } fn child_storage( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result> { @@ -338,14 +339,14 @@ impl sc_client_api::StorageProvider for Client { self, client, { - client.child_storage(id, child_info, key) + client.child_storage(hash, child_info, key) } } } fn child_storage_keys( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { @@ -353,14 +354,14 @@ impl sc_client_api::StorageProvider for Client { self, client, { - client.child_storage_keys(id, child_info, key_prefix) + client.child_storage_keys(hash, child_info, key_prefix) } } } fn child_storage_keys_iter<'a>( &self, - id: &BlockId, + hash: &::Hash, child_info: ChildInfo, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, @@ -371,14 +372,14 @@ impl sc_client_api::StorageProvider for Client { self, client, { - client.child_storage_keys_iter(id, child_info, prefix, start_key) + client.child_storage_keys_iter(hash, child_info, prefix, start_key) } } } fn child_storage_hash( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result::Hash>> { @@ -386,7 +387,7 @@ impl sc_client_api::StorageProvider for Client { self, client, { - client.child_storage_hash(id, child_info, key) + client.child_storage_hash(hash, child_info, key) } } } @@ -499,7 +500,6 @@ pub trait RuntimeApiCollection: + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys + sp_authority_discovery::AuthorityDiscoveryApi - + pallet_contracts_rpc::ContractsRuntimeApi where >::StateBackend: sp_api::StateBackend, { @@ -517,8 +517,7 @@ where + sp_api::Metadata + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys - + sp_authority_discovery::AuthorityDiscoveryApi - + pallet_contracts_rpc::ContractsRuntimeApi, + + sp_authority_discovery::AuthorityDiscoveryApi, >::StateBackend: sp_api::StateBackend, { } diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 6698fa902..e13ba7131 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -1,44 +1,45 @@ [package] name = "cere-service" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] futures = "0.3.21" jsonrpsee = { version = "0.15.1", features = ["server"] } -node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } rand = "0.8" -sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", features = ["wasmtime"] } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-network-common = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", features = ["wasmtime"] } -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-sysinfo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } serde = { version = "1.0.136", features = ["derive"] } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } + +node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", features = ["wasmtime"] } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", features = ["wasmtime"] } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } # Local cere-client = { path = "../client", default-features = false, optional = true } diff --git a/node/service/src/chain_spec.rs b/node/service/src/chain_spec.rs index 4aaf48b3f..83dfe40af 100644 --- a/node/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -1,11 +1,10 @@ -#[cfg(feature = "cere-native")] -use cere_runtime as cere; - #[cfg(feature = "cere-dev-native")] use cere_dev_runtime as cere_dev; #[cfg(feature = "cere-dev-native")] use cere_dev_runtime_constants::currency::DOLLARS as TEST_UNITS; - +#[cfg(feature = "cere-native")] +use cere_runtime as cere; +use jsonrpsee::core::__reexports::serde_json; pub use node_primitives::{AccountId, Balance, Block, Signature}; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use sc_chain_spec::ChainSpecExtension; @@ -241,6 +240,18 @@ pub fn cere_dev_genesis( } } +/// Returns the properties for the [`cere-dev-native`]. +pub fn cere_dev_native_chain_spec_properties() -> serde_json::map::Map { + serde_json::json!({ + "tokenDecimals": 10, + "tokenSymbol": "CERE", + "ss58Format": 54, + }) + .as_object() + .expect("Map given; qed") + .clone() +} + /// Helper function to create Cere `GenesisConfig` for testing #[cfg(feature = "cere-dev-native")] fn cere_dev_config_genesis(wasm_binary: &[u8]) -> cere_dev::GenesisConfig { @@ -275,7 +286,7 @@ pub fn cere_dev_development_config() -> Result { None, Some(DEFAULT_PROTOCOL_ID), None, - None, + Some(cere_dev_native_chain_spec_properties()), Default::default(), )) } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 582802499..a8d6c24f3 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1,13 +1,15 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. +use std::sync::Arc; + #[cfg(feature = "cere-dev-native")] pub use cere_dev_runtime; #[cfg(feature = "cere-native")] pub use cere_runtime; - use futures::prelude::*; use sc_client_api::BlockBackend; use sc_consensus_babe::{self, SlotProportion}; +pub use sc_executor::NativeExecutionDispatch; use sc_network::Event; use sc_service::{ error::Error as ServiceError, Configuration, KeystoreContainer, RpcHandlers, TaskManager, @@ -15,9 +17,6 @@ use sc_service::{ use sc_telemetry::{Telemetry, TelemetryWorker}; use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; use sp_trie::PrefixedMemoryDB; -use std::sync::Arc; - -pub use sc_executor::NativeExecutionDispatch; pub mod chain_spec; pub use cere_client::{ AbstractClient, CereDevExecutorDispatch, CereExecutorDispatch, Client, ClientHandle, @@ -29,7 +28,6 @@ pub use sc_executor::NativeElseWasmExecutor; use sc_network_common::service::NetworkEventStream; pub use sc_service::ChainSpec; pub use sp_api::ConstructRuntimeApi; -pub use sp_core::offchain::OffchainStorage; type FullSelectChain = sc_consensus::LongestChain; type FullGrandpaBlockImport = sc_finality_grandpa::GrandpaBlockImport< @@ -388,15 +386,6 @@ where warp_sync: Some(warp_sync), })?; - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), - ); - } - let role = config.role.clone(); let force_authoring = config.force_authoring; let backoff_authoring_blocks = diff --git a/pallets/chainbridge/Cargo.toml b/pallets/chainbridge/Cargo.toml index cadac0151..68935e2e8 100644 --- a/pallets/chainbridge/Cargo.toml +++ b/pallets/chainbridge/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-chainbridge" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" homepage = "https://substrate.io" @@ -14,14 +14,14 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/chainbridge/src/mock.rs b/pallets/chainbridge/src/mock.rs index 2a3fd20b5..33fd9c5c0 100644 --- a/pallets/chainbridge/src/mock.rs +++ b/pallets/chainbridge/src/mock.rs @@ -1,11 +1,10 @@ #![cfg(test)] -use super::*; - use frame_support::{ assert_ok, ord_parameter_types, parameter_types, traits::Everything, weights::Weight, }; use frame_system::{self as system}; +pub use pallet_balances as balances; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -13,8 +12,8 @@ use sp_runtime::{ Perbill, }; +use super::*; use crate::{self as bridge, Config}; -pub use pallet_balances as balances; parameter_types! { pub const BlockHashCount: u64 = 250; diff --git a/pallets/chainbridge/src/tests.rs b/pallets/chainbridge/src/tests.rs index 25a354fc2..673b33cb9 100644 --- a/pallets/chainbridge/src/tests.rs +++ b/pallets/chainbridge/src/tests.rs @@ -1,5 +1,7 @@ #![cfg(test)] +use frame_support::{assert_noop, assert_ok}; + use super::{ mock::{ assert_events, new_test_ext, Balances, Bridge, ProposalLifetime, RuntimeCall, RuntimeEvent, @@ -9,7 +11,6 @@ use super::{ *, }; use crate::mock::new_test_ext_initialized; -use frame_support::{assert_noop, assert_ok}; #[test] fn derive_ids() { @@ -298,6 +299,7 @@ fn create_sucessful_proposal() { expiry: ProposalLifetime::get() + 1, }; assert_eq!(prop, expected); + // Second relayer votes against assert_ok!(Bridge::reject_proposal( RuntimeOrigin::signed(RELAYER_B), @@ -367,6 +369,7 @@ fn create_unsucessful_proposal() { expiry: ProposalLifetime::get() + 1, }; assert_eq!(prop, expected); + // Second relayer votes against assert_ok!(Bridge::reject_proposal( RuntimeOrigin::signed(RELAYER_B), @@ -383,6 +386,7 @@ fn create_unsucessful_proposal() { expiry: ProposalLifetime::get() + 1, }; assert_eq!(prop, expected); + // Third relayer votes against assert_ok!(Bridge::reject_proposal( RuntimeOrigin::signed(RELAYER_C), @@ -520,6 +524,7 @@ fn proposal_expires() { expiry: ProposalLifetime::get() + 1, }; assert_eq!(prop, expected); + // eval_vote_state should have no effect assert_noop!( Bridge::eval_vote_state( diff --git a/pallets/ddc-clusters/Cargo.toml b/pallets/ddc-clusters/Cargo.toml index b8597443a..c35c39389 100644 --- a/pallets/ddc-clusters/Cargo.toml +++ b/pallets/ddc-clusters/Cargo.toml @@ -1,33 +1,32 @@ [package] name = "pallet-ddc-clusters" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -hex = { version = "0.4", default-features = false } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../../primitives" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } hex-literal = "^0.3.1" -pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } pallet-ddc-nodes = { version = "4.7.0", default-features = false, path = "../ddc-nodes" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } serde = { version = "1.0.136", default-features = false, features = ["derive"], optional = true } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] @@ -37,7 +36,6 @@ std = [ "ddc-primitives/std", "frame-support/std", "frame-system/std", - "frame-benchmarking/std", "pallet-contracts/std", "pallet-ddc-nodes/std", "scale-info/std", diff --git a/pallets/ddc-clusters/src/cluster.rs b/pallets/ddc-clusters/src/cluster.rs index 5fc7821c8..af42ea45e 100644 --- a/pallets/ddc-clusters/src/cluster.rs +++ b/pallets/ddc-clusters/src/cluster.rs @@ -1,4 +1,3 @@ -use crate::pallet::Error; use codec::{Decode, Encode}; use ddc_primitives::{ClusterId, ClusterParams}; use frame_support::{pallet_prelude::*, parameter_types}; @@ -6,6 +5,8 @@ use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; +use crate::pallet::Error; + parameter_types! { pub MaxClusterParamsLen: u16 = 2048; } diff --git a/pallets/ddc-clusters/src/lib.rs b/pallets/ddc-clusters/src/lib.rs index 49bbe1f87..e10ce6aac 100644 --- a/pallets/ddc-clusters/src/lib.rs +++ b/pallets/ddc-clusters/src/lib.rs @@ -28,10 +28,6 @@ pub(crate) mod mock; #[cfg(test)] mod tests; -use crate::{ - cluster::Cluster, - node_provider_auth::{NodeProviderAuthContract, NodeProviderAuthContractError}, -}; use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterGovParams, ClusterId, ClusterParams, ClusterPricingParams, NodePubKey, NodeType, @@ -51,6 +47,11 @@ use pallet_ddc_nodes::{NodeRepository, NodeTrait}; use sp_runtime::SaturatedConversion; use sp_std::prelude::*; +use crate::{ + cluster::Cluster, + node_provider_auth::{NodeProviderAuthContract, NodeProviderAuthContractError}, +}; + pub mod cluster; mod node_provider_auth; @@ -60,10 +61,11 @@ pub type BalanceOf = #[frame_support::pallet] pub mod pallet { - use super::*; use ddc_traits::cluster::{ClusterManager, ClusterManagerError}; use pallet_contracts::chain_extension::UncheckedFrom; + use super::*; + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] diff --git a/pallets/ddc-clusters/src/mock.rs b/pallets/ddc-clusters/src/mock.rs index ab7e449bb..911d4ce84 100644 --- a/pallets/ddc-clusters/src/mock.rs +++ b/pallets/ddc-clusters/src/mock.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -use crate::{self as pallet_ddc_clusters, *}; use ddc_primitives::{ClusterId, NodePubKey}; use ddc_traits::staking::{StakerCreator, StakingVisitor, StakingVisitorError}; use frame_support::{ @@ -22,6 +21,8 @@ use sp_runtime::{ MultiSignature, Perquintill, }; +use crate::{self as pallet_ddc_clusters, *}; + /// The AccountId alias in this test module. pub type AccountId = <::Signer as IdentifyAccount>::AccountId; pub(crate) type AccountIndex = u64; @@ -90,7 +91,6 @@ impl contracts::Config for Test { type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; - type ContractAccessWeight = (); type MaxCodeLen = ConstU32<{ 128 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; } diff --git a/pallets/ddc-clusters/src/node_provider_auth.rs b/pallets/ddc-clusters/src/node_provider_auth.rs index 653bb53d3..183df979b 100644 --- a/pallets/ddc-clusters/src/node_provider_auth.rs +++ b/pallets/ddc-clusters/src/node_provider_auth.rs @@ -1,4 +1,3 @@ -use crate::Config; use codec::Encode; use ddc_primitives::{NodePubKey, NodeType}; use frame_support::weights::Weight; @@ -7,6 +6,8 @@ use pallet_contracts::chain_extension::UncheckedFrom; use sp_runtime::traits::Hash; use sp_std::{prelude::Vec, vec}; +use crate::Config; + /// ink! 4.x selector for the "is_authorized" message, equals to the first four bytes of the /// blake2("is_authorized"). See also: https://use.ink/basics/selectors#selector-calculation/, /// https://use.ink/macros-attributes/selector/. @@ -14,7 +15,8 @@ const INK_SELECTOR_IS_AUTHORIZED: [u8; 4] = [0x96, 0xb0, 0x45, 0x3e]; /// The maximum amount of weight that the cluster extension contract call is allowed to consume. /// See also https://github.com/paritytech/substrate/blob/a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d/frame/contracts/rpc/src/lib.rs#L63. -const EXTENSION_CALL_GAS_LIMIT: Weight = Weight::from_ref_time(5_000_000_000_000); +const EXTENSION_CALL_GAS_LIMIT: Weight = + Weight::from_ref_time(5_000_000_000_000).set_proof_size(u64::MAX); pub struct NodeProviderAuthContract { pub contract_id: T::AccountId, @@ -61,7 +63,6 @@ where Ok(is_authorized) } - #[allow(dead_code)] pub fn deploy_contract( &self, caller_id: T::AccountId, @@ -100,7 +101,6 @@ where Ok(Self::new(contract_id, caller_id)) } - #[allow(dead_code)] pub fn authorize_node( &self, node_pub_key: NodePubKey, diff --git a/pallets/ddc-clusters/src/tests.rs b/pallets/ddc-clusters/src/tests.rs index b79ede63f..734e4f465 100644 --- a/pallets/ddc-clusters/src/tests.rs +++ b/pallets/ddc-clusters/src/tests.rs @@ -1,6 +1,5 @@ //! Tests for the module. -use super::{mock::*, *}; use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterId, ClusterParams, ClusterPricingParams, NodeParams, NodePubKey, StorageNodeMode, StorageNodeParams, @@ -11,6 +10,8 @@ use frame_system::Config; use hex_literal::hex; use sp_runtime::{traits::Hash, Perquintill}; +use super::{mock::*, *}; + #[test] fn create_cluster_works() { ExtBuilder.build_and_execute(|| { @@ -302,7 +303,7 @@ fn add_and_delete_node_works() { // Deploy the contract. const GAS_LIMIT: frame_support::weights::Weight = - Weight::from_ref_time(100_000_000_000); + Weight::from_ref_time(100_000_000_000).set_proof_size(u64::MAX); const ENDOWMENT: Balance = 0; Contracts::instantiate_with_code( RuntimeOrigin::signed(alice.clone()), @@ -332,7 +333,7 @@ fn add_and_delete_node_works() { RuntimeOrigin::signed(alice), contract_id.clone(), 0, - Weight::from_ref_time(1_000_000_000_000), + Weight::from_ref_time(1_000_000_000_000).set_proof_size(u64::MAX), None, call_data, ); @@ -461,7 +462,7 @@ fn set_cluster_gov_params_works() { BadOrigin ); - let updated_gov_params: ClusterGovParams = ClusterGovParams { + let updated_gov_params = ClusterGovParams { treasury_share: Perquintill::from_float(0.06), validators_share: Perquintill::from_float(0.02), cluster_reserve_share: Perquintill::from_float(0.03), diff --git a/pallets/ddc-clusters/src/weights.rs b/pallets/ddc-clusters/src/weights.rs index 92f58e898..af2bb5559 100644 --- a/pallets/ddc-clusters/src/weights.rs +++ b/pallets/ddc-clusters/src/weights.rs @@ -1,9 +1,9 @@ //! Autogenerated weights for pallet_ddc_clusters //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bench`, CPU: `DO-Premium-AMD` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024 +//! DATE: 2023-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `Yahors-MacBook-Pro.local`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: // ./target/release/cere @@ -40,7 +40,7 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcClusters Clusters (r:1 w:1) // Storage: DdcClusters ClustersGovParams (r:0 w:1) fn create_cluster() -> Weight { - Weight::from_ref_time(243_795_000_u64) + Weight::from_ref_time(15_000_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -59,7 +59,7 @@ impl WeightInfo for SubstrateWeight { // Storage: unknown [0x89eb0d6a8a691dae2cd15ed0369931ce0a949ecafa5c3f93f8121833646e15c3] (r:1 w:0) // Storage: unknown [0xc3ad1d87683b6ac25f2e809346840d7a7ed0c05653ee606dba68aba3bdb5d957] (r:1 w:0) fn add_node() -> Weight { - Weight::from_ref_time(37_168_211_000_u64) + Weight::from_ref_time(599_000_000_u64) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -67,20 +67,20 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcNodes StorageNodes (r:1 w:1) // Storage: DdcClusters ClustersNodes (r:0 w:1) fn remove_node() -> Weight { - Weight::from_ref_time(290_065_000_u64) + Weight::from_ref_time(24_000_000_u64) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } // Storage: DdcClusters Clusters (r:1 w:1) fn set_cluster_params() -> Weight { - Weight::from_ref_time(161_977_000_u64) + Weight::from_ref_time(16_000_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: DdcClusters Clusters (r:1 w:0) // Storage: DdcClusters ClustersGovParams (r:0 w:1) fn set_cluster_gov_params() -> Weight { - Weight::from_ref_time(164_837_000_u64) + Weight::from_ref_time(17_000_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -91,7 +91,7 @@ impl WeightInfo for () { // Storage: DdcClusters Clusters (r:1 w:1) // Storage: DdcClusters ClustersGovParams (r:0 w:1) fn create_cluster() -> Weight { - Weight::from_ref_time(243_795_000_u64) + Weight::from_ref_time(15_000_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -110,7 +110,7 @@ impl WeightInfo for () { // Storage: unknown [0x89eb0d6a8a691dae2cd15ed0369931ce0a949ecafa5c3f93f8121833646e15c3] (r:1 w:0) // Storage: unknown [0xc3ad1d87683b6ac25f2e809346840d7a7ed0c05653ee606dba68aba3bdb5d957] (r:1 w:0) fn add_node() -> Weight { - Weight::from_ref_time(37_168_211_000_u64) + Weight::from_ref_time(599_000_000_u64) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -118,20 +118,20 @@ impl WeightInfo for () { // Storage: DdcNodes StorageNodes (r:1 w:1) // Storage: DdcClusters ClustersNodes (r:0 w:1) fn remove_node() -> Weight { - Weight::from_ref_time(290_065_000_u64) + Weight::from_ref_time(24_000_000_u64) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } // Storage: DdcClusters Clusters (r:1 w:1) fn set_cluster_params() -> Weight { - Weight::from_ref_time(161_977_000_u64) + Weight::from_ref_time(16_000_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: DdcClusters Clusters (r:1 w:0) // Storage: DdcClusters ClustersGovParams (r:0 w:1) fn set_cluster_gov_params() -> Weight { - Weight::from_ref_time(164_837_000_u64) + Weight::from_ref_time(17_000_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/ddc-customers/Cargo.toml b/pallets/ddc-customers/Cargo.toml index 93f1c2ddd..52ef56f1f 100644 --- a/pallets/ddc-customers/Cargo.toml +++ b/pallets/ddc-customers/Cargo.toml @@ -1,15 +1,16 @@ [package] name = "pallet-ddc-customers" -version = "0.1.0" +version = "4.8.3" edition = "2021" [dependencies] -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +# Substrate +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # 3rd Party codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } @@ -18,17 +19,17 @@ rand_chacha = { version = "0.2", default-features = false, optional = true } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } # Cere -ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../../primitives" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } [dev-dependencies] -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/ddc-customers/src/benchmarking.rs b/pallets/ddc-customers/src/benchmarking.rs index 2a15e69bb..b7794cc13 100644 --- a/pallets/ddc-customers/src/benchmarking.rs +++ b/pallets/ddc-customers/src/benchmarking.rs @@ -1,14 +1,15 @@ //! DdcStaking pallet benchmarking. #![cfg(feature = "runtime-benchmarks")] -use super::*; -use crate::Pallet as DdcCustomers; use ddc_primitives::{ClusterGovParams, ClusterId, ClusterParams}; use frame_benchmarking::{account, benchmarks, whitelist_account}; use frame_support::traits::Currency; use sp_runtime::Perquintill; use sp_std::prelude::*; +use super::*; +use crate::Pallet as DdcCustomers; + pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; diff --git a/pallets/ddc-customers/src/lib.rs b/pallets/ddc-customers/src/lib.rs index f5e1eed3e..482f9465b 100644 --- a/pallets/ddc-customers/src/lib.rs +++ b/pallets/ddc-customers/src/lib.rs @@ -13,7 +13,6 @@ pub(crate) mod mock; mod tests; use codec::{Decode, Encode}; - use ddc_primitives::{BucketId, ClusterId}; use ddc_traits::{ cluster::{ClusterCreator, ClusterVisitor}, @@ -29,7 +28,7 @@ use scale_info::TypeInfo; use sp_io::hashing::blake2_128; use sp_runtime::{ traits::{AccountIdConversion, CheckedAdd, CheckedSub, Saturating, Zero}, - DispatchError, RuntimeDebug, SaturatedConversion, + RuntimeDebug, SaturatedConversion, }; use sp_std::prelude::*; @@ -98,11 +97,10 @@ impl AccountsLedger { /// total by the sum of their balances. fn consolidate_unlocked(self, current_block: T::BlockNumber) -> Self { let mut total = self.total; - let unlocking: BoundedVec<_, _> = self + let unlocking_result: Result, _> = self .unlocking .into_iter() .filter(|chunk| { - log::debug!("Chunk era: {:?}", chunk.block); if chunk.block > current_block { true } else { @@ -111,21 +109,23 @@ impl AccountsLedger { } }) .collect::>() - .try_into() - .expect( - "filtering items from a bounded vec always leaves length less than bounds. qed", - ); + .try_into(); - Self { owner: self.owner, total, active: self.active, unlocking } + if let Ok(unlocking) = unlocking_result { + Self { owner: self.owner, total, active: self.active, unlocking } + } else { + panic!("Failed to filter unlocking"); + } } } #[frame_support::pallet] pub mod pallet { - use super::*; use frame_support::{pallet_prelude::*, traits::LockableCurrency}; use frame_system::pallet_prelude::*; + use super::*; + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] diff --git a/pallets/ddc-customers/src/mock.rs b/pallets/ddc-customers/src/mock.rs index 56b644f37..7b07b6b06 100644 --- a/pallets/ddc-customers/src/mock.rs +++ b/pallets/ddc-customers/src/mock.rs @@ -1,6 +1,5 @@ //! Test utilities -use crate::{self as pallet_ddc_customers, *}; use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterGovParams, ClusterId, ClusterParams, ClusterPricingParams, NodePubKey, NodeType, @@ -8,7 +7,6 @@ use ddc_primitives::{ use ddc_traits::cluster::{ ClusterCreator, ClusterManager, ClusterManagerError, ClusterVisitor, ClusterVisitorError, }; - use frame_support::{ construct_runtime, parameter_types, traits::{ConstU32, ConstU64, Everything, GenesisBuild}, @@ -23,6 +21,8 @@ use sp_runtime::{ DispatchResult, Perquintill, }; +use crate::{self as pallet_ddc_customers, *}; + /// The AccountId alias in this test module. pub(crate) type AccountId = u128; pub(crate) type AccountIndex = u64; diff --git a/pallets/ddc-customers/src/tests.rs b/pallets/ddc-customers/src/tests.rs index 8d7d80350..9a7738ca5 100644 --- a/pallets/ddc-customers/src/tests.rs +++ b/pallets/ddc-customers/src/tests.rs @@ -1,9 +1,10 @@ //! Tests for the module. -use super::{mock::*, *}; use ddc_primitives::ClusterId; use frame_support::{assert_noop, assert_ok}; +use super::{mock::*, *}; + #[test] fn create_bucket_works() { ExtBuilder.build_and_execute(|| { diff --git a/pallets/ddc-metrics-offchain-worker/Cargo.toml b/pallets/ddc-metrics-offchain-worker/Cargo.toml deleted file mode 100644 index d6232ef79..000000000 --- a/pallets/ddc-metrics-offchain-worker/Cargo.toml +++ /dev/null @@ -1,50 +0,0 @@ -[package] -name = "pallet-ddc-metrics-offchain-worker" -version = "4.8.2" -authors = ["Parity Technologies "] -edition = "2021" -homepage = "https://substrate.dev" -license = "Unlicense" -readme = "README.md" -repository = "https://github.com/paritytech/substrate/" -description = "FRAME example pallet for offchain worker" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -alt_serde = { version = "1", default-features = false, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["full"] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -hex = { version = "0.4", default-features = false } -hex-literal = "^0.3.1" -pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -serde_json = { version = "1", default-features = false, git = "https://github.com/Cerebellum-Network/json", branch = "no-std-cere", features = ["alloc"] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-keystore = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } - -[features] -default = ["std"] -std = [ - "codec/std", - "sp-keystore", - "frame-support/std", - "frame-system/std", - "sp-core/std", - "sp-io/std", - "sp-runtime/std", - "sp-std/std", - "pallet-contracts/std", - # "pallet-contracts-rpc-runtime-api/std", -] - -[dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pretty_assertions = "0.6.1" diff --git a/pallets/ddc-metrics-offchain-worker/README.md b/pallets/ddc-metrics-offchain-worker/README.md deleted file mode 100644 index 7d2c21996..000000000 --- a/pallets/ddc-metrics-offchain-worker/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# DDC Storage Inspector (Offchain Worker) - -## Usage - -See the [Cere Network Book](https://cere-network.gitbook.io/cere-network/ddc/how-to-configure-reporter-ocw). - -## Documentation - -Run `cargo doc --package pallet-ddc-metrics-offchain-worker --open` to view this module's -documentation. - -- [`pallet_ddc_metrics_offchain_worker::Trait`](https://docs.rs/pallet-ddc-metrics-offchain-worker/latest/pallet_ddc_metrics_offchain_worker/trait.Trait.html) -- [`Call`](https://docs.rs/pallet-ddc-metrics-offchain-worker/latest/pallet_ddc_metrics_offchain_worker/enum.Call.html) -- [`Module`](https://docs.rs/pallet-ddc-metrics-offchain-worker/latest/pallet_ddc_metrics_offchain_worker/struct.Module.html) \ No newline at end of file diff --git a/pallets/ddc-metrics-offchain-worker/src/lib.rs b/pallets/ddc-metrics-offchain-worker/src/lib.rs deleted file mode 100644 index d293c926b..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/lib.rs +++ /dev/null @@ -1,839 +0,0 @@ -// Offchain worker for DDC metrics. -// -// Inspired from https://github.com/paritytech/substrate/tree/master/frame/example-offchain-worker -#![allow(clippy::all)] -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(test)] -mod tests; - -use alt_serde::{de::DeserializeOwned, Deserialize}; -use codec::{Decode, Encode, HasCompact}; -use frame_support::{ - decl_event, decl_module, decl_storage, - log::{error, info, warn}, - traits::{Currency, Get}, -}; -use frame_system::offchain::{ - AppCrypto, CreateSignedTransaction, SendSignedTransaction, Signer, SigningTypes, -}; - -use hex_literal::hex; - -use sp_core::crypto::{KeyTypeId, UncheckedFrom}; -use sp_runtime::{ - offchain::{http, storage::StorageValueRef, Duration}, - traits::StaticLookup, - AccountId32, -}; -use sp_std::vec::Vec; - -#[macro_use] -extern crate alloc; - -use alloc::string::String; -use core::fmt::Debug; -use frame_support::weights::Weight; -use scale_info::TypeInfo; - -pub const BLOCK_INTERVAL: u32 = 100; // TODO: Change to 1200 later [1h]. Now - 200 [10 minutes] for testing purposes. - -// Smart contract method selectors -pub const REPORT_METRICS_DDN_SELECTOR: [u8; 4] = hex!("de028ad8"); -pub const REPORT_METRICS_SELECTOR: [u8; 4] = hex!("35320bbe"); -pub const REPORT_DDN_STATUS_SELECTOR: [u8; 4] = hex!("83fd8226"); -pub const CURRENT_PERIOD_MS: [u8; 4] = hex!("ace4ecb3"); -pub const GET_ALL_DDC_NODES_SELECTOR: [u8; 4] = hex!("e6c98b60"); -pub const FINALIZE_METRIC_PERIOD: [u8; 4] = hex!("b269d557"); - -type BalanceOf = <::Currency as Currency< - ::AccountId, ->>::Balance; - -#[derive(Encode, Decode)] -pub struct DDCNode { - p2p_id: String, - p2p_addr: String, - url: String, - permissions: u64, -} - -struct Metric { - app_id: String, - storage_bytes: u64, - wcu_used: u64, - rcu_used: u64, -} - -struct MetricDDN { - p2p_id: String, - storage_bytes: u64, - wcu_used: u64, - rcu_used: u64, -} - -#[derive(Deserialize)] -#[serde(crate = "alt_serde")] -#[allow(non_snake_case)] -struct ApiMetric { - appPubKey: String, - storageBytes: u64, - wcuUsed: u64, - rcuUsed: u64, -} - -/// Defines application identifier for crypto keys of this module. -/// -/// Every module that deals with signatures needs to declare its unique identifier for -/// its crypto keys. -/// When offchain worker is signing transactions it's going to request keys of type -/// `KeyTypeId` from the keystore and use the ones it finds to sign the transaction. -/// The keys can be inserted manually via RPC (see `author_insertKey`). -pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"ddc1"); - -pub const HTTP_NODES: &str = "/api/rest/nodes"; -pub const HTTP_METRICS: &str = "/api/rest/metrics?isMaster=true&active=true"; -pub const METRICS_PARAM_FROM: &str = "&from="; -pub const METRICS_PARAM_TO: &str = "&to="; -pub const END_TIME_DELAY_MS: u64 = 120_000; -pub const HTTP_TIMEOUT_MS: u64 = 30_000; // in milli-seconds - -/// Based on the above `KeyTypeId` we need to generate a pallet-specific crypto type wrappers. -/// We can use from supported crypto kinds (`sr25519`, `ed25519` and `ecdsa`) and augment -/// the types with this pallet-specific identifier. -pub mod crypto { - use super::KEY_TYPE; - use frame_system::offchain::AppCrypto; - use sp_core::sr25519::Signature as Sr25519Signature; - use sp_runtime::{ - app_crypto::{app_crypto, sr25519}, - traits::Verify, - }; - app_crypto!(sr25519, KEY_TYPE); - - use sp_runtime::{MultiSignature, MultiSigner}; - - pub struct TestAuthId; - - impl AppCrypto<::Signer, Sr25519Signature> for TestAuthId { - type RuntimeAppPublic = Public; - type GenericSignature = sp_core::sr25519::Signature; - type GenericPublic = sp_core::sr25519::Public; - } - - impl AppCrypto for TestAuthId { - type RuntimeAppPublic = Public; - type GenericSignature = sp_core::sr25519::Signature; - type GenericPublic = sp_core::sr25519::Public; - } -} - -type ResultStr = Result; - -const MS_PER_DAY: u64 = 24 * 3600 * 1000; - -decl_module! { - /// A public part of the pallet. - pub struct Module for enum Call where - origin: T::RuntimeOrigin, - ::AccountId: AsRef<[u8]>, - ::AccountId: UncheckedFrom, - as HasCompact>::Type: Clone, - as HasCompact>::Type: Eq, - as HasCompact>::Type: PartialEq, - as HasCompact>::Type: Debug, - as HasCompact>::Type: TypeInfo, - as HasCompact>::Type: Encode { - //fn deposit_event() = default; - - /// Offchain Worker entry point. - /// - /// By implementing `fn offchain_worker` within `decl_module!` you declare a new offchain - /// worker. - /// This function will be called when the node is fully synced and a new best block is - /// succesfuly imported. - /// Note that it's not guaranteed for offchain workers to run on EVERY block, there might - /// be cases where some blocks are skipped, or for some the worker runs twice (re-orgs), - /// so the code should be able to handle that. - /// You can use `Local Storage` API to coordinate runs of the worker. - /// You can use `debug::native` namespace to not log in wasm mode. - fn offchain_worker(block_number: T::BlockNumber) { - let res = Self::offchain_worker_main(block_number); - match res { - Ok(()) => info!("[OCW] Offchain Worker complete."), - Err(err) => error!("[OCW] Error in Offchain Worker: {}", err), - }; - } - } -} - -decl_storage! { - trait Store for Module as DdcMetricsOffchainWorker - where ::AccountId: AsRef<[u8]> + UncheckedFrom, - as HasCompact>::Type: Clone + Eq + PartialEq + Debug + TypeInfo + Encode { - } -} - -impl Module -where - ::AccountId: AsRef<[u8]> + UncheckedFrom, - as HasCompact>::Type: Clone + Eq + PartialEq + Debug + TypeInfo + Encode, -{ - fn offchain_worker_main(block_number: T::BlockNumber) -> ResultStr<()> { - let signer = match Self::get_signer() { - Err(e) => { - warn!("{:?}", e); - return Ok(()) - }, - Ok(signer) => signer, - }; - - let contract_address = match Self::get_contract_id() { - None => return Ok(()), - Some(contract_address) => contract_address, - }; - - let should_proceed = Self::check_if_should_proceed(block_number); - if !should_proceed { - return Ok(()) - } - - let day_start_ms = - Self::sc_get_current_period_ms(contract_address.clone()).map_err(|err| { - error!("[OCW] Contract error occurred: {:?}", err); - "Could not call get_current_period_ms TX" - })?; - - let day_end_ms = day_start_ms + MS_PER_DAY; - - let (aggregated_metrics, ddn_aggregated_metrics, offline_nodes) = - Self::fetch_all_metrics(contract_address.clone(), day_start_ms).map_err(|err| { - error!("[OCW] HTTP error occurred: {:?}", err); - "could not fetch metrics" - })?; - - for offline_node in offline_nodes { - let p2p_id = offline_node.p2p_id; - let contract_id = contract_address.clone(); - Self::report_ddn_status_to_sc(contract_id, &signer, &p2p_id, false).map_err(|err| { - error!("[OCW] Contract error occurred: {:?}", err); - "could not submit report_ddn_status TX" - })?; - } - - Self::send_metrics_to_sc( - contract_address.clone(), - &signer, - day_start_ms, - aggregated_metrics, - ) - .map_err(|err| { - error!("[OCW] Contract error occurred: {:?}", err); - "could not submit report_metrics TX" - })?; - - Self::send_metrics_ddn_to_sc( - contract_address.clone(), - &signer, - day_start_ms, - ddn_aggregated_metrics, - ) - .map_err(|err| { - error!("[OCW] Contract error occurred: {:?}", err); - "could not submit report_metrics_ddn TX" - })?; - - let block_timestamp = sp_io::offchain::timestamp().unix_millis(); - - if day_end_ms < block_timestamp { - Self::finalize_metric_period(contract_address, &signer, day_start_ms).map_err( - |err| { - error!("[OCW] Contract error occurred: {:?}", err); - "could not call finalize_metric_period TX" - }, - )?; - } - - Ok(()) - } - - fn get_contract_id() -> Option<::AccountId> { - let value = StorageValueRef::persistent(b"ddc-metrics-offchain-worker::sc_address").get(); - - match value { - Ok(None) => { - warn!("[OCW] Smart Contract is not configured. Please configure it using offchain_localStorageSet with key=ddc-metrics-offchain-worker::sc_address"); - None - }, - Ok(Some(contract_address)) => Some(contract_address), - Err(_) => { - error!("[OCW] Smart Contract is configured but the value could not be decoded to an account ID"); - None - }, - } - } - - fn get_block_interval() -> Option { - let value = StorageValueRef::persistent(b"ddc-metrics-offchain-worker::block_interval") - .get::(); - - match value { - Ok(None) => None, - Ok(Some(block_interval)) => Some(block_interval), - Err(_) => { - error!("[OCW] Block Interval could not be decoded"); - None - }, - } - } - - fn check_if_should_proceed(block_number: T::BlockNumber) -> bool { - let s_next_at = StorageValueRef::persistent(b"ddc-metrics-offchain-worker::next-at"); - - match s_next_at.mutate(|current_next_at| { - let current_next_at = match current_next_at { - Ok(Some(val)) => Some(val), - _ => Some(T::BlockNumber::default()), - }; - - if let Some(current_next_at) = current_next_at { - if current_next_at > block_number { - info!( - "[OCW] Too early to execute. Current: {:?}, next execution at: {:?}", - block_number, current_next_at - ); - Err("Skipping") - } else { - let mut block_interval = T::BlockInterval::get(); - if let Some(block_interval_configured) = Self::get_block_interval() { - block_interval = ::BlockNumber::from( - block_interval_configured, - ); - } - - // set new value - Ok(block_interval + block_number) - } - } else { - error!("[OCW] Something went wrong in `check_if_should_proceed`"); - Err("Unexpected error") - } - }) { - Ok(_val) => true, - Err(_e) => false, - } - } - - fn get_start_of_day_ms() -> u64 { - let now = sp_io::offchain::timestamp(); - - (now.unix_millis() / MS_PER_DAY) * MS_PER_DAY - } - - fn get_signer() -> ResultStr> { - let signer = Signer::<_, _>::any_account(); - if !signer.can_sign() { - return Err("[OCW] No local accounts available. Consider adding one via `author_insertKey` RPC."); - } - Ok(signer) - } - - fn sc_get_current_period_ms( - contract_id: ::AccountId, - ) -> ResultStr { - let call_data = Self::encode_get_current_period_ms(); - let nobody = T::AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes()); - let contract_exec_result = pallet_contracts::Pallet::::bare_call( - nobody.unwrap(), - contract_id, - 0u32.into(), - Weight::from_ref_time(100_000_000_000), - None, - call_data, - false, - ); - - let mut data = match &contract_exec_result.result { - Ok(v) => &v.data[..], - Err(exec_error) => { - // Return default value in case of error - warn!("[OCW] Error in call get_current_period_ms of smart contract. Return default value for period. Details: {:?}", exec_error); - return Ok(Self::get_start_of_day_ms()) - }, - }; - - let current_period_ms = u64::decode(&mut data) - .map_err(|_| "[OCW] error decoding get_current_period_ms result")?; - - info!("[OCW] sc_get_current_period_ms - data response from sc: {:?}", current_period_ms); - - Ok(current_period_ms) - } - - fn finalize_metric_period( - contract_id: ::AccountId, - signer: &Signer, - in_day_start_ms: u64, - ) -> ResultStr<()> { - let contract_id_unl = - <::Lookup as StaticLookup>::unlookup(contract_id); - - let call_data = Self::encode_finalize_metric_period(in_day_start_ms); - - let results = signer.send_signed_transaction(|_account| pallet_contracts::Call::call { - dest: contract_id_unl.clone(), - value: 0u32.into(), - gas_limit: Weight::from_ref_time(100_000_000_000), - storage_deposit_limit: None, - data: call_data.clone(), - }); - - match &results { - None | Some((_, Err(()))) => - return Err("Error while submitting finalize_metric_period TX to SC"), - Some((_, Ok(()))) => {}, - } - - Ok(()) - } - - fn send_metrics_to_sc( - contract_id: ::AccountId, - signer: &Signer, - day_start_ms: u64, - metrics: Vec, - ) -> ResultStr<()> { - info!("[OCW] Using Contract Address: {:?}", contract_id); - - for one_metric in metrics.iter() { - let app_id = Self::account_id_from_hex(&one_metric.app_id)?; - - if one_metric.storage_bytes == 0 && one_metric.wcu_used == 0 && one_metric.rcu_used == 0 - { - continue - } - - let results = signer.send_signed_transaction(|account| { - info!( - "[OCW] Sending transactions from {:?}: report_metrics({:?}, {:?}, {:?}, {:?}, {:?})", - account.id, - one_metric.app_id, - day_start_ms, - one_metric.storage_bytes, - one_metric.wcu_used, - one_metric.rcu_used, - ); - - let call_data = Self::encode_report_metrics( - &app_id, - day_start_ms, - one_metric.storage_bytes, - one_metric.wcu_used, - one_metric.rcu_used, - ); - - let contract_id_unl = - <::Lookup as StaticLookup>::unlookup( - contract_id.clone(), - ); - - pallet_contracts::Call::call { - dest: contract_id_unl, - value: 0u32.into(), - gas_limit: Weight::from_ref_time(100_000_000_000), - storage_deposit_limit: None, - data: call_data, - } - }); - - match &results { - None | Some((_, Err(()))) => return Err("Error while submitting TX to SC"), - Some((_, Ok(()))) => {}, - } - } - - Ok(()) - } - - fn send_metrics_ddn_to_sc( - contract_id: ::AccountId, - signer: &Signer, - day_start_ms: u64, - metrics: Vec, - ) -> ResultStr<()> { - info!("[OCW] Using Contract Address: {:?}", contract_id); - - for one_metric in metrics.iter() { - let results = signer.send_signed_transaction(|account| { - info!( - "[OCW] Sending transactions from {:?}: report_metrics_ddn({:?}, {:?}, {:?}, {:?}, {:?})", - account.id, - one_metric.p2p_id, - day_start_ms, - one_metric.storage_bytes, - one_metric.wcu_used, - one_metric.rcu_used, - ); - - let call_data = Self::encode_report_metrics_ddn( - one_metric.p2p_id.clone(), - day_start_ms, - one_metric.storage_bytes, - one_metric.wcu_used, - one_metric.rcu_used, - ); - - let contract_id_unl = - <::Lookup as StaticLookup>::unlookup( - contract_id.clone(), - ); - pallet_contracts::Call::call { - dest: contract_id_unl, - value: 0u32.into(), - gas_limit: Weight::from_ref_time(100_000_000_000), - storage_deposit_limit: None, - data: call_data, - } - }); - - match &results { - None | Some((_, Err(()))) => return Err("Error while submitting TX to SC"), - Some((_, Ok(()))) => {}, - } - } - - Ok(()) - } - - fn report_ddn_status_to_sc( - contract_id: ::AccountId, - signer: &Signer, - p2p_id: &String, - is_online: bool, - ) -> ResultStr<()> { - info!("[OCW] Using Contract Address: {:?}", contract_id); - - let results = signer.send_signed_transaction(|account| { - info!( - "[OCW] Sending transactions from {:?}: report_ddn_status({:?}, {:?})", - account.id, p2p_id, is_online, - ); - - let call_data = Self::encode_report_ddn_status(p2p_id, is_online); - - let contract_id_unl = <::Lookup as StaticLookup>::unlookup( - contract_id.clone(), - ); - - pallet_contracts::Call::call { - dest: contract_id_unl, - value: 0u32.into(), - gas_limit: Weight::from_ref_time(100_000_000_000), - storage_deposit_limit: None, - data: call_data, - } - }); - - match &results { - None | Some((_, Err(()))) => return Err("Error while submitting TX to SC"), - Some((_, Ok(()))) => {}, - } - - Ok(()) - } - - fn fetch_all_metrics( - contract_id: ::AccountId, - day_start_ms: u64, - ) -> ResultStr<(Vec, Vec, Vec)> { - let a_moment_ago_ms = sp_io::offchain::timestamp() - .sub(Duration::from_millis(END_TIME_DELAY_MS)) - .unix_millis(); - - let mut aggregated_metrics = MetricsAggregator::default(); - let mut ddn_aggregated_metrics = DDNMetricsAggregator::default(); - - let nodes = Self::fetch_nodes(contract_id)?; - let mut offline_nodes: Vec = Vec::new(); - - for node in nodes { - let metrics_of_node = - match Self::fetch_node_metrics(&node.url, day_start_ms, a_moment_ago_ms) { - Ok(value) => value, - Err(_) => { - offline_nodes.push(node); - continue - }, - }; - - ddn_aggregated_metrics.add(node.p2p_id.clone(), &metrics_of_node); - - for metric in &metrics_of_node { - aggregated_metrics.add(metric); - } - } - - Ok((aggregated_metrics.finish(), ddn_aggregated_metrics.finish(), offline_nodes)) - } - - fn fetch_nodes(contract_id: ::AccountId) -> ResultStr> { - let nobody = T::AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes()); - let call_data = Self::encode_get_all_ddc_nodes(); - let contract_exec_result = pallet_contracts::Pallet::::bare_call( - nobody.unwrap(), - contract_id, - 0u32.into(), - Weight::from_ref_time(100_000_000_000), - None, - call_data, - false, - ); - - let mut data = match &contract_exec_result.result { - Ok(v) => &v.data[..], - Err(exec_error) => { - warn!( - "[OCW] Error in call get_all_ddc_nodes of smart contract. Error: {:?}", - exec_error - ); - return Ok(Vec::new()) - }, - }; - - let ddc_nodes = Vec::::decode(&mut data) - .map_err(|_| "[OCW] error decoding get_all_ddc_nodes result")?; - - Ok(ddc_nodes) - } - - fn fetch_node_metrics( - node_url: &str, - day_start_ms: u64, - end_ms: u64, - ) -> ResultStr> { - let metrics_url = format!( - "{}{}{}{}{}{}", - node_url, - HTTP_METRICS, - METRICS_PARAM_FROM, - day_start_ms / 1000, - METRICS_PARAM_TO, - end_ms / 1000 - ); - - let metrics: Vec = Self::http_get_json(&metrics_url)?; - - Ok(metrics - .into_iter() - .map(|data| Metric { - app_id: data.appPubKey, - storage_bytes: data.storageBytes, - wcu_used: data.wcuUsed, - rcu_used: data.rcuUsed, - }) - .collect()) - } - - fn http_get_json(url: &str) -> ResultStr { - let body = Self::http_get_request(url).map_err(|err| { - error!("[OCW] Error while getting {}: {:?}", url, err); - "HTTP GET error" - })?; - - serde_json::from_slice(&body).map_err(|err| { - warn!("[OCW] Error while parsing JSON from {}: {:?}", url, err); - "HTTP JSON parse error" - }) - } - - fn http_get_request(http_url: &str) -> Result, http::Error> { - info!("[OCW] Sending request to: {:?}", http_url); - - // Initiate an external HTTP GET request. This is using high-level wrappers from - // `sp_runtime`. - let request = http::Request::get(http_url); - - let deadline = sp_io::offchain::timestamp().add(Duration::from_millis(HTTP_TIMEOUT_MS)); - - let pending = request.deadline(deadline).send().map_err(|_| http::Error::IoError)?; - - let response = pending.try_wait(deadline).map_err(|_| http::Error::DeadlineReached)??; - - if response.code != 200 { - warn!("[OCW] http_get_request unexpected status code: {}", response.code); - return Err(http::Error::Unknown) - } - - // Next we fully read the response body and collect it to a vector of bytes. - Ok(response.body().collect::>()) - } - - /// Prepare get_current_period_ms call params. - /// Must match the contract function here: https://github.com/Cerebellum-Network/cere-enterprise-smart-contracts/blob/dev/cere02/lib.rs - fn encode_get_current_period_ms() -> Vec { - CURRENT_PERIOD_MS.to_vec() - } - - /// Prepare encode_get_current_period_ms call params. - fn encode_get_all_ddc_nodes() -> Vec { - GET_ALL_DDC_NODES_SELECTOR.to_vec() - } - - /// Prepare finalize_metric_period call params. - /// Must match the contract function here: https://github.com/Cerebellum-Network/cere-enterprise-smart-contracts/blob/dev/cere02/lib.rs - fn encode_finalize_metric_period(in_day_start_ms: u64) -> Vec { - let mut call_data = FINALIZE_METRIC_PERIOD.to_vec(); - in_day_start_ms.encode_to(&mut call_data); - - call_data - } - - /// Prepare report_metrics call params. - /// Must match the contract function here: https://github.com/Cerebellum-Network/cere-enterprise-smart-contracts/blob/dev/cere02/lib.rs - fn encode_report_metrics( - app_id: &AccountId32, - day_start_ms: u64, - storage_bytes: u64, - wcu_used: u64, - rcu_used: u64, - ) -> Vec { - let mut call_data = REPORT_METRICS_SELECTOR.to_vec(); - app_id.encode_to(&mut call_data); - day_start_ms.encode_to(&mut call_data); - storage_bytes.encode_to(&mut call_data); - wcu_used.encode_to(&mut call_data); - rcu_used.encode_to(&mut call_data); - - call_data - } - - fn encode_report_metrics_ddn( - p2p_id: String, - day_start_ms: u64, - storage_bytes: u64, - wcu_used: u64, - rcu_used: u64, - ) -> Vec { - let mut call_data = REPORT_METRICS_DDN_SELECTOR.to_vec(); - p2p_id.encode_to(&mut call_data); - day_start_ms.encode_to(&mut call_data); - storage_bytes.encode_to(&mut call_data); - wcu_used.encode_to(&mut call_data); - rcu_used.encode_to(&mut call_data); - - call_data - } - - fn encode_report_ddn_status(p2p_id: &String, is_online: bool) -> Vec { - let mut call_data = REPORT_DDN_STATUS_SELECTOR.to_vec(); - p2p_id.encode_to(&mut call_data); - is_online.encode_to(&mut call_data); - call_data - } - - fn account_id_from_hex(id_hex: &str) -> ResultStr { - let id_hex = id_hex.trim_start_matches("0x"); - if id_hex.len() != 64 { - return Err("Wrong length of hex-encoded account ID, expected 64") - } - let mut bytes = [0u8; 32]; - hex::decode_to_slice(id_hex, &mut bytes).map_err(|_| "invalid hex address.")?; - Ok(AccountId32::from(bytes)) - } -} - -#[derive(Default)] -struct MetricsAggregator(Vec); - -impl MetricsAggregator { - fn add(&mut self, metric: &Metric) { - let existing_pubkey_index = - self.0.iter().position(|one_result_obj| metric.app_id == one_result_obj.app_id); - - if let Some(existing_pubkey_index) = existing_pubkey_index { - // Add to metrics of an existing app. - self.0[existing_pubkey_index].storage_bytes += metric.storage_bytes; - self.0[existing_pubkey_index].wcu_used += metric.wcu_used; - self.0[existing_pubkey_index].rcu_used += metric.rcu_used; - } else { - // New app. - let new_metric_obj = Metric { - app_id: metric.app_id.clone(), - storage_bytes: metric.storage_bytes, - wcu_used: metric.wcu_used, - rcu_used: metric.rcu_used, - }; - self.0.push(new_metric_obj); - } - } - - fn finish(self) -> Vec { - self.0 - } -} - -#[derive(Default)] -struct DDNMetricsAggregator(Vec); - -impl DDNMetricsAggregator { - fn add(&mut self, p2p_id: String, metrics: &Vec) { - let existing_pubkey_index = - self.0.iter().position(|one_result_obj| p2p_id == one_result_obj.p2p_id); - - // Only if key does not exists - add new item, otherwise - skip - if existing_pubkey_index.is_none() { - let mut storage_bytes_sum = 0; - let mut wcu_used_sum = 0; - let mut rcu_used_sum = 0; - - for metric_item in metrics.iter() { - storage_bytes_sum += metric_item.storage_bytes; - wcu_used_sum += metric_item.wcu_used; - rcu_used_sum += metric_item.rcu_used; - } - - let new_metric_obj = MetricDDN { - p2p_id, - storage_bytes: storage_bytes_sum, - wcu_used: wcu_used_sum, - rcu_used: rcu_used_sum, - }; - self.0.push(new_metric_obj); - } - } - - fn finish(self) -> Vec { - self.0 - } -} - -// TODO: remove, or write meaningful events. -decl_event!( - /// Events generated by the module. - pub enum Event - where - AccountId = ::AccountId, - { - NewDdcMetric(AccountId, Vec), - } -); - -pub trait Config: - frame_system::Config - + pallet_contracts::Config - + CreateSignedTransaction> -where - ::AccountId: AsRef<[u8]> + UncheckedFrom, - as HasCompact>::Type: Clone + Eq + PartialEq + Debug + TypeInfo + Encode, -{ - /// The identifier type for an offchain worker. - type AuthorityId: AppCrypto<::Public, ::Signature>; - - // TODO: remove, or use Event and Call. - /// The overarching event type. - type RuntimeEvent: From> + Into<::RuntimeEvent>; - /// The overarching dispatch call type. - type RuntimeCall: From>; - - type BlockInterval: Get; -} diff --git a/pallets/ddc-metrics-offchain-worker/src/tests/mod.rs b/pallets/ddc-metrics-offchain-worker/src/tests/mod.rs deleted file mode 100644 index 6d649486a..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/tests/mod.rs +++ /dev/null @@ -1,380 +0,0 @@ -use frame_support::traits::{Currency, OffchainWorker}; -use frame_system::Config as FSC; -use sp_core::offchain::{ - testing, OffchainDbExt, OffchainWorkerExt, Timestamp as OCWTimestamp, TransactionPoolExt, -}; -use sp_runtime::{traits::Hash, AccountId32, RuntimeAppPublic}; -use test_runtime::{ - AccountId, Balance, Balances, Contracts, DdcMetricsOffchainWorker, RuntimeOrigin, System, Test, - Timestamp, -}; - -use sp_keystore::{testing::KeyStore, KeystoreExt, SyncCryptoStore}; -use std::sync::Arc; - -use crate::{ - CURRENT_PERIOD_MS, FINALIZE_METRIC_PERIOD, REPORT_DDN_STATUS_SELECTOR, REPORT_METRICS_SELECTOR, -}; -use codec::Encode; -use frame_support::weights::Weight; -use hex_literal::hex; -use sp_core::bytes::from_hex; - -mod test_runtime; - -type T = Test; - -#[test] -fn test_contract_api() { - // Parse the contract spec. - let contract_meta = include_str!("./test_data/metadata.json"); - let contract_meta: serde_json::Value = serde_json::from_str(contract_meta).unwrap(); - let messages = contract_meta.pointer("/spec/messages").unwrap().as_array().unwrap(); - - // Find the report_metrics function. - let report_metrics = messages - .iter() - .find(|msg| msg.pointer("/name/0").unwrap().as_str().unwrap() == "report_metrics") - .unwrap(); - - // Check the selector. - let selector = from_hex(report_metrics.get("selector").unwrap().as_str().unwrap()).unwrap(); - assert_eq!(REPORT_METRICS_SELECTOR.to_vec(), selector); - - // Find the get_current_period_ms function. - let get_current_period_ms = messages - .iter() - .find(|msg| msg.pointer("/name/0").unwrap().as_str().unwrap() == "get_current_period_ms") - .unwrap(); - - // Check the selector for get_current_period_ms - let selector_get_current_period_ms = - from_hex(get_current_period_ms.get("selector").unwrap().as_str().unwrap()).unwrap(); - assert_eq!(CURRENT_PERIOD_MS.to_vec(), selector_get_current_period_ms); - - // Find the finalize_metric_period function. - let finalize_metric_period = messages - .iter() - .find(|msg| msg.pointer("/name/0").unwrap().as_str().unwrap() == "finalize_metric_period") - .unwrap(); - - // Check the selector for finalize_metric_period - let selector_finalize_metric_period = - from_hex(finalize_metric_period.get("selector").unwrap().as_str().unwrap()).unwrap(); - assert_eq!(FINALIZE_METRIC_PERIOD.to_vec(), selector_finalize_metric_period); - - // Find the report_ddn_status function. - let report_ddn_status = messages - .iter() - .find(|msg| msg.pointer("/name/0").unwrap().as_str().unwrap() == "report_ddn_status") - .unwrap(); - - // Check the selector for report_ddn_status - let selector_report_ddn_status = - from_hex(report_ddn_status.get("selector").unwrap().as_str().unwrap()).unwrap(); - assert_eq!(REPORT_DDN_STATUS_SELECTOR.to_vec(), selector_report_ddn_status); -} - -#[test] -fn test_encode_report_metrics() { - let call_data = DdcMetricsOffchainWorker::encode_report_metrics( - &AccountId32::from([2; 32]), - 3 + (4 << 8), - 5 + (6 << 16), - 7 + (8 << 24), - 9 + (16 << 24), - ); - assert_eq!( - call_data, - vec![ - 53, 50, 11, 190, // Selector - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, // 32 bytes, app_id - 3, 4, 0, 0, 0, 0, 0, 0, // 8 bytes, day_start_ms - 5, 0, 6, 0, 0, 0, 0, 0, // 8 bytes, storage_bytes - 7, 0, 0, 8, 0, 0, 0, 0, // 8 bytes, wcu_used - 9, 0, 0, 16, 0, 0, 0, 0 // 8 bytes, rcu_used - ] - ); -} - -#[test] -fn test_encode_get_current_period_ms() { - let call_data = DdcMetricsOffchainWorker::encode_get_current_period_ms(); - assert_eq!( - call_data, - vec![ - 172, 228, 236, 179, // Selector - ] - ); -} - -#[test] -fn test_encode_finalize_metric_period() { - let call_data = DdcMetricsOffchainWorker::encode_finalize_metric_period(INIT_TIME_MS); - assert_eq!( - call_data, - vec![ - 178, 105, 213, 87, // Selector - 80, 152, 94, 120, 118, 1, 0, 0, // 8 bytes, in_day_start_ms - ] - ); -} - -#[test] -fn test_encode_report_ddn_status() { - let call_data = DdcMetricsOffchainWorker::encode_report_ddn_status( - &String::from_utf8(vec![0, 1, 2, 3]).unwrap(), - true, - ); - assert_eq!( - call_data, - [ - REPORT_DDN_STATUS_SELECTOR.to_vec(), // Selector - vec![ - 16, // size of p2p_id - 0, 1, 2, 3, // p2p_id - 1 // is_online - ], - ] - .concat() - ); -} - -fn build_ext() -> sp_io::TestExternalities { - build_ext_for_contracts() -} - -// Some day, and some time during that day. -const INIT_DAY_MS: u64 = 51 * 365 * 24 * 3_600 * 1_000; -const INIT_TIME_MS: u64 = INIT_DAY_MS + 1234 * 1000; - -// Taken from pallet_contracts::tests::ExtBuilder -fn build_ext_for_contracts() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - pallet_balances::GenesisConfig:: { balances: vec![] } - .assimilate_storage(&mut t) - .unwrap(); - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| { - System::set_block_number(1); - Timestamp::set_timestamp(INIT_TIME_MS); - }); - ext -} - -#[test] -fn should_submit_signed_transaction_on_chain() { - let mut t = build_ext(); - - let (pool, pool_state) = testing::TestTransactionPoolExt::new(); - t.register_extension(TransactionPoolExt::new(pool)); - - const PHRASE: &str = - "news slush supreme milk chapter athlete soap sausage put clutch what kitten"; - let keystore = KeyStore::new(); - keystore - .sr25519_generate_new(crate::crypto::Public::ID, Some(&format!("{}/hunter1", PHRASE))) - .unwrap(); - t.register_extension(KeystoreExt(Arc::new(keystore))); - - let (offchain, offchain_state) = testing::TestOffchainExt::new(); - t.register_extension(OffchainDbExt::new(offchain.clone())); - t.register_extension(OffchainWorkerExt::new(offchain)); - - { - let mut state = offchain_state.write(); - - state.timestamp = OCWTimestamp::from_unix_millis(INIT_TIME_MS); - - let mut expect_request = |url: &str, response: &[u8]| { - state.expect_request(testing::PendingRequest { - method: "GET".into(), - uri: url.to_string(), - response: Some(response.to_vec()), - sent: true, - ..Default::default() - }); - }; - - // List partitions from a boot node. - expect_request("https://node-0.ddc.stage.cere.network/api/rest/metrics?isMaster=true&active=true&from=1608336000&to=1608337114", - include_bytes!("test_data/ddc_metrics_node-0.json")); - - // List partitions from a boot node. - expect_request("https://node-3.ddc.stage.cere.network/api/rest/metrics?isMaster=true&active=true&from=1608336000&to=1608337114", - include_bytes!("test_data/ddc_metrics_node-3.json")); - } - - t.execute_with(|| { - let contract_id = deploy_contract(); - - let kind = sp_core::offchain::StorageKind::PERSISTENT; - sp_io::offchain::local_storage_set( - kind, - b"ddc-metrics-offchain-worker::sc_address", - contract_id.as_ref(), - ); - - // Trigger the worker. - DdcMetricsOffchainWorker::offchain_worker(0); - - let events = System::events(); - eprintln!("Events: {:?}\n", events); - - // Get the transaction from the worker. - let transactions = pool_state.read().transactions.clone(); - eprintln!("Transactions: {:?}\n", transactions); - assert_eq!(transactions.len(), 4); // (2 x send_metrics_to_sc) + (2 x send_metrics_ddn_to_sc) - - // Check metrics of an app based on ddc_metrics_node-0.json and ddc_metrics_node-3.json. - let app_id = AccountId32::from(hex!( - "00a2e826451b78afb99241b1331e7594526329225ff8937dbc62f43ec20d1830" - )); - let expected_call = - DdcMetricsOffchainWorker::encode_report_metrics(&app_id, INIT_DAY_MS, 2 + 20, 0, 0); - assert!( - transactions[0].ends_with(&expected_call), - "Expected a specific call to the report_metrics function" - ); - - // Check metrics of the second app. - let app_id = AccountId32::from(hex!( - "100ad4097b6e60700a5d5c5294cb6d663090ef5f547e84cc20ec6bcc7a552f13" - )); - let expected_call = - DdcMetricsOffchainWorker::encode_report_metrics(&app_id, INIT_DAY_MS, 200, 0, 0); - assert!( - transactions[1].ends_with(&expected_call), - "Expected a specific call to the report_metrics function" - ); - - let expected_call = DdcMetricsOffchainWorker::encode_report_metrics_ddn( - "12D3KooWB4SMhKK12ASU4qH1ZYh3pN9vsW9QbFTwkjZxUhTqmYaS".to_string(), - INIT_DAY_MS, - 2 + 200, - 0, - 0, - ); - assert!( - transactions[2].ends_with(&expected_call), - "Expected a specific call to the report_metrics_ddn function" - ); - - let expected_call = DdcMetricsOffchainWorker::encode_report_metrics_ddn( - "12D3KooWJLuJEmtYf3bakUwe2q1uMcnbCBKRg7GkpG6Ws74Aq6NC".to_string(), - INIT_DAY_MS, - 20, - 0, - 0, - ); - assert!( - transactions[3].ends_with(&expected_call), - "Expected a specific call to the report_metrics_ddn function" - ); - }); -} - -#[test] -fn should_run_contract() { - let mut t = build_ext(); - - t.execute_with(|| { - let alice = AccountId::from([1; 32]); - let contract_id = deploy_contract(); - let call_data = DdcMetricsOffchainWorker::encode_get_current_period_ms(); - - pallet_contracts::Pallet::::call( - RuntimeOrigin::signed(alice.clone()), - contract_id.clone(), - 0, - Weight::from_ref_time(100_000_000_000), - None, - call_data.clone(), - ) - .unwrap(); - let contract_exec_result = pallet_contracts::Pallet::::bare_call( - alice, - contract_id, - 0, - Weight::from_ref_time(100_000_000_000), - None, - call_data, - false, - ); - match &contract_exec_result.result { - Ok(res) => { - //println!("XXX Contract returned {:?}", res.data); - assert_eq!(res.data.len(), 8); // size of u64 - }, - Err(_) => panic!("error in contract call"), - }; - }); -} - -pub const CTOR_SELECTOR: [u8; 4] = hex!("9bae9d5e"); - -fn encode_constructor() -> Vec { - let mut call_data = CTOR_SELECTOR.to_vec(); - let x = 0_u128; - for _ in 0..9 { - x.encode_to(&mut call_data); - } - call_data -} - -fn deploy_contract() -> AccountId { - // Admin account who deploys the contract. - let alice = AccountId::from([1; 32]); - let _ = Balances::deposit_creating(&alice, 1_000_000_000_000); - - // Load the contract code. - let wasm = &include_bytes!("./test_data/ddc.wasm")[..]; - let wasm_hash = ::Hashing::hash(wasm); - let contract_args = encode_constructor(); - - // Deploy the contract. - //let endowment = contracts::Config::::subsistence_threshold_uncached(); - const GAS_LIMIT: frame_support::weights::Weight = Weight::from_ref_time(100_000_000_000); - const ENDOWMENT: Balance = 100_000_000_000; - Contracts::instantiate_with_code( - RuntimeOrigin::signed(alice.clone()), - ENDOWMENT, - GAS_LIMIT, - None, - wasm.to_vec(), - contract_args, - vec![], - ) - .unwrap(); - // Configure worker with the contract address. - let contract_id = Contracts::contract_address(&alice, &wasm_hash, &[]); - - pub const ADD_DDC_NODE_SELECTOR: [u8; 4] = hex!("11a9e1b9"); - - let call_data_items = vec![ - ["12D3KooWB4SMhKK12ASU4qH1ZYh3pN9vsW9QbFTwkjZxUhTqmYaS", "/dns4/node-0.ddc.dev.cere.network/tcp/5000/p2p/12D3KooWB4SMhKK12ASU4qH1ZYh3pN9vsW9QbFTwkjZxUhTqmYaS", "https://node-0.ddc.stage.cere.network"], - ["12D3KooWJLuJEmtYf3bakUwe2q1uMcnbCBKRg7GkpG6Ws74Aq6NC", "/dns4/node-3.ddc.dev.cere.network/tcp/5000/p2p/12D3KooWJLuJEmtYf3bakUwe2q1uMcnbCBKRg7GkpG6Ws74Aq6NC", "https://node-3.ddc.stage.cere.network"], - ]; - let permissions: u64 = 1; - - for call_data_item in call_data_items { - let mut call_data = ADD_DDC_NODE_SELECTOR.to_vec(); - call_data_item[0].encode_to(&mut call_data); - call_data_item[1].encode_to(&mut call_data); - call_data_item[2].encode_to(&mut call_data); - permissions.encode_to(&mut call_data); - - let results = Contracts::call( - RuntimeOrigin::signed(alice.clone()), - contract_id.clone(), - 0, - Weight::from_ref_time(1_000_000_000_000), - None, - call_data, - ); - results.unwrap(); - } - - contract_id -} diff --git a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-0.json b/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-0.json deleted file mode 100644 index 42e3c28d9..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-0.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "appPubKey" : "0x00a2e826451b78afb99241b1331e7594526329225ff8937dbc62f43ec20d1830", - "partitionId" : "0cb0f451-255b-4a4f-918b-6c34c7047331", - "storageBytes" : 2, - "wcuUsed": 0, - "rcuUsed": 0 - }, - { - "appPubKey" : "0x100ad4097b6e60700a5d5c5294cb6d663090ef5f547e84cc20ec6bcc7a552f13", - "partitionId" : "d9fb155d-6e15-44c5-8d71-ff22db7a0193", - "storageBytes" : 200, - "wcuUsed": 0, - "rcuUsed": 0 - } -] diff --git a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-3.json b/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-3.json deleted file mode 100644 index 6d284ae02..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/ddc_metrics_node-3.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "appPubKey" : "0x00a2e826451b78afb99241b1331e7594526329225ff8937dbc62f43ec20d1830", - "partitionId" : "f6cbe4e6-ef3a-4970-b3da-f8ae29cd22bd", - "storageBytes" : 20, - "wcuUsed": 0, - "rcuUsed": 0 - } -] diff --git a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/generate.sh b/pallets/ddc-metrics-offchain-worker/src/tests/test_data/generate.sh deleted file mode 100755 index 180acda0b..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/tests/test_data/generate.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# These commands were used to get sample data from DDC nodes. -# The data was modified to simplify testing. - -curl https://node-0.ddc.stage.cere.network/api/rest/nodes | json_pp > ddc_nodes.json - -curl "https://node-0.ddc.stage.cere.network/api/rest/metrics?isMaster=true&active=true" | json_pp > ddc_metrics_node-0.json - -curl "https://node-3.ddc.stage.cere.network/api/rest/metrics?isMaster=true&active=true" | json_pp > ddc_metrics_node-3.json diff --git a/pallets/ddc-metrics-offchain-worker/src/tests/test_runtime.rs b/pallets/ddc-metrics-offchain-worker/src/tests/test_runtime.rs deleted file mode 100644 index 7a5033b9b..000000000 --- a/pallets/ddc-metrics-offchain-worker/src/tests/test_runtime.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! Runtime for testing an offchain worker. -// -// Inspired from pos-network-node/frame/contracts/src/tests.rs - -use crate::{self as pallet_ddc_metrics_offchain_worker, *}; - -use frame_support::{ - parameter_types, - traits::{ConstU32, Currency, Everything, Get, Nothing}, - weights::Weight, -}; -use sp_core::H256; -use sp_runtime::{ - generic, - testing::TestXt, - traits::{ - BlakeTwo256, Convert, Extrinsic as ExtrinsicT, IdentifyAccount, IdentityLookup, Verify, - }, - MultiSignature, Perbill, -}; -use std::cell::RefCell; - -pub type Signature = MultiSignature; -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; -pub type Balance = u128; -pub type BlockNumber = u32; -pub type Moment = u64; - -// -- Implement a contracts runtime for testing -- - -// Macro hack: Give names to the pallets. -use pallet_contracts as contracts; - -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; - -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Contracts: contracts::{Pallet, Call, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Randomness: pallet_randomness_collective_flip::{Pallet, Storage}, - DdcMetricsOffchainWorker: pallet_ddc_metrics_offchain_worker::{Pallet, Call, Event}, - } -); - -parameter_types! { - pub const BlockHashCount: BlockNumber = 250; - pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024); - pub const MaximumBlockLength: u32 = 2 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::one(); -} - -impl frame_system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); - type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; - type Hash = H256; - type RuntimeCall = RuntimeCall; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - // u64; // sp_core::sr25519::Public; - type Lookup = IdentityLookup; - type Header = generic::Header; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; -} - -impl pallet_balances::Config for Test { - type Balance = Balance; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = (); -} - -thread_local! { - static EXISTENTIAL_DEPOSIT: RefCell = RefCell::new(1); -} - -pub struct ExistentialDeposit; - -impl Get for ExistentialDeposit { - fn get() -> Balance { - EXISTENTIAL_DEPOSIT.with(|v| *v.borrow()) - } -} - -parameter_types! { - pub const MinimumPeriod: u64 = 1; -} -impl pallet_timestamp::Config for Test { - type Moment = Moment; - type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); -} -parameter_types! { - pub const SignedClaimHandicap: BlockNumber = 2; - pub const TombstoneDeposit: Balance = 16; - pub const StorageSizeOffset: u32 = 8; - pub const RentByteFee: Balance = 4; - pub const RentDepositOffset: Balance = 10_000; - pub const SurchargeReward: Balance = 150; - pub const MaxDepth: u32 = 100; - pub const MaxValueSize: u32 = 16_384; - pub Schedule: pallet_contracts::Schedule = Default::default(); -} - -// Contracts for Test Runtime. -use contracts::Config as contractsConfig; - -type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; - -impl contracts::Config for Test { - type Time = Timestamp; - type Randomness = Randomness; - type Currency = Balances; - type RuntimeEvent = RuntimeEvent; - type CallStack = [pallet_contracts::Frame; 31]; - type WeightPrice = Self; //pallet_transaction_payment::Module; - type WeightInfo = (); - type ChainExtension = (); - type DeletionQueueDepth = (); - type DeletionWeightLimit = (); - type Schedule = Schedule; - type RuntimeCall = RuntimeCall; - type CallFilter = Nothing; - type DepositPerByte = DepositPerByte; - type DepositPerItem = DepositPerItem; - type AddressGenerator = pallet_contracts::DefaultAddressGenerator; - type ContractAccessWeight = (); - type MaxCodeLen = ConstU32<{ 128 * 1024 }>; - type MaxStorageKeyLen = ConstU32<128>; -} - -parameter_types! { - pub const TransactionByteFee: u64 = 0; - pub const DepositPerItem: Balance = 0; - pub const DepositPerByte: Balance = 0; -} - -impl Convert> for Test { - fn convert(w: Weight) -> BalanceOf { - w.ref_time().into() - } -} - -// -- End contracts runtime -- - -use frame_system::offchain::{ - AppCrypto, CreateSignedTransaction, SendTransactionTypes, SigningTypes, -}; - -pub type Extrinsic = TestXt; - -impl SigningTypes for Test { - type Public = ::Signer; - type Signature = Signature; -} - -impl SendTransactionTypes for Test -where - RuntimeCall: From, -{ - type OverarchingCall = RuntimeCall; - type Extrinsic = Extrinsic; -} -impl pallet_randomness_collective_flip::Config for Test {} - -impl CreateSignedTransaction for Test -where - RuntimeCall: From, -{ - fn create_transaction>( - call: RuntimeCall, - _public: ::Signer, - _account: AccountId, - nonce: u64, - ) -> Option<(RuntimeCall, ::SignaturePayload)> { - Some((call, (nonce, ()))) - } -} - -parameter_types! { - pub const OcwBlockInterval: u32 = crate::BLOCK_INTERVAL; -} - -impl Config for Test { - type BlockInterval = OcwBlockInterval; - - type AuthorityId = crypto::TestAuthId; - - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} diff --git a/pallets/ddc-nodes/Cargo.toml b/pallets/ddc-nodes/Cargo.toml index 9729e2945..5392d28f7 100644 --- a/pallets/ddc-nodes/Cargo.toml +++ b/pallets/ddc-nodes/Cargo.toml @@ -1,27 +1,27 @@ [package] name = "pallet-ddc-nodes" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../../primitives" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } serde = { version = "1.0.136", default-features = false, features = ["derive"], optional = true } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/ddc-nodes/src/lib.rs b/pallets/ddc-nodes/src/lib.rs index e849d158b..b5cc37a1f 100644 --- a/pallets/ddc-nodes/src/lib.rs +++ b/pallets/ddc-nodes/src/lib.rs @@ -32,12 +32,10 @@ use ddc_traits::{ node::{NodeCreator, NodeVisitor, NodeVisitorError}, staking::StakingVisitor, }; - use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; pub use pallet::*; use sp_std::prelude::*; - mod node; mod storage_node; diff --git a/pallets/ddc-nodes/src/mock.rs b/pallets/ddc-nodes/src/mock.rs index ca74d8af7..8a4be3286 100644 --- a/pallets/ddc-nodes/src/mock.rs +++ b/pallets/ddc-nodes/src/mock.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -use crate::{self as pallet_ddc_nodes, *}; use ddc_traits::staking::{StakingVisitor, StakingVisitorError}; use frame_support::{ construct_runtime, parameter_types, @@ -17,6 +16,8 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, }; +use crate::{self as pallet_ddc_nodes, *}; + /// The AccountId alias in this test module. pub(crate) type AccountId = u64; pub(crate) type AccountIndex = u64; diff --git a/pallets/ddc-nodes/src/node.rs b/pallets/ddc-nodes/src/node.rs index e277431d8..617d9f501 100644 --- a/pallets/ddc-nodes/src/node.rs +++ b/pallets/ddc-nodes/src/node.rs @@ -1,14 +1,15 @@ #![allow(clippy::needless_lifetimes)] // ToDo +use codec::{Decode, Encode}; +use ddc_primitives::{NodeParams, NodePubKey, NodeType}; +use scale_info::TypeInfo; +use sp_runtime::RuntimeDebug; + use crate::{ pallet::Error, storage_node::{StorageNode, StorageNodeProps}, ClusterId, }; -use codec::{Decode, Encode}; -use ddc_primitives::{NodeParams, NodePubKey, NodeType}; -use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; #[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo, PartialEq)] pub enum Node { diff --git a/pallets/ddc-nodes/src/storage_node.rs b/pallets/ddc-nodes/src/storage_node.rs index c2034d74c..eb5c05215 100644 --- a/pallets/ddc-nodes/src/storage_node.rs +++ b/pallets/ddc-nodes/src/storage_node.rs @@ -1,4 +1,3 @@ -use crate::node::{NodeError, NodeProps, NodeTrait}; use codec::{Decode, Encode}; use ddc_primitives::{ ClusterId, NodeParams, NodePubKey, NodeType, StorageNodeMode, StorageNodePubKey, @@ -9,6 +8,8 @@ use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_runtime::RuntimeDebug; +use crate::node::{NodeError, NodeProps, NodeTrait}; + parameter_types! { pub MaxHostLen: u8 = 255; pub MaxDomainLen: u8 = 255; diff --git a/pallets/ddc-nodes/src/testing_utils.rs b/pallets/ddc-nodes/src/testing_utils.rs index 8ebe3f7bc..52e0198fa 100644 --- a/pallets/ddc-nodes/src/testing_utils.rs +++ b/pallets/ddc-nodes/src/testing_utils.rs @@ -1,10 +1,11 @@ //! Testing utils for ddc-staking. -use crate::{Config, NodePubKey}; use ddc_primitives::{NodeParams, StorageNodeMode, StorageNodeParams, StorageNodePubKey}; use frame_benchmarking::account; use sp_std::vec; +use crate::{Config, NodePubKey}; + const SEED: u32 = 0; /// Grab a funded user. diff --git a/pallets/ddc-nodes/src/tests.rs b/pallets/ddc-nodes/src/tests.rs index 1f1657ad9..618a01c8e 100644 --- a/pallets/ddc-nodes/src/tests.rs +++ b/pallets/ddc-nodes/src/tests.rs @@ -1,11 +1,12 @@ //! Tests for the module. -use super::{mock::*, *}; use ddc_primitives::{NodePubKey, StorageNodeMode, StorageNodeParams}; use frame_support::{assert_noop, assert_ok}; use sp_runtime::AccountId32; use storage_node::{MaxDomainLen, MaxHostLen}; +use super::{mock::*, *}; + #[test] fn create_storage_node_works() { ExtBuilder.build_and_execute(|| { diff --git a/pallets/ddc-nodes/src/weights.rs b/pallets/ddc-nodes/src/weights.rs index 784708100..bc05729ba 100644 --- a/pallets/ddc-nodes/src/weights.rs +++ b/pallets/ddc-nodes/src/weights.rs @@ -1,9 +1,9 @@ //! Autogenerated weights for pallet_ddc_nodes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bench`, CPU: `DO-Premium-AMD` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024 +//! DATE: 2023-12-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `Yahors-MacBook-Pro.local`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: // ./target/release/cere @@ -37,20 +37,20 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: DdcNodes StorageNodes (r:1 w:1) fn create_node() -> Weight { - Weight::from_ref_time(179_667_000_u64) + Weight::from_ref_time(12_000_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: DdcNodes StorageNodes (r:1 w:1) // Storage: DdcStaking Nodes (r:1 w:0) fn delete_node() -> Weight { - Weight::from_ref_time(180_906_000_u64) + Weight::from_ref_time(16_000_000_u64) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: DdcNodes StorageNodes (r:1 w:1) fn set_node_params() -> Weight { - Weight::from_ref_time(228_136_000_u64) + Weight::from_ref_time(15_000_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -60,21 +60,21 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: DdcNodes StorageNodes (r:1 w:1) fn create_node() -> Weight { - Weight::from_ref_time(179_667_000_u64) + Weight::from_ref_time(12_000_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: DdcNodes StorageNodes (r:1 w:1) // Storage: DdcStaking Nodes (r:1 w:0) fn delete_node() -> Weight { - Weight::from_ref_time(180_906_000_u64) + Weight::from_ref_time(16_000_000_u64) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: DdcNodes StorageNodes (r:1 w:1) fn set_node_params() -> Weight { - Weight::from_ref_time(228_136_000_u64) + Weight::from_ref_time(15_000_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } -} \ No newline at end of file +} diff --git a/pallets/ddc-payouts/Cargo.toml b/pallets/ddc-payouts/Cargo.toml index a87903482..9b9a4e9c7 100644 --- a/pallets/ddc-payouts/Cargo.toml +++ b/pallets/ddc-payouts/Cargo.toml @@ -1,30 +1,30 @@ [package] name = "pallet-ddc-payouts" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] byte-unit = { version = "4.0.19", default-features = false, features = ["u128"] } codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../../primitives" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -sp-io = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-staking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-tracing = { version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-test-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/ddc-payouts/src/lib.rs b/pallets/ddc-payouts/src/lib.rs index a883a27f3..8dbd206d5 100644 --- a/pallets/ddc-payouts/src/lib.rs +++ b/pallets/ddc-payouts/src/lib.rs @@ -109,11 +109,12 @@ parameter_types! { #[frame_support::pallet] pub mod pallet { - use super::*; use frame_support::PalletId; use sp_io::hashing::blake2_128; use sp_runtime::traits::{AccountIdConversion, Zero}; + use super::*; + #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] diff --git a/pallets/ddc-payouts/src/mock.rs b/pallets/ddc-payouts/src/mock.rs index 8230c6508..9b01f98a4 100644 --- a/pallets/ddc-payouts/src/mock.rs +++ b/pallets/ddc-payouts/src/mock.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] -use crate::{self as pallet_ddc_payouts, *}; use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterGovParams, ClusterParams, ClusterPricingParams, NodeType, DOLLARS, @@ -13,7 +12,6 @@ use ddc_traits::{ pallet::PalletVisitor, }; use frame_election_provider_support::SortedListProvider; - use frame_support::{ construct_runtime, parameter_types, traits::{ConstU32, ConstU64, Everything, Randomness}, @@ -30,6 +28,8 @@ use sp_runtime::{ }; use sp_std::prelude::*; +use crate::{self as pallet_ddc_payouts, *}; + /// The AccountId alias in this test module. pub type AccountId = u128; pub(crate) type AccountIndex = u64; diff --git a/pallets/ddc-payouts/src/tests.rs b/pallets/ddc-payouts/src/tests.rs index d5f70e8ea..2b4c9a1d9 100644 --- a/pallets/ddc-payouts/src/tests.rs +++ b/pallets/ddc-payouts/src/tests.rs @@ -1,11 +1,12 @@ //! Tests for the module. -use super::{mock::*, *}; use ddc_primitives::ClusterId; use frame_support::{assert_noop, assert_ok, error::BadOrigin, traits::Randomness}; use sp_core::H256; use sp_runtime::Perquintill; +use super::{mock::*, *}; + #[test] fn set_authorised_caller_works() { ExtBuilder.build_and_execute(|| { diff --git a/pallets/ddc-staking/Cargo.toml b/pallets/ddc-staking/Cargo.toml index 043e60973..54dc6416a 100644 --- a/pallets/ddc-staking/Cargo.toml +++ b/pallets/ddc-staking/Cargo.toml @@ -1,28 +1,28 @@ [package] name = "pallet-ddc-staking" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../../primitives" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [dev-dependencies] lazy_static = "1.4.0" -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } parking_lot = "0.12.1" -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/ddc-staking/src/benchmarking.rs b/pallets/ddc-staking/src/benchmarking.rs index 4b1138753..ebf8e27d4 100644 --- a/pallets/ddc-staking/src/benchmarking.rs +++ b/pallets/ddc-staking/src/benchmarking.rs @@ -1,18 +1,17 @@ //! DdcStaking pallet benchmarking. -use super::*; -use crate::Pallet as DdcStaking; use ddc_primitives::{NodeParams, NodeType, StorageNodeMode, StorageNodeParams, StorageNodePubKey}; -use testing_utils::*; - -use frame_support::traits::Currency; -use sp_runtime::traits::StaticLookup; -use sp_std::prelude::*; - pub use frame_benchmarking::{ account, benchmarks, impl_benchmark_test_suite, whitelist_account, whitelisted_caller, }; +use frame_support::traits::Currency; use frame_system::RawOrigin; +use sp_runtime::traits::StaticLookup; +use sp_std::prelude::*; +use testing_utils::*; + +use super::*; +use crate::Pallet as DdcStaking; const USER_SEED: u32 = 999666; diff --git a/pallets/ddc-staking/src/lib.rs b/pallets/ddc-staking/src/lib.rs index f9e09fcd3..10a7feb56 100644 --- a/pallets/ddc-staking/src/lib.rs +++ b/pallets/ddc-staking/src/lib.rs @@ -26,7 +26,7 @@ pub(crate) mod mock; mod tests; pub mod weights; -use crate::weights::WeightInfo; +use core::fmt::Debug; use codec::{Decode, Encode, HasCompact}; pub use ddc_primitives::{ClusterId, NodePubKey, NodeType}; @@ -35,7 +35,6 @@ use ddc_traits::{ node::{NodeCreator, NodeVisitor}, staking::{StakerCreator, StakingVisitor, StakingVisitorError}, }; - use frame_support::{ assert_ok, pallet_prelude::*, @@ -44,6 +43,7 @@ use frame_support::{ BoundedVec, }; use frame_system::pallet_prelude::*; +pub use pallet::*; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, Saturating, StaticLookup, Zero}, @@ -51,7 +51,7 @@ use sp_runtime::{ }; use sp_std::prelude::*; -pub use pallet::*; +use crate::weights::WeightInfo; const DDC_STAKING_ID: LockIdentifier = *b"ddcstake"; // DDC maintainer's stake @@ -65,20 +65,28 @@ parameter_types! { } /// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] -pub struct UnlockChunk { +pub struct UnlockChunk +where + Balance: HasCompact + MaxEncodedLen, + BlockNumber: HasCompact + MaxEncodedLen, +{ /// Amount of funds to be unlocked. #[codec(compact)] value: Balance, /// Block number at which point it'll be unlocked. #[codec(compact)] - block: T::BlockNumber, + block: BlockNumber, } -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] -pub struct StakingLedger { +pub struct StakingLedger +where + Balance: HasCompact + MaxEncodedLen, + T: Config, +{ /// The stash account whose balance is actually locked and at stake. pub stash: AccountId, /// The total amount of the stash's balance that we are currently accounting for. @@ -94,12 +102,12 @@ pub struct StakingLedger { /// Any balance that is becoming free, which may eventually be transferred out of the stash /// (assuming it doesn't get slashed first). It is assumed that this will be treated as a first /// in, first out queue where the new (higher value) blocks get pushed on the back. - pub unlocking: BoundedVec, MaxUnlockingChunks>, + pub unlocking: BoundedVec, MaxUnlockingChunks>, } impl< AccountId, - Balance: HasCompact + Copy + Saturating + AtLeast32BitUnsigned + Zero, + Balance: HasCompact + Copy + Saturating + AtLeast32BitUnsigned + Zero + MaxEncodedLen + Debug, T: Config, > StakingLedger { diff --git a/pallets/ddc-staking/src/mock.rs b/pallets/ddc-staking/src/mock.rs index 75ff7684b..9017e9ef5 100644 --- a/pallets/ddc-staking/src/mock.rs +++ b/pallets/ddc-staking/src/mock.rs @@ -2,7 +2,8 @@ #![allow(dead_code)] -use crate::{self as pallet_ddc_staking, *}; +use std::cell::RefCell; + use ddc_primitives::{ ClusterBondingParams, ClusterFeesParams, ClusterGovParams, ClusterParams, ClusterPricingParams, NodeParams, NodePubKey, StorageNodePubKey, @@ -11,14 +12,12 @@ use ddc_traits::{ cluster::{ClusterManager, ClusterManagerError, ClusterVisitor, ClusterVisitorError}, node::{NodeVisitor, NodeVisitorError}, }; - use frame_support::{ construct_runtime, dispatch::DispatchResult, traits::{ConstU32, ConstU64, Everything, GenesisBuild}, weights::constants::RocksDbWeight, }; - use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; use lazy_static::lazy_static; use parking_lot::{ReentrantMutex, ReentrantMutexGuard}; @@ -30,7 +29,8 @@ use sp_runtime::{ Perquintill, }; use sp_std::collections::btree_map::BTreeMap; -use std::cell::RefCell; + +use crate::{self as pallet_ddc_staking, *}; /// The AccountId alias in this test module. pub(crate) type AccountId = u64; diff --git a/pallets/ddc-staking/src/testing_utils.rs b/pallets/ddc-staking/src/testing_utils.rs index 5b2ffd33b..c106e0bce 100644 --- a/pallets/ddc-staking/src/testing_utils.rs +++ b/pallets/ddc-staking/src/testing_utils.rs @@ -1,18 +1,17 @@ //! Testing utils for ddc-staking. -use crate::{Pallet as DdcStaking, *}; use ddc_primitives::{ ClusterGovParams, ClusterId, ClusterParams, NodeParams, StorageNodeMode, StorageNodeParams, StorageNodePubKey, }; - use frame_benchmarking::account; -use frame_system::RawOrigin; - use frame_support::traits::Currency; +use frame_system::RawOrigin; use sp_runtime::{traits::StaticLookup, Perquintill}; use sp_std::prelude::*; +use crate::{Pallet as DdcStaking, *}; + const SEED: u32 = 0; /// This function removes all storage and Storages nodes from storage. diff --git a/pallets/ddc-staking/src/tests.rs b/pallets/ddc-staking/src/tests.rs index 53f400101..5442803e3 100644 --- a/pallets/ddc-staking/src/tests.rs +++ b/pallets/ddc-staking/src/tests.rs @@ -1,10 +1,11 @@ //! Tests for the module. -use super::{mock::*, *}; use ddc_primitives::StorageNodePubKey; use frame_support::{assert_noop, assert_ok, traits::ReservableCurrency}; use pallet_balances::Error as BalancesError; +use super::{mock::*, *}; + pub const BLOCK_TIME: u64 = 1000; pub const INIT_TIMESTAMP: u64 = 30_000; diff --git a/pallets/ddc-staking/src/weights.rs b/pallets/ddc-staking/src/weights.rs index 9a7445f84..e7157a60d 100644 --- a/pallets/ddc-staking/src/weights.rs +++ b/pallets/ddc-staking/src/weights.rs @@ -1,9 +1,9 @@ //! Autogenerated weights for pallet_ddc_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bench`, CPU: `DO-Premium-AMD` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024 +//! DATE: 2023-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `Yahors-MacBook-Pro.local`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: // ./target/release/cere @@ -46,7 +46,7 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcNodes StorageNodes (r:1 w:0) // Storage: Balances Locks (r:1 w:1) fn bond() -> Weight { - Weight::from_ref_time(472_772_000_u64) + Weight::from_ref_time(39_000_000_u64) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -57,7 +57,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unbond() -> Weight { - Weight::from_ref_time(425_643_000_u64) + Weight::from_ref_time(37_000_000_u64) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -67,7 +67,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn withdraw_unbonded() -> Weight { - Weight::from_ref_time(355_174_000_u64) + Weight::from_ref_time(33_000_000_u64) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -78,7 +78,7 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcStaking Storages (r:1 w:1) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn store() -> Weight { - Weight::from_ref_time(256_886_000_u64) + Weight::from_ref_time(28_000_000_u64) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -86,14 +86,14 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcStaking Storages (r:1 w:1) // Storage: DdcClusters ClustersGovParams (r:1 w:0) fn chill() -> Weight { - Weight::from_ref_time(337_644_000_u64) + Weight::from_ref_time(28_000_000_u64) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } // Storage: DdcStaking Bonded (r:1 w:1) // Storage: DdcStaking Ledger (r:2 w:2) fn set_controller() -> Weight { - Weight::from_ref_time(162_697_000_u64) + Weight::from_ref_time(14_000_000_u64) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -102,7 +102,7 @@ impl WeightInfo for SubstrateWeight { // Storage: DdcStaking Storages (r:1 w:0) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn set_node() -> Weight { - Weight::from_ref_time(151_137_000_u64) + Weight::from_ref_time(14_000_000_u64) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -117,7 +117,7 @@ impl WeightInfo for () { // Storage: DdcNodes StorageNodes (r:1 w:0) // Storage: Balances Locks (r:1 w:1) fn bond() -> Weight { - Weight::from_ref_time(472_772_000_u64) + Weight::from_ref_time(39_000_000_u64) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -128,7 +128,7 @@ impl WeightInfo for () { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unbond() -> Weight { - Weight::from_ref_time(425_643_000_u64) + Weight::from_ref_time(37_000_000_u64) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -138,7 +138,7 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn withdraw_unbonded() -> Weight { - Weight::from_ref_time(355_174_000_u64) + Weight::from_ref_time(33_000_000_u64) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -149,7 +149,7 @@ impl WeightInfo for () { // Storage: DdcStaking Storages (r:1 w:1) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn store() -> Weight { - Weight::from_ref_time(256_886_000_u64) + Weight::from_ref_time(28_000_000_u64) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -157,14 +157,14 @@ impl WeightInfo for () { // Storage: DdcStaking Storages (r:1 w:1) // Storage: DdcClusters ClustersGovParams (r:1 w:0) fn chill() -> Weight { - Weight::from_ref_time(337_644_000_u64) + Weight::from_ref_time(28_000_000_u64) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } // Storage: DdcStaking Bonded (r:1 w:1) // Storage: DdcStaking Ledger (r:2 w:2) fn set_controller() -> Weight { - Weight::from_ref_time(162_697_000_u64) + Weight::from_ref_time(14_000_000_u64) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -173,8 +173,8 @@ impl WeightInfo for () { // Storage: DdcStaking Storages (r:1 w:0) // Storage: DdcStaking LeavingStorages (r:1 w:0) fn set_node() -> Weight { - Weight::from_ref_time(151_137_000_u64) + Weight::from_ref_time(14_000_000_u64) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } -} +} \ No newline at end of file diff --git a/pallets/ddc/Cargo.toml b/pallets/ddc/Cargo.toml deleted file mode 100644 index 616ccc358..000000000 --- a/pallets/ddc/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = 'pallet-cere-ddc' -version = '4.8.2' -authors = ['Substrate DevHub '] -edition = '2021' -homepage = 'https://www.cere.network/' -license = 'Unlicense' -readme = 'README.md' -repository = 'https://github.com/Cerebellum-Network/ddc-pallet' -description = 'FRAME pallet template for defining custom runtime logic.' - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } - -[dev-dependencies] -serde = { version = "1.0.101" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } - -[features] -default = ['std'] -std = [ - 'codec/std', - 'sp-io/std', - 'sp-std/std', - 'sp-runtime/std', - 'frame-support/std', - 'frame-system/std', -] - -[package.metadata.cargo-machete] -ignored = ["scale-info", "codec"] diff --git a/pallets/ddc/LICENSE-APACHE2 b/pallets/ddc/LICENSE-APACHE2 deleted file mode 100644 index fbb0616d1..000000000 --- a/pallets/ddc/LICENSE-APACHE2 +++ /dev/null @@ -1,211 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -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. - - NOTE - -Individual files contain the following tag instead of the full license -text. - - SPDX-License-Identifier: Apache-2.0 - -This enables machine processing of license information based on the SPDX -License Identifiers that are here available: http://spdx.org/licenses/ \ No newline at end of file diff --git a/pallets/ddc/README.md b/pallets/ddc/README.md deleted file mode 100644 index f943ea5be..000000000 --- a/pallets/ddc/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# CereDDCModule - -A module for sending any character sequence-based data from wallet A to wallet B in the Network. - -## Overview - -### Terminology - -DDC - Decentralized Data Cloud by Cere Network. - -### Goals - -Send any character sequence-based data from wallet A to wallet B in the Network. -* Data can be updated. - -## Interface - -### Dispatchable Functions - -* `send_data` - Transfers character sequence-based data from the function caller's account (`origin`) to a `send_to` account. - -### Public Functions - -* `stringDataOf` - Get the character sequence-based data data of `AccountId`. -* `send_data` - Send character sequence-based data an account. - -## Usage - -* Go to `Developer` -> `Extrinsic submission` sub menu, execute the cereDdcModule's `send_data` method. -* Go to `Developer` -> `Chain state` sub menu, query chain state of the cereDdcModule's `stringDataOf`. - -### Prerequisites - -Import the CereDDCModule and derive your runtime configuration traits from the CereDDCModule trait. - -### Import Instruction - -* Pull ddc-pallet. From project root folder: - ```bash - git submodule update --remote - ``` - -* Import to frame structure node. In `./Cargo.toml` add: - ```rust - [workspace] - members = [ - "bin/node-template/node", - ... - "frame/vesting", - "frame/ddc-pallet", - "primitives/allocator", - ... - "utils/wasm-builder", - ] - ``` - -### Code Snippet - -1. In ./bin/node/runtime/Cargo.toml add: - ```rust - frame-executive = { default-features = false, path = "../../../frame/executive" } - ... - pallet-cere-ddc = { version = "7.3.0", default-features = false, path = "../../../frame/ddc-pallet" } - ``` - -1. In .bin/node/runtime/src/lib.rs find "construct_runtime!" then add bellow source: - ```rust - pub use pallet_cere_ddc; - ... - parameter_types! { - // Minimum bounds on storage are important to secure your chain. - pub const MinDataLength: usize = 1; - // Maximum bounds on storage are important to secure your chain. - pub const MaxDataLength: usize = usize::MAX; - } - - /// Configure the send data pallet - impl pallet_cere_ddc::Trait for Runtime { - type MinLength = MinDataLength; - type MaxLength = MaxDataLength; - // The ubiquitous event type. - type Event = Event; - } - - construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = node_primitives::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - ... - Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, - CereDDCModule: pallet_cere_ddc::{Pallet, Call, Storage, Event}, - } - ); - ``` - -### Command List -* Check before compiling node by command: - ```bash - cd ./frame/ddc-pallet - SKIP_WASM_BUILD=1 cargo check - ``` - -* Run unit test command: - ```bash - cd ./frame/ddc-pallet - SKIP_WASM_BUILD=1 cargo test - ``` - -* Build and run node. From project root folder: - ```bash - cargo build --release - ./target/release/cere --dev --ws-external - ``` - -## Assumptions - -Below are assumptions that must be held when using this module. If any of -them are violated, the behavior of this module is undefined. -* The length of string data should be greater than `1`. -* The length of string data should be less than `usize::MAX`. - -## Related Modules - -* [`System`](https://docs.rs/frame-system/latest/frame_system/) -* [`Support`](https://docs.rs/frame-support/latest/frame_support/) - -## License - -[LICENSE-APACHE2](LICENSE-APACHE2) diff --git a/pallets/ddc/src/lib.rs b/pallets/ddc/src/lib.rs deleted file mode 100644 index c7bdc1d73..000000000 --- a/pallets/ddc/src/lib.rs +++ /dev/null @@ -1,109 +0,0 @@ -#![allow(clippy::all)] -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::{ - decl_error, - decl_event, - decl_module, - decl_storage, - // dispatch, - ensure, - traits::Get, -}; -use frame_system::ensure_signed; - -/// 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: -/// https://substrate.dev/docs/en/knowledgebase/runtime/frame -use sp_std::prelude::*; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod tests; - -/// Configure the pallet by specifying the parameters and types on which it depends. -pub trait Config: frame_system::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. - type RuntimeEvent: From> + Into<::RuntimeEvent>; - - /// The minimum length a name may be. - type MinLength: Get; - - /// The maximum length a name may be. - type MaxLength: Get; -} - -// The pallet's runtime storage items. -// https://substrate.dev/docs/en/knowledgebase/runtime/storage -decl_storage! { - // A unique name is used to ensure that the pallet's storage items are isolated. - // This name may be updated, but each pallet in the runtime must use a unique name. - // ---------------------------------vvvvvvvvvvvvvv - trait Store for Module as CereDDCModule { - /// The lookup table for string. - StringDataOf: map hasher(twox_64_concat) T::AccountId => Option>; - } -} - -// Pallets use events to inform users when important changes are made. -// https://substrate.dev/docs/en/knowledgebase/runtime/events -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - { - /// A data string was set. \[who\] - DataStringSet(AccountId), - - /// A data string was changed. \[who\] - DataStringChanged(AccountId), - } -); - -// Errors inform users that something went wrong. -decl_error! { - pub enum Error for Module { - /// A name is too short. - TooShort, - /// A name is too long. - TooLong, - } -} - -// 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. -decl_module! { - /// CereDDCModule declaration. - pub struct Module for enum Call where origin: T::RuntimeOrigin { - // Errors must be initialized if they are used by the pallet. - type Error = Error; - - // Events must be initialized if they are used by the pallet. - fn deposit_event() = default; - - /// The minimum length a name may be. - const MinLength: u32 = T::MinLength::get() as u32; - - /// The maximum length a name may be. - const MaxLength: u32 = T::MaxLength::get() as u32; - - #[weight = 50_000_000] - fn send_data(origin, send_to: T::AccountId, data: Vec) { - let sender = ensure_signed(origin)?; - - ensure!(data.len() >= T::MinLength::get(), Error::::TooShort); - ensure!(data.len() <= T::MaxLength::get(), Error::::TooLong); - - if >::get(&sender).is_some() { - Self::deposit_event(RawEvent::DataStringChanged(sender)); - } else { - Self::deposit_event(RawEvent::DataStringSet(sender)); - }; - - >::insert(send_to, data); - } - } -} diff --git a/pallets/ddc/src/mock.rs b/pallets/ddc/src/mock.rs deleted file mode 100644 index c514078ba..000000000 --- a/pallets/ddc/src/mock.rs +++ /dev/null @@ -1,70 +0,0 @@ -use crate as pallet_cere_ddc; -use frame_support::{construct_runtime, parameter_types, traits::Everything}; -use frame_system as system; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, -}; - -// Configure a mock runtime to test the pallet. -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; - -construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CereDDCModule: pallet_cere_ddc::{Pallet, Call, Storage, Event}, - } -); - -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - -impl system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type RuntimeEvent = (); - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; -} - -parameter_types! { - pub const MinLength: usize = 8; - pub const MaxLength: usize = 10; -} - -impl pallet_cere_ddc::Config for Test { - type RuntimeEvent = (); - type MinLength = MinLength; - type MaxLength = MaxLength; -} - -// Build genesis storage according to the mock runtime. -pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default().build_storage::().unwrap().into() -} diff --git a/pallets/ddc/src/tests.rs b/pallets/ddc/src/tests.rs deleted file mode 100644 index 95f5927ae..000000000 --- a/pallets/ddc/src/tests.rs +++ /dev/null @@ -1,34 +0,0 @@ -use crate::{mock::*, Error}; -use frame_support::{assert_noop, assert_ok}; - -const BOB: u64 = 2; - -#[test] -fn send_data_works_valid_input() { - new_test_ext().execute_with(|| { - // Dispatch a signed extrinsic. - assert_ok!(CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"12345678".to_vec())); - }); -} - -#[test] -fn send_data_error_too_long() { - new_test_ext().execute_with(|| { - // Ensure the expected error is thrown when no value is present. - assert_noop!( - CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"TestTooLongString".to_vec()), - Error::::TooLong - ); - }); -} - -#[test] -fn send_data_error_too_short() { - new_test_ext().execute_with(|| { - // Ensure the expected error is thrown when no value is present. - assert_noop!( - CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"Short".to_vec()), - Error::::TooShort - ); - }); -} diff --git a/pallets/erc20/Cargo.toml b/pallets/erc20/Cargo.toml index 56e1df2fa..d2bff4c7a 100644 --- a/pallets/erc20/Cargo.toml +++ b/pallets/erc20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-erc20" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" homepage = "https://substrate.dev" @@ -14,17 +14,17 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } pallet-chainbridge = { version = "4.2.0", default-features = false, path = "../chainbridge" } pallet-erc721 = { version = "4.2.0", default-features = false, path = "../erc721" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/erc20/src/lib.rs b/pallets/erc20/src/lib.rs index 8e7967ed6..cdc37a064 100644 --- a/pallets/erc20/src/lib.rs +++ b/pallets/erc20/src/lib.rs @@ -2,9 +2,6 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -use pallet_chainbridge as bridge; -use pallet_erc721 as erc721; - use frame_support::{ decl_error, decl_event, decl_module, decl_storage, dispatch::DispatchResult, @@ -12,6 +9,8 @@ use frame_support::{ traits::{Currency, EnsureOrigin, ExistenceRequirement::AllowDeath, Get}, }; use frame_system::{self as system, ensure_signed}; +use pallet_chainbridge as bridge; +use pallet_erc721 as erc721; use sp_arithmetic::traits::SaturatedConversion; use sp_core::U256; use sp_std::prelude::*; diff --git a/pallets/erc721/Cargo.toml b/pallets/erc721/Cargo.toml index 7fecb780e..59d674a5e 100644 --- a/pallets/erc721/Cargo.toml +++ b/pallets/erc721/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-erc721" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" homepage = "https://substrate.dev" @@ -14,15 +14,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } pallet-chainbridge = { version = "4.2.0", default-features = false, path = "../chainbridge" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/pallets/erc721/src/mock.rs b/pallets/erc721/src/mock.rs index 9406619ae..dc8865d84 100644 --- a/pallets/erc721/src/mock.rs +++ b/pallets/erc721/src/mock.rs @@ -2,6 +2,8 @@ use frame_support::{ord_parameter_types, parameter_types, traits::Everything, weights::Weight}; use frame_system::{self as system}; +pub use pallet_balances as balances; +use pallet_chainbridge as bridge; use sp_core::{hashing::blake2_128, H256}; use sp_runtime::{ testing::Header, @@ -10,8 +12,6 @@ use sp_runtime::{ }; use crate::{self as erc721, Config}; -pub use pallet_balances as balances; -use pallet_chainbridge as bridge; parameter_types! { pub const BlockHashCount: u64 = 250; diff --git a/pallets/erc721/src/tests.rs b/pallets/erc721/src/tests.rs index 097b61399..2a2add321 100644 --- a/pallets/erc721/src/tests.rs +++ b/pallets/erc721/src/tests.rs @@ -1,11 +1,12 @@ #![cfg(test)] +use frame_support::{assert_noop, assert_ok}; +use sp_core::U256; + use super::{ mock::{new_test_ext, Erc721, RuntimeOrigin, Test, USER_A, USER_B, USER_C}, *, }; -use frame_support::{assert_noop, assert_ok}; -use sp_core::U256; #[test] fn mint_burn_tokens() { @@ -25,6 +26,7 @@ fn mint_burn_tokens() { Erc721::mint(RuntimeOrigin::root(), USER_A, id_a, metadata_a), Error::::TokenAlreadyExists ); + assert_ok!(Erc721::mint(RuntimeOrigin::root(), USER_A, id_b, metadata_b.clone())); assert_eq!( Erc721::tokens(id_b).unwrap(), diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index bfcc2b87b..4aab9b25e 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "ddc-primitives" -version = "0.1.0" +version = "4.8.3" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } serde = { version = "1.0.136", default-features = false, features = ["derive"], optional = true } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index b2703ab43..0214cbc94 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,30 +1,29 @@ [package] name = "cere-rpc" -version = "4.8.2" +version = "4.8.3" edition = "2021" [dependencies] jsonrpsee = { version = "0.15.1", features = ["server"] } -node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-keystore = { version = "0.12.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } +substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index e8cffa484..75daa9a88 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -83,7 +83,6 @@ where + Send + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_contracts_rpc::ContractsRuntimeApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, C::Api: BlockBuilder, @@ -92,7 +91,6 @@ where B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::backend::StateBackend>, { - use pallet_contracts_rpc::{Contracts, ContractsApiServer}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use sc_consensus_babe_rpc::{Babe, BabeApiServer}; use sc_finality_grandpa_rpc::GrandpaApiServer; @@ -117,7 +115,6 @@ where // Making synchronous calls in light client freezes the browser currently, // more context: https://github.com/paritytech/substrate/pull/3480 // These RPCs should use an asynchronous caller instead. - io.merge(Contracts::new(client.clone()).into_rpc())?; io.merge(TransactionPayment::new(client.clone()).into_rpc())?; io.merge( Babe::new( diff --git a/runtime/cere-dev/Cargo.toml b/runtime/cere-dev/Cargo.toml index d9ed5a46d..0712b5bd2 100644 --- a/runtime/cere-dev/Cargo.toml +++ b/runtime/cere-dev/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cere-dev-runtime" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] build = "build.rs" edition = "2021" @@ -20,93 +20,90 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive" static_assertions = "1.1.0" # primitives -node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, version = "4.0.0-dev" } -sp-consensus-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, version = "4.0.0-dev" } +sp-consensus-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # frame dependencies -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -pallet-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-bags-list = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-chainbridge = { version = "4.8.2", default-features = false, path = "../../pallets/chainbridge" } -pallet-child-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-collective = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-democracy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-election-provider-multi-phase = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-election-provider-support-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -pallet-elections-phragmen = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-fast-unstake = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-identity = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-indices = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-membership = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-multisig = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate.git", default-features = false, optional = true, branch = "polkadot-v0.9.30" } -pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-offences = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, optional = true } -pallet-proxy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-recovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-session = { features = ["historical"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, optional = true } -pallet-society = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-staking-reward-curve = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-tips = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-utility = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-vesting = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +pallet-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-bags-list = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-chainbridge = { version = "4.8.3", default-features = false, path = "../../pallets/chainbridge" } +pallet-child-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-collective = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-contracts-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-democracy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-election-provider-multi-phase = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-election-provider-support-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +pallet-elections-phragmen = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-fast-unstake = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-identity = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-indices = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-membership = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-multisig = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.31" } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-offences = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, optional = true } +pallet-proxy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-recovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-session = { features = ["historical"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, optional = true } +pallet-society = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-staking-reward-curve = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-tips = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-utility = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-vesting = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # cere dependencies cere-dev-runtime-constants = { path = "./constants", default-features = false } cere-runtime-common = { path = "../common", default-features = false } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -pallet-cere-ddc = { version = "4.8.2", default-features = false, path = "../../pallets/ddc" } -pallet-ddc-clusters = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-clusters" } -pallet-ddc-customers = { version = "0.1.0", default-features = false, path = "../../pallets/ddc-customers" } -pallet-ddc-metrics-offchain-worker = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-metrics-offchain-worker" } -pallet-ddc-nodes = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-nodes" } -pallet-ddc-payouts = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-payouts" } -pallet-ddc-staking = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-staking" } -pallet-erc20 = { version = "4.8.2", default-features = false, path = "../../pallets/erc20" } -pallet-erc721 = { version = "4.8.2", default-features = false, path = "../../pallets/erc721" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +pallet-ddc-clusters = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-clusters" } +pallet-ddc-customers = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-customers" } +pallet-ddc-nodes = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-nodes" } +pallet-ddc-payouts = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-payouts" } +pallet-ddc-staking = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-staking" } +pallet-erc20 = { version = "4.8.3", default-features = false, path = "../../pallets/erc20" } +pallet-erc721 = { version = "4.8.3", default-features = false, path = "../../pallets/erc721" } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] @@ -126,12 +123,10 @@ std = [ "pallet-collective/std", "pallet-contracts/std", "pallet-contracts-primitives/std", - "pallet-contracts-rpc-runtime-api/std", "pallet-democracy/std", "pallet-fast-unstake/std", "pallet-elections-phragmen/std", "frame-executive/std", - "pallet-cere-ddc/std", "pallet-chainbridge/std", "pallet-erc721/std", "pallet-erc20/std", @@ -146,7 +141,6 @@ std = [ "pallet-identity/std", "pallet-scheduler/std", "node-primitives/std", - "sp-offchain/std", "pallet-offences/std", "pallet-proxy/std", "sp-core/std", @@ -179,14 +173,13 @@ std = [ "frame-try-runtime/std", "sp-io/std", "pallet-child-bounties/std", - "pallet-ddc-metrics-offchain-worker/std", + "pallet-ddc-payouts/std", + "pallet-ddc-nodes/std", "pallet-ddc-staking/std", "cere-runtime-common/std", "cere-dev-runtime-constants/std", "pallet-ddc-customers/std", - "pallet-ddc-nodes/std", "pallet-ddc-clusters/std", - "pallet-ddc-payouts/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/runtime/cere-dev/constants/Cargo.toml b/runtime/cere-dev/constants/Cargo.toml index b3e0328ba..c9e5a1162 100644 --- a/runtime/cere-dev/constants/Cargo.toml +++ b/runtime/cere-dev/constants/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "cere-dev-runtime-constants" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" [dependencies] -node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/runtime/cere-dev/src/impls.rs b/runtime/cere-dev/src/impls.rs index 3e725dca7..25d3f1be5 100644 --- a/runtime/cere-dev/src/impls.rs +++ b/runtime/cere-dev/src/impls.rs @@ -17,9 +17,10 @@ //! Some configurable implementations as associated type for the substrate runtime. -use crate::{Authorship, Balances, NegativeImbalance}; use frame_support::traits::{Currency, OnUnbalanced}; +use crate::{Authorship, Balances, NegativeImbalance}; + pub struct Author; impl OnUnbalanced for Author { fn on_nonzero_unbalanced(amount: NegativeImbalance) { @@ -28,342 +29,3 @@ impl OnUnbalanced for Author { } } } - -#[cfg(test)] -mod multiplier_tests { - use crate::{ - AdjustmentVariable, MinimumMultiplier, Runtime, RuntimeBlockWeights as BlockWeights, - System, TargetBlockFullness, TransactionPayment, - }; - use cere_dev_runtime_constants::{currency::*, time::*}; - use frame_support::{ - dispatch::DispatchClass, - weights::{Weight, WeightToFee as WeightToFeeT}, - }; - use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; - use sp_runtime::{ - assert_eq_error_rate, - traits::{Convert, One, Zero}, - FixedPointNumber, - }; - - fn max_normal() -> Weight { - BlockWeights::get() - .get(DispatchClass::Normal) - .max_total - .unwrap_or_else(|| BlockWeights::get().max_block) - } - - fn min_multiplier() -> Multiplier { - MinimumMultiplier::get() - } - - fn target() -> Weight { - TargetBlockFullness::get() * max_normal() - } - - // update based on runtime impl. - fn runtime_multiplier_update(fm: Multiplier) -> Multiplier { - TargetedFeeAdjustment::< - Runtime, - TargetBlockFullness, - AdjustmentVariable, - MinimumMultiplier, - >::convert(fm) - } - - // update based on reference impl. - fn truth_value_update(block_weight: Weight, previous: Multiplier) -> Multiplier { - let accuracy = Multiplier::accuracy() as f64; - let previous_float = previous.into_inner() as f64 / accuracy; - // bump if it is zero. - let previous_float = previous_float.max(min_multiplier().into_inner() as f64 / accuracy); - - // maximum tx weight - let m = max_normal().ref_time() as f64; - // block weight always truncated to max weight - let block_weight = (block_weight.ref_time() as f64).min(m); - let v: f64 = AdjustmentVariable::get().to_float(); - - // Ideal saturation in terms of weight - let ss = target().ref_time() as f64; - // Current saturation in terms of weight - let s = block_weight; - - let t1 = v * (s / m - ss / m); - let t2 = v.powi(2) * (s / m - ss / m).powi(2) / 2.0; - let next_float = previous_float * (1.0 + t1 + t2); - Multiplier::from_float(next_float) - } - - fn run_with_system_weight(w: Weight, assertions: F) - where - F: Fn(), - { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); - t.execute_with(|| { - System::set_block_consumed_resources(w, 0); - assertions() - }); - } - - #[test] - fn truth_value_update_poc_works() { - let fm = Multiplier::saturating_from_rational(1, 2); - let test_set = vec![ - (0, fm), - (100, fm), - (1000, fm), - (target().ref_time(), fm), - (max_normal().ref_time() / 2, fm), - (max_normal().ref_time(), fm), - ]; - test_set.into_iter().for_each(|(w, fm)| { - run_with_system_weight(Weight::from_ref_time(w), || { - assert_eq_error_rate!( - truth_value_update(Weight::from_ref_time(w), fm), - runtime_multiplier_update(fm), - // Error is only 1 in 100^18 - Multiplier::from_inner(100), - ); - }) - }) - } - - #[test] - fn multiplier_can_grow_from_zero() { - // if the min is too small, then this will not change, and we are doomed forever. - // the weight is 1/100th bigger than target. - run_with_system_weight(target() * 101 / 100, || { - let next = runtime_multiplier_update(min_multiplier()); - assert!(next > min_multiplier(), "{:?} !>= {:?}", next, min_multiplier()); - }) - } - - #[test] - fn multiplier_cannot_go_below_limit() { - // will not go any further below even if block is empty. - run_with_system_weight(Weight::from_ref_time(0), || { - let next = runtime_multiplier_update(min_multiplier()); - assert_eq!(next, min_multiplier()); - }) - } - - #[test] - fn time_to_reach_zero() { - // blocks per 24h in substrate-node: 28,800 (k) - // s* = 0.1875 - // The bound from the research in an empty chain is: - // v <~ (p / k(0 - s*)) - // p > v * k * -0.1875 - // to get p == -1 we'd need - // -1 > 0.00001 * k * -0.1875 - // 1 < 0.00001 * k * 0.1875 - // 10^9 / 1875 < k - // k > 533_333 ~ 18,5 days. - run_with_system_weight(Weight::from_ref_time(0), || { - // start from 1, the default. - let mut fm = Multiplier::one(); - let mut iterations: u64 = 0; - loop { - let next = runtime_multiplier_update(fm); - fm = next; - if fm == min_multiplier() { - break - } - iterations += 1; - } - assert!(iterations > 533_333); - }) - } - - #[test] - fn min_change_per_day() { - run_with_system_weight(max_normal(), || { - let mut fm = Multiplier::one(); - // See the example in the doc of `TargetedFeeAdjustment`. are at least 0.234, hence - // `fm > 1.234`. - for _ in 0..DAYS { - let next = runtime_multiplier_update(fm); - fm = next; - } - assert!(fm > Multiplier::saturating_from_rational(1114, 1000)); - }) - } - - #[test] - #[ignore] - fn congested_chain_simulation() { - // `cargo test congested_chain_simulation -- --nocapture` to get some insight. - - // almost full. The entire quota of normal transactions is taken. - let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() - - Weight::from_ref_time(100); - - // Default substrate weight. - let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get(); - - run_with_system_weight(block_weight, || { - // initial value configured on module - let mut fm = Multiplier::one(); - assert_eq!(fm, TransactionPayment::next_fee_multiplier()); - - let mut iterations: u64 = 0; - loop { - let next = runtime_multiplier_update(fm); - // if no change, panic. This should never happen in this case. - if fm == next { - panic!("The fee should ever increase"); - } - fm = next; - iterations += 1; - let fee = - ::WeightToFee::weight_to_fee( - &tx_weight, - ); - let adjusted_fee = fm.saturating_mul_acc_int(fee); - println!( - "iteration {}, new fm = {:?}. Fee at this point is: {} units / {} millicents, \ - {} cents, {} dollars", - iterations, - fm, - adjusted_fee, - adjusted_fee / MILLICENTS, - adjusted_fee / CENTS, - adjusted_fee / DOLLARS, - ); - } - }); - } - - #[test] - fn stateless_weight_mul() { - let fm = Multiplier::saturating_from_rational(1, 2); - run_with_system_weight(target() / 4, || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() / 4, fm), - Multiplier::from_inner(100), - ); - - // Light block. Multiplier is reduced a little. - assert!(next < fm); - }); - - run_with_system_weight(target() / 2, || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() / 2, fm), - Multiplier::from_inner(100), - ); - // Light block. Multiplier is reduced a little. - assert!(next < fm); - }); - run_with_system_weight(target(), || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target(), fm), - Multiplier::from_inner(100), - ); - // ideal. No changes. - assert_eq!(next, fm) - }); - run_with_system_weight(target() * 2, || { - // More than ideal. Fee is increased. - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() * 2, fm), - Multiplier::from_inner(100), - ); - - // Heavy block. Fee is increased a little. - assert!(next > fm); - }); - } - - #[test] - fn weight_mul_grow_on_big_block() { - run_with_system_weight(target() * 2, || { - let mut original = Multiplier::zero(); - let mut next = Multiplier::default(); - - (0..1_000).for_each(|_| { - next = runtime_multiplier_update(original); - assert_eq_error_rate!( - next, - truth_value_update(target() * 2, original), - Multiplier::from_inner(100), - ); - // must always increase - assert!(next > original, "{:?} !>= {:?}", next, original); - original = next; - }); - }); - } - - #[test] - fn weight_mul_decrease_on_small_block() { - run_with_system_weight(target() / 2, || { - let mut original = Multiplier::saturating_from_rational(1, 2); - let mut next; - - for _ in 0..100 { - // decreases - next = runtime_multiplier_update(original); - assert!(next < original, "{:?} !<= {:?}", next, original); - original = next; - } - }) - } - - #[test] - fn weight_to_fee_should_not_overflow_on_large_weights() { - let kb = 1024_u64; - let mb = kb * kb; - let max_fm = Multiplier::saturating_from_integer(i128::MAX); - - // check that for all values it can compute, correctly. - vec![ - 0, - 1, - 10, - 1000, - kb, - 10 * kb, - 100 * kb, - mb, - 10 * mb, - 2147483647, - 4294967295, - BlockWeights::get().max_block.ref_time() / 2, - BlockWeights::get().max_block.ref_time(), - u64::MAX / 2, - u64::MAX, - ] - .into_iter() - .for_each(|i| { - run_with_system_weight(Weight::from_ref_time(i), || { - let next = runtime_multiplier_update(Multiplier::one()); - let truth = truth_value_update(Weight::from_ref_time(i), Multiplier::one()); - assert_eq_error_rate!(truth, next, Multiplier::from_inner(50_000_000)); - }); - }); - - // Some values that are all above the target and will cause an increase. - let t = target().ref_time(); - vec![t + 100, t * 2, t * 4].into_iter().for_each(|i| { - run_with_system_weight(Weight::from_ref_time(i), || { - let fm = runtime_multiplier_update(max_fm); - // won't grow. The convert saturates everything. - assert_eq!(fm, max_fm); - }) - }); - } -} diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index 743b20bb4..6ded2c9d1 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ traits::{ ConstU128, ConstU16, ConstU32, Currency, EitherOfDiverse, EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, Nothing, OnUnbalanced, - U128CurrencyToVote, + U128CurrencyToVote, WithdrawReasons, }, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, @@ -41,17 +41,19 @@ use frame_support::{ }, PalletId, RuntimeDebug, }; +#[cfg(any(feature = "std", test))] +pub use frame_system::Call as SystemCall; use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; pub use node_primitives::{AccountId, Signature}; use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment}; -pub use pallet_cere_ddc; +#[cfg(any(feature = "std", test))] +pub use pallet_balances::Call as BalancesCall; pub use pallet_chainbridge; pub use pallet_ddc_clusters; pub use pallet_ddc_customers; -pub use pallet_ddc_metrics_offchain_worker; pub use pallet_ddc_nodes; pub use pallet_ddc_payouts; pub use pallet_ddc_staking; @@ -61,6 +63,10 @@ use pallet_grandpa::{ }; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical::{self as pallet_session_historical}; +#[cfg(any(feature = "std", test))] +pub use pallet_staking::StakerStatus; +#[cfg(any(feature = "std", test))] +pub use pallet_sudo::Call as SudoCall; pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use sp_api::impl_runtime_apis; @@ -68,12 +74,14 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_inherents::{CheckInherentsResult, InherentData}; use sp_io::hashing::blake2_128; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, curve::PiecewiseLinear, generic, impl_opaque_keys, traits::{ - self, AccountIdConversion, BlakeTwo256, Block as BlockT, ConvertInto, + self, AccountIdConversion, BlakeTwo256, Block as BlockT, Bounded, ConvertInto, Identity as IdentityConvert, NumberFor, OpaqueKeys, SaturatedConversion, StaticLookup, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, @@ -85,23 +93,11 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use static_assertions::const_assert; -#[cfg(any(feature = "std", test))] -pub use frame_system::Call as SystemCall; -#[cfg(any(feature = "std", test))] -pub use pallet_balances::Call as BalancesCall; -#[cfg(any(feature = "std", test))] -pub use pallet_staking::StakerStatus; -#[cfg(any(feature = "std", test))] -pub use pallet_sudo::Call as SudoCall; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; - /// Implementations of some helper traits passed into runtime modules as associated types. pub mod impls; -use impls::Author; - /// Constant values used within the runtime. use cere_dev_runtime_constants::{currency::*, time::*}; +use impls::Author; use sp_runtime::generic::Era; /// Generated voter bag information. @@ -131,10 +127,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 48202, + spec_version: 48300, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 8, + transaction_version: 9, state_version: 0, }; @@ -175,8 +171,8 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2); +/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size. +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2).set_proof_size(u64::MAX); parameter_types! { pub const BlockHashCount: BlockNumber = 2400; @@ -353,11 +349,10 @@ impl pallet_scheduler::Config for Runtime { type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; - type MaxScheduledPerBlock = ConstU32<50>; + type MaxScheduledPerBlock = ConstU32<512>; type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type OriginPrivilegeCmp = EqualPrivilegeOnly; - type PreimageProvider = (); - type NoPreimagePostponement = (); + type Preimages = (); } parameter_types! { @@ -432,6 +427,7 @@ parameter_types! { pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); + pub MaximumMultiplier: Multiplier = Bounded::max_value(); } impl pallet_transaction_payment::Config for Runtime { @@ -440,8 +436,13 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = - TargetedFeeAdjustment; + type FeeMultiplierUpdate = TargetedFeeAdjustment< + Self, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, + >; } parameter_types! { @@ -734,7 +735,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -774,14 +774,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cool-off period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = (); - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = ConstU32<100>; type WeightInfo = pallet_democracy::weights::SubstrateWeight; type MaxProposals = MaxProposals; + type Preimages = (); + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -999,7 +1000,6 @@ impl pallet_contracts::Config for Runtime { type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; - type ContractAccessWeight = pallet_contracts::DefaultContractAccessWeight; type MaxCodeLen = ConstU32<{ 128 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; } @@ -1195,6 +1195,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -1203,26 +1205,12 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = pallet_vesting::weights::SubstrateWeight; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the // highest number of schedules that encodes less than 2^10. const MAX_VESTING_SCHEDULES: u32 = 28; } -parameter_types! { - // Minimum bounds on storage are important to secure your chain. - pub const MinDataLength: usize = 1; - // Maximum bounds on storage are important to secure your chain. - pub const MaxDataLength: usize = usize::MAX; -} - -/// Configure the send data pallet -impl pallet_cere_ddc::Config for Runtime { - type MinLength = MinDataLength; - type MaxLength = MaxDataLength; - // The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; -} - parameter_types! { pub const ChainId: u8 = 1; pub const ProposalLifetime: BlockNumber = 1000; @@ -1259,10 +1247,6 @@ impl pallet_erc20::Config for Runtime { type Erc721Id = NFTTokenId; } -parameter_types! { - pub const OcwBlockInterval: u32 = pallet_ddc_metrics_offchain_worker::BLOCK_INTERVAL; -} - parameter_types! { pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); // Allow pools that got slashed up to 90% to remain operational. @@ -1308,15 +1292,6 @@ impl frame_support::traits::OnRuntimeUpgrade for InitiateNominationPools { } } -impl pallet_ddc_metrics_offchain_worker::Config for Runtime { - type BlockInterval = OcwBlockInterval; - - type AuthorityId = pallet_ddc_metrics_offchain_worker::crypto::TestAuthId; - - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} - impl pallet_ddc_staking::Config for Runtime { type Currency = Balances; type RuntimeEvent = RuntimeEvent; @@ -1429,11 +1404,9 @@ construct_runtime!( ChildBounties: pallet_child_bounties, NominationPools: pallet_nomination_pools, FastUnstake: pallet_fast_unstake, - CereDDCModule: pallet_cere_ddc::{Pallet, Call, Storage, Event}, ChainBridge: pallet_chainbridge::{Pallet, Call, Storage, Event}, Erc721: pallet_erc721::{Pallet, Call, Storage, Event}, Erc20: pallet_erc20::{Pallet, Call, Storage, Event}, - DdcMetricsOffchainWorker: pallet_ddc_metrics_offchain_worker::{Pallet, Call, Storage, Event}, DdcStaking: pallet_ddc_staking, DdcCustomers: pallet_ddc_customers, DdcNodes: pallet_ddc_nodes, @@ -1490,14 +1463,10 @@ pub type Executive = frame_executive::Executive< Runtime, AllPalletsWithSystem, ( - pallet_staking::migrations::v11::MigrateToV11< - Runtime, - VoterList, - StakingMigrationV11OldPallet, - >, - pallet_staking::migrations::v12::MigrateToV12, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, pallet_contracts::Migration, - custom_migration::Upgrade, ), >; @@ -1712,33 +1681,33 @@ impl_runtime_apis! { } } - impl pallet_contracts_rpc_runtime_api::ContractsApi< - Block, AccountId, Balance, BlockNumber, Hash, - > - for Runtime + + impl pallet_contracts::ContractsApi for Runtime { fn call( origin: AccountId, dest: AccountId, value: Balance, - gas_limit: u64, + gas_limit: Option, storage_deposit_limit: Option, input_data: Vec, ) -> pallet_contracts_primitives::ContractExecResult { - Contracts::bare_call(origin, dest, value, Weight::from_ref_time(gas_limit), storage_deposit_limit, input_data, true) + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_call(origin, dest, value, gas_limit, storage_deposit_limit, input_data, true) } fn instantiate( origin: AccountId, value: Balance, - gas_limit: u64, + gas_limit: Option, storage_deposit_limit: Option, code: pallet_contracts_primitives::Code, data: Vec, salt: Vec, ) -> pallet_contracts_primitives::ContractInstantiateResult { - Contracts::bare_instantiate(origin, value, Weight::from_ref_time(gas_limit), storage_deposit_limit, code, data, salt, true) + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_instantiate(origin, value, gas_limit, storage_deposit_limit, code, data, salt, true) } fn upload_code( @@ -1908,11 +1877,12 @@ impl_runtime_apis! { #[cfg(test)] mod tests { - use super::*; use frame_election_provider_support::NposSolution; use frame_system::offchain::CreateSignedTransaction; use sp_runtime::UpperOf; + use super::*; + #[test] fn validate_transaction_submitter_bounds() { fn is_submit_signed_transaction() @@ -1927,7 +1897,7 @@ mod tests { #[test] fn perbill_as_onchain_accuracy() { type OnChainAccuracy = - <::Solution as NposSolution>::Accuracy; + <::Solution as NposSolution>::Accuracy; let maximum_chain_accuracy: Vec> = (0..MaxNominations::get()) .map(|_| >::from(OnChainAccuracy::one().deconstruct())) .collect(); diff --git a/runtime/cere/Cargo.toml b/runtime/cere/Cargo.toml index 40014f495..ff1da0860 100644 --- a/runtime/cere/Cargo.toml +++ b/runtime/cere/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cere-runtime" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] build = "build.rs" edition = "2021" @@ -20,93 +20,90 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive" static_assertions = "1.1.0" # primitives -node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, version = "4.0.0-dev" } -sp-consensus-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, version = "4.0.0-dev" } +sp-consensus-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # frame dependencies -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -pallet-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-bags-list = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-chainbridge = { version = "4.8.2", default-features = false, path = "../../pallets/chainbridge" } -pallet-child-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-collective = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-contracts-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-democracy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-election-provider-multi-phase = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-election-provider-support-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", optional = true } -pallet-elections-phragmen = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-fast-unstake = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-identity = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-indices = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-membership = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-multisig = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate.git", default-features = false, optional = true, branch = "polkadot-v0.9.30" } -pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -pallet-offences = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, optional = true } -pallet-proxy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-recovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-session = { features = ["historical"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } -pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false, optional = true } -pallet-society = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-staking-reward-curve = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-tips = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-utility = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -pallet-vesting = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-election-provider-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +pallet-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-babe = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-bags-list = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-chainbridge = { version = "4.8.3", default-features = false, path = "../../pallets/chainbridge" } +pallet-child-bounties = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-collective = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-contracts = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-contracts-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-democracy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-election-provider-multi-phase = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-election-provider-support-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true } +pallet-elections-phragmen = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-fast-unstake = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-identity = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-indices = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-membership = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-multisig = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.31" } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } +pallet-offences = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, optional = true } +pallet-proxy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-recovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-session = { features = ["historical"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false } +pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false, optional = true } +pallet-society = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-staking-reward-curve = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-tips = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-utility = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +pallet-vesting = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } # cere dependencies cere-runtime-common = { path = "../common", default-features = false } cere-runtime-constants = { path = "./constants", default-features = false } -ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" } -pallet-cere-ddc = { version = "4.8.2", default-features = false, path = "../../pallets/ddc" } -pallet-ddc-clusters = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-clusters" } -pallet-ddc-customers = { version = "0.1.0", default-features = false, path = "../../pallets/ddc-customers" } -pallet-ddc-metrics-offchain-worker = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-metrics-offchain-worker" } -pallet-ddc-nodes = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-nodes" } -pallet-ddc-payouts = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-payouts" } -pallet-ddc-staking = { version = "4.8.2", default-features = false, path = "../../pallets/ddc-staking" } -pallet-erc20 = { version = "4.8.2", default-features = false, path = "../../pallets/erc20" } -pallet-erc721 = { version = "4.8.2", default-features = false, path = "../../pallets/erc721" } +ddc-traits = { version = "4.8.3", default-features = false, path = "../../traits" } +pallet-ddc-clusters = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-clusters" } +pallet-ddc-customers = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-customers" } +pallet-ddc-nodes = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-nodes" } +pallet-ddc-payouts = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-payouts" } +pallet-ddc-staking = { version = "4.8.3", default-features = false, path = "../../pallets/ddc-staking" } +pallet-erc20 = { version = "4.8.3", default-features = false, path = "../../pallets/erc20" } +pallet-erc721 = { version = "4.8.3", default-features = false, path = "../../pallets/erc721" } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] @@ -126,12 +123,10 @@ std = [ "pallet-collective/std", "pallet-contracts/std", "pallet-contracts-primitives/std", - "pallet-contracts-rpc-runtime-api/std", "pallet-democracy/std", "pallet-fast-unstake/std", "pallet-elections-phragmen/std", "frame-executive/std", - "pallet-cere-ddc/std", "pallet-chainbridge/std", "pallet-erc721/std", "pallet-erc20/std", @@ -146,7 +141,6 @@ std = [ "pallet-identity/std", "pallet-scheduler/std", "node-primitives/std", - "sp-offchain/std", "pallet-offences/std", "pallet-proxy/std", "sp-core/std", @@ -179,7 +173,6 @@ std = [ "frame-try-runtime/std", "sp-io/std", "pallet-child-bounties/std", - "pallet-ddc-metrics-offchain-worker/std", "pallet-ddc-clusters/std", "pallet-ddc-customers/std", "pallet-ddc-nodes/std", diff --git a/runtime/cere/constants/Cargo.toml b/runtime/cere/constants/Cargo.toml index 9fbe6944e..d33a892dc 100644 --- a/runtime/cere/constants/Cargo.toml +++ b/runtime/cere/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "cere-runtime-constants" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" [dependencies] -node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } +node-primitives = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } [features] default = ["std"] diff --git a/runtime/cere/src/impls.rs b/runtime/cere/src/impls.rs index f1763dea1..25d3f1be5 100644 --- a/runtime/cere/src/impls.rs +++ b/runtime/cere/src/impls.rs @@ -17,9 +17,10 @@ //! Some configurable implementations as associated type for the substrate runtime. -use crate::{Authorship, Balances, NegativeImbalance}; use frame_support::traits::{Currency, OnUnbalanced}; +use crate::{Authorship, Balances, NegativeImbalance}; + pub struct Author; impl OnUnbalanced for Author { fn on_nonzero_unbalanced(amount: NegativeImbalance) { @@ -28,342 +29,3 @@ impl OnUnbalanced for Author { } } } - -#[cfg(test)] -mod multiplier_tests { - use crate::{ - AdjustmentVariable, MinimumMultiplier, Runtime, RuntimeBlockWeights as BlockWeights, - System, TargetBlockFullness, TransactionPayment, - }; - use cere_runtime_constants::{currency::*, time::*}; - use frame_support::{ - dispatch::DispatchClass, - weights::{Weight, WeightToFee as WeightToFeeT}, - }; - use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; - use sp_runtime::{ - assert_eq_error_rate, - traits::{Convert, One, Zero}, - FixedPointNumber, - }; - - fn max_normal() -> Weight { - BlockWeights::get() - .get(DispatchClass::Normal) - .max_total - .unwrap_or_else(|| BlockWeights::get().max_block) - } - - fn min_multiplier() -> Multiplier { - MinimumMultiplier::get() - } - - fn target() -> Weight { - TargetBlockFullness::get() * max_normal() - } - - // update based on runtime impl. - fn runtime_multiplier_update(fm: Multiplier) -> Multiplier { - TargetedFeeAdjustment::< - Runtime, - TargetBlockFullness, - AdjustmentVariable, - MinimumMultiplier, - >::convert(fm) - } - - // update based on reference impl. - fn truth_value_update(block_weight: Weight, previous: Multiplier) -> Multiplier { - let accuracy = Multiplier::accuracy() as f64; - let previous_float = previous.into_inner() as f64 / accuracy; - // bump if it is zero. - let previous_float = previous_float.max(min_multiplier().into_inner() as f64 / accuracy); - - // maximum tx weight - let m = max_normal().ref_time() as f64; - // block weight always truncated to max weight - let block_weight = (block_weight.ref_time() as f64).min(m); - let v: f64 = AdjustmentVariable::get().to_float(); - - // Ideal saturation in terms of weight - let ss = target().ref_time() as f64; - // Current saturation in terms of weight - let s = block_weight; - - let t1 = v * (s / m - ss / m); - let t2 = v.powi(2) * (s / m - ss / m).powi(2) / 2.0; - let next_float = previous_float * (1.0 + t1 + t2); - Multiplier::from_float(next_float) - } - - fn run_with_system_weight(w: Weight, assertions: F) - where - F: Fn(), - { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); - t.execute_with(|| { - System::set_block_consumed_resources(w, 0); - assertions() - }); - } - - #[test] - fn truth_value_update_poc_works() { - let fm = Multiplier::saturating_from_rational(1, 2); - let test_set = vec![ - (0, fm), - (100, fm), - (1000, fm), - (target().ref_time(), fm), - (max_normal().ref_time() / 2, fm), - (max_normal().ref_time(), fm), - ]; - test_set.into_iter().for_each(|(w, fm)| { - run_with_system_weight(Weight::from_ref_time(w), || { - assert_eq_error_rate!( - truth_value_update(Weight::from_ref_time(w), fm), - runtime_multiplier_update(fm), - // Error is only 1 in 100^18 - Multiplier::from_inner(100), - ); - }) - }) - } - - #[test] - fn multiplier_can_grow_from_zero() { - // if the min is too small, then this will not change, and we are doomed forever. - // the weight is 1/100th bigger than target. - run_with_system_weight(target() * 101 / 100, || { - let next = runtime_multiplier_update(min_multiplier()); - assert!(next > min_multiplier(), "{:?} !>= {:?}", next, min_multiplier()); - }) - } - - #[test] - fn multiplier_cannot_go_below_limit() { - // will not go any further below even if block is empty. - run_with_system_weight(Weight::from_ref_time(0), || { - let next = runtime_multiplier_update(min_multiplier()); - assert_eq!(next, min_multiplier()); - }) - } - - #[test] - fn time_to_reach_zero() { - // blocks per 24h in substrate-node: 28,800 (k) - // s* = 0.1875 - // The bound from the research in an empty chain is: - // v <~ (p / k(0 - s*)) - // p > v * k * -0.1875 - // to get p == -1 we'd need - // -1 > 0.00001 * k * -0.1875 - // 1 < 0.00001 * k * 0.1875 - // 10^9 / 1875 < k - // k > 533_333 ~ 18,5 days. - run_with_system_weight(Weight::from_ref_time(0), || { - // start from 1, the default. - let mut fm = Multiplier::one(); - let mut iterations: u64 = 0; - loop { - let next = runtime_multiplier_update(fm); - fm = next; - if fm == min_multiplier() { - break - } - iterations += 1; - } - assert!(iterations > 533_333); - }) - } - - #[test] - fn min_change_per_day() { - run_with_system_weight(max_normal(), || { - let mut fm = Multiplier::one(); - // See the example in the doc of `TargetedFeeAdjustment`. are at least 0.234, hence - // `fm > 1.234`. - for _ in 0..DAYS { - let next = runtime_multiplier_update(fm); - fm = next; - } - assert!(fm > Multiplier::saturating_from_rational(1114, 1000)); - }) - } - - #[test] - #[ignore] - fn congested_chain_simulation() { - // `cargo test congested_chain_simulation -- --nocapture` to get some insight. - - // almost full. The entire quota of normal transactions is taken. - let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() - - Weight::from_ref_time(100); - - // Default substrate weight. - let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get(); - - run_with_system_weight(block_weight, || { - // initial value configured on module - let mut fm = Multiplier::one(); - assert_eq!(fm, TransactionPayment::next_fee_multiplier()); - - let mut iterations: u64 = 0; - loop { - let next = runtime_multiplier_update(fm); - // if no change, panic. This should never happen in this case. - if fm == next { - panic!("The fee should ever increase"); - } - fm = next; - iterations += 1; - let fee = - ::WeightToFee::weight_to_fee( - &tx_weight, - ); - let adjusted_fee = fm.saturating_mul_acc_int(fee); - println!( - "iteration {}, new fm = {:?}. Fee at this point is: {} units / {} millicents, \ - {} cents, {} dollars", - iterations, - fm, - adjusted_fee, - adjusted_fee / MILLICENTS, - adjusted_fee / CENTS, - adjusted_fee / DOLLARS, - ); - } - }); - } - - #[test] - fn stateless_weight_mul() { - let fm = Multiplier::saturating_from_rational(1, 2); - run_with_system_weight(target() / 4, || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() / 4, fm), - Multiplier::from_inner(100), - ); - - // Light block. Multiplier is reduced a little. - assert!(next < fm); - }); - - run_with_system_weight(target() / 2, || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() / 2, fm), - Multiplier::from_inner(100), - ); - // Light block. Multiplier is reduced a little. - assert!(next < fm); - }); - run_with_system_weight(target(), || { - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target(), fm), - Multiplier::from_inner(100), - ); - // ideal. No changes. - assert_eq!(next, fm) - }); - run_with_system_weight(target() * 2, || { - // More than ideal. Fee is increased. - let next = runtime_multiplier_update(fm); - assert_eq_error_rate!( - next, - truth_value_update(target() * 2, fm), - Multiplier::from_inner(100), - ); - - // Heavy block. Fee is increased a little. - assert!(next > fm); - }); - } - - #[test] - fn weight_mul_grow_on_big_block() { - run_with_system_weight(target() * 2, || { - let mut original = Multiplier::zero(); - let mut next = Multiplier::default(); - - (0..1_000).for_each(|_| { - next = runtime_multiplier_update(original); - assert_eq_error_rate!( - next, - truth_value_update(target() * 2, original), - Multiplier::from_inner(100), - ); - // must always increase - assert!(next > original, "{:?} !>= {:?}", next, original); - original = next; - }); - }); - } - - #[test] - fn weight_mul_decrease_on_small_block() { - run_with_system_weight(target() / 2, || { - let mut original = Multiplier::saturating_from_rational(1, 2); - let mut next; - - for _ in 0..100 { - // decreases - next = runtime_multiplier_update(original); - assert!(next < original, "{:?} !<= {:?}", next, original); - original = next; - } - }) - } - - #[test] - fn weight_to_fee_should_not_overflow_on_large_weights() { - let kb = 1024_u64; - let mb = kb * kb; - let max_fm = Multiplier::saturating_from_integer(i128::MAX); - - // check that for all values it can compute, correctly. - vec![ - 0, - 1, - 10, - 1000, - kb, - 10 * kb, - 100 * kb, - mb, - 10 * mb, - 2147483647, - 4294967295, - BlockWeights::get().max_block.ref_time() / 2, - BlockWeights::get().max_block.ref_time(), - u64::MAX / 2, - u64::MAX, - ] - .into_iter() - .for_each(|i| { - run_with_system_weight(Weight::from_ref_time(i), || { - let next = runtime_multiplier_update(Multiplier::one()); - let truth = truth_value_update(Weight::from_ref_time(i), Multiplier::one()); - assert_eq_error_rate!(truth, next, Multiplier::from_inner(50_000_000)); - }); - }); - - // Some values that are all above the target and will cause an increase. - let t = target().ref_time(); - vec![t + 100, t * 2, t * 4].into_iter().for_each(|i| { - run_with_system_weight(Weight::from_ref_time(i), || { - let fm = runtime_multiplier_update(max_fm); - // won't grow. The convert saturates everything. - assert_eq!(fm, max_fm); - }) - }); - } -} diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index e3c35acde..8aa19d8be 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ traits::{ ConstU128, ConstU16, ConstU32, Currency, EitherOfDiverse, EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, Nothing, OnUnbalanced, - U128CurrencyToVote, + U128CurrencyToVote, WithdrawReasons, }, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, @@ -41,21 +41,27 @@ use frame_support::{ }, PalletId, RuntimeDebug, }; +#[cfg(any(feature = "std", test))] +pub use frame_system::Call as SystemCall; use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; pub use node_primitives::{AccountId, Signature}; use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment}; -pub use pallet_cere_ddc; +#[cfg(any(feature = "std", test))] +pub use pallet_balances::Call as BalancesCall; pub use pallet_chainbridge; -pub use pallet_ddc_metrics_offchain_worker; use pallet_election_provider_multi_phase::SolutionAccuracyOf; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical::{self as pallet_session_historical}; +#[cfg(any(feature = "std", test))] +pub use pallet_staking::StakerStatus; +#[cfg(any(feature = "std", test))] +pub use pallet_sudo::Call as SudoCall; pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use sp_api::impl_runtime_apis; @@ -63,12 +69,14 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_inherents::{CheckInherentsResult, InherentData}; use sp_io::hashing::blake2_128; +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; use sp_runtime::{ create_runtime_str, curve::PiecewiseLinear, generic, impl_opaque_keys, traits::{ - self, AccountIdConversion, BlakeTwo256, Block as BlockT, ConvertInto, + self, AccountIdConversion, BlakeTwo256, Block as BlockT, Bounded, ConvertInto, Identity as IdentityConvert, NumberFor, OpaqueKeys, SaturatedConversion, StaticLookup, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, @@ -80,23 +88,11 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use static_assertions::const_assert; -#[cfg(any(feature = "std", test))] -pub use frame_system::Call as SystemCall; -#[cfg(any(feature = "std", test))] -pub use pallet_balances::Call as BalancesCall; -#[cfg(any(feature = "std", test))] -pub use pallet_staking::StakerStatus; -#[cfg(any(feature = "std", test))] -pub use pallet_sudo::Call as SudoCall; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; - /// Implementations of some helper traits passed into runtime modules as associated types. pub mod impls; -use impls::Author; - /// Constant values used within the runtime. use cere_runtime_constants::{currency::*, time::*}; +use impls::Author; use sp_runtime::generic::Era; /// Generated voter bag information. @@ -126,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 48202, + spec_version: 48300, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 8, @@ -170,8 +166,8 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2); +/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size. +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2).set_proof_size(u64::MAX); parameter_types! { pub const BlockHashCount: BlockNumber = 2400; @@ -348,11 +344,10 @@ impl pallet_scheduler::Config for Runtime { type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; - type MaxScheduledPerBlock = ConstU32<50>; + type MaxScheduledPerBlock = ConstU32<512>; type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type OriginPrivilegeCmp = EqualPrivilegeOnly; - type PreimageProvider = (); - type NoPreimagePostponement = (); + type Preimages = (); } parameter_types! { @@ -427,6 +422,7 @@ parameter_types! { pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); + pub MaximumMultiplier: Multiplier = Bounded::max_value(); } impl pallet_transaction_payment::Config for Runtime { @@ -435,8 +431,13 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = - TargetedFeeAdjustment; + type FeeMultiplierUpdate = TargetedFeeAdjustment< + Self, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, + >; } parameter_types! { @@ -730,7 +731,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -770,14 +770,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cool-off period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = (); - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = ConstU32<100>; type WeightInfo = pallet_democracy::weights::SubstrateWeight; type MaxProposals = MaxProposals; + type Preimages = (); + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -995,7 +996,6 @@ impl pallet_contracts::Config for Runtime { type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; - type ContractAccessWeight = pallet_contracts::DefaultContractAccessWeight; type MaxCodeLen = ConstU32<{ 128 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; } @@ -1191,6 +1191,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -1199,26 +1201,12 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = pallet_vesting::weights::SubstrateWeight; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the // highest number of schedules that encodes less than 2^10. const MAX_VESTING_SCHEDULES: u32 = 28; } -parameter_types! { - // Minimum bounds on storage are important to secure your chain. - pub const MinDataLength: usize = 1; - // Maximum bounds on storage are important to secure your chain. - pub const MaxDataLength: usize = usize::MAX; -} - -/// Configure the send data pallet -impl pallet_cere_ddc::Config for Runtime { - type MinLength = MinDataLength; - type MaxLength = MaxDataLength; - // The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; -} - parameter_types! { pub const ChainId: u8 = 1; pub const ProposalLifetime: BlockNumber = 1000; @@ -1255,10 +1243,6 @@ impl pallet_erc20::Config for Runtime { type Erc721Id = NFTTokenId; } -parameter_types! { - pub const OcwBlockInterval: u32 = pallet_ddc_metrics_offchain_worker::BLOCK_INTERVAL; -} - parameter_types! { pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); // Allow pools that got slashed up to 90% to remain operational. @@ -1304,15 +1288,6 @@ impl frame_support::traits::OnRuntimeUpgrade for InitiateNominationPools { } } -impl pallet_ddc_metrics_offchain_worker::Config for Runtime { - type BlockInterval = OcwBlockInterval; - - type AuthorityId = pallet_ddc_metrics_offchain_worker::crypto::TestAuthId; - - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} - parameter_types! { pub const DdcCustomersPalletId: PalletId = PalletId(*b"accounts"); // DDC maintainer's stake pub const UnlockingDelay: BlockNumber = 100800_u32; // 1 hour * 24 * 7 = 7 days; (1 hour is 600 blocks) @@ -1425,11 +1400,9 @@ construct_runtime!( ChildBounties: pallet_child_bounties, NominationPools: pallet_nomination_pools, FastUnstake: pallet_fast_unstake, - CereDDCModule: pallet_cere_ddc::{Pallet, Call, Storage, Event}, ChainBridge: pallet_chainbridge::{Pallet, Call, Storage, Event}, Erc721: pallet_erc721::{Pallet, Call, Storage, Event}, Erc20: pallet_erc20::{Pallet, Call, Storage, Event}, - DdcMetricsOffchainWorker: pallet_ddc_metrics_offchain_worker::{Pallet, Call, Storage, Event}, DdcStaking: pallet_ddc_staking, DdcCustomers: pallet_ddc_customers, DdcNodes: pallet_ddc_nodes, @@ -1486,12 +1459,9 @@ pub type Executive = frame_executive::Executive< Runtime, AllPalletsWithSystem, ( - pallet_staking::migrations::v11::MigrateToV11< - Runtime, - VoterList, - StakingMigrationV11OldPallet, - >, - pallet_staking::migrations::v12::MigrateToV12, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, pallet_contracts::Migration, ), >; @@ -1694,33 +1664,32 @@ impl_runtime_apis! { } } - impl pallet_contracts_rpc_runtime_api::ContractsApi< - Block, AccountId, Balance, BlockNumber, Hash, - > - for Runtime + impl pallet_contracts::ContractsApi for Runtime { fn call( origin: AccountId, dest: AccountId, value: Balance, - gas_limit: u64, + gas_limit: Option, storage_deposit_limit: Option, input_data: Vec, ) -> pallet_contracts_primitives::ContractExecResult { - Contracts::bare_call(origin, dest, value, Weight::from_ref_time(gas_limit), storage_deposit_limit, input_data, true) + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_call(origin, dest, value, gas_limit, storage_deposit_limit, input_data, true) } fn instantiate( origin: AccountId, value: Balance, - gas_limit: u64, + gas_limit: Option, storage_deposit_limit: Option, code: pallet_contracts_primitives::Code, data: Vec, salt: Vec, ) -> pallet_contracts_primitives::ContractInstantiateResult { - Contracts::bare_instantiate(origin, value, Weight::from_ref_time(gas_limit), storage_deposit_limit, code, data, salt, true) + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_instantiate(origin, value, gas_limit, storage_deposit_limit, code, data, salt, true) } fn upload_code( @@ -1890,11 +1859,12 @@ impl_runtime_apis! { #[cfg(test)] mod tests { - use super::*; use frame_election_provider_support::NposSolution; use frame_system::offchain::CreateSignedTransaction; use sp_runtime::UpperOf; + use super::*; + #[test] fn validate_transaction_submitter_bounds() { fn is_submit_signed_transaction() diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 94c9309d3..4fa285307 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cere-runtime-common" -version = "4.8.2" +version = "4.8.3" authors = ["Parity Technologies "] edition = "2021" @@ -10,7 +10,7 @@ no_std = [] std = [] [dependencies] -frame-support = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -node-primitives = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -sp-core = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.30" } +frame-support = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.31" } +node-primitives = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.31" } +sp-core = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.31" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } diff --git a/rustfmt.toml b/rustfmt.toml index 2797c252b..0e86d10d6 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -24,8 +24,6 @@ use_field_init_shorthand = true ignore = [ "pallets/chainbridge", - "pallets/ddc-metrics-offchain-worker", - "pallets/ddc", "pallets/erc20", "pallets/erc721", ] diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 9f1e81c34..66cd79f72 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "ddc-traits" -version = "0.1.0" +version = "4.8.3" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } -ddc-primitives = { path = "../primitives", default-features = false } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } +ddc-primitives = { version = "4.8.3", default-features = false, path = "../primitives" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30", default-features = false } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" } diff --git a/traits/src/customer.rs b/traits/src/customer.rs index 746a20f6d..ac428137f 100644 --- a/traits/src/customer.rs +++ b/traits/src/customer.rs @@ -1,4 +1,5 @@ use core::u128; + use sp_runtime::DispatchError; pub trait CustomerCharger { diff --git a/traits/src/lib.rs b/traits/src/lib.rs index b82b351c0..24ea7a7a1 100644 --- a/traits/src/lib.rs +++ b/traits/src/lib.rs @@ -4,3 +4,4 @@ pub mod customer; pub mod node; pub mod pallet; pub mod staking; +pub mod validator; diff --git a/traits/src/treasury.rs b/traits/src/treasury.rs new file mode 100644 index 000000000..f97529467 --- /dev/null +++ b/traits/src/treasury.rs @@ -0,0 +1,2 @@ +pub trait TreasuryVisitor { + fn cluster_has_node(cluster_id: &ClusterId, node_pub_key: &NodePubKey) -> bool; diff --git a/traits/src/validator.rs b/traits/src/validator.rs new file mode 100644 index 000000000..af7e29dc1 --- /dev/null +++ b/traits/src/validator.rs @@ -0,0 +1,6 @@ +use frame_system::Config; +use sp_std::prelude::*; + +pub trait ValidatorVisitor { + fn get_active_validators() -> Vec; +} diff --git a/zombienet/0001-ddc-validation/ddc-validation.toml b/zombienet/0001-ddc-validation/ddc-validation.toml index e5d7ae40a..77b82c4ea 100644 --- a/zombienet/0001-ddc-validation/ddc-validation.toml +++ b/zombienet/0001-ddc-validation/ddc-validation.toml @@ -1,6 +1,6 @@ [relaychain] default_command = "./target/release/cere" -default_args = ["--enable-ddc-validation --dac-url {{DAC_URL}}"] +default_args = [""] chain = "local" [[relaychain.nodes]]