diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 150613796121..d73a90cb3a63 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,6 +54,19 @@ default: paths: - ./artifacts/ +# collecting vars for pipeline stopper +# they will be used if the job fails +.pipeline-stopper-vars: &pipeline-stopper-vars + - echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env + - echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env + - echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env + - echo "PR_NUM=${CI_COMMIT_REF_NAME}" >> pipeline-stopper.env + +.pipeline-stopper-artifacts: &pipeline-stopper-artifacts + artifacts: + reports: + dotenv: pipeline-stopper.env + .kubernetes-env: &kubernetes-env retry: max: 2 @@ -172,7 +185,8 @@ check-runtime: stage: stage1 image: paritytech/tools:latest <<: *kubernetes-env - <<: *test-refs + rules: + - if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27 variables: GITLAB_API: "https://gitlab.parity.io/api/v4" GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" @@ -222,8 +236,12 @@ build-linux-stable: test-linux-stable: stage: stage1 <<: *docker-env - <<: *compiler-info <<: *common-refs + <<: *pipeline-stopper-artifacts + before_script: + - rustup show + - cargo --version + - *pipeline-stopper-vars variables: RUST_TOOLCHAIN: stable # Enable debug assertions since we are running optimized builds for testing @@ -307,7 +325,7 @@ build-staking-miner: stage: stage2 # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs needs: - - job: check-runtime + - job: cargo-fmt artifacts: false <<: *docker-env <<: *test-pr-refs @@ -336,7 +354,7 @@ test-node-metrics: stage: stage2 # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs needs: - - job: check-runtime + - job: cargo-fmt artifacts: false <<: *docker-env <<: *compiler-info @@ -605,7 +623,6 @@ check-try-runtime: script: # Check that everything compiles with `try-runtime` feature flag. - cargo check --features try-runtime --all - - sccache -s check-no-default-features: stage: stage3 @@ -738,6 +755,36 @@ zombienet-tests-parachains-disputes: tags: - zombienet-polkadot-integration-test +zombienet-tests-parachains-disputes-garbage-candidate: + stage: stage3 + image: "${ZOMBIENET_IMAGE}" + <<: *kubernetes-env + <<: *zombienet-refs + needs: + - job: publish-polkadot-debug-image + - job: publish-test-collators-image + - job: publish-malus-image + variables: + GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional" + before_script: + - echo "Zombie-net Tests Config" + - echo "${ZOMBIENET_IMAGE_NAME}" + - echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}" + - echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}" + - echo "${GH_DIR}" + - export DEBUG=zombie,zombie::network-node + - export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG} + - export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG} + - export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG} + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh + --github-remote-dir="${GH_DIR}" + --test="0003-parachains-garbage-candidate.feature" + allow_failure: false + retry: 2 + tags: + - zombienet-polkadot-integration-test + zombienet-test-parachains-upgrade-smoke-test: stage: stage3 image: "${ZOMBIENET_IMAGE}" @@ -974,17 +1021,18 @@ short-benchmark-westend: when: on_failure variables: PROJECT_ID: "${CI_PROJECT_ID}" + PROJECT_NAME: "${CI_PROJECT_NAME}" PIPELINE_ID: "${CI_PIPELINE_ID}" - trigger: "parity/infrastructure/ci_cd/pipeline-stopper" + FAILED_JOB_URL: "${FAILED_JOB_URL}" + FAILED_JOB_NAME: "${FAILED_JOB_NAME}" + PR_NUM: "${PR_NUM}" + trigger: + project: "parity/infrastructure/ci_cd/pipeline-stopper" + # remove branch, when pipeline-stopper for polakdot is updated to the same branch + branch: "as-improve" cancel-pipeline-test-linux-stable: extends: .cancel-pipeline-template needs: - job: test-linux-stable - artifacts: false -cancel-pipeline-check-try-runtime: - extends: .cancel-pipeline-template - needs: - - job: check-try-runtime - artifacts: false diff --git a/Cargo.lock b/Cargo.lock index 3d7609e2dea4..6e351afebf5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -423,7 +423,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "beefy-primitives", @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -479,7 +479,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "beefy-primitives", "sp-api", @@ -488,7 +488,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -1051,18 +1051,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7901fbba05decc537080b07cb3f1cadf53be7b7602ca8255786288a8692ae29a" +checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ba1b45d243a4a28e12d26cd5f2507da74e77c45927d40de8b6ffbf088b46b5" +checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", @@ -1078,33 +1078,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54cc30032171bf230ce22b99c07c3a1de1221cb5375bd6dbe6dbe77d0eed743c" +checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23f2672426d2bb4c9c3ef53e023076cfc4d8922f0eeaebaf372c92fae8b5c69" +checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" [[package]] name = "cranelift-entity" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886c59a5e0de1f06dbb7da80db149c75de10d5e2caca07cdd9fef8a5918a6336" +checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace74eeca11c439a9d4ed1a5cb9df31a54cd0f7fbddf82c8ce4ea8e9ad2a8fe0" +checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" dependencies = [ "cranelift-codegen", "log", @@ -1114,15 +1114,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db1ae52a5cc2cad0d86fdd3dcb16b7217d2f1e65ab4f5814aa4f014ad335fa43" +checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" [[package]] name = "cranelift-native" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dadcfb7852900780d37102bce5698bcd401736403f07b52e714ff7a180e0e22f" +checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" dependencies = [ "cranelift-codegen", "libc", @@ -1131,9 +1131,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.1" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84e3410960389110b88f97776f39f6d2c8becdaa4cd59e390e6b76d9d0e7190" +checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1960,7 +1960,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", ] @@ -1978,7 +1978,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -2000,7 +2000,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "Inflector", "chrono", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2062,7 +2062,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "bitflags", "frame-metadata", @@ -2120,6 +2120,7 @@ dependencies = [ "scale-info", "serde", "smallvec", + "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", @@ -2136,7 +2137,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2148,7 +2149,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2160,7 +2161,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro2", "quote", @@ -2170,7 +2171,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2193,7 +2194,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -2204,7 +2205,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "log", @@ -2221,7 +2222,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -2236,7 +2237,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "sp-api", @@ -2245,7 +2246,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "sp-api", @@ -2427,7 +2428,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "chrono", "frame-election-provider-support", @@ -3231,6 +3232,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", + "remote-externalities", "rustc-hex", "scale-info", "separator", @@ -3254,12 +3256,14 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-tracing", "sp-transaction-pool", "sp-trie", "sp-version", "static_assertions", "substrate-wasm-builder", "tiny-keccak", + "tokio", "xcm", "xcm-builder", "xcm-executor", @@ -4797,7 +4801,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -4811,7 +4815,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -4827,7 +4831,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -4842,7 +4846,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -4866,7 +4870,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4886,7 +4890,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4905,7 +4909,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -4920,7 +4924,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "beefy-primitives", "frame-support", @@ -4936,7 +4940,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4959,7 +4963,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -4977,7 +4981,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -4996,7 +5000,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5013,7 +5017,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5029,7 +5033,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5052,7 +5056,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5065,7 +5069,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5083,7 +5087,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5098,7 +5102,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5121,7 +5125,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5137,7 +5141,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5157,7 +5161,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5174,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5191,7 +5195,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5209,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5224,7 +5228,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5239,7 +5243,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5256,7 +5260,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5275,7 +5279,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "sp-api", @@ -5285,7 +5289,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5302,7 +5306,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5325,7 +5329,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5341,7 +5345,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5356,7 +5360,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5371,7 +5375,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5387,7 +5391,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5408,7 +5412,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5424,7 +5428,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5438,7 +5442,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5461,7 +5465,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5472,7 +5476,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "sp-arithmetic", @@ -5481,7 +5485,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5495,7 +5499,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5513,7 +5517,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5532,7 +5536,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-support", "frame-system", @@ -5548,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5563,7 +5567,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5574,7 +5578,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5591,7 +5595,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5607,7 +5611,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6275,6 +6279,7 @@ dependencies = [ "polkadot-primitives", "polkadot-primitives-test-helpers", "sc-network", + "sc-network-common", "sp-consensus", "sp-core", "sp-keyring", @@ -6667,6 +6672,7 @@ dependencies = [ "derive_more", "fatality", "futures", + "hex", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -6952,6 +6958,8 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -6974,6 +6982,7 @@ dependencies = [ "polkadot-runtime-common", "polkadot-runtime-constants", "polkadot-runtime-parachains", + "remote-externalities", "rustc-hex", "scale-info", "separator", @@ -6996,12 +7005,14 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-tracing", "sp-transaction-pool", "sp-trie", "sp-version", "static_assertions", "substrate-wasm-builder", "tiny-keccak", + "tokio", "trie-db", "xcm", "xcm-builder", @@ -7208,6 +7219,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-offchain", "sc-service", "sc-sync-state-rpc", @@ -7433,6 +7445,7 @@ dependencies = [ "sc-executor", "sc-finality-grandpa", "sc-network", + "sc-network-common", "sc-service", "sc-tracing", "sc-transaction-pool", @@ -8073,7 +8086,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8415,7 +8428,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "sp-core", @@ -8426,9 +8439,8 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ - "async-trait", "futures", "futures-timer", "ip_network", @@ -8440,6 +8452,7 @@ dependencies = [ "rand 0.7.3", "sc-client-api", "sc-network", + "sc-network-common", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -8453,7 +8466,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "futures-timer", @@ -8476,7 +8489,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8492,7 +8505,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8509,7 +8522,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8520,7 +8533,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "chrono", "clap", @@ -8559,7 +8572,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "fnv", "futures", @@ -8587,7 +8600,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "hash-db", "kvdb", @@ -8612,7 +8625,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures", @@ -8636,7 +8649,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "fork-tree", @@ -8678,7 +8691,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "jsonrpsee", @@ -8700,7 +8713,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8713,7 +8726,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures", @@ -8738,7 +8751,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "lazy_static", "lru 0.7.7", @@ -8765,14 +8778,13 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "environmental", "parity-scale-codec", "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", - "sp-serializer", "sp-wasm-interface", "thiserror", "wasm-instrument", @@ -8782,7 +8794,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "parity-scale-codec", @@ -8797,7 +8809,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8817,7 +8829,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ahash", "async-trait", @@ -8858,7 +8870,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "finality-grandpa", "futures", @@ -8879,7 +8891,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ansi_term", "futures", @@ -8887,7 +8899,7 @@ dependencies = [ "log", "parity-util-mem", "sc-client-api", - "sc-network", + "sc-network-common", "sc-transaction-pool-api", "sp-blockchain", "sp-runtime", @@ -8896,7 +8908,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "hex", @@ -8911,7 +8923,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "asynchronous-codec", @@ -8960,9 +8972,11 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ + "async-trait", "bitflags", + "bytes", "futures", "libp2p", "parity-scale-codec", @@ -8973,12 +8987,13 @@ dependencies = [ "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ahash", "futures", @@ -8987,6 +9002,7 @@ dependencies = [ "log", "lru 0.7.7", "sc-network", + "sc-network-common", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -8995,7 +9011,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "hex", @@ -9016,7 +9032,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "fork-tree", "futures", @@ -9044,7 +9060,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "bytes", "fnv", @@ -9060,6 +9076,7 @@ dependencies = [ "rand 0.7.3", "sc-client-api", "sc-network", + "sc-network-common", "sc-utils", "sp-api", "sp-core", @@ -9072,7 +9089,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "libp2p", @@ -9085,7 +9102,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9094,7 +9111,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "hash-db", @@ -9124,7 +9141,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "jsonrpsee", @@ -9147,7 +9164,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "jsonrpsee", @@ -9160,7 +9177,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "directories", @@ -9227,7 +9244,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "parity-scale-codec", @@ -9241,7 +9258,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9260,7 +9277,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "libc", @@ -9279,7 +9296,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "chrono", "futures", @@ -9297,7 +9314,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ansi_term", "atty", @@ -9328,7 +9345,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9339,7 +9356,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "futures-timer", @@ -9365,7 +9382,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "log", @@ -9378,7 +9395,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "futures-timer", @@ -9863,7 +9880,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "hash-db", "log", @@ -9880,7 +9897,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "blake2", "proc-macro-crate", @@ -9892,7 +9909,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9905,7 +9922,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "integer-sqrt", "num-traits", @@ -9920,7 +9937,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9933,7 +9950,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "parity-scale-codec", @@ -9945,7 +9962,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "sp-api", @@ -9957,7 +9974,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "log", @@ -9975,7 +9992,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures", @@ -9994,7 +10011,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "merlin", @@ -10017,7 +10034,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10031,7 +10048,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10044,7 +10061,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "base58", "bitflags", @@ -10090,7 +10107,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "blake2", "byteorder", @@ -10104,7 +10121,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro2", "quote", @@ -10115,7 +10132,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "kvdb", "parking_lot 0.12.0", @@ -10124,7 +10141,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro2", "quote", @@ -10134,7 +10151,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "environmental", "parity-scale-codec", @@ -10145,7 +10162,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "finality-grandpa", "log", @@ -10163,7 +10180,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10177,7 +10194,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "bytes", "futures", @@ -10203,7 +10220,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "lazy_static", "sp-core", @@ -10214,7 +10231,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures", @@ -10231,7 +10248,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "thiserror", "zstd", @@ -10240,7 +10257,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "parity-scale-codec", @@ -10255,7 +10272,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10269,7 +10286,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "sp-api", "sp-core", @@ -10279,7 +10296,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "backtrace", "lazy_static", @@ -10289,7 +10306,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "rustc-hash", "serde", @@ -10299,7 +10316,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "either", "hash256-std-hasher", @@ -10321,7 +10338,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10339,7 +10356,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "Inflector", "proc-macro-crate", @@ -10351,7 +10368,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "parity-scale-codec", @@ -10362,19 +10379,10 @@ dependencies = [ "wasmi", ] -[[package]] -name = "sp-serializer" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10388,7 +10396,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "scale-info", @@ -10399,7 +10407,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "hash-db", "log", @@ -10421,12 +10429,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10439,7 +10447,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "log", "sp-core", @@ -10452,7 +10460,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures-timer", @@ -10468,7 +10476,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "sp-std", @@ -10480,7 +10488,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "sp-api", "sp-runtime", @@ -10489,7 +10497,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "log", @@ -10505,7 +10513,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "hash-db", "memory-db", @@ -10521,7 +10529,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10538,7 +10546,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10549,7 +10557,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "impl-trait-for-tuples", "log", @@ -10723,7 +10731,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "platforms", ] @@ -10731,7 +10739,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10752,7 +10760,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures-util", "hyper", @@ -10765,7 +10773,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "jsonrpsee", "log", @@ -10786,7 +10794,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "async-trait", "futures", @@ -10812,7 +10820,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "futures", "substrate-test-utils-derive", @@ -10822,7 +10830,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10833,7 +10841,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "ansi_term", "build-helper", @@ -11229,9 +11237,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.18.2" +version = "1.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" dependencies = [ "bytes", "libc", @@ -11547,7 +11555,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#f64cd4fa987473ad1d05f409afe886d4a620782b" +source = "git+https://github.com/paritytech/substrate?branch=master#34a0621761c4a333cb2074ff720f7acbfb92dbb8" dependencies = [ "clap", "jsonrpsee", @@ -11616,9 +11624,9 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -11971,9 +11979,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e76e2b2833bb0ece666ccdbed7b71b617d447da11f1bb61f4f2bab2648f745ee" +checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" dependencies = [ "anyhow", "backtrace", @@ -12002,9 +12010,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743a9f142d93318262d7e1fe329394ff2e8f86a1df45ae5e4f0eedba215ca5ce" +checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" dependencies = [ "anyhow", "base64", @@ -12022,9 +12030,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc0f80afa1ce97083a7168e6b6948d015d6237369e9f4a511d38c9c4ac8fbb9" +checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" dependencies = [ "anyhow", "cranelift-codegen", @@ -12044,9 +12052,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0816d9365196f1f447060087e0f87239ccded830bd54970a1168b0c9c8e824c9" +checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" dependencies = [ "anyhow", "cranelift-entity", @@ -12064,9 +12072,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c687f33cfa0f89ec1646929d0ff102087052cf9f0d15533de56526b0da0d1b3" +checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" dependencies = [ "addr2line", "anyhow", @@ -12090,9 +12098,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b252d1d025f94f3954ba2111f12f3a22826a0764a11c150c2d46623115a69e27" +checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" dependencies = [ "lazy_static", "object 0.28.4", @@ -12101,9 +12109,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace251693103c9facbbd7df87a29a75e68016e48bc83c09133f2fda6b575e0ab" +checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" dependencies = [ "anyhow", "backtrace", @@ -12127,9 +12135,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d129b0487a95986692af8708ffde9c50b0568dcefd79200941d475713b4f40bb" +checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" dependencies = [ "cranelift-entity", "serde", @@ -12235,6 +12243,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", + "remote-externalities", "rustc-hex", "scale-info", "serde", @@ -12256,11 +12265,13 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-tracing", "sp-transaction-pool", "sp-trie", "sp-version", "substrate-wasm-builder", "tiny-keccak", + "tokio", "westend-runtime-constants", "xcm", "xcm-builder", @@ -12641,9 +12652,9 @@ dependencies = [ [[package]] name = "yamux" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0608f53c1dc0bad505d03a34bbd49fbf2ad7b51eb036123e896365532745a1" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ "futures", "log", diff --git a/Cargo.toml b/Cargo.toml index ae1bf5b269c6..b23c37d8ad5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ parity-util-mem = { version = "0.11.0", default-features = false, features = ["j assert_cmd = "2.0.4" nix = "0.24.1" tempfile = "3.2.0" -tokio = "1.18.2" +tokio = "1.19.2" remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-core-primitives = { path = "core-primitives" } diff --git a/node/core/approval-voting/src/tests.rs b/node/core/approval-voting/src/tests.rs index 641e6cb3a4f9..6182b4a99e5c 100644 --- a/node/core/approval-voting/src/tests.rs +++ b/node/core/approval-voting/src/tests.rs @@ -80,7 +80,7 @@ impl TestSyncOracleHandle { } impl SyncOracle for TestSyncOracle { - fn is_major_syncing(&mut self) -> bool { + fn is_major_syncing(&self) -> bool { let is_major_syncing = self.flag.load(Ordering::SeqCst); if !is_major_syncing { @@ -92,7 +92,7 @@ impl SyncOracle for TestSyncOracle { is_major_syncing } - fn is_offline(&mut self) -> bool { + fn is_offline(&self) -> bool { unimplemented!("not used in network bridge") } } diff --git a/node/metrics/Cargo.toml b/node/metrics/Cargo.toml index bbcf15e4924f..6cbc5a1124cc 100644 --- a/node/metrics/Cargo.toml +++ b/node/metrics/Cargo.toml @@ -28,7 +28,7 @@ assert_cmd = "2.0.4" nix = "0.24.1" tempfile = "3.2.0" hyper = { version = "0.14.19", default-features = false, features = ["http1", "tcp"] } -tokio = "1.18.2" +tokio = "1.19.2" polkadot-test-service = { path = "../test/service", features=["runtime-metrics"]} substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/availability-distribution/src/tests/mod.rs b/node/network/availability-distribution/src/tests/mod.rs index fd5d0dafaf1f..ebbc436a00dd 100644 --- a/node/network/availability-distribution/src/tests/mod.rs +++ b/node/network/availability-distribution/src/tests/mod.rs @@ -18,8 +18,8 @@ use std::collections::HashSet; use futures::{executor, future, Future}; -use polkadot_node_network_protocol::request_response::IncomingRequest; -use polkadot_primitives::v2::CoreState; +use polkadot_node_network_protocol::request_response::{IncomingRequest, ReqProtocolNames}; +use polkadot_primitives::v2::{CoreState, Hash}; use sp_keystore::SyncCryptoStorePtr; use polkadot_node_subsystem_test_helpers as test_helpers; @@ -41,9 +41,12 @@ fn test_harness>( let pool = sp_core::testing::TaskExecutor::new(); let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); + let genesis_hash = Hash::repeat_byte(0xff); + let req_protocol_names = ReqProtocolNames::new(&genesis_hash, None); - let (pov_req_receiver, pov_req_cfg) = IncomingRequest::get_config_receiver(); - let (chunk_req_receiver, chunk_req_cfg) = IncomingRequest::get_config_receiver(); + let (pov_req_receiver, pov_req_cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); + let (chunk_req_receiver, chunk_req_cfg) = + IncomingRequest::get_config_receiver(&req_protocol_names); let subsystem = AvailabilityDistributionSubsystem::new( keystore, IncomingRequestReceivers { pov_req_receiver, chunk_req_receiver }, diff --git a/node/network/availability-recovery/src/tests.rs b/node/network/availability-recovery/src/tests.rs index 3c16157f4882..2cfed743bc5e 100644 --- a/node/network/availability-recovery/src/tests.rs +++ b/node/network/availability-recovery/src/tests.rs @@ -21,7 +21,7 @@ use futures::{executor, future}; use futures_timer::Delay; use parity_scale_codec::Encode; -use polkadot_node_network_protocol::request_response::IncomingRequest; +use polkadot_node_network_protocol::request_response::{IncomingRequest, ReqProtocolNames}; use super::*; @@ -36,11 +36,14 @@ use polkadot_node_subsystem::{ }; use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle}; use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_primitives::v2::{AuthorityDiscoveryId, HeadData, PersistedValidationData}; +use polkadot_primitives::v2::{AuthorityDiscoveryId, Hash, HeadData, PersistedValidationData}; use polkadot_primitives_test_helpers::{dummy_candidate_receipt, dummy_hash}; type VirtualOverseer = TestSubsystemContextHandle; +// Deterministic genesis hash for protocol names +const GENESIS_HASH: Hash = Hash::repeat_byte(0xff); + fn test_harness_fast_path>( test: impl FnOnce(VirtualOverseer, RequestResponseConfig) -> T, ) { @@ -53,7 +56,8 @@ fn test_harness_fast_path> { protocol: Cow<'static, str>, multiaddresses: HashSet, ) -> Result<(), String> { - sc_network::NetworkService::set_reserved_peers(&**self, protocol, multiaddresses) + NetworkService::set_reserved_peers(&**self, protocol, multiaddresses) } async fn remove_from_peers_set(&mut self, protocol: Cow<'static, str>, peers: Vec) { - sc_network::NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers); + NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers); } fn report_peer(&self, who: PeerId, cost_benefit: Rep) { - sc_network::NetworkService::report_peer(&**self, who, cost_benefit.into_base_rep()); + NetworkService::report_peer(&**self, who, cost_benefit.into_base_rep()); } fn disconnect_peer(&self, who: PeerId, peer_set: PeerSet) { - sc_network::NetworkService::disconnect_peer( - &**self, - who, - peer_set.into_default_protocol_name(), - ); + NetworkService::disconnect_peer(&**self, who, peer_set.into_default_protocol_name()); } fn write_notification(&self, who: PeerId, peer_set: PeerSet, message: Vec) { - sc_network::NetworkService::write_notification( + NetworkService::write_notification( &**self, who, peer_set.into_default_protocol_name(), @@ -153,6 +153,7 @@ impl Network for Arc> { &self, authority_discovery: &mut AD, req: Requests, + req_protocol_names: &ReqProtocolNames, if_disconnected: IfDisconnected, ) { let (protocol, OutgoingRequest { peer, payload, pending_response }) = req.encode_request(); @@ -198,7 +199,7 @@ impl Network for Arc> { NetworkService::start_request( &*self, peer_id, - protocol.into_protocol_name(), + req_protocol_names.get_name(protocol), payload, pending_response, if_disconnected, diff --git a/node/network/bridge/src/rx/tests.rs b/node/network/bridge/src/rx/tests.rs index d7e95a966bcc..ad1d8392d30c 100644 --- a/node/network/bridge/src/rx/tests.rs +++ b/node/network/bridge/src/rx/tests.rs @@ -31,7 +31,8 @@ use std::{ use sc_network::{Event as NetworkEvent, IfDisconnected}; use polkadot_node_network_protocol::{ - request_response::outgoing::Requests, view, ObservedRole, Versioned, + request_response::{outgoing::Requests, ReqProtocolNames}, + view, ObservedRole, Versioned, }; use polkadot_node_subsystem::{ jaeger, @@ -117,6 +118,7 @@ impl Network for TestNetwork { &self, _: &mut AD, _: Requests, + _: &ReqProtocolNames, _: IfDisconnected, ) { } @@ -236,7 +238,7 @@ impl TestSyncOracleHandle { } impl SyncOracle for TestSyncOracle { - fn is_major_syncing(&mut self) -> bool { + fn is_major_syncing(&self) -> bool { let is_major_syncing = self.is_major_syncing.load(Ordering::SeqCst); if !is_major_syncing { @@ -248,7 +250,7 @@ impl SyncOracle for TestSyncOracle { is_major_syncing } - fn is_offline(&mut self) -> bool { + fn is_offline(&self) -> bool { unimplemented!("not used in network bridge") } } diff --git a/node/network/bridge/src/tx/mod.rs b/node/network/bridge/src/tx/mod.rs index d58ccf8fbb95..ac34cf315cec 100644 --- a/node/network/bridge/src/tx/mod.rs +++ b/node/network/bridge/src/tx/mod.rs @@ -17,7 +17,9 @@ //! The Network Bridge Subsystem - handles _outgoing_ messages, from subsystem to the network. use super::*; -use polkadot_node_network_protocol::{peer_set::PeerSet, v1 as protocol_v1, PeerId, Versioned}; +use polkadot_node_network_protocol::{ + peer_set::PeerSet, request_response::ReqProtocolNames, v1 as protocol_v1, PeerId, Versioned, +}; use polkadot_node_subsystem::{ errors::SubsystemError, messages::NetworkBridgeTxMessage, overseer, FromOrchestra, @@ -50,6 +52,7 @@ pub struct NetworkBridgeTx { network_service: N, authority_discovery_service: AD, metrics: Metrics, + req_protocol_names: ReqProtocolNames, } impl NetworkBridgeTx { @@ -57,8 +60,13 @@ impl NetworkBridgeTx { /// /// This assumes that the network service has had the notifications protocol for the network /// bridge already registered. See [`peers_sets_info`](peers_sets_info). - pub fn new(network_service: N, authority_discovery_service: AD, metrics: Metrics) -> Self { - Self { network_service, authority_discovery_service, metrics } + pub fn new( + network_service: N, + authority_discovery_service: AD, + metrics: Metrics, + req_protocol_names: ReqProtocolNames, + ) -> Self { + Self { network_service, authority_discovery_service, metrics, req_protocol_names } } } @@ -82,6 +90,7 @@ async fn handle_subsystem_messages( mut network_service: N, mut authority_discovery_service: AD, metrics: Metrics, + req_protocol_names: ReqProtocolNames, ) -> Result<(), Error> where N: Network, @@ -102,6 +111,7 @@ where authority_discovery_service.clone(), msg, &metrics, + &req_protocol_names, ) .await; }, @@ -117,6 +127,7 @@ async fn handle_incoming_subsystem_communication( mut authority_discovery_service: AD, msg: NetworkBridgeTxMessage, metrics: &Metrics, + req_protocol_names: &ReqProtocolNames, ) -> (N, AD) where N: Network, @@ -218,7 +229,12 @@ where for req in reqs { network_service - .start_request(&mut authority_discovery_service, req, if_disconnected) + .start_request( + &mut authority_discovery_service, + req, + req_protocol_names, + if_disconnected, + ) .await; } }, @@ -275,9 +291,21 @@ where N: Network, AD: validator_discovery::AuthorityDiscovery + Clone + Sync, { - let NetworkBridgeTx { network_service, authority_discovery_service, metrics } = bridge; - - handle_subsystem_messages(ctx, network_service, authority_discovery_service, metrics).await?; + let NetworkBridgeTx { + network_service, + authority_discovery_service, + metrics, + req_protocol_names, + } = bridge; + + handle_subsystem_messages( + ctx, + network_service, + authority_discovery_service, + metrics, + req_protocol_names, + ) + .await?; Ok(()) } diff --git a/node/network/bridge/src/tx/tests.rs b/node/network/bridge/src/tx/tests.rs index 63d9730e6599..d5b6d3ca67ab 100644 --- a/node/network/bridge/src/tx/tests.rs +++ b/node/network/bridge/src/tx/tests.rs @@ -25,12 +25,13 @@ use std::{borrow::Cow, collections::HashSet}; use sc_network::{Event as NetworkEvent, IfDisconnected}; use polkadot_node_network_protocol::{ - request_response::outgoing::Requests, ObservedRole, Versioned, + request_response::{outgoing::Requests, ReqProtocolNames}, + ObservedRole, Versioned, }; use polkadot_node_subsystem::{FromOrchestra, OverseerSignal}; use polkadot_node_subsystem_test_helpers::TestSubsystemContextHandle; use polkadot_node_subsystem_util::metered; -use polkadot_primitives::v2::AuthorityDiscoveryId; +use polkadot_primitives::v2::{AuthorityDiscoveryId, Hash}; use polkadot_primitives_test_helpers::dummy_collator_signature; use sc_network::Multiaddr; use sp_keyring::Sr25519Keyring; @@ -104,6 +105,7 @@ impl Network for TestNetwork { &self, _: &mut AD, _: Requests, + _: &ReqProtocolNames, _: IfDisconnected, ) { } @@ -182,7 +184,10 @@ fn test_harness>(test: impl FnOnce(TestHarne let (context, virtual_overseer) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let bridge_out = NetworkBridgeTx::new(network, discovery, Metrics(None)); + let genesis_hash = Hash::repeat_byte(0xff); + let protocol_names = ReqProtocolNames::new(genesis_hash, None); + + let bridge_out = NetworkBridgeTx::new(network, discovery, Metrics(None), protocol_names); let network_bridge_out_fut = run_network_out(bridge_out, context) .map_err(|e| panic!("bridge-out subsystem execution failed {:?}", e)) diff --git a/node/network/bridge/src/validator_discovery.rs b/node/network/bridge/src/validator_discovery.rs index eb9bb954e7a1..9c90200aa06a 100644 --- a/node/network/bridge/src/validator_discovery.rs +++ b/node/network/bridge/src/validator_discovery.rs @@ -162,7 +162,10 @@ mod tests { use async_trait::async_trait; use futures::stream::BoxStream; - use polkadot_node_network_protocol::{request_response::outgoing::Requests, PeerId}; + use polkadot_node_network_protocol::{ + request_response::{outgoing::Requests, ReqProtocolNames}, + PeerId, + }; use sc_network::{Event as NetworkEvent, IfDisconnected}; use sp_keyring::Sr25519Keyring; use std::{ @@ -236,6 +239,7 @@ mod tests { &self, _: &mut AD, _: Requests, + _: &ReqProtocolNames, _: IfDisconnected, ) { } diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index 4d95b7c807e2..f81e738e16a4 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -29,7 +29,11 @@ use sp_core::crypto::Pair; use sp_keyring::Sr25519Keyring; use sp_runtime::traits::AppVerify; -use polkadot_node_network_protocol::{our_view, request_response::IncomingRequest, view}; +use polkadot_node_network_protocol::{ + our_view, + request_response::{IncomingRequest, ReqProtocolNames}, + view, +}; use polkadot_node_primitives::BlockData; use polkadot_node_subsystem::{ jaeger, @@ -201,7 +205,11 @@ fn test_harness>( let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); - let (collation_req_receiver, req_cfg) = IncomingRequest::get_config_receiver(); + let genesis_hash = Hash::repeat_byte(0xff); + let req_protocol_names = ReqProtocolNames::new(&genesis_hash, None); + + let (collation_req_receiver, req_cfg) = + IncomingRequest::get_config_receiver(&req_protocol_names); let subsystem = async { run(context, local_peer_id, collator_pair, collation_req_receiver, Default::default()) .await diff --git a/node/network/dispute-distribution/src/tests/mod.rs b/node/network/dispute-distribution/src/tests/mod.rs index 9c843f3e786b..8f78b664de82 100644 --- a/node/network/dispute-distribution/src/tests/mod.rs +++ b/node/network/dispute-distribution/src/tests/mod.rs @@ -31,7 +31,7 @@ use parity_scale_codec::{Decode, Encode}; use sc_network::config::RequestResponseConfig; use polkadot_node_network_protocol::{ - request_response::{v1::DisputeRequest, IncomingRequest}, + request_response::{v1::DisputeRequest, IncomingRequest, ReqProtocolNames}, PeerId, }; use sp_keyring::Sr25519Keyring; @@ -723,7 +723,9 @@ where sp_tracing::try_init_simple(); let keystore = make_ferdie_keystore(); - let (req_receiver, req_cfg) = IncomingRequest::get_config_receiver(); + let genesis_hash = Hash::repeat_byte(0xff); + let req_protocol_names = ReqProtocolNames::new(&genesis_hash, None); + let (req_receiver, req_cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); let subsystem = DisputeDistributionSubsystem::new( keystore, req_receiver, diff --git a/node/network/protocol/Cargo.toml b/node/network/protocol/Cargo.toml index 7b26a03e3d44..8b863089cc91 100644 --- a/node/network/protocol/Cargo.toml +++ b/node/network/protocol/Cargo.toml @@ -7,6 +7,7 @@ description = "Primitives types for the Node-side" [dependencies] async-trait = "0.1.53" +hex = "0.4.3" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-jaeger = { path = "../../jaeger" } diff --git a/node/network/protocol/src/request_response/incoming/mod.rs b/node/network/protocol/src/request_response/incoming/mod.rs index 309ca32b0de4..808d70645995 100644 --- a/node/network/protocol/src/request_response/incoming/mod.rs +++ b/node/network/protocol/src/request_response/incoming/mod.rs @@ -25,7 +25,7 @@ use parity_scale_codec::{Decode, Encode}; use sc_network::{config as netconfig, config::RequestResponseConfig, PeerId}; -use super::IsRequest; +use super::{IsRequest, ReqProtocolNames}; use crate::UnifiedReputationChange; mod error; @@ -55,8 +55,10 @@ where /// /// This Register that config with substrate networking and receive incoming requests via the /// returned `IncomingRequestReceiver`. - pub fn get_config_receiver() -> (IncomingRequestReceiver, RequestResponseConfig) { - let (raw, cfg) = Req::PROTOCOL.get_config(); + pub fn get_config_receiver( + req_protocol_names: &ReqProtocolNames, + ) -> (IncomingRequestReceiver, RequestResponseConfig) { + let (raw, cfg) = Req::PROTOCOL.get_config(req_protocol_names); (IncomingRequestReceiver { raw, phantom: PhantomData {} }, cfg) } diff --git a/node/network/protocol/src/request_response/mod.rs b/node/network/protocol/src/request_response/mod.rs index b434c152b895..fb955286990e 100644 --- a/node/network/protocol/src/request_response/mod.rs +++ b/node/network/protocol/src/request_response/mod.rs @@ -32,11 +32,11 @@ //! //! Versioned (v1 module): The actual requests and responses as sent over the network. -use std::{borrow::Cow, time::Duration, u64}; +use std::{borrow::Cow, collections::HashMap, time::Duration, u64}; use futures::channel::mpsc; use polkadot_primitives::v2::{MAX_CODE_SIZE, MAX_POV_SIZE}; -use strum::EnumIter; +use strum::{EnumIter, IntoEnumIterator}; pub use sc_network::{config as network, config::RequestResponseConfig}; @@ -126,13 +126,17 @@ impl Protocol { /// /// Returns a receiver for messages received on this protocol and the requested /// `ProtocolConfig`. - pub fn get_config(self) -> (mpsc::Receiver, RequestResponseConfig) { - let p_name = self.into_protocol_name(); + pub fn get_config( + self, + req_protocol_names: &ReqProtocolNames, + ) -> (mpsc::Receiver, RequestResponseConfig) { + let name = req_protocol_names.get_name(self); + let fallback_names = self.get_fallback_names(); let (tx, rx) = mpsc::channel(self.get_channel_size()); let cfg = match self { Protocol::ChunkFetchingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, max_response_size: POV_RESPONSE_SIZE as u64 * 3, // We are connected to all validators: @@ -140,8 +144,8 @@ impl Protocol { inbound_queue: Some(tx), }, Protocol::CollationFetchingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, max_response_size: POV_RESPONSE_SIZE, // Taken from initial implementation in collator protocol: @@ -149,16 +153,16 @@ impl Protocol { inbound_queue: Some(tx), }, Protocol::PoVFetchingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, max_response_size: POV_RESPONSE_SIZE, request_timeout: POV_REQUEST_TIMEOUT_CONNECTED, inbound_queue: Some(tx), }, Protocol::AvailableDataFetchingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, // Available data size is dominated by the PoV size. max_response_size: POV_RESPONSE_SIZE, @@ -166,8 +170,8 @@ impl Protocol { inbound_queue: Some(tx), }, Protocol::StatementFetchingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, // Available data size is dominated code size. max_response_size: STATEMENT_RESPONSE_SIZE, @@ -184,8 +188,8 @@ impl Protocol { inbound_queue: Some(tx), }, Protocol::DisputeSendingV1 => RequestResponseConfig { - name: p_name, - fallback_names: Vec::new(), + name, + fallback_names, max_request_size: 1_000, /// Responses are just confirmation, in essence not even a bit. So 100 seems /// plenty. @@ -243,13 +247,13 @@ impl Protocol { } } - /// Get the protocol name of this protocol, as understood by substrate networking. - pub fn into_protocol_name(self) -> Cow<'static, str> { - self.get_protocol_name_static().into() + /// Fallback protocol names of this protocol, as understood by substrate networking. + fn get_fallback_names(self) -> Vec> { + std::iter::once(self.get_legacy_name().into()).collect() } - /// Get the protocol name associated with each peer set as static str. - pub const fn get_protocol_name_static(self) -> &'static str { + /// Legacy protocol name associated with each peer set. + const fn get_legacy_name(self) -> &'static str { match self { Protocol::ChunkFetchingV1 => "/polkadot/req_chunk/1", Protocol::CollationFetchingV1 => "/polkadot/req_collation/1", @@ -269,3 +273,51 @@ pub trait IsRequest { /// What protocol this `Request` implements. const PROTOCOL: Protocol; } + +/// Type for getting on the wire [`Protocol`] names using genesis hash & fork id. +pub struct ReqProtocolNames { + names: HashMap>, +} + +impl ReqProtocolNames { + /// Construct [`ReqProtocolNames`] from `genesis_hash` and `fork_id`. + pub fn new>(genesis_hash: Hash, fork_id: Option<&str>) -> Self { + let mut names = HashMap::new(); + for protocol in Protocol::iter() { + names.insert(protocol, Self::generate_name(protocol, &genesis_hash, fork_id)); + } + Self { names } + } + + /// Get on the wire [`Protocol`] name. + pub fn get_name(&self, protocol: Protocol) -> Cow<'static, str> { + self.names + .get(&protocol) + .expect("All `Protocol` enum variants are added above via `strum`; qed") + .clone() + } + + /// Protocol name of this protocol based on `genesis_hash` and `fork_id`. + fn generate_name>( + protocol: Protocol, + genesis_hash: &Hash, + fork_id: Option<&str>, + ) -> Cow<'static, str> { + let prefix = if let Some(fork_id) = fork_id { + format!("/{}/{}", hex::encode(genesis_hash), fork_id) + } else { + format!("/{}", hex::encode(genesis_hash)) + }; + + let short_name = match protocol { + Protocol::ChunkFetchingV1 => "/req_chunk/1", + Protocol::CollationFetchingV1 => "/req_collation/1", + Protocol::PoVFetchingV1 => "/req_pov/1", + Protocol::AvailableDataFetchingV1 => "/req_available_data/1", + Protocol::StatementFetchingV1 => "/req_statement/1", + Protocol::DisputeSendingV1 => "/send_dispute/1", + }; + + format!("{}{}", prefix, short_name).into() + } +} diff --git a/node/network/statement-distribution/src/tests.rs b/node/network/statement-distribution/src/tests.rs index 49a6e211bbd6..efc9ca896bb1 100644 --- a/node/network/statement-distribution/src/tests.rs +++ b/node/network/statement-distribution/src/tests.rs @@ -22,7 +22,7 @@ use parity_scale_codec::{Decode, Encode}; use polkadot_node_network_protocol::{ request_response::{ v1::{StatementFetchingRequest, StatementFetchingResponse}, - IncomingRequest, Recipient, Requests, + IncomingRequest, Recipient, ReqProtocolNames, Requests, }, view, ObservedRole, }; @@ -44,6 +44,9 @@ use sp_keyring::Sr25519Keyring; use sp_keystore::{CryptoStore, SyncCryptoStore, SyncCryptoStorePtr}; use std::{iter::FromIterator as _, sync::Arc, time::Duration}; +// Some deterministic genesis hash for protocol names +const GENESIS_HASH: Hash = Hash::repeat_byte(0xff); + #[test] fn active_head_accepts_only_2_seconded_per_validator() { let validators = vec![ @@ -724,7 +727,8 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() { let pool = sp_core::testing::TaskExecutor::new(); let (ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None); + let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(&req_protocol_names); let bg = async move { let s = StatementDistributionSubsystem::new( @@ -917,7 +921,9 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing( let pool = sp_core::testing::TaskExecutor::new(); let (ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let (statement_req_receiver, mut req_cfg) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None); + let (statement_req_receiver, mut req_cfg) = + IncomingRequest::get_config_receiver(&req_protocol_names); let bg = async move { let s = StatementDistributionSubsystem::new( @@ -1429,7 +1435,9 @@ fn share_prioritizes_backing_group() { let pool = sp_core::testing::TaskExecutor::new(); let (ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let (statement_req_receiver, mut req_cfg) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None); + let (statement_req_receiver, mut req_cfg) = + IncomingRequest::get_config_receiver(&req_protocol_names); let bg = async move { let s = StatementDistributionSubsystem::new( @@ -1724,7 +1732,8 @@ fn peer_cant_flood_with_large_statements() { let pool = sp_core::testing::TaskExecutor::new(); let (ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None); + let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(&req_protocol_names); let bg = async move { let s = StatementDistributionSubsystem::new( make_ferdie_keystore(), @@ -1928,7 +1937,8 @@ fn handle_multiple_seconded_statements() { let pool = sp_core::testing::TaskExecutor::new(); let (ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&GENESIS_HASH, None); + let (statement_req_receiver, _) = IncomingRequest::get_config_receiver(&req_protocol_names); let virtual_overseer_fut = async move { let s = StatementDistributionSubsystem::new( diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 1649d6de9d7e..57533e577665 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -19,6 +19,7 @@ sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "mast sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/service/src/chain_spec.rs b/node/service/src/chain_spec.rs index 350a0080f180..c4fe17640d18 100644 --- a/node/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -386,6 +386,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene }, paras: Default::default(), xcm_pallet: Default::default(), + nomination_pools: Default::default(), } } @@ -1369,6 +1370,7 @@ pub fn polkadot_testnet_genesis( }, paras: Default::default(), xcm_pallet: Default::default(), + nomination_pools: Default::default(), } } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index c39be9d85701..206809aeefe8 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -46,6 +46,7 @@ use { self as chain_selection_subsystem, Config as ChainSelectionConfig, }, polkadot_node_core_dispute_coordinator::Config as DisputeCoordinatorConfig, + polkadot_node_network_protocol::request_response::ReqProtocolNames, polkadot_overseer::BlockInfo, sc_client_api::{BlockBackend, ExecutorProvider}, sp_core::traits::SpawnNamed, @@ -831,22 +832,19 @@ where let shared_voter_state = rpc_setup; let auth_disc_publish_non_global_ips = config.network.allow_non_globals_in_dht; + let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); + // Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change // anything in terms of behaviour, but makes the logs more consistent with the other // Substrate nodes. - let grandpa_protocol_name = grandpa::protocol_standard_name( - &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), - &config.chain_spec, - ); + let grandpa_protocol_name = grandpa::protocol_standard_name(&genesis_hash, &config.chain_spec); config .network .extra_sets .push(grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone())); - let beefy_protocol_name = beefy_gadget::protocol_standard_name( - &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), - &config.chain_spec, - ); + let beefy_protocol_name = + beefy_gadget::protocol_standard_name(&genesis_hash, &config.chain_spec); if enable_beefy { config .network @@ -860,17 +858,20 @@ where config.network.extra_sets.extend(peer_sets_info(is_authority)); } - let (pov_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let req_protocol_names = ReqProtocolNames::new(&genesis_hash, config.chain_spec.fork_id()); + + let (pov_req_receiver, cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); - let (chunk_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let (chunk_req_receiver, cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); - let (collation_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let (collation_req_receiver, cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); - let (available_data_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let (available_data_req_receiver, cfg) = + IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); - let (statement_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let (statement_req_receiver, cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); - let (dispute_req_receiver, cfg) = IncomingRequest::get_config_receiver(); + let (dispute_req_receiver, cfg) = IncomingRequest::get_config_receiver(&req_protocol_names); config.network.request_response_protocols.push(cfg); let grandpa_hard_forks = if config.chain_spec.is_kusama() { @@ -988,6 +989,7 @@ where let authority_discovery_service = if auth_or_collator || overseer_enable_anyways { use futures::StreamExt; use sc_network::Event; + use sc_network_common::service::NetworkEventStream; let authority_discovery_role = if role.is_authority() { sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore()) @@ -1060,6 +1062,7 @@ where dispute_coordinator_config, pvf_checker_enabled, overseer_message_channel_capacity_override, + req_protocol_names, }, ) .map_err(|e| { diff --git a/node/service/src/overseer.rs b/node/service/src/overseer.rs index efc36de15423..622b815944ae 100644 --- a/node/service/src/overseer.rs +++ b/node/service/src/overseer.rs @@ -24,7 +24,9 @@ use polkadot_node_core_av_store::Config as AvailabilityConfig; use polkadot_node_core_candidate_validation::Config as CandidateValidationConfig; use polkadot_node_core_chain_selection::Config as ChainSelectionConfig; use polkadot_node_core_dispute_coordinator::Config as DisputeCoordinatorConfig; -use polkadot_node_network_protocol::request_response::{v1 as request_v1, IncomingRequestReceiver}; +use polkadot_node_network_protocol::request_response::{ + v1 as request_v1, IncomingRequestReceiver, ReqProtocolNames, +}; #[cfg(any(feature = "malus", test))] pub use polkadot_overseer::{ dummy::{dummy_overseer_builder, DummySubsystem}, @@ -39,6 +41,7 @@ use polkadot_primitives::runtime_api::ParachainHost; use sc_authority_discovery::Service as AuthorityDiscoveryService; use sc_client_api::AuxStore; use sc_keystore::LocalKeystore; +use sc_network_common::service::NetworkStateInfo; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_consensus_babe::BabeApi; @@ -117,6 +120,8 @@ where pub pvf_checker_enabled: bool, /// Overseer channel capacity override. pub overseer_message_channel_capacity_override: Option, + /// Request-response protocol names source. + pub req_protocol_names: ReqProtocolNames, } /// Obtain a prepared `OverseerBuilder`, that is initialized @@ -145,6 +150,7 @@ pub fn prepared_overseer_builder<'a, Spawner, RuntimeClient>( dispute_coordinator_config, pvf_checker_enabled, overseer_message_channel_capacity_override, + req_protocol_names, }: OverseerGenArgs<'a, Spawner, RuntimeClient>, ) -> Result< InitializedOverseerBuilder< @@ -193,11 +199,13 @@ where let spawner = SpawnGlue(spawner); let network_bridge_metrics: NetworkBridgeMetrics = Metrics::register(registry)?; + let builder = Overseer::builder() .network_bridge_tx(NetworkBridgeTxSubsystem::new( network_service.clone(), authority_discovery_service.clone(), network_bridge_metrics.clone(), + req_protocol_names, )) .network_bridge_rx(NetworkBridgeRxSubsystem::new( network_service.clone(), diff --git a/node/test/service/Cargo.toml b/node/test/service/Cargo.toml index f1cd0eb23018..75253c2e1873 100644 --- a/node/test/service/Cargo.toml +++ b/node/test/service/Cargo.toml @@ -10,7 +10,7 @@ hex = "0.4.3" gum = { package = "tracing-gum", path = "../../gum" } rand = "0.8.5" tempfile = "3.2.0" -tokio = "1.18.2" +tokio = "1.19.2" # Polkadot dependencies polkadot-overseer = { path = "../../overseer" } @@ -45,6 +45,7 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = [ "wasmtime" ] } @@ -60,7 +61,7 @@ substrate-test-client = { git = "https://github.com/paritytech/substrate", branc pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } serde_json = "1.0.81" substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.18.2", features = ["macros"] } +tokio = { version = "1.19.2", features = ["macros"] } [features] runtime-metrics=["polkadot-test-runtime/runtime-metrics"] diff --git a/node/test/service/src/lib.rs b/node/test/service/src/lib.rs index b9b99f28d1b9..6e7e4d0e0b87 100644 --- a/node/test/service/src/lib.rs +++ b/node/test/service/src/lib.rs @@ -41,12 +41,13 @@ use sc_network::{ config::{NetworkConfiguration, TransportConfig}, multiaddr, }; +use sc_network_common::service::NetworkStateInfo; use sc_service::{ config::{ DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, WasmExecutionMethod, WasmtimeInstantiationStrategy, }, - BasePath, Configuration, KeepBlocks, Role, RpcHandlers, TaskManager, + BasePath, BlocksPruning, Configuration, Role, RpcHandlers, TaskManager, }; use sp_arithmetic::traits::SaturatedConversion; use sp_blockchain::HeaderBackend; @@ -178,7 +179,7 @@ pub fn node_config( state_cache_size: 16777216, state_cache_child_ratio: None, state_pruning: Default::default(), - keep_blocks: KeepBlocks::All, + blocks_pruning: BlocksPruning::All, chain_spec: Box::new(spec), wasm_method: WasmExecutionMethod::Compiled { instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite, diff --git a/node/zombienet-backchannel/Cargo.toml b/node/zombienet-backchannel/Cargo.toml index 3982fda62a34..a7b01c51a1eb 100644 --- a/node/zombienet-backchannel/Cargo.toml +++ b/node/zombienet-backchannel/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" publish = false [dependencies] -tokio = { version = "1.18.2", default-features = false, features = ["macros", "net", "rt-multi-thread", "sync"] } +tokio = { version = "1.19.2", default-features = false, features = ["macros", "net", "rt-multi-thread", "sync"] } url = "2.0.0" tokio-tungstenite = "0.17" futures-util = "0.3.21" diff --git a/parachain/test-parachains/adder/collator/Cargo.toml b/parachain/test-parachains/adder/collator/Cargo.toml index 96d0ade921ba..d232c72fcb22 100644 --- a/parachain/test-parachains/adder/collator/Cargo.toml +++ b/parachain/test-parachains/adder/collator/Cargo.toml @@ -44,4 +44,4 @@ substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.18.2", features = ["macros"] } +tokio = { version = "1.19.2", features = ["macros"] } diff --git a/parachain/test-parachains/undying/collator/Cargo.toml b/parachain/test-parachains/undying/collator/Cargo.toml index 612f00e11b6c..53c93b7792fd 100644 --- a/parachain/test-parachains/undying/collator/Cargo.toml +++ b/parachain/test-parachains/undying/collator/Cargo.toml @@ -44,4 +44,4 @@ substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.18", features = ["macros"] } +tokio = { version = "1.19", features = ["macros"] } diff --git a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md index eb571420fb78..579a1ce8f143 100644 --- a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md +++ b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md @@ -30,7 +30,7 @@ This design should result in a protocol that is: #### Disputes -Protocol: `"/polkadot/send_dispute/1"` +Protocol: `"///send_dispute/1"` Request: @@ -86,7 +86,7 @@ enum DisputeResponse { #### Vote Recovery -Protocol: `"/polkadot/req_votes/1"` +Protocol: `"///req_votes/1"` ```rust struct IHaveVotesRequest { diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 73c3ae0c5f39..8424b930e6af 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -43,7 +43,7 @@ use frame_support::{ weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use frame_system::limits; -use primitives::v2::{AssignmentId, BlockNumber, ValidatorId}; +use primitives::v2::{AssignmentId, Balance, BlockNumber, ValidatorId}; use sp_runtime::{FixedPointNumber, Perbill, Perquintill}; use static_assertions::const_assert; @@ -215,6 +215,23 @@ impl pallet_staking::BenchmarkingConfig for StakingBenchmarkingConfig { type MaxNominators = ConstU32<1000>; } +/// Convert a balance to an unsigned 256-bit number, use in nomination pools. +pub struct BalanceToU256; +impl sp_runtime::traits::Convert for BalanceToU256 { + fn convert(n: Balance) -> sp_core::U256 { + n.into() + } +} + +/// Convert an unsigned 256-bit number to balance, use in nomination pools. +pub struct U256ToBalance; +impl sp_runtime::traits::Convert for U256ToBalance { + fn convert(n: sp_core::U256) -> Balance { + use frame_support::traits::Defensive; + n.try_into().defensive_unwrap_or(Balance::MAX) + } +} + /// Macro to set a value (e.g. when using the `parameter_types` macro) to either a production value /// or to an environment variable or testing value (in case the `fast-runtime` feature is selected). /// Note that the environment variable is evaluated _at compile time_. diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index 4037622a865d..5373f27e8eed 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -104,6 +104,9 @@ keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substra sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } separator = "0.4.1" serde_json = "1.0.81" +remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } +tokio = { version = "1.19.2", features = ["macros"] } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 3774df793770..d5f80bc87f0e 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -31,7 +31,8 @@ use primitives::v2::{ }; use runtime_common::{ auctions, claims, crowdloan, impl_runtime_weights, impls::DealWithFees, paras_registrar, - prod_or_fast, slots, BlockHashCount, BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate, + prod_or_fast, slots, BalanceToU256, BlockHashCount, BlockLength, CurrencyToVote, + SlowAdjustingFeeUpdate, U256ToBalance, }; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; @@ -715,6 +716,8 @@ parameter_types! { pub TermDuration: BlockNumber = prod_or_fast!(24 * HOURS, 2 * MINUTES, "KSM_TERM_DURATION"); pub const DesiredMembers: u32 = 19; pub const DesiredRunnersUp: u32 = 19; + pub const MaxVoters: u32 = 10 * 1000; + pub const MaxCandidates: u32 = 1000; pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; } @@ -735,6 +738,8 @@ impl pallet_elections_phragmen::Config for Runtime { type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; type TermDuration = TermDuration; + type MaxVoters = MaxVoters; + type MaxCandidates = MaxCandidates; type PalletId = PhragmenElectionPalletId; type WeightInfo = weights::pallet_elections_phragmen::WeightInfo; } @@ -1196,7 +1201,8 @@ impl InstanceFilter for ProxyType { Call::Crowdloan(..) | Call::Slots(..) | Call::Auctions(..) | // Specifically omitting the entire XCM Pallet - Call::VoterList(..) + Call::VoterList(..) | + Call::NominationPools(..) ), ProxyType::Governance => matches!( c, @@ -1423,20 +1429,6 @@ impl pallet_gilt::Config for Runtime { type WeightInfo = weights::pallet_gilt::WeightInfo; } -pub struct BalanceToU256; -impl sp_runtime::traits::Convert for BalanceToU256 { - fn convert(n: Balance) -> sp_core::U256 { - n.into() - } -} -pub struct U256ToBalance; -impl sp_runtime::traits::Convert for U256ToBalance { - fn convert(n: sp_core::U256) -> Balance { - use frame_support::traits::Defensive; - n.try_into().defensive_unwrap_or(Balance::MAX) - } -} - parameter_types! { pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); pub const MaxPointsToBalance: u8 = 10; @@ -2007,6 +1999,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi< Block, AccountId, @@ -2308,3 +2311,38 @@ mod multiplier_tests { } } } + +#[cfg(all(test, feature = "try-runtime"))] +mod remote_tests { + use super::*; + use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime; + use remote_externalities::{ + Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, + }; + use std::env::var; + + #[tokio::test] + async fn run_migrations() { + sp_tracing::try_init_simple(); + let transport: Transport = + var("WS").unwrap_or("wss://kusama-rpc.polkadot.io:443".to_string()).into(); + let maybe_state_snapshot: Option = var("SNAP").map(|s| s.into()).ok(); + let mut ext = Builder::::default() + .mode(if let Some(state_snapshot) = maybe_state_snapshot { + Mode::OfflineOrElseOnline( + OfflineConfig { state_snapshot: state_snapshot.clone() }, + OnlineConfig { + transport, + state_snapshot: Some(state_snapshot), + ..Default::default() + }, + ) + } else { + Mode::Online(OnlineConfig { transport, ..Default::default() }) + }) + .build() + .await + .unwrap(); + ext.execute_with(|| Runtime::on_runtime_upgrade()); + } +} diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index 37bc47c49759..a07de073ad72 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -54,6 +54,7 @@ pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = " pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -79,6 +80,7 @@ frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", b pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } +pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } hex-literal = { version = "0.3.4", optional = true } runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } @@ -97,6 +99,9 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } trie-db = "0.23.1" serde_json = "1.0.81" separator = "0.4.1" +remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } +tokio = { version = "1.19.2", features = ["macros"] } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -140,6 +145,7 @@ std = [ "pallet-indices/std", "pallet-membership/std", "pallet-multisig/std", + "pallet-nomination-pools/std", "pallet-offences/std", "pallet-preimage/std", "pallet-proxy/std", @@ -193,6 +199,8 @@ runtime-benchmarks = [ "pallet-indices/runtime-benchmarks", "pallet-membership/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", + "pallet-nomination-pools/runtime-benchmarks", + "pallet-nomination-pools-benchmarking", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 0521cc24e19c..93c58587cce2 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -71,7 +71,7 @@ use sp_runtime::{ OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, }; use sp_staking::SessionIndex; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; @@ -183,7 +183,8 @@ impl Contains for BaseFilter { Call::Auctions(_) | Call::Crowdloan(_) | Call::VoterList(_) | - Call::XcmPallet(_) => true, + Call::XcmPallet(_) | + Call::NominationPools(_) => true, // All pallets are allowed, but exhaustive match is defensive // in the case of adding new pallets. } @@ -613,7 +614,7 @@ impl pallet_staking::Config for Runtime { type VoterList = VoterList; type MaxUnlockingChunks = frame_support::traits::ConstU32<32>; type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig; - type OnStakerSlash = (); + type OnStakerSlash = NominationPools; type WeightInfo = weights::pallet_staking::WeightInfo; } @@ -746,6 +747,8 @@ parameter_types! { /// 13 members initially, to be increased to 23 eventually. pub const DesiredMembers: u32 = 13; pub const DesiredRunnersUp: u32 = 20; + pub const MaxVoters: u32 = 10 * 1000; + pub const MaxCandidates: u32 = 1000; pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; } // Make sure that there are no more than `MaxMembers` members elected via phragmen. @@ -766,6 +769,8 @@ impl pallet_elections_phragmen::Config for Runtime { type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; type TermDuration = TermDuration; + type MaxVoters = MaxVoters; + type MaxCandidates = MaxCandidates; type WeightInfo = weights::pallet_elections_phragmen::WeightInfo; } @@ -1180,7 +1185,8 @@ impl InstanceFilter for ProxyType { Call::Crowdloan(..) | Call::Slots(..) | Call::Auctions(..) | // Specifically omitting the entire XCM Pallet - Call::VoterList(..) + Call::VoterList(..) | + Call::NominationPools(..) ), ProxyType::Governance => matches!( c, @@ -1389,6 +1395,53 @@ impl auctions::Config for Runtime { type WeightInfo = weights::runtime_common_auctions::WeightInfo; } +parameter_types! { + pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); + // Allow pools that got slashed up to 90% to remain operational. + pub const MaxPointsToBalance: u8 = 10; +} + +impl pallet_nomination_pools::Config for Runtime { + type Event = Event; + type Currency = Balances; + type CurrencyBalance = Balance; + type RewardCounter = FixedU128; + type BalanceToU256 = runtime_common::BalanceToU256; + type U256ToBalance = runtime_common::U256ToBalance; + type StakingInterface = Staking; + type PostUnbondingPoolsWindow = frame_support::traits::ConstU32<4>; + type MaxMetadataLen = frame_support::traits::ConstU32<256>; + // we use the same number of allowed unlocking chunks as with staking. + type MaxUnbonding = ::MaxUnlockingChunks; + type PalletId = PoolsPalletId; + type MaxPointsToBalance = MaxPointsToBalance; + type WeightInfo = weights::pallet_nomination_pools::WeightInfo; +} + +pub struct InitiateNominationPools; +impl frame_support::traits::OnRuntimeUpgrade for InitiateNominationPools { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + // we use one as an indicator if this has already been set. + if pallet_nomination_pools::MaxPools::::get().is_none() { + // 5 DOT to join a pool. + pallet_nomination_pools::MinJoinBond::::put(5 * UNITS); + // 100 DOT to create a pool. + pallet_nomination_pools::MinCreateBond::::put(100 * UNITS); + + // Initialize with limits for now. + pallet_nomination_pools::MaxPools::::put(0); + pallet_nomination_pools::MaxPoolMembersPerPool::::put(0); + pallet_nomination_pools::MaxPoolMembers::::put(0); + + log::info!(target: "runtime::polkadot", "pools config initiated 🎉"); + ::DbWeight::get().reads_writes(1, 5) + } else { + log::info!(target: "runtime::polkadot", "pools config already initiated 😏"); + ::DbWeight::get().reads(1) + } + } +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1458,6 +1511,9 @@ construct_runtime! { // Provides a semi-sorted list of nominators for staking. VoterList: pallet_bags_list::{Pallet, Call, Storage, Event} = 37, + // nomination pools: extension to staking. + NominationPools: pallet_nomination_pools::{Pallet, Call, Storage, Event, Config} = 39, + // Parachains pallets. Start indices at 50 to leave room. ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50, Configuration: parachains_configuration::{Pallet, Call, Storage, Config} = 51, @@ -1515,7 +1571,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_staking::migrations::v10::MigrateToV10, + (pallet_staking::migrations::v10::MigrateToV10, InitiateNominationPools), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -1558,6 +1614,7 @@ mod benches { [pallet_indices, Indices] [pallet_membership, TechnicalMembership] [pallet_multisig, Multisig] + [pallet_nomination_pools, NominationPoolsBench::] [pallet_offences, OffencesBench::] [pallet_preimage, Preimage] [pallet_proxy, Proxy] @@ -1913,6 +1970,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { @@ -1938,6 +2006,7 @@ sp_api::impl_runtime_apis! { use pallet_session_benchmarking::Pallet as SessionBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench; + use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; use frame_system_benchmarking::Pallet as SystemBench; use frame_benchmarking::baseline::Pallet as Baseline; @@ -1960,6 +2029,7 @@ sp_api::impl_runtime_apis! { use pallet_session_benchmarking::Pallet as SessionBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench; + use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; use frame_system_benchmarking::Pallet as SystemBench; use frame_benchmarking::baseline::Pallet as Baseline; @@ -1968,6 +2038,7 @@ sp_api::impl_runtime_apis! { impl pallet_election_provider_support_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} impl frame_benchmarking::baseline::Config for Runtime {} + impl pallet_nomination_pools_benchmarking::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -2305,3 +2376,38 @@ mod multiplier_tests { } } } + +#[cfg(all(test, feature = "try-runtime"))] +mod remote_tests { + use super::*; + use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime; + use remote_externalities::{ + Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, + }; + use std::env::var; + + #[tokio::test] + async fn run_migrations() { + sp_tracing::try_init_simple(); + let transport: Transport = + var("WS").unwrap_or("wss://rpc.polkadot.io:443".to_string()).into(); + let maybe_state_snapshot: Option = var("SNAP").map(|s| s.into()).ok(); + let mut ext = Builder::::default() + .mode(if let Some(state_snapshot) = maybe_state_snapshot { + Mode::OfflineOrElseOnline( + OfflineConfig { state_snapshot: state_snapshot.clone() }, + OnlineConfig { + transport, + state_snapshot: Some(state_snapshot), + ..Default::default() + }, + ) + } else { + Mode::Online(OnlineConfig { transport, ..Default::default() }) + }) + .build() + .await + .unwrap(); + ext.execute_with(|| Runtime::on_runtime_upgrade()); + } +} diff --git a/runtime/polkadot/src/weights/mod.rs b/runtime/polkadot/src/weights/mod.rs index 568961700a05..9435ef0c2e0e 100644 --- a/runtime/polkadot/src/weights/mod.rs +++ b/runtime/polkadot/src/weights/mod.rs @@ -31,6 +31,7 @@ pub mod pallet_im_online; pub mod pallet_indices; pub mod pallet_membership; pub mod pallet_multisig; +pub mod pallet_nomination_pools; pub mod pallet_preimage; pub mod pallet_proxy; pub mod pallet_scheduler; diff --git a/runtime/polkadot/src/weights/pallet_nomination_pools.rs b/runtime/polkadot/src/weights/pallet_nomination_pools.rs new file mode 100644 index 000000000000..82e40e452d2c --- /dev/null +++ b/runtime/polkadot/src/weights/pallet_nomination_pools.rs @@ -0,0 +1,271 @@ +// Copyright 2017-2022 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . +//! Autogenerated weights for `pallet_nomination_pools` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-02, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// /home/benchbot/cargo_target_dir/production/polkadot +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --pallet=pallet_nomination_pools +// --chain=polkadot-dev +// --header=./file_header.txt +// --output=./runtime/polkadot/src/weights/pallet_nomination_pools.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_nomination_pools`. +pub struct WeightInfo(PhantomData); +impl pallet_nomination_pools::WeightInfo for WeightInfo { + // Storage: NominationPools MinJoinBond (r:1 w:0) + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: System Account (r:2 w:1) + // Storage: NominationPools MaxPoolMembersPerPool (r:1 w:0) + // Storage: NominationPools MaxPoolMembers (r:1 w:0) + // Storage: NominationPools CounterForPoolMembers (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: VoterList ListNodes (r:3 w:3) + // Storage: VoterList ListBags (r:2 w:2) + fn join() -> Weight { + (118_410_000 as Weight) + .saturating_add(T::DbWeight::get().reads(17 as Weight)) + .saturating_add(T::DbWeight::get().writes(12 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: System Account (r:3 w:2) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: VoterList ListNodes (r:3 w:3) + // Storage: VoterList ListBags (r:2 w:2) + fn bond_extra_transfer() -> Weight { + (110_847_000 as Weight) + .saturating_add(T::DbWeight::get().reads(14 as Weight)) + .saturating_add(T::DbWeight::get().writes(12 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: System Account (r:3 w:3) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Bonded (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: VoterList ListNodes (r:2 w:2) + // Storage: VoterList ListBags (r:2 w:2) + fn bond_extra_reward() -> Weight { + (117_431_000 as Weight) + .saturating_add(T::DbWeight::get().reads(13 as Weight)) + .saturating_add(T::DbWeight::get().writes(12 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: System Account (r:1 w:1) + fn claim_payout() -> Weight { + (46_087_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: System Account (r:2 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking Nominators (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: VoterList ListNodes (r:3 w:3) + // Storage: Staking Bonded (r:1 w:0) + // Storage: VoterList ListBags (r:2 w:2) + // Storage: NominationPools SubPoolsStorage (r:1 w:1) + // Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1) + fn unbond() -> Weight { + (116_969_000 as Weight) + .saturating_add(T::DbWeight::get().reads(18 as Weight)) + .saturating_add(T::DbWeight::get().writes(13 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:0) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + /// The range of component `s` is `[0, 100]`. + fn pool_withdraw_unbonded(s: u32, ) -> Weight { + (37_619_000 as Weight) + // Standard Error: 0 + .saturating_add((28_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools SubPoolsStorage (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: NominationPools CounterForPoolMembers (r:1 w:1) + /// The range of component `s` is `[0, 100]`. + fn withdraw_unbonded_update(s: u32, ) -> Weight { + (73_374_000 as Weight) + // Standard Error: 0 + .saturating_add((35_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) + } + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: NominationPools SubPoolsStorage (r:1 w:1) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking SlashingSpans (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:0) + // Storage: System Account (r:2 w:2) + // Storage: Balances Locks (r:1 w:1) + // Storage: NominationPools CounterForPoolMembers (r:1 w:1) + // Storage: NominationPools ReversePoolIdLookup (r:1 w:1) + // Storage: NominationPools CounterForReversePoolIdLookup (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: NominationPools CounterForRewardPools (r:1 w:1) + // Storage: NominationPools CounterForSubPoolsStorage (r:1 w:1) + // Storage: NominationPools CounterForBondedPools (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) + /// The range of component `s` is `[0, 100]`. + fn withdraw_unbonded_kill(s: u32, ) -> Weight { + (128_477_000 as Weight) + // Standard Error: 1_000 + .saturating_add((11_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(19 as Weight)) + .saturating_add(T::DbWeight::get().writes(16 as Weight)) + } + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: NominationPools MinCreateBond (r:1 w:0) + // Storage: NominationPools MinJoinBond (r:1 w:0) + // Storage: NominationPools MaxPools (r:1 w:0) + // Storage: NominationPools CounterForBondedPools (r:1 w:1) + // Storage: NominationPools PoolMembers (r:1 w:1) + // Storage: NominationPools LastPoolId (r:1 w:1) + // Storage: NominationPools MaxPoolMembersPerPool (r:1 w:0) + // Storage: NominationPools MaxPoolMembers (r:1 w:0) + // Storage: NominationPools CounterForPoolMembers (r:1 w:1) + // Storage: System Account (r:2 w:2) + // Storage: Staking Ledger (r:1 w:1) + // Storage: Staking Bonded (r:1 w:1) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking HistoryDepth (r:1 w:0) + // Storage: Balances Locks (r:1 w:1) + // Storage: NominationPools RewardPools (r:1 w:1) + // Storage: NominationPools CounterForRewardPools (r:1 w:1) + // Storage: NominationPools ReversePoolIdLookup (r:1 w:1) + // Storage: NominationPools CounterForReversePoolIdLookup (r:1 w:1) + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: Staking Payee (r:0 w:1) + fn create() -> Weight { + (118_156_000 as Weight) + .saturating_add(T::DbWeight::get().reads(22 as Weight)) + .saturating_add(T::DbWeight::get().writes(15 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:0) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking MinNominatorBond (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking MaxNominatorsCount (r:1 w:0) + // Storage: Staking Validators (r:2 w:0) + // Storage: Staking CurrentEra (r:1 w:0) + // Storage: Staking Bonded (r:1 w:0) + // Storage: VoterList ListNodes (r:1 w:1) + // Storage: VoterList ListBags (r:1 w:1) + // Storage: VoterList CounterForListNodes (r:1 w:1) + // Storage: Staking CounterForNominators (r:1 w:1) + /// The range of component `n` is `[1, 16]`. + fn nominate(n: u32, ) -> Weight { + (47_219_000 as Weight) + // Standard Error: 10_000 + .saturating_add((2_107_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(12 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:1) + // Storage: Staking Ledger (r:1 w:0) + fn set_state() -> Weight { + (23_730_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:0) + // Storage: NominationPools Metadata (r:1 w:1) + // Storage: NominationPools CounterForMetadata (r:1 w:1) + /// The range of component `n` is `[1, 256]`. + fn set_metadata(n: u32, ) -> Weight { + (13_082_000 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(n as Weight)) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: NominationPools MinJoinBond (r:0 w:1) + // Storage: NominationPools MaxPoolMembers (r:0 w:1) + // Storage: NominationPools MaxPoolMembersPerPool (r:0 w:1) + // Storage: NominationPools MinCreateBond (r:0 w:1) + // Storage: NominationPools MaxPools (r:0 w:1) + fn set_configs() -> Weight { + (6_135_000 as Weight) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:1) + fn update_roles() -> Weight { + (20_373_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: NominationPools BondedPools (r:1 w:0) + // Storage: Staking Ledger (r:1 w:0) + // Storage: Staking Validators (r:1 w:0) + // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking CounterForNominators (r:1 w:1) + // Storage: VoterList ListNodes (r:1 w:1) + // Storage: VoterList ListBags (r:1 w:1) + // Storage: VoterList CounterForListNodes (r:1 w:1) + fn chill() -> Weight { + (45_186_000 as Weight) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } +} diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 8a3b97159822..86582ea05a3d 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -1322,6 +1322,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index a27e8635100d..d18a2c9bb95c 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -1065,6 +1065,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl crate::GetLastTimestamp for Runtime { fn get_last_timestamp() -> u64 { Timestamp::now() diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 16e7efd5fe85..fc436cff9dd5 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -99,6 +99,9 @@ tiny-keccak = { version = "2.0.2", features = ["keccak"] } keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } serde_json = "1.0.81" +remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } +tokio = { version = "1.19.2", features = ["macros"] } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index b46d60ecfaca..c8a37ffdc05b 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -44,8 +44,8 @@ use primitives::v2::{ }; use runtime_common::{ assigned_slots, auctions, crowdloan, elections::OnChainAccuracy, impl_runtime_weights, - impls::ToAuthor, paras_registrar, paras_sudo_wrapper, prod_or_fast, slots, BlockHashCount, - BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate, + impls::ToAuthor, paras_registrar, paras_sudo_wrapper, prod_or_fast, slots, BalanceToU256, + BlockHashCount, BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate, U256ToBalance, }; use runtime_parachains::{ configuration as parachains_configuration, disputes as parachains_disputes, @@ -1015,20 +1015,6 @@ impl auctions::Config for Runtime { type WeightInfo = weights::runtime_common_auctions::WeightInfo; } -pub struct BalanceToU256; -impl sp_runtime::traits::Convert for BalanceToU256 { - fn convert(n: Balance) -> sp_core::U256 { - n.into() - } -} -pub struct U256ToBalance; -impl sp_runtime::traits::Convert for U256ToBalance { - fn convert(n: sp_core::U256) -> Balance { - use frame_support::traits::Defensive; - n.try_into().defensive_unwrap_or(Balance::MAX) - } -} - parameter_types! { pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); pub const MaxPointsToBalance: u8 = 10; @@ -1575,6 +1561,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi< Block, AccountId, @@ -1748,3 +1745,38 @@ sp_api::impl_runtime_apis! { } } } + +#[cfg(all(test, feature = "try-runtime"))] +mod remote_tests { + use super::*; + use frame_try_runtime::runtime_decl_for_TryRuntime::TryRuntime; + use remote_externalities::{ + Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, Transport, + }; + use std::env::var; + + #[tokio::test] + async fn run_migrations() { + sp_tracing::try_init_simple(); + let transport: Transport = + var("WS").unwrap_or("wss://westend-rpc.polkadot.io:443".to_string()).into(); + let maybe_state_snapshot: Option = var("SNAP").map(|s| s.into()).ok(); + let mut ext = Builder::::default() + .mode(if let Some(state_snapshot) = maybe_state_snapshot { + Mode::OfflineOrElseOnline( + OfflineConfig { state_snapshot: state_snapshot.clone() }, + OnlineConfig { + transport, + state_snapshot: Some(state_snapshot), + ..Default::default() + }, + ) + } else { + Mode::Online(OnlineConfig { transport, ..Default::default() }) + }) + .build() + .await + .unwrap(); + ext.execute_with(|| Runtime::on_runtime_upgrade()); + } +} diff --git a/utils/remote-ext-tests/bags-list/Cargo.toml b/utils/remote-ext-tests/bags-list/Cargo.toml index 2e6e1313576c..dbd9565f5a1a 100644 --- a/utils/remote-ext-tests/bags-list/Cargo.toml +++ b/utils/remote-ext-tests/bags-list/Cargo.toml @@ -19,4 +19,4 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } clap = { version = "3.1", features = ["derive"] } log = "0.4.17" -tokio = { version = "1.18.2", features = ["macros"] } +tokio = { version = "1.19.2", features = ["macros"] } diff --git a/utils/staking-miner/Cargo.toml b/utils/staking-miner/Cargo.toml index 758886fd1591..38812b0ff19b 100644 --- a/utils/staking-miner/Cargo.toml +++ b/utils/staking-miner/Cargo.toml @@ -14,7 +14,7 @@ paste = "1.0.7" serde = "1.0.137" serde_json = "1.0" thiserror = "1.0.31" -tokio = { version = "1.18.2", features = ["macros", "rt-multi-thread", "sync"] } +tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread", "sync"] } remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/zombienet_tests/functional/0003-parachains-garbage-candidate.feature b/zombienet_tests/functional/0003-parachains-garbage-candidate.feature new file mode 100644 index 000000000000..24be749f13e6 --- /dev/null +++ b/zombienet_tests/functional/0003-parachains-garbage-candidate.feature @@ -0,0 +1,41 @@ +Description: Test dispute finality lag when 1/3 of parachain validators always attempt to include an invalid block +Network: ./0003-parachains-garbage-candidate.toml +Creds: config + +honest-validator-0: is up +honest-validator-1: is up +honest-validator-2: is up +malus-validator-0: is up + +# Check authority status. +honest-validator-0: reports node_roles is 4 +honest-validator-1: reports node_roles is 4 +honest-validator-2: reports node_roles is 4 +malus-validator-0: reports node_roles is 4 + +# Parachains should be making progress even if we have up to 1/3 malicious validators. +honest-validator-0: parachain 2000 block height is at least 2 within 180 seconds +honest-validator-1: parachain 2001 block height is at least 2 within 180 seconds +honest-validator-2: parachain 2002 block height is at least 2 within 180 seconds + +# Check for chain reversion after dispute conclusion. +honest-validator-0: log line contains "reverted due to a bad parachain block" within 180 seconds +honest-validator-1: log line contains "reverted due to a bad parachain block" within 180 seconds +honest-validator-2: log line contains "reverted due to a bad parachain block" within 180 seconds + +# Check if disputes are concluded in less than 2 blocks. +honest-validator-0: reports polkadot_parachain_disputes_finality_lag is lower than 2 +honest-validator-1: reports polkadot_parachain_disputes_finality_lag is lower than 2 +honest-validator-2: reports polkadot_parachain_disputes_finality_lag is lower than 2 + +# Allow more time for malicious validator activity. +sleep 30 seconds + +# Check that garbage parachain blocks included by malicious validators are being disputed. +honest-validator-0: reports parachain_candidate_disputes_total is at least 2 within 15 seconds +honest-validator-1: reports parachain_candidate_disputes_total is at least 2 within 15 seconds +honest-validator-2: reports parachain_candidate_disputes_total is at least 2 within 15 seconds + +# Disputes should always end as "invalid" +honest-validator-0: reports parachain_candidate_dispute_concluded{validity="invalid"} is at least 2 within 15 seconds +honest-validator-1: reports parachain_candidate_dispute_concluded{validity="valid"} is 0 within 15 seconds diff --git a/zombienet_tests/functional/0003-parachains-garbage-candidate.toml b/zombienet_tests/functional/0003-parachains-garbage-candidate.toml new file mode 100644 index 000000000000..8f82d30e2ac6 --- /dev/null +++ b/zombienet_tests/functional/0003-parachains-garbage-candidate.toml @@ -0,0 +1,46 @@ +[settings] +timeout = 1000 +bootnode = true + +[relaychain.genesis.runtime.runtime_genesis_config.configuration.config] + max_validators_per_core = 1 + needed_approvals = 2 + +[relaychain] +default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" +chain = "rococo-local" +chain_spec_command = "polkadot build-spec --chain rococo-local --disable-default-bootnode" +default_command = "polkadot" + +[relaychain.default_resources] +limits = { memory = "4G", cpu = "2" } +requests = { memory = "2G", cpu = "1" } + + [[relaychain.node_groups]] + name = "honest-validator" + count = 3 + args = ["-lparachain=debug,runtime=debug"] + + [[relaychain.node_groups]] + image = "{{MALUS_IMAGE}}" + name = "malus-validator" + command = "malus suggest-garbage-candidate" + args = ["-lparachain=debug,MALUS=trace"] + count = 1 + +{% for id in range(2000,2003) %} +[[parachains]] +id = {{id}} +addToGenesis = true +genesis_state_generator = "undying-collator export-genesis-state --pov-size={{10000*(id-1999)}} --pvf-complexity={{id - 1999}}" + [parachains.collator] + image = "{{COL_IMAGE}}" + name = "collator" + command = "undying-collator" + args = ["-lparachain=debug", "--pov-size={{10000*(id-1999)}}", "--parachain-id={{id}}", "--pvf-complexity={{id - 1999}}"] +{% endfor %} + +[types.Header] +number = "u64" +parent_hash = "Hash" +post_state = "Hash"