diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0860aab7adcd..4859391ec14c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -309,7 +309,7 @@ build-malus: --polkadot "$DEPENDENT_REPO" "$GITHUB_PR_TOKEN" - $CARGO_UPDATE_CRATES + "$CARGO_UPDATE_CRATES" check-dependent-cumulus: <<: *check-dependent-project diff --git a/Cargo.lock b/Cargo.lock index 05a2d607b4b1..cfdcc642ba7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,7 +236,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.2", + "socket2 0.4.4", "waker-fn", "winapi 0.3.9", ] @@ -439,7 +439,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "beefy-primitives", "fnv", @@ -468,7 +468,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -491,12 +491,12 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -570,6 +570,15 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "blake2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94ba84325db59637ffc528bbe8c7f86c02c57cff5c0e2b9b00f9a851f42f309" +dependencies = [ + "digest 0.10.2", +] + [[package]] name = "blake2-rfc" version = "0.2.18" @@ -1306,9 +1315,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +checksum = "a4600d695eb3f6ce1cd44e6e291adceb2cc3ab12f20a33777ecd0bf6eba34e06" dependencies = [ "generic-array 0.14.4", ] @@ -1480,13 +1489,13 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +checksum = "8cb780dce4f9a8f5c087362b3a4595936b2019e7c8b30f2c3e9a7e94e6ae9837" dependencies = [ "block-buffer 0.10.0", "crypto-common", - "generic-array 0.14.4", + "subtle", ] [[package]] @@ -1832,7 +1841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.4", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1880,7 +1889,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", ] @@ -1898,7 +1907,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -1920,7 +1929,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "Inflector", "chrono", @@ -1947,7 +1956,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -1961,7 +1970,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -1989,7 +1998,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "bitflags", "frame-metadata", @@ -2018,7 +2027,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2030,10 +2039,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -2042,7 +2051,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "proc-macro2", "quote", @@ -2052,7 +2061,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2075,7 +2084,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -2086,7 +2095,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "log", @@ -2103,7 +2112,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -2118,7 +2127,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "sp-api", @@ -2127,7 +2136,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "sp-api", @@ -2323,7 +2332,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "chrono", "frame-election-provider-support", @@ -2671,7 +2680,7 @@ dependencies = [ "httpdate", "itoa 1.0.1", "pin-project-lite 0.2.7", - "socket2 0.4.2", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -3123,7 +3132,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4299ebf790ea9de1cb72e73ff2ae44c723ef264299e5e2d5ef46a371eb3ac3d8" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -3226,7 +3235,7 @@ dependencies = [ [[package]] name = "kusama-runtime" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bitvec", @@ -3318,7 +3327,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "polkadot-primitives", @@ -3389,9 +3398,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.112" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "libgit2-sys" @@ -3495,7 +3504,7 @@ dependencies = [ "pin-project 1.0.10", "prost", "prost-build", - "rand 0.8.4", + "rand 0.8.5", "ring", "rw-stream-sink", "sha2 0.9.8", @@ -3633,9 +3642,9 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.4", + "rand 0.8.5", "smallvec", - "socket2 0.4.2", + "socket2 0.4.4", "void", ] @@ -3685,7 +3694,7 @@ dependencies = [ "log", "prost", "prost-build", - "rand 0.8.4", + "rand 0.8.5", "sha2 0.9.8", "snow", "static_assertions", @@ -3736,7 +3745,7 @@ dependencies = [ "pin-project 1.0.10", "rand 0.7.3", "salsa20", - "sha3", + "sha3 0.9.1", ] [[package]] @@ -3776,7 +3785,7 @@ dependencies = [ "log", "prost", "prost-build", - "rand 0.8.4", + "rand 0.8.5", "sha2 0.9.8", "thiserror", "unsigned-varint 0.7.1", @@ -3843,7 +3852,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.2", + "socket2 0.4.4", ] [[package]] @@ -3928,7 +3937,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.4", + "rand 0.8.5", "serde", "sha2 0.9.8", "typenum", @@ -4102,6 +4111,15 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + [[package]] name = "matches" version = "0.1.9" @@ -4200,7 +4218,7 @@ dependencies = [ [[package]] name = "metered-channel" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "derive_more", @@ -4219,7 +4237,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd2c2cc134e57461f0898b0e921f0a7819b5e3f3a4335b9aa390ce81a5f36fb9" dependencies = [ "futures 0.3.21", - "rand 0.8.4", + "rand 0.8.5", "thrift", ] @@ -4266,9 +4284,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -4358,7 +4376,7 @@ dependencies = [ "generic-array 0.14.4", "multihash-derive", "sha2 0.9.8", - "sha3", + "sha3 0.9.1", "unsigned-varint 0.5.1", ] @@ -4381,7 +4399,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro-error", "proc-macro2", "quote", @@ -4421,7 +4439,7 @@ dependencies = [ "num-complex", "num-rational 0.4.0", "num-traits", - "rand 0.8.4", + "rand 0.8.5", "rand_distr", "simba", "typenum", @@ -4444,7 +4462,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a8690bf09abf659851e58cd666c3d37ac6af07c2bd7a9e332cfba471715775" dependencies = [ - "rand 0.8.4", + "rand 0.8.5", ] [[package]] @@ -4734,7 +4752,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4748,7 +4766,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -4764,7 +4782,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -4779,7 +4797,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4803,7 +4821,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4823,7 +4841,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4843,7 +4861,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4858,7 +4876,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "beefy-primitives", "frame-support", @@ -4874,7 +4892,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4899,7 +4917,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4983,7 +5001,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5000,7 +5018,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5016,7 +5034,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5039,7 +5057,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5057,7 +5075,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5072,7 +5090,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5095,7 +5113,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5111,7 +5129,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5131,7 +5149,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5148,7 +5166,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5165,7 +5183,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5183,7 +5201,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5199,7 +5217,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5216,7 +5234,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5231,7 +5249,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5245,7 +5263,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5262,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5285,7 +5303,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5301,7 +5319,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5316,7 +5334,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5330,7 +5348,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5346,7 +5364,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5367,7 +5385,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5383,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5397,7 +5415,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5420,9 +5438,9 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -5431,7 +5449,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "sp-arithmetic", @@ -5440,7 +5458,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5454,7 +5472,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5472,7 +5490,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5491,7 +5509,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-support", "frame-system", @@ -5508,7 +5526,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5525,7 +5543,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5536,7 +5554,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5553,7 +5571,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5569,7 +5587,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5583,7 +5601,7 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "frame-system", @@ -5605,7 +5623,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-benchmarking", "frame-support", @@ -5643,7 +5661,7 @@ dependencies = [ "lz4", "memmap2 0.2.3", "parking_lot 0.11.2", - "rand 0.8.4", + "rand 0.8.5", "snap", ] @@ -5667,7 +5685,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -5976,7 +5994,7 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_cmd", "color-eyre", @@ -5991,7 +6009,7 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "env_logger 0.9.0", @@ -6011,7 +6029,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "bitvec", @@ -6032,7 +6050,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "derive_more", @@ -6048,7 +6066,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-primitives-test-helpers", - "rand 0.8.4", + "rand 0.8.5", "sc-network", "sp-core", "sp-keyring", @@ -6060,7 +6078,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "env_logger 0.9.0", @@ -6077,7 +6095,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-primitives-test-helpers", - "rand 0.8.4", + "rand 0.8.5", "sc-network", "sp-application-crypto", "sp-core", @@ -6088,7 +6106,7 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.16" +version = "0.9.17" dependencies = [ "clap", "frame-benchmarking-cli", @@ -6110,7 +6128,7 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -6142,7 +6160,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.16" +version = "0.9.17" dependencies = [ "always-assert", "assert_matches", @@ -6170,7 +6188,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.16" +version = "0.9.17" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6182,7 +6200,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -6212,7 +6230,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.16" +version = "0.9.17" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -6225,7 +6243,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -6237,7 +6255,7 @@ dependencies = [ "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.4", + "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", "sp-application-crypto", @@ -6251,7 +6269,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -6275,7 +6293,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "parity-scale-codec", @@ -6294,7 +6312,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "bitvec", @@ -6331,7 +6349,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "bitvec", @@ -6359,7 +6377,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "bitvec", @@ -6384,7 +6402,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "polkadot-node-subsystem", @@ -6400,7 +6418,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -6422,7 +6440,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "maplit", @@ -6441,7 +6459,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "futures 0.3.21", @@ -6462,7 +6480,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "futures 0.3.21", @@ -6486,7 +6504,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.16" +version = "0.9.17" dependencies = [ "async-trait", "futures 0.3.21", @@ -6502,7 +6520,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.16" +version = "0.9.17" dependencies = [ "bitvec", "futures 0.3.21", @@ -6513,7 +6531,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-primitives-test-helpers", - "rand 0.8.4", + "rand 0.8.5", "sp-application-crypto", "sp-keystore", "thiserror", @@ -6522,7 +6540,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.16" +version = "0.9.17" dependencies = [ "always-assert", "assert_matches", @@ -6536,7 +6554,7 @@ dependencies = [ "polkadot-core-primitives", "polkadot-node-subsystem-util", "polkadot-parachain", - "rand 0.8.4", + "rand 0.8.5", "sc-executor", "sc-executor-common", "sc-executor-wasmtime", @@ -6555,7 +6573,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "futures-timer", @@ -6578,7 +6596,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "memory-lru", @@ -6599,7 +6617,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.16" +version = "0.9.17" dependencies = [ "async-std", "lazy_static", @@ -6616,7 +6634,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_cmd", "bs58", @@ -6644,7 +6662,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.16" +version = "0.9.17" dependencies = [ "async-trait", "derive_more", @@ -6661,7 +6679,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.16" +version = "0.9.17" dependencies = [ "bounded-vec", "futures 0.3.21", @@ -6683,7 +6701,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.16" +version = "0.9.17" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -6692,7 +6710,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" -version = "0.9.16" +version = "0.9.17" dependencies = [ "async-trait", "futures 0.3.21", @@ -6710,7 +6728,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.16" +version = "0.9.17" dependencies = [ "derive_more", "futures 0.3.21", @@ -6728,7 +6746,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -6751,7 +6769,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "polkadot-primitives-test-helpers", - "rand 0.8.4", + "rand 0.8.5", "sp-application-crypto", "sp-core", "sp-keystore", @@ -6761,7 +6779,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "femme", @@ -6786,7 +6804,7 @@ dependencies = [ [[package]] name = "polkadot-overseer-gen" -version = "0.9.16" +version = "0.9.17" dependencies = [ "async-trait", "futures 0.3.21", @@ -6803,10 +6821,10 @@ dependencies = [ [[package]] name = "polkadot-overseer-gen-proc-macro" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -6814,7 +6832,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.16" +version = "0.9.17" dependencies = [ "derive_more", "frame-support", @@ -6830,7 +6848,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.16" +version = "0.9.17" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -6844,7 +6862,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.16" +version = "0.9.17" dependencies = [ "bitvec", "frame-system", @@ -6873,7 +6891,7 @@ dependencies = [ [[package]] name = "polkadot-primitives-test-helpers" -version = "0.9.16" +version = "0.9.17" dependencies = [ "polkadot-primitives", "sp-application-crypto", @@ -6883,7 +6901,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -6913,7 +6931,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bitvec", @@ -7002,7 +7020,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bitvec", @@ -7054,7 +7072,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "polkadot-primitives", @@ -7065,7 +7083,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.16" +version = "0.9.17" dependencies = [ "bs58", "parity-scale-codec", @@ -7076,7 +7094,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "bitflags", @@ -7101,7 +7119,7 @@ dependencies = [ "polkadot-primitives", "polkadot-primitives-test-helpers", "polkadot-runtime-metrics", - "rand 0.8.4", + "rand 0.8.5", "rand_chacha 0.3.1", "rustc-hex", "sc-keystore", @@ -7126,7 +7144,7 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -7233,7 +7251,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.16" +version = "0.9.17" dependencies = [ "arrayvec 0.5.2", "assert_matches", @@ -7263,7 +7281,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.16" +version = "0.9.17" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -7272,7 +7290,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures 0.3.21", "parity-scale-codec", @@ -7298,7 +7316,7 @@ dependencies = [ [[package]] name = "polkadot-test-malus" -version = "0.9.16" +version = "0.9.17" dependencies = [ "assert_matches", "async-trait", @@ -7325,7 +7343,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bitvec", @@ -7391,7 +7409,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-benchmarking", "frame-system", @@ -7411,7 +7429,7 @@ dependencies = [ "polkadot-runtime-parachains", "polkadot-service", "polkadot-test-runtime", - "rand 0.8.4", + "rand 0.8.5", "sc-authority-discovery", "sc-chain-spec", "sc-cli", @@ -7446,7 +7464,7 @@ dependencies = [ [[package]] name = "polkadot-voter-bags" -version = "0.9.16" +version = "0.9.17" dependencies = [ "clap", "generate-bags", @@ -7561,9 +7579,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "9dada8c9981fcf32929c3c0f0cd796a9284aca335565227ed88c83babb1d43dc" dependencies = [ "thiserror", "toml", @@ -7737,20 +7755,19 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", "rand_pcg", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -7798,7 +7815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "964d548f8e7d12e102ef183a0de7e98180c9f8729f555897a857b96e48122d2f" dependencies = [ "num-traits", - "rand 0.8.4", + "rand 0.8.5", ] [[package]] @@ -7810,15 +7827,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -7962,7 +7970,7 @@ dependencies = [ [[package]] name = "remote-ext-tests-bags-list" -version = "0.9.16" +version = "0.9.17" dependencies = [ "clap", "frame-system", @@ -7982,7 +7990,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "env_logger 0.9.0", "jsonrpsee 0.8.0", @@ -8084,7 +8092,7 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bp-messages", @@ -8158,7 +8166,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "polkadot-primitives", @@ -8329,7 +8337,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "sp-core", @@ -8340,7 +8348,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -8367,7 +8375,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "futures-timer", @@ -8390,7 +8398,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8406,7 +8414,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8423,9 +8431,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -8434,7 +8442,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "chrono", "clap", @@ -8472,7 +8480,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "fnv", "futures 0.3.21", @@ -8500,7 +8508,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "hash-db", "kvdb", @@ -8525,7 +8533,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -8549,7 +8557,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "fork-tree", @@ -8592,7 +8600,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -8616,7 +8624,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8629,7 +8637,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -8654,7 +8662,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "sc-client-api", "sp-authorship", @@ -8665,7 +8673,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "lazy_static", "libsecp256k1", @@ -8693,7 +8701,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "environmental", "parity-scale-codec", @@ -8710,7 +8718,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "parity-scale-codec", @@ -8726,7 +8734,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8744,8 +8752,9 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ + "ahash", "async-trait", "dyn-clone", "finality-grandpa", @@ -8755,7 +8764,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.11.2", - "rand 0.8.4", + "rand 0.8.5", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -8782,7 +8791,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -8806,7 +8815,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "ansi_term", "futures 0.3.21", @@ -8823,7 +8832,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "hex", @@ -8838,7 +8847,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-std", "async-trait", @@ -8888,8 +8897,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ + "ahash", "futures 0.3.21", "futures-timer", "libp2p", @@ -8904,7 +8914,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "bytes 1.1.0", "fnv", @@ -8932,7 +8942,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "libp2p", @@ -8945,7 +8955,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8954,7 +8964,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "hash-db", @@ -8985,7 +8995,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9010,7 +9020,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "jsonrpc-core", @@ -9027,7 +9037,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "directories", @@ -9091,7 +9101,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "parity-scale-codec", @@ -9105,7 +9115,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -9116,7 +9126,6 @@ dependencies = [ "sc-consensus-babe", "sc-consensus-epochs", "sc-finality-grandpa", - "sc-rpc-api", "serde", "serde_json", "sp-blockchain", @@ -9127,7 +9136,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "chrono", "futures 0.3.21", @@ -9145,7 +9154,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "ansi_term", "atty", @@ -9170,15 +9179,15 @@ dependencies = [ "thiserror", "tracing", "tracing-log", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -9187,7 +9196,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9214,7 +9223,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "log", @@ -9227,7 +9236,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9256,7 +9265,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -9424,9 +9433,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa 1.0.1", "ryu", @@ -9497,13 +9506,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6" +checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" dependencies = [ "cfg-if 1.0.0", "cpufeatures 0.2.1", - "digest 0.10.1", + "digest 0.10.2", ] [[package]] @@ -9518,6 +9527,16 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha3" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f935e31cf406e8c0e96c2815a5516181b7004ae8c5f296293221e9b1e356bd" +dependencies = [ + "digest 0.10.2", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -9578,7 +9597,7 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "slot-range-helper" -version = "0.9.16" +version = "0.9.17" dependencies = [ "enumn", "parity-scale-codec", @@ -9598,9 +9617,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "snap" @@ -9615,9 +9634,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6142f7c25e94f6fd25a32c3348ec230df9109b463f59c8c7acc4bd34936babb7" dependencies = [ "aes-gcm", - "blake2", + "blake2 0.9.2", "chacha20poly1305", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "ring", "rustc_version 0.3.3", @@ -9639,9 +9658,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi 0.3.9", @@ -9659,14 +9678,14 @@ dependencies = [ "futures 0.3.21", "httparse", "log", - "rand 0.8.4", + "rand 0.8.5", "sha-1 0.9.8", ] [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "hash-db", "log", @@ -9683,10 +9702,10 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "blake2-rfc", - "proc-macro-crate 1.1.0", + "blake2 0.10.2", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -9695,7 +9714,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -9708,7 +9727,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "integer-sqrt", "num-traits", @@ -9723,7 +9742,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -9736,7 +9755,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "parity-scale-codec", @@ -9748,7 +9767,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "sp-api", @@ -9760,7 +9779,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "log", @@ -9778,7 +9797,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -9797,7 +9816,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "merlin", @@ -9820,7 +9839,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -9832,7 +9851,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9844,7 +9863,7 @@ dependencies = [ [[package]] name = "sp-core" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "base58", "bitflags", @@ -9872,7 +9891,6 @@ dependencies = [ "schnorrkel", "secrecy", "serde", - "sha2 0.10.0", "sp-core-hashing", "sp-debug-derive", "sp-externalities", @@ -9883,8 +9901,6 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", - "tiny-keccak", - "twox-hash", "wasmi", "zeroize", ] @@ -9892,20 +9908,21 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "blake2-rfc", + "blake2 0.10.2", "byteorder", - "sha2 0.10.0", + "digest 0.10.2", + "sha2 0.10.1", + "sha3 0.10.0", "sp-std", - "tiny-keccak", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "proc-macro2", "quote", @@ -9916,7 +9933,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "kvdb", "parking_lot 0.11.2", @@ -9925,7 +9942,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "proc-macro2", "quote", @@ -9935,7 +9952,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "environmental", "parity-scale-codec", @@ -9946,7 +9963,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "finality-grandpa", "log", @@ -9964,7 +9981,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9978,7 +9995,7 @@ dependencies = [ [[package]] name = "sp-io" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "hash-db", @@ -10002,7 +10019,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "lazy_static", "sp-core", @@ -10013,7 +10030,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -10030,7 +10047,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "thiserror", "zstd", @@ -10039,7 +10056,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -10054,9 +10071,9 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -10065,7 +10082,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "sp-api", "sp-core", @@ -10075,7 +10092,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "backtrace", "lazy_static", @@ -10085,7 +10102,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "rustc-hash", "serde", @@ -10095,7 +10112,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "either", "hash256-std-hasher", @@ -10117,7 +10134,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10134,10 +10151,10 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "Inflector", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -10146,7 +10163,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "serde", "serde_json", @@ -10155,7 +10172,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -10169,7 +10186,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "scale-info", @@ -10180,7 +10197,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.11.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "hash-db", "log", @@ -10203,12 +10220,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" [[package]] name = "sp-storage" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10221,7 +10238,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "log", "sp-core", @@ -10234,7 +10251,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures-timer", @@ -10250,19 +10267,19 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "sp-std", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "sp-api", "sp-runtime", @@ -10271,7 +10288,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "log", @@ -10287,7 +10304,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "hash-db", "memory-db", @@ -10302,7 +10319,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10319,7 +10336,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10330,7 +10347,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "impl-trait-for-tuples", "log", @@ -10368,10 +10385,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staking-miner" -version = "0.9.16" +version = "0.9.17" dependencies = [ "clap", - "env_logger 0.9.0", "frame-election-provider-support", "frame-support", "frame-system", @@ -10399,6 +10415,7 @@ dependencies = [ "sub-tokens", "thiserror", "tokio", + "tracing-subscriber 0.3.9", "westend-runtime", ] @@ -10443,7 +10460,7 @@ dependencies = [ "lazy_static", "nalgebra", "num-traits", - "rand 0.8.4", + "rand 0.8.5", ] [[package]] @@ -10498,7 +10515,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "platforms", ] @@ -10506,7 +10523,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -10528,7 +10545,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-std", "futures-util", @@ -10542,7 +10559,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "async-trait", "futures 0.3.21", @@ -10568,7 +10585,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", @@ -10578,9 +10595,9 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.2", "proc-macro2", "quote", "syn", @@ -10589,7 +10606,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "ansi_term", "build-helper", @@ -10651,7 +10668,7 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.4", + "rand 0.8.5", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -10674,7 +10691,7 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-parachain-adder" -version = "0.9.16" +version = "0.9.17" dependencies = [ "dlmalloc", "parity-scale-codec", @@ -10687,7 +10704,7 @@ dependencies = [ [[package]] name = "test-parachain-adder-collator" -version = "0.9.16" +version = "0.9.17" dependencies = [ "clap", "futures 0.3.21", @@ -10713,14 +10730,14 @@ dependencies = [ [[package]] name = "test-parachain-halt" -version = "0.9.16" +version = "0.9.17" dependencies = [ "substrate-wasm-builder", ] [[package]] name = "test-parachains" -version = "0.9.16" +version = "0.9.17" dependencies = [ "parity-scale-codec", "sp-core", @@ -10731,7 +10748,7 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "polkadot-primitives", @@ -10774,9 +10791,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] @@ -10891,18 +10908,20 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes 1.1.0", "libc", "memchr", - "mio 0.7.14", + "mio 0.8.0", "num_cpus", "once_cell", + "parking_lot 0.12.0", "pin-project-lite 0.2.7", "signal-hook-registry", + "socket2 0.4.4", "tokio-macros", "winapi 0.3.9", ] @@ -11005,9 +11024,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "f6c650a8ef0cd2dd93736f033d21cbd1224c5a967aa0c258d00fcf7dafef9b9f" dependencies = [ "cfg-if 1.0.0", "log", @@ -11018,9 +11037,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" +checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" dependencies = [ "proc-macro2", "quote", @@ -11029,11 +11048,12 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" dependencies = [ "lazy_static", + "valuable", ] [[package]] @@ -11076,7 +11096,7 @@ dependencies = [ "ansi_term", "chrono", "lazy_static", - "matchers", + "matchers 0.0.1", "parking_lot 0.11.2", "regex", "serde", @@ -11090,6 +11110,24 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" +dependencies = [ + "ansi_term", + "lazy_static", + "matchers 0.1.0", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "trie-db" version = "0.23.1" @@ -11129,7 +11167,7 @@ dependencies = [ "ipnet", "lazy_static", "log", - "rand 0.8.4", + "rand 0.8.5", "smallvec", "thiserror", "tinyvec", @@ -11164,7 +11202,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#27b8806ed82844bb5283a4dadf853ee518fd042f" +source = "git+https://github.com/paritytech/substrate?branch=master#5cdbaa3e1caac94fa3ede30f9fb08fd1f031b3d4" dependencies = [ "clap", "jsonrpsee 0.4.1", @@ -11218,7 +11256,7 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.4", + "rand 0.8.5", "sha-1 0.9.8", "thiserror", "url 2.2.2", @@ -11232,7 +11270,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ "cfg-if 1.0.0", - "rand 0.8.4", + "digest 0.10.2", + "rand 0.8.5", "static_assertions", ] @@ -11371,6 +11410,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.0.0-alpha.8" @@ -11713,7 +11758,7 @@ dependencies = [ "mach", "memoffset", "more-asserts", - "rand 0.8.4", + "rand 0.8.5", "region", "rustix", "thiserror", @@ -11792,7 +11837,7 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.16" +version = "0.9.17" dependencies = [ "beefy-primitives", "bitvec", @@ -11881,7 +11926,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "polkadot-primitives", @@ -12040,7 +12085,7 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.16" +version = "0.9.17" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -12052,7 +12097,7 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "frame-system", @@ -12075,7 +12120,7 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-benchmarking", "frame-support", @@ -12092,7 +12137,7 @@ dependencies = [ [[package]] name = "xcm-executor-integration-tests" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "frame-system", @@ -12122,7 +12167,7 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "parity-scale-codec", @@ -12138,7 +12183,7 @@ dependencies = [ [[package]] name = "xcm-simulator-example" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "frame-system", @@ -12161,7 +12206,7 @@ dependencies = [ [[package]] name = "xcm-simulator-fuzzer" -version = "0.9.16" +version = "0.9.17" dependencies = [ "frame-support", "frame-system", @@ -12193,7 +12238,7 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.11.2", - "rand 0.8.4", + "rand 0.8.5", "static_assertions", ] @@ -12220,7 +12265,7 @@ dependencies = [ [[package]] name = "zombienet-backchannel" -version = "0.9.16" +version = "0.9.17" dependencies = [ "futures-util", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 016077132ccd..aa031107ec3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ path = "src/main.rs" name = "polkadot" description = "Implementation of a `https://polkadot.network` node in Rust based on the Substrate framework." license = "GPL-3.0-only" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" rust-version = "1.57.0" # custom profiles @@ -21,7 +21,7 @@ parity-util-mem = { version = "*", default-features = false, features = ["jemall assert_cmd = "2.0.4" nix = "0.23.1" tempfile = "3.2.0" -tokio = "1.15.0" +tokio = "1.17.0" remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-core-primitives = { path = "core-primitives" } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d084ba6649d1..231a5f4f5363 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-cli" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Polkadot Relay-chain Client Node" edition = "2018" diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index 8b683c321c60..bb7c809c65fd 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-core-primitives" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/erasure-coding/Cargo.toml b/erasure-coding/Cargo.toml index f0a725105a40..cd5853df5033 100644 --- a/erasure-coding/Cargo.toml +++ b/erasure-coding/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-erasure-coding" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/erasure-coding/fuzzer/Cargo.toml b/erasure-coding/fuzzer/Cargo.toml index 580080d2d73e..13812ab76bd7 100644 --- a/erasure-coding/fuzzer/Cargo.toml +++ b/erasure-coding/fuzzer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erasure_coding_fuzzer" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/node/client/Cargo.toml b/node/client/Cargo.toml index 0e382e8b59f3..3ebd65de8ab1 100644 --- a/node/client/Cargo.toml +++ b/node/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-client" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/node/collation-generation/Cargo.toml b/node/collation-generation/Cargo.toml index 01ef3ff4ca91..09cc647e441c 100644 --- a/node/collation-generation/Cargo.toml +++ b/node/collation-generation/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-node-collation-generation" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-erasure-coding = { path = "../../erasure-coding" } polkadot-node-primitives = { path = "../primitives" } polkadot-node-subsystem = { path = "../subsystem" } diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index 403afcc431ec..a328dec18d50 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-core-approval-voting" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -8,7 +8,7 @@ edition = "2018" futures = "0.3.21" futures-timer = "3.0.2" parity-scale-codec = { version = "2.3.1", default-features = false, features = ["bit-vec", "derive"] } -tracing = "0.1.29" +tracing = "0.1.31" bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } lru = "0.7" merlin = "2.0" diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index ad430486f7ec..4c79fc9fcff5 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-core-av-store" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -9,7 +9,7 @@ futures = "0.3.21" futures-timer = "3.0.2" kvdb = "0.10.0" thiserror = "1.0.30" -tracing = "0.1.29" +tracing = "0.1.31" bitvec = "0.20.1" parity-scale-codec = { version = "2.3.1", features = ["derive"] } diff --git a/node/core/backing/Cargo.toml b/node/core/backing/Cargo.toml index 8585a193dc9c..0bc7ff04c1c3 100644 --- a/node/core/backing/Cargo.toml +++ b/node/core/backing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-core-backing" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -14,7 +14,7 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" } erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" } statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" } bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -tracing = "0.1.29" +tracing = "0.1.31" thiserror = "1.0.30" [dev-dependencies] diff --git a/node/core/bitfield-signing/Cargo.toml b/node/core/bitfield-signing/Cargo.toml index b4f000b115b6..60501a3137a7 100644 --- a/node/core/bitfield-signing/Cargo.toml +++ b/node/core/bitfield-signing/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-node-core-bitfield-signing" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-primitives = { path = "../../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/candidate-validation/Cargo.toml b/node/core/candidate-validation/Cargo.toml index 50668b098e75..ab0fbccf1268 100644 --- a/node/core/candidate-validation/Cargo.toml +++ b/node/core/candidate-validation/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "polkadot-node-core-candidate-validation" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] async-trait = "0.1.52" futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", git = "https://github.com/paritytech/substrate", branch = "master" } parity-scale-codec = { version = "2.3.1", default-features = false, features = ["bit-vec", "derive"] } diff --git a/node/core/chain-api/Cargo.toml b/node/core/chain-api/Cargo.toml index 1d38289272dd..ecac94abcb46 100644 --- a/node/core/chain-api/Cargo.toml +++ b/node/core/chain-api/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-node-core-chain-api" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index ad541da9a45f..38544cf0574c 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "polkadot-node-core-chain-selection" description = "Chain Selection Subsystem" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" futures-timer = "3" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index 746d160d0301..686441352bbe 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" parity-scale-codec = "2" kvdb = "0.10.0" thiserror = "1.0.30" diff --git a/node/core/dispute-coordinator/src/real/initialized.rs b/node/core/dispute-coordinator/src/real/initialized.rs index 9f9f1305a9a8..d9d71c67e9bb 100644 --- a/node/core/dispute-coordinator/src/real/initialized.rs +++ b/node/core/dispute-coordinator/src/real/initialized.rs @@ -244,8 +244,10 @@ impl Initialized { if !overlay_db.is_empty() { let ops = overlay_db.into_write_ops(); backend.write(ops)?; - confirm_write()?; } + // even if the changeset was empty, + // otherwise the caller will error. + confirm_write()?; } } @@ -882,7 +884,8 @@ impl Initialized { // Whether or not we know already that this is a good dispute: // - // Note we can only know for sure whether we reached the `byzantine_threshold` after updating candidate votes above, therefore the spam checking is afterwards: + // Note we can only know for sure whether we reached the `byzantine_threshold` after + // updating candidate votes above, therefore the spam checking is afterwards: let is_confirmed = is_included || was_confirmed || is_local || votes.voted_indices().len() > @@ -890,13 +893,19 @@ impl Initialized { // Potential spam: if !is_confirmed { - let mut free_spam_slots = statements.is_empty(); + let mut free_spam_slots_available = true; + // Only allow import if all validators voting invalid, have not exceeded + // their spam slots: for (statement, index) in statements.iter() { - free_spam_slots |= statement.statement().is_backing() || + // Disputes can only be triggered via an invalidity stating vote, thus we only + // need to increase spam slots on invalid votes. (If we did not, we would also + // increase spam slots for backing validators for example - as validators have to + // provide some opposing vote for dispute-distribution). + free_spam_slots_available &= statement.statement().indicates_validity() || self.spam_slots.add_unconfirmed(session, candidate_hash, *index); } - // No reporting validator had a free spam slot: - if !free_spam_slots { + // Only validity stating votes or validator had free spam slot? + if !free_spam_slots_available { tracing::debug!( target: LOG_TARGET, ?candidate_hash, diff --git a/node/core/dispute-coordinator/src/real/spam_slots.rs b/node/core/dispute-coordinator/src/real/spam_slots.rs index 6c8707152a68..b58b812b042a 100644 --- a/node/core/dispute-coordinator/src/real/spam_slots.rs +++ b/node/core/dispute-coordinator/src/real/spam_slots.rs @@ -23,19 +23,24 @@ use crate::real::LOG_TARGET; /// Type used for counting potential spam votes. type SpamCount = u32; -/// How many unconfirmed disputes a validator is allowed to be a participant in (per session). +/// How many unconfirmed disputes a validator is allowed to import (per session). /// /// Unconfirmed means: Node has not seen the candidate be included on any chain, it has not cast a /// vote itself on that dispute, the dispute has not yet reached more than a third of /// validator's votes and the including relay chain block has not yet been finalized. /// /// Exact number of `MAX_SPAM_VOTES` is not that important here. It is important that the number is -/// low enough to not cause resource exhaustion, if multiple validators spend their limits. Also -/// if things are working properly, this number cannot really be too low either, as all relevant -/// disputes _should_ have been seen as included my enough validators. (Otherwise the candidate -/// would not have been available in the first place and could not have been included.) So this is -/// really just a fallback mechanism if things go terribly wrong. +/// low enough to not cause resource exhaustion (disk & memory) on the importing validator, even if +/// multiple validators fully make use of their assigned spam slots. +/// +/// Also if things are working properly, this number cannot really be too low either, as all +/// relevant disputes _should_ have been seen as included by enough validators. (Otherwise the +/// candidate would not have been available in the first place and could not have been included.) +/// So this is really just a fallback mechanism if things go terribly wrong. +#[cfg(not(test))] const MAX_SPAM_VOTES: SpamCount = 50; +#[cfg(test)] +const MAX_SPAM_VOTES: SpamCount = 1; /// Spam slots for raised disputes concerning unknown candidates. pub struct SpamSlots { @@ -76,7 +81,12 @@ impl SpamSlots { Self { slots, unconfirmed: unconfirmed_disputes } } - /// Add an unconfirmed dispute if free slots are available. + /// Increase a "voting invalid" validator's spam slot. + /// + /// This function should get called for any validator's invalidity vote for any not yet + /// confirmed dispute. + /// + /// Returns: `true` if validator still had vacant spam slots, `false` otherwise. pub fn add_unconfirmed( &mut self, session: SessionIndex, @@ -90,14 +100,16 @@ impl SpamSlots { let validators = self.unconfirmed.entry((session, candidate)).or_default(); if validators.insert(validator) { + // We only increment spam slots once per candidate, as each validator has to provide an + // opposing vote for sending out its own vote. Therefore, receiving multiple votes for + // a single candidate is expected and should not get punished here. *c += 1; - true - } else { - false } + + true } - /// Clear out spam slots for a given candiate in a session. + /// Clear out spam slots for a given candidate in a session. /// /// This effectively reduces the spam slot count for all validators participating in a dispute /// for that candidate. You should call this function once a dispute became obsolete or got diff --git a/node/core/dispute-coordinator/src/real/tests.rs b/node/core/dispute-coordinator/src/real/tests.rs index aed361f5886f..9d031a70b22f 100644 --- a/node/core/dispute-coordinator/src/real/tests.rs +++ b/node/core/dispute-coordinator/src/real/tests.rs @@ -32,7 +32,7 @@ use futures::{ use kvdb::KeyValueDB; use parity_scale_codec::Encode; -use polkadot_node_primitives::SignedDisputeStatement; +use polkadot_node_primitives::{SignedDisputeStatement, SignedFullStatement, Statement}; use polkadot_node_subsystem::{ messages::{ ChainApiMessage, DisputeCoordinatorMessage, DisputeDistributionMessage, @@ -43,7 +43,7 @@ use polkadot_node_subsystem::{ }; use polkadot_node_subsystem_util::TimeoutExt; use sc_keystore::LocalKeystore; -use sp_core::testing::TaskExecutor; +use sp_core::{sr25519::Pair, testing::TaskExecutor, Pair as PairT}; use sp_keyring::Sr25519Keyring; use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; @@ -57,8 +57,8 @@ use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystem use polkadot_primitives::{ v1::{ BlakeTwo256, BlockNumber, CandidateCommitments, CandidateHash, CandidateReceipt, Hash, - HashT, Header, MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex, ValidatorId, - ValidatorIndex, + HashT, Header, MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex, SigningContext, + ValidatorId, ValidatorIndex, }, v2::SessionInfo, }; @@ -78,12 +78,12 @@ use super::db::v1::DbBackend; const TEST_TIMEOUT: Duration = Duration::from_secs(2); // sets up a keystore with the given keyring accounts. -fn make_keystore(accounts: &[Sr25519Keyring]) -> LocalKeystore { +fn make_keystore(seeds: impl Iterator) -> LocalKeystore { let store = LocalKeystore::in_memory(); - for s in accounts.iter().copied().map(|k| k.to_seed()) { + for s in seeds { store - .sr25519_generate_new(polkadot_primitives::v1::PARACHAIN_KEY_TYPE_ID, Some(s.as_str())) + .sr25519_generate_new(polkadot_primitives::v1::PARACHAIN_KEY_TYPE_ID, Some(&s)) .unwrap(); } @@ -120,7 +120,7 @@ impl MockClock { } struct TestState { - validators: Vec, + validators: Vec, validator_public: Vec, validator_groups: Vec>, master_keystore: Arc, @@ -133,17 +133,28 @@ struct TestState { impl Default for TestState { fn default() -> TestState { + let p1 = Pair::from_string("//Polka", None).unwrap(); + let p2 = Pair::from_string("//Dot", None).unwrap(); + let p3 = Pair::from_string("//Kusama", None).unwrap(); let validators = vec![ - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - Sr25519Keyring::Eve, - Sr25519Keyring::One, - Sr25519Keyring::Ferdie, + (Sr25519Keyring::Alice.pair(), Sr25519Keyring::Alice.to_seed()), + (Sr25519Keyring::Bob.pair(), Sr25519Keyring::Bob.to_seed()), + (Sr25519Keyring::Charlie.pair(), Sr25519Keyring::Charlie.to_seed()), + (Sr25519Keyring::Dave.pair(), Sr25519Keyring::Dave.to_seed()), + (Sr25519Keyring::Eve.pair(), Sr25519Keyring::Eve.to_seed()), + (Sr25519Keyring::One.pair(), Sr25519Keyring::One.to_seed()), + (Sr25519Keyring::Ferdie.pair(), Sr25519Keyring::Ferdie.to_seed()), + // Two more keys needed so disputes are not confirmed already with only 3 statements. + (p1, "//Polka".into()), + (p2, "//Dot".into()), + (p3, "//Kusama".into()), ]; - let validator_public = validators.iter().map(|k| ValidatorId::from(k.public())).collect(); + let validator_public = validators + .clone() + .into_iter() + .map(|k| ValidatorId::from(k.0.public())) + .collect(); let validator_groups = vec![ vec![ValidatorIndex(0), ValidatorIndex(1)], @@ -151,14 +162,15 @@ impl Default for TestState { vec![ValidatorIndex(4), ValidatorIndex(5), ValidatorIndex(6)], ]; - let master_keystore = make_keystore(&validators).into(); - let subsystem_keystore = make_keystore(&[Sr25519Keyring::Alice]).into(); + let master_keystore = make_keystore(validators.iter().map(|v| v.1.clone())).into(); + let subsystem_keystore = + make_keystore(vec![Sr25519Keyring::Alice.to_seed()].into_iter()).into(); let db = Arc::new(kvdb_memorydb::create(1)); let config = Config { col_data: 0 }; TestState { - validators, + validators: validators.into_iter().map(|(pair, _)| pair).collect(), validator_public, validator_groups, master_keystore, @@ -322,7 +334,7 @@ impl TestState { } } - async fn issue_statement_with_index( + async fn issue_explicit_statement_with_index( &self, index: usize, candidate_hash: CandidateHash, @@ -339,6 +351,32 @@ impl TestState { .unwrap() } + async fn issue_backing_statement_with_index( + &self, + index: usize, + candidate_hash: CandidateHash, + session: SessionIndex, + ) -> SignedDisputeStatement { + let keystore = self.master_keystore.clone() as SyncCryptoStorePtr; + let validator_id = self.validators[index].public().into(); + let context = + SigningContext { session_index: session, parent_hash: Hash::repeat_byte(0xac) }; + + let statement = SignedFullStatement::sign( + &keystore, + Statement::Valid(candidate_hash), + &context, + ValidatorIndex(index as _), + &validator_id, + ) + .await + .unwrap() + .unwrap() + .into_unchecked(); + + SignedDisputeStatement::from_backing_statement(&statement, context, validator_id).unwrap() + } + fn resume(self, test: F) -> Self where F: FnOnce(TestState, VirtualOverseer) -> BoxFuture<'static, TestState>, @@ -393,6 +431,477 @@ fn make_invalid_candidate_receipt() -> CandidateReceipt { dummy_candidate_receipt_bad_sig(Default::default(), Some(Default::default())) } +#[test] +fn too_many_unconfirmed_statements_are_considered_spam() { + test_harness(|mut test_state, mut virtual_overseer| { + Box::pin(async move { + let session = 1; + + test_state.handle_resume_sync(&mut virtual_overseer, session).await; + + let candidate_receipt1 = make_valid_candidate_receipt(); + let candidate_hash1 = candidate_receipt1.hash(); + let candidate_receipt2 = make_invalid_candidate_receipt(); + let candidate_hash2 = candidate_receipt2.hash(); + + test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; + + let valid_vote1 = + test_state.issue_backing_statement_with_index(3, candidate_hash1, session).await; + + let invalid_vote1 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let valid_vote2 = + test_state.issue_backing_statement_with_index(3, candidate_hash1, session).await; + + let invalid_vote2 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let (pending_confirmation, _confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash1, + candidate_receipt: candidate_receipt1.clone(), + session, + statements: vec![ + (valid_vote1, ValidatorIndex(3)), + (invalid_vote1, ValidatorIndex(1)), + ], + pending_confirmation, + }, + }) + .await; + + // Participation has to fail, otherwise the dispute will be confirmed. + participation_missing_availability(&mut virtual_overseer).await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ActiveDisputes(tx), + }) + .await; + + assert_eq!(rx.await.unwrap(), vec![(session, candidate_hash1)]); + + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash1)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 1); + assert_eq!(votes.invalid.len(), 1); + } + + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash2, + candidate_receipt: candidate_receipt2.clone(), + session, + statements: vec![ + (valid_vote2, ValidatorIndex(3)), + (invalid_vote2, ValidatorIndex(1)), + ], + pending_confirmation, + }, + }) + .await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash2)], + tx, + ), + }) + .await; + + assert_matches!(rx.await.unwrap().get(0), None); + } + + // Result should be invalid, because it should be considered spam. + assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::InvalidImport)); + + virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await; + + // No more messages expected: + assert!(virtual_overseer.try_recv().await.is_none()); + + test_state + }) + }); +} + +#[test] +fn dispute_gets_confirmed_via_participation() { + test_harness(|mut test_state, mut virtual_overseer| { + Box::pin(async move { + let session = 1; + + test_state.handle_resume_sync(&mut virtual_overseer, session).await; + + let candidate_receipt1 = make_valid_candidate_receipt(); + let candidate_hash1 = candidate_receipt1.hash(); + let candidate_receipt2 = make_invalid_candidate_receipt(); + let candidate_hash2 = candidate_receipt2.hash(); + + test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; + + let valid_vote1 = test_state + .issue_explicit_statement_with_index(3, candidate_hash1, session, true) + .await; + + let invalid_vote1 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let valid_vote2 = test_state + .issue_explicit_statement_with_index(3, candidate_hash1, session, true) + .await; + + let invalid_vote2 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let (pending_confirmation, _confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash1, + candidate_receipt: candidate_receipt1.clone(), + session, + statements: vec![ + (valid_vote1, ValidatorIndex(3)), + (invalid_vote1, ValidatorIndex(1)), + ], + pending_confirmation, + }, + }) + .await; + + participation_with_distribution(&mut virtual_overseer, &candidate_hash1).await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ActiveDisputes(tx), + }) + .await; + + assert_eq!(rx.await.unwrap(), vec![(session, candidate_hash1)]); + + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash1)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 2); + assert_eq!(votes.invalid.len(), 1); + } + + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash2, + candidate_receipt: candidate_receipt2.clone(), + session, + statements: vec![ + (valid_vote2, ValidatorIndex(3)), + (invalid_vote2, ValidatorIndex(1)), + ], + pending_confirmation, + }, + }) + .await; + + participation_missing_availability(&mut virtual_overseer).await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash2)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 1); + assert_eq!(votes.invalid.len(), 1); + } + + // Result should be valid, because our node participated, so spam slots are cleared: + assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport)); + + virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await; + + // No more messages expected: + assert!(virtual_overseer.try_recv().await.is_none()); + + test_state + }) + }); +} + +#[test] +fn dispute_gets_confirmed_at_byzantine_threshold() { + test_harness(|mut test_state, mut virtual_overseer| { + Box::pin(async move { + let session = 1; + + test_state.handle_resume_sync(&mut virtual_overseer, session).await; + + let candidate_receipt1 = make_valid_candidate_receipt(); + let candidate_hash1 = candidate_receipt1.hash(); + let candidate_receipt2 = make_invalid_candidate_receipt(); + let candidate_hash2 = candidate_receipt2.hash(); + + test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; + + let valid_vote1 = test_state + .issue_explicit_statement_with_index(3, candidate_hash1, session, true) + .await; + + let invalid_vote1 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let valid_vote1a = test_state + .issue_explicit_statement_with_index(4, candidate_hash1, session, true) + .await; + + let invalid_vote1a = test_state + .issue_explicit_statement_with_index(5, candidate_hash1, session, false) + .await; + + let valid_vote2 = test_state + .issue_explicit_statement_with_index(3, candidate_hash1, session, true) + .await; + + let invalid_vote2 = test_state + .issue_explicit_statement_with_index(1, candidate_hash1, session, false) + .await; + + let (pending_confirmation, _confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash1, + candidate_receipt: candidate_receipt1.clone(), + session, + statements: vec![ + (valid_vote1, ValidatorIndex(3)), + (invalid_vote1, ValidatorIndex(1)), + (valid_vote1a, ValidatorIndex(4)), + (invalid_vote1a, ValidatorIndex(5)), + ], + pending_confirmation, + }, + }) + .await; + + participation_missing_availability(&mut virtual_overseer).await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ActiveDisputes(tx), + }) + .await; + + assert_eq!(rx.await.unwrap(), vec![(session, candidate_hash1)]); + + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash1)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 2); + assert_eq!(votes.invalid.len(), 2); + } + + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash: candidate_hash2, + candidate_receipt: candidate_receipt2.clone(), + session, + statements: vec![ + (valid_vote2, ValidatorIndex(3)), + (invalid_vote2, ValidatorIndex(1)), + ], + pending_confirmation, + }, + }) + .await; + + participation_missing_availability(&mut virtual_overseer).await; + + { + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash2)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 1); + assert_eq!(votes.invalid.len(), 1); + } + + // Result should be valid, because byzantine threshold has been reached in first + // import, so spam slots are cleared: + assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport)); + + virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await; + + // No more messages expected: + assert!(virtual_overseer.try_recv().await.is_none()); + + test_state + }) + }); +} + +#[test] +fn backing_statements_import_works_and_no_spam() { + test_harness(|mut test_state, mut virtual_overseer| { + Box::pin(async move { + let session = 1; + + test_state.handle_resume_sync(&mut virtual_overseer, session).await; + + let candidate_receipt = make_valid_candidate_receipt(); + let candidate_hash = candidate_receipt.hash(); + + test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; + + let valid_vote1 = + test_state.issue_backing_statement_with_index(3, candidate_hash, session).await; + + let valid_vote2 = + test_state.issue_backing_statement_with_index(4, candidate_hash, session).await; + + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash, + candidate_receipt: candidate_receipt.clone(), + session, + statements: vec![ + (valid_vote1, ValidatorIndex(3)), + (valid_vote2, ValidatorIndex(4)), + ], + pending_confirmation, + }, + }) + .await; + assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport)); + + { + // Just backing votes - we should not have any active disputes now. + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ActiveDisputes(tx), + }) + .await; + + assert!(rx.await.unwrap().is_empty()); + + let (tx, rx) = oneshot::channel(); + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::QueryCandidateVotes( + vec![(session, candidate_hash)], + tx, + ), + }) + .await; + + let (_, _, votes) = rx.await.unwrap().get(0).unwrap().clone(); + assert_eq!(votes.valid.len(), 2); + assert_eq!(votes.invalid.len(), 0); + } + + let candidate_receipt = make_invalid_candidate_receipt(); + let candidate_hash = candidate_receipt.hash(); + + let valid_vote1 = + test_state.issue_backing_statement_with_index(3, candidate_hash, session).await; + + let valid_vote2 = + test_state.issue_backing_statement_with_index(4, candidate_hash, session).await; + + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + // Backing vote import should not have accounted to spam slots, so this should succeed + // as well: + virtual_overseer + .send(FromOverseer::Communication { + msg: DisputeCoordinatorMessage::ImportStatements { + candidate_hash, + candidate_receipt: candidate_receipt.clone(), + session, + statements: vec![ + (valid_vote1, ValidatorIndex(3)), + (valid_vote2, ValidatorIndex(4)), + ], + pending_confirmation, + }, + }) + .await; + + // Result should be valid, because our node participated, so spam slots are cleared: + assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport)); + + virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await; + + // No more messages expected: + assert!(virtual_overseer.try_recv().await.is_none()); + + test_state + }) + }); +} + #[test] fn conflicting_votes_lead_to_dispute_participation() { test_harness(|mut test_state, mut virtual_overseer| { @@ -406,14 +915,17 @@ fn conflicting_votes_lead_to_dispute_participation() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(3, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(3, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; - let invalid_vote_2 = - test_state.issue_statement_with_index(2, candidate_hash, session, false).await; + let invalid_vote_2 = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, false) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -510,11 +1022,13 @@ fn positive_votes_dont_trigger_participation() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let valid_vote_2 = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + let valid_vote_2 = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, true) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -615,11 +1129,13 @@ fn wrong_validator_index_is_ignored() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -685,11 +1201,13 @@ fn finality_votes_ignore_disputed_candidates() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -781,11 +1299,13 @@ fn supermajority_valid_dispute_may_be_finalized() { let supermajority_threshold = polkadot_primitives::v1::supermajority_threshold(test_state.validators.len()); - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -807,8 +1327,9 @@ fn supermajority_valid_dispute_may_be_finalized() { let mut statements = Vec::new(); for i in (0..supermajority_threshold - 1).map(|i| i + 3) { - let vote = - test_state.issue_statement_with_index(i, candidate_hash, session, true).await; + let vote = test_state + .issue_explicit_statement_with_index(i, candidate_hash, session, true) + .await; statements.push((vote, ValidatorIndex(i as _))); } @@ -898,11 +1419,13 @@ fn concluded_supermajority_for_non_active_after_time() { let supermajority_threshold = polkadot_primitives::v1::supermajority_threshold(test_state.validators.len()); - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -925,8 +1448,9 @@ fn concluded_supermajority_for_non_active_after_time() { let mut statements = Vec::new(); // -2: 1 for already imported vote and one for local vote (which is valid). for i in (0..supermajority_threshold - 2).map(|i| i + 3) { - let vote = - test_state.issue_statement_with_index(i, candidate_hash, session, true).await; + let vote = test_state + .issue_explicit_statement_with_index(i, candidate_hash, session, true) + .await; statements.push((vote, ValidatorIndex(i as _))); } @@ -993,11 +1517,13 @@ fn concluded_supermajority_against_non_active_after_time() { let supermajority_threshold = polkadot_primitives::v1::supermajority_threshold(test_state.validators.len()); - let valid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, false) + .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1023,8 +1549,9 @@ fn concluded_supermajority_against_non_active_after_time() { let mut statements = Vec::new(); // minus 2, because of local vote and one previously imported invalid vote. for i in (0..supermajority_threshold - 2).map(|i| i + 3) { - let vote = - test_state.issue_statement_with_index(i, candidate_hash, session, false).await; + let vote = test_state + .issue_explicit_statement_with_index(i, candidate_hash, session, false) + .await; statements.push((vote, ValidatorIndex(i as _))); } @@ -1090,11 +1617,13 @@ fn resume_dispute_without_local_statement() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, false) + .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1146,14 +1675,24 @@ fn resume_dispute_without_local_statement() { participation_with_distribution(&mut virtual_overseer, &candidate_hash).await; - let valid_vote0 = - test_state.issue_statement_with_index(0, candidate_hash, session, true).await; - let valid_vote3 = - test_state.issue_statement_with_index(3, candidate_hash, session, true).await; - let valid_vote4 = - test_state.issue_statement_with_index(4, candidate_hash, session, true).await; - let valid_vote5 = - test_state.issue_statement_with_index(5, candidate_hash, session, true).await; + let valid_vote0 = test_state + .issue_explicit_statement_with_index(0, candidate_hash, session, true) + .await; + let valid_vote3 = test_state + .issue_explicit_statement_with_index(3, candidate_hash, session, true) + .await; + let valid_vote4 = test_state + .issue_explicit_statement_with_index(4, candidate_hash, session, true) + .await; + let valid_vote5 = test_state + .issue_explicit_statement_with_index(5, candidate_hash, session, true) + .await; + let valid_vote6 = test_state + .issue_explicit_statement_with_index(6, candidate_hash, session, true) + .await; + let valid_vote7 = test_state + .issue_explicit_statement_with_index(7, candidate_hash, session, true) + .await; let (pending_confirmation, _confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1167,6 +1706,8 @@ fn resume_dispute_without_local_statement() { (valid_vote3, ValidatorIndex(3)), (valid_vote4, ValidatorIndex(4)), (valid_vote5, ValidatorIndex(5)), + (valid_vote6, ValidatorIndex(6)), + (valid_vote7, ValidatorIndex(7)), ], pending_confirmation, }, @@ -1210,14 +1751,17 @@ fn resume_dispute_with_local_statement() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let local_valid_vote = - test_state.issue_statement_with_index(0, candidate_hash, session, true).await; + let local_valid_vote = test_state + .issue_explicit_statement_with_index(0, candidate_hash, session, true) + .await; - let valid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, false) + .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1277,7 +1821,8 @@ fn resume_dispute_with_local_statement() { fn resume_dispute_without_local_statement_or_local_key() { let session = 1; let mut test_state = TestState::default(); - test_state.subsystem_keystore = make_keystore(&[Sr25519Keyring::Two]).into(); + test_state.subsystem_keystore = + make_keystore(vec![Sr25519Keyring::Two.to_seed()].into_iter()).into(); test_state .resume(|mut test_state, mut virtual_overseer| { Box::pin(async move { @@ -1288,11 +1833,13 @@ fn resume_dispute_without_local_statement_or_local_key() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let valid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, false) + .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1364,14 +1911,17 @@ fn resume_dispute_with_local_statement_without_local_key() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; - let local_valid_vote = - test_state.issue_statement_with_index(0, candidate_hash, session, true).await; + let local_valid_vote = test_state + .issue_explicit_statement_with_index(0, candidate_hash, session, true) + .await; - let valid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + let valid_vote = test_state + .issue_explicit_statement_with_index(1, candidate_hash, session, true) + .await; - let invalid_vote = - test_state.issue_statement_with_index(2, candidate_hash, session, false).await; + let invalid_vote = test_state + .issue_explicit_statement_with_index(2, candidate_hash, session, false) + .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); virtual_overseer @@ -1411,7 +1961,8 @@ fn resume_dispute_with_local_statement_without_local_key() { }) }); // No keys: - test_state.subsystem_keystore = make_keystore(&[Sr25519Keyring::Two]).into(); + test_state.subsystem_keystore = + make_keystore(vec![Sr25519Keyring::Two.to_seed()].into_iter()).into(); // Two should not send a DisputeParticiationMessage::Participate on restart since we gave // her a non existing key. test_state.resume(|test_state, mut virtual_overseer| { @@ -1453,7 +2004,7 @@ fn issue_local_statement_does_cause_distribution_but_not_duplicate_participation test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; let other_vote = test_state - .issue_statement_with_index(1, candidate_hash, session, !validity) + .issue_explicit_statement_with_index(1, candidate_hash, session, !validity) .await; let (pending_confirmation, confirmation_rx) = oneshot::channel(); @@ -1606,10 +2157,10 @@ fn redundant_votes_ignored() { test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await; let valid_vote = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + test_state.issue_backing_statement_with_index(1, candidate_hash, session).await; let valid_vote_2 = - test_state.issue_statement_with_index(1, candidate_hash, session, true).await; + test_state.issue_backing_statement_with_index(1, candidate_hash, session).await; assert!(valid_vote.validator_signature() != valid_vote_2.validator_signature()); diff --git a/node/core/parachains-inherent/Cargo.toml b/node/core/parachains-inherent/Cargo.toml index f72e37c216a1..a050d4a6974e 100644 --- a/node/core/parachains-inherent/Cargo.toml +++ b/node/core/parachains-inherent/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "polkadot-node-core-parachains-inherent" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -tracing = "0.1.29" +tracing = "0.1.31" thiserror = "1.0.30" async-trait = "0.1.52" polkadot-node-subsystem = { path = "../../subsystem" } diff --git a/node/core/provisioner/Cargo.toml b/node/core/provisioner/Cargo.toml index ed771185b566..1fbe9f83bef8 100644 --- a/node/core/provisioner/Cargo.toml +++ b/node/core/provisioner/Cargo.toml @@ -1,20 +1,20 @@ [package] name = "polkadot-node-core-provisioner" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" thiserror = "1.0.30" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } futures-timer = "3.0.2" -rand = "0.8.4" +rand = "0.8.5" [dev-dependencies] sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/pvf-checker/Cargo.toml b/node/core/pvf-checker/Cargo.toml index 21b6f6712bd7..efb3b1d2ac0a 100644 --- a/node/core/pvf-checker/Cargo.toml +++ b/node/core/pvf-checker/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "polkadot-node-core-pvf-checker" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" thiserror = "1.0.30" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } diff --git a/node/core/pvf/Cargo.toml b/node/core/pvf/Cargo.toml index b00b8658e58d..ee486b3c66dd 100644 --- a/node/core/pvf/Cargo.toml +++ b/node/core/pvf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-core-pvf" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -16,9 +16,9 @@ assert_matches = "1.4.0" futures = "0.3.21" futures-timer = "3.0.2" slotmap = "1.0" -tracing = "0.1.29" +tracing = "0.1.31" pin-project = "1.0.9" -rand = "0.8.3" +rand = "0.8.5" parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } polkadot-parachain = { path = "../../../parachain" } polkadot-core-primitives = { path = "../../../core-primitives" } diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index 2e6efb4894e8..143d7b5dca9a 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-node-core-runtime-api" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" memory-lru = "0.1.0" parity-util-mem = { version = "0.10.0", default-features = false } diff --git a/node/jaeger/Cargo.toml b/node/jaeger/Cargo.toml index 0ef1a9a1432e..d7a16098c190 100644 --- a/node/jaeger/Cargo.toml +++ b/node/jaeger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-jaeger" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Polkadot Jaeger primitives" diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index 33b77b355028..8b72a4a6feac 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-test-malus" description = "Misbehaving nodes for local testnets, system and Simnet tests." license = "GPL-3.0-only" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" readme = "README.md" @@ -31,7 +31,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste clap = { version = "3.0", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.2" -tracing = "0.1.26" +tracing = "0.1.31" [features] default = [] diff --git a/node/metered-channel/Cargo.toml b/node/metered-channel/Cargo.toml index 661149c3a6c4..2d21321130b7 100644 --- a/node/metered-channel/Cargo.toml +++ b/node/metered-channel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metered-channel" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Channels with attached Meters" @@ -9,7 +9,7 @@ description = "Channels with attached Meters" futures = "0.3.21" futures-timer = "3.0.2" derive_more = "0.99" -tracing = "0.1.29" +tracing = "0.1.31" thiserror = "1.0.30" [dev-dependencies] @@ -17,4 +17,4 @@ futures = { version = "0.3.21", features = ["thread-pool"] } assert_matches = "1.5" env_logger = "0.9" log = "0.4" -tracing = { version = "0.1.29", features = ["log"] } +tracing = { version = "0.1.31", features = ["log"] } diff --git a/node/metrics/Cargo.toml b/node/metrics/Cargo.toml index 60cc09451fad..b41ae13c5386 100644 --- a/node/metrics/Cargo.toml +++ b/node/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-metrics" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Subsystem metric helpers" @@ -8,7 +8,7 @@ description = "Subsystem metric helpers" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -tracing = "0.1.29" +tracing = "0.1.31" metered-channel = { path = "../metered-channel" } @@ -28,7 +28,7 @@ assert_cmd = "2.0.4" nix = "0.23.1" tempfile = "3.2.0" hyper = { version = "0.14.17", default-features = false, features = ["http1", "tcp"] } -tokio = "1.13" +tokio = "1.17.0" 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/approval-distribution/Cargo.toml b/node/network/approval-distribution/Cargo.toml index f5f5ebfe6dc7..83e628663767 100644 --- a/node/network/approval-distribution/Cargo.toml +++ b/node/network/approval-distribution/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-approval-distribution" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -12,7 +12,7 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-primitives = { path = "../../../primitives" } futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" [dev-dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index d1614aa5419a..41e8d4d40195 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-availability-distribution" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" parity-scale-codec = { version = "2.3.1", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } polkadot-erasure-coding = { path = "../../../erasure-coding" } @@ -17,7 +17,7 @@ polkadot-node-primitives = { path = "../../primitives" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.30" -rand = "0.8.3" +rand = "0.8.5" derive_more = "0.99.17" lru = "0.7.2" diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index df6691b466db..70756fefdab8 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "polkadot-availability-recovery" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" lru = "0.7.2" -rand = "0.8.3" +rand = "0.8.5" thiserror = "1.0.30" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-erasure-coding = { path = "../../../erasure-coding" } polkadot-primitives = { path = "../../../primitives" } diff --git a/node/network/bitfield-distribution/Cargo.toml b/node/network/bitfield-distribution/Cargo.toml index c126f498da4e..346a26353cb1 100644 --- a/node/network/bitfield-distribution/Cargo.toml +++ b/node/network/bitfield-distribution/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-availability-bitfield-distribution" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-primitives = { path = "../../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/network/bridge/Cargo.toml b/node/network/bridge/Cargo.toml index 6570fd38ee7c..4062d463b8a7 100644 --- a/node/network/bridge/Cargo.toml +++ b/node/network/bridge/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "polkadot-network-bridge" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] async-trait = "0.1.52" futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-primitives = { path = "../../../primitives" } parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index f385d71431e7..21ec6620cbf4 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-collator-protocol" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -10,7 +10,7 @@ derive_more = "0.99.17" futures = "0.3.21" futures-timer = "3" thiserror = "1.0.30" -tracing = "0.1.29" +tracing = "0.1.31" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/collator-protocol/src/collator_side/mod.rs b/node/network/collator-protocol/src/collator_side/mod.rs index 58d6898bc2ac..6834d6ffa4b7 100644 --- a/node/network/collator-protocol/src/collator_side/mod.rs +++ b/node/network/collator-protocol/src/collator_side/mod.rs @@ -321,14 +321,15 @@ impl State { /// Distribute a collation. /// -/// If the para is not scheduled on any core, at the relay parent, -/// or the relay parent isn't in our view or we already collated on the relay parent, -/// we ignore the message as it must be invalid in that case - -/// although this indicates a logic error elsewhere in the node. -/// -/// Otherwise, start advertising the collation to interested peers. +/// Figure out the core our para is assigned to and the relevant validators. +/// Issue a connection request to these validators. +/// If the para is not scheduled or next up on any core, at the relay-parent, +/// or the relay-parent isn't in the active-leaves set, we ignore the message +/// as it must be invalid in that case - although this indicates a logic error +/// elsewhere in the node. async fn distribute_collation( ctx: &mut Context, + runtime: &mut RuntimeInfo, state: &mut State, id: ParaId, receipt: CandidateReceipt, @@ -357,8 +358,32 @@ where return Ok(()) } - if !state.our_validators_groups.contains_key(&relay_parent) { - tracing::warn!(target: LOG_TARGET, "Could not determine validators assigned to the core."); + // Determine which core the para collated-on is assigned to. + // If it is not scheduled then ignore the message. + let (our_core, num_cores) = match determine_core(ctx, id, relay_parent).await? { + Some(core) => core, + None => { + tracing::warn!( + target: LOG_TARGET, + para_id = %id, + ?relay_parent, + "looks like no core is assigned to {} at {}", id, relay_parent, + ); + + return Ok(()) + }, + }; + + // Determine the group on that core. + let current_validators = + determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; + + if current_validators.validators.is_empty() { + tracing::warn!( + target: LOG_TARGET, + core = ?our_core, + "there are no validators assigned to core", + ); return Ok(()) } @@ -369,9 +394,16 @@ where relay_parent = %relay_parent, candidate_hash = ?receipt.hash(), pov_hash = ?pov.hash(), - "Accepted collation", + core = ?our_core, + ?current_validators, + "Accepted collation, connecting to validators." ); + // Issue a discovery request for the validators of the current group: + connect_to_validators(ctx, current_validators.validators.into_iter().collect()).await; + + state.our_validators_groups.insert(relay_parent, ValidatorGroup::new()); + if let Some(result_sender) = result_sender { state.collation_result_senders.insert(receipt.hash(), result_sender); } @@ -490,7 +522,7 @@ where Context: overseer::SubsystemContext, { // ignore address resolution failure - // will reissue a new request on new relay parent + // will reissue a new request on new collation let (failed, _) = oneshot::channel(); ctx.send_message(NetworkBridgeMessage::ConnectToValidators { validator_ids, @@ -601,7 +633,8 @@ where ); }, Some(id) => { - distribute_collation(ctx, state, id, receipt, pov, result_sender).await?; + distribute_collation(ctx, runtime, state, id, receipt, pov, result_sender) + .await?; }, None => { tracing::warn!( @@ -886,7 +919,7 @@ where }, OurViewChange(view) => { tracing::trace!(target: LOG_TARGET, ?view, "Own view change"); - handle_our_view_change(ctx, runtime, state, view).await?; + handle_our_view_change(state, view).await?; }, PeerMessage(remote, msg) => { handle_incoming_peer_message(ctx, runtime, state, remote, msg).await?; @@ -900,16 +933,7 @@ where } /// Handles our view changes. -async fn handle_our_view_change( - ctx: &mut Context, - runtime: &mut RuntimeInfo, - state: &mut State, - view: OurView, -) -> Result<()> -where - Context: SubsystemContext, - Context: overseer::SubsystemContext, -{ +async fn handle_our_view_change(state: &mut State, view: OurView) -> Result<()> { for removed in state.view.difference(&view) { tracing::debug!(target: LOG_TARGET, relay_parent = ?removed, "Removing relay parent because our view changed."); @@ -943,60 +967,6 @@ where } state.view = view; - if state.view.is_empty() { - return Ok(()) - } - - let id = match state.collating_on { - Some(id) => id, - None => return Ok(()), - }; - - // all validators assigned to the core - // across all active leaves - // this is typically our current group - // but can also include the previous group at - // rotation boundaries and considering forks - let mut group_validators = HashSet::new(); - - for relay_parent in state.view.iter().cloned() { - tracing::debug!( - target: LOG_TARGET, - ?relay_parent, - para_id = ?id, - "Processing relay parent.", - ); - - // Determine our assigned core. - // If it is not scheduled then ignore the relay parent. - let (our_core, num_cores) = match determine_core(ctx, id, relay_parent).await? { - Some(core) => core, - None => continue, - }; - - // Determine the group on that core. - let current_validators = - determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; - - let validators = current_validators.validators; - group_validators.extend(validators); - - state.our_validators_groups.entry(relay_parent).or_insert(ValidatorGroup::new()); - } - - let validators: Vec<_> = group_validators.into_iter().collect(); - let no_one_is_assigned = validators.is_empty(); - if no_one_is_assigned { - tracing::warn!(target: LOG_TARGET, "No validators assigned to our core.",); - return Ok(()) - } - tracing::debug!( - target: LOG_TARGET, - ?validators, - para_id = ?id, - "Connecting to validators.", - ); - connect_to_validators(ctx, validators).await; Ok(()) } diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index 86d5639ad610..526cfab04e19 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -29,7 +29,7 @@ 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, OurView}; +use polkadot_node_network_protocol::{our_view, request_response::IncomingRequest, view}; use polkadot_node_primitives::BlockData; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::{ @@ -172,7 +172,13 @@ impl TestState { our_view![self.relay_parent] }; - set_our_view(virtual_overseer, &self, our_view).await; + overseer_send( + virtual_overseer, + CollatorProtocolMessage::NetworkBridgeUpdateV1(NetworkBridgeEvent::OurViewChange( + our_view, + )), + ) + .await; } } @@ -272,83 +278,13 @@ async fn setup_system(virtual_overseer: &mut VirtualOverseer, test_state: &TestS ) .await; - set_our_view(virtual_overseer, test_state, our_view![test_state.relay_parent]).await; -} - -/// Check our view change triggers the right messages -async fn set_our_view( - virtual_overseer: &mut VirtualOverseer, - test_state: &TestState, - our_view: OurView, -) { overseer_send( virtual_overseer, CollatorProtocolMessage::NetworkBridgeUpdateV1(NetworkBridgeEvent::OurViewChange( - our_view.clone(), + our_view![test_state.relay_parent], )), ) .await; - - for parent in our_view.iter().cloned() { - // obtain the availability cores. - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx) - )) => { - assert_eq!(relay_parent, parent); - tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); - } - ); - - // We don't know precisely what is going to come as session info might be cached: - loop { - match overseer_recv(virtual_overseer).await { - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )) => { - assert_eq!(relay_parent, relay_parent); - tx.send(Ok(test_state.current_session_index())).unwrap(); - }, - - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionInfo(index, tx), - )) => { - assert_eq!(relay_parent, parent); - assert_eq!(index, test_state.current_session_index()); - - tx.send(Ok(Some(test_state.session_info.clone()))).unwrap(); - }, - - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::ValidatorGroups(tx), - )) => { - assert_eq!(relay_parent, parent); - tx.send(Ok(( - test_state.session_info.validator_groups.clone(), - test_state.group_rotation_info.clone(), - ))) - .unwrap(); - // This call is mandatory - we are done: - break - }, - other => panic!("Unexpected message received: {:?}", other), - } - } - } - - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ConnectToValidators { - .. - } - ) => {} - ); } /// Result of [`distribute_collation`] @@ -361,6 +297,8 @@ struct DistributeCollation { async fn distribute_collation( virtual_overseer: &mut VirtualOverseer, test_state: &TestState, + // whether or not we expect a connection request or not. + should_connect: bool, ) -> DistributeCollation { // Now we want to distribute a `PoVBlock` let pov_block = PoV { block_data: BlockData(vec![42, 43, 44]) }; @@ -381,6 +319,67 @@ async fn distribute_collation( ) .await; + // obtain the availability cores. + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx) + )) => { + assert_eq!(relay_parent, test_state.relay_parent); + tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); + } + ); + + // We don't know precisely what is going to come as session info might be cached: + loop { + match overseer_recv(virtual_overseer).await { + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + assert_eq!(relay_parent, test_state.relay_parent); + tx.send(Ok(test_state.current_session_index())).unwrap(); + }, + + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionInfo(index, tx), + )) => { + assert_eq!(relay_parent, test_state.relay_parent); + assert_eq!(index, test_state.current_session_index()); + + tx.send(Ok(Some(test_state.session_info.clone()))).unwrap(); + }, + + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::ValidatorGroups(tx), + )) => { + assert_eq!(relay_parent, test_state.relay_parent); + tx.send(Ok(( + test_state.session_info.validator_groups.clone(), + test_state.group_rotation_info.clone(), + ))) + .unwrap(); + // This call is mandatory - we are done: + break + }, + other => panic!("Unexpected message received: {:?}", other), + } + } + + if should_connect { + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ConnectToValidators { + .. + } + ) => {} + ); + } + DistributeCollation { candidate, pov_block } } @@ -509,7 +508,7 @@ fn advertise_and_send_collation() { setup_system(&mut virtual_overseer, &test_state).await; let DistributeCollation { candidate, pov_block } = - distribute_collation(&mut virtual_overseer, &test_state).await; + distribute_collation(&mut virtual_overseer, &test_state, true).await; for (val, peer) in test_state .current_group_validator_authority_ids() @@ -626,7 +625,7 @@ fn advertise_and_send_collation() { assert!(overseer_recv_with_timeout(&mut virtual_overseer, TIMEOUT).await.is_none()); - distribute_collation(&mut virtual_overseer, &test_state).await; + distribute_collation(&mut virtual_overseer, &test_state, true).await; // Send info about peer's view. overseer_send( @@ -714,7 +713,7 @@ fn collations_are_only_advertised_to_validators_with_correct_view() { // And let it tell us that it is has the same view. send_peer_view_change(virtual_overseer, &peer2, vec![test_state.relay_parent]).await; - distribute_collation(virtual_overseer, &test_state).await; + distribute_collation(virtual_overseer, &test_state, true).await; expect_advertise_collation_msg(virtual_overseer, &peer2, test_state.relay_parent).await; @@ -753,14 +752,14 @@ fn collate_on_two_different_relay_chain_blocks() { expect_declare_msg(virtual_overseer, &test_state, &peer).await; expect_declare_msg(virtual_overseer, &test_state, &peer2).await; - distribute_collation(virtual_overseer, &test_state).await; + distribute_collation(virtual_overseer, &test_state, true).await; let old_relay_parent = test_state.relay_parent; // Advance to a new round, while informing the subsystem that the old and the new relay parent are active. test_state.advance_to_new_round(virtual_overseer, true).await; - distribute_collation(virtual_overseer, &test_state).await; + distribute_collation(virtual_overseer, &test_state, true).await; send_peer_view_change(virtual_overseer, &peer, vec![old_relay_parent]).await; expect_advertise_collation_msg(virtual_overseer, &peer, old_relay_parent).await; @@ -790,7 +789,7 @@ fn validator_reconnect_does_not_advertise_a_second_time() { connect_peer(virtual_overseer, peer.clone(), Some(validator_id.clone())).await; expect_declare_msg(virtual_overseer, &test_state, &peer).await; - distribute_collation(virtual_overseer, &test_state).await; + distribute_collation(virtual_overseer, &test_state, true).await; send_peer_view_change(virtual_overseer, &peer, vec![test_state.relay_parent]).await; expect_advertise_collation_msg(virtual_overseer, &peer, test_state.relay_parent).await; @@ -875,7 +874,7 @@ where setup_system(virtual_overseer, &test_state).await; let DistributeCollation { candidate, pov_block } = - distribute_collation(virtual_overseer, &test_state).await; + distribute_collation(virtual_overseer, &test_state, true).await; for (val, peer) in test_state .current_group_validator_authority_ids() diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 769b1448690b..0aa53156e759 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -58,7 +58,7 @@ pub struct CollatorEvictionPolicy { impl Default for CollatorEvictionPolicy { fn default() -> Self { CollatorEvictionPolicy { - inactive_collator: Duration::from_secs(5), + inactive_collator: Duration::from_secs(24), undeclared: Duration::from_secs(1), } } diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index 5a504437c8d3..7c2f0436d6da 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "polkadot-dispute-distribution" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" derive_more = "0.99.17" parity-scale-codec = { version = "2.3.1", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } diff --git a/node/network/gossip-support/Cargo.toml b/node/network/gossip-support/Cargo.toml index 0e7693fc37f0..221f6de7bd2b 100644 --- a/node/network/gossip-support/Cargo.toml +++ b/node/network/gossip-support/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-gossip-support" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -17,9 +17,9 @@ polkadot-primitives = { path = "../../../primitives" } futures = "0.3.21" futures-timer = "3.0.2" -rand = { version = "0.8.3", default-features = false } +rand = { version = "0.8.5", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } -tracing = "0.1.29" +tracing = "0.1.31" [dev-dependencies] sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/protocol/Cargo.toml b/node/network/protocol/Cargo.toml index 32dfb046f118..a1bc6ac1f257 100644 --- a/node/network/protocol/Cargo.toml +++ b/node/network/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-network-protocol" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Primitives types for the Node-side" diff --git a/node/network/statement-distribution/Cargo.toml b/node/network/statement-distribution/Cargo.toml index 5366eecf0de6..4a3a06a25a96 100644 --- a/node/network/statement-distribution/Cargo.toml +++ b/node/network/statement-distribution/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "polkadot-statement-distribution" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Statement Distribution Subsystem" edition = "2018" [dependencies] futures = "0.3.21" -tracing = "0.1.29" +tracing = "0.1.31" polkadot-primitives = { path = "../../../primitives" } sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/statement-distribution/src/lib.rs b/node/network/statement-distribution/src/lib.rs index 2c522a340a2a..db1c022a94b5 100644 --- a/node/network/statement-distribution/src/lib.rs +++ b/node/network/statement-distribution/src/lib.rs @@ -77,6 +77,13 @@ use responder::{respond, ResponderMessage}; mod tests; const COST_UNEXPECTED_STATEMENT: Rep = Rep::CostMinor("Unexpected Statement"); +const COST_UNEXPECTED_STATEMENT_MISSING_KNOWLEDGE: Rep = + Rep::CostMinor("Unexpected Statement, missing knowlege for relay parent"); +const COST_UNEXPECTED_STATEMENT_UNKNOWN_CANDIDATE: Rep = + Rep::CostMinor("Unexpected Statement, unknown candidate"); +const COST_UNEXPECTED_STATEMENT_REMOTE: Rep = + Rep::CostMinor("Unexpected Statement, remote not allowed"); + const COST_FETCH_FAIL: Rep = Rep::CostMinor("Requesting `CommittedCandidateReceipt` from peer failed"); const COST_INVALID_SIGNATURE: Rep = Rep::CostMajor("Invalid Statement Signature"); @@ -320,14 +327,14 @@ impl PeerRelayParentKnowledge { .note_remote(h.clone()); if !allowed_remote { - return Err(COST_UNEXPECTED_STATEMENT) + return Err(COST_UNEXPECTED_STATEMENT_REMOTE) } h }, CompactStatement::Valid(ref h) => { if !self.is_known_candidate(&h) { - return Err(COST_UNEXPECTED_STATEMENT) + return Err(COST_UNEXPECTED_STATEMENT_UNKNOWN_CANDIDATE) } h @@ -380,14 +387,14 @@ impl PeerRelayParentKnowledge { .map_or(true, |r| r.is_wanted_candidate(h)); if !allowed_remote { - return Err(COST_UNEXPECTED_STATEMENT) + return Err(COST_UNEXPECTED_STATEMENT_REMOTE) } h }, CompactStatement::Valid(ref h) => { if !self.is_known_candidate(&h) { - return Err(COST_UNEXPECTED_STATEMENT) + return Err(COST_UNEXPECTED_STATEMENT_UNKNOWN_CANDIDATE) } h @@ -476,7 +483,7 @@ impl PeerData { ) -> std::result::Result { self.view_knowledge .get_mut(relay_parent) - .ok_or(COST_UNEXPECTED_STATEMENT)? + .ok_or(COST_UNEXPECTED_STATEMENT_MISSING_KNOWLEDGE)? .receive(fingerprint, max_message_count) } @@ -491,7 +498,7 @@ impl PeerData { ) -> std::result::Result<(), Rep> { self.view_knowledge .get(relay_parent) - .ok_or(COST_UNEXPECTED_STATEMENT)? + .ok_or(COST_UNEXPECTED_STATEMENT_MISSING_KNOWLEDGE)? .check_can_receive(fingerprint, max_message_count) } @@ -499,7 +506,7 @@ impl PeerData { fn receive_large_statement(&mut self, relay_parent: &Hash) -> std::result::Result<(), Rep> { self.view_knowledge .get_mut(relay_parent) - .ok_or(COST_UNEXPECTED_STATEMENT)? + .ok_or(COST_UNEXPECTED_STATEMENT_MISSING_KNOWLEDGE)? .receive_large_statement() } } @@ -1325,6 +1332,7 @@ async fn handle_incoming_message<'a>( if let Err(rep) = peer_data.check_can_receive(&relay_parent, &fingerprint, max_message_count) { tracing::debug!( target: LOG_TARGET, + ?relay_parent, ?peer, ?message, ?rep, diff --git a/node/network/statement-distribution/src/tests.rs b/node/network/statement-distribution/src/tests.rs index 4146416b0c2b..1858eb8c09a3 100644 --- a/node/network/statement-distribution/src/tests.rs +++ b/node/network/statement-distribution/src/tests.rs @@ -273,11 +273,11 @@ fn per_peer_relay_parent_knowledge_receive() { assert_eq!( knowledge.check_can_receive(&(CompactStatement::Valid(hash_a), ValidatorIndex(0)), 3), - Err(COST_UNEXPECTED_STATEMENT), + Err(COST_UNEXPECTED_STATEMENT_UNKNOWN_CANDIDATE), ); assert_eq!( knowledge.receive(&(CompactStatement::Valid(hash_a), ValidatorIndex(0)), 3), - Err(COST_UNEXPECTED_STATEMENT), + Err(COST_UNEXPECTED_STATEMENT_UNKNOWN_CANDIDATE), ); assert!(knowledge @@ -336,11 +336,11 @@ fn per_peer_relay_parent_knowledge_receive() { assert_eq!( knowledge.check_can_receive(&(CompactStatement::Seconded(hash_c), ValidatorIndex(0)), 3), - Err(COST_UNEXPECTED_STATEMENT), + Err(COST_UNEXPECTED_STATEMENT_REMOTE), ); assert_eq!( knowledge.receive(&(CompactStatement::Seconded(hash_c), ValidatorIndex(0)), 3), - Err(COST_UNEXPECTED_STATEMENT), + Err(COST_UNEXPECTED_STATEMENT_REMOTE), ); // Last, make sure that already-known statements are disregarded. diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index ad70c6c3426e..4392b6997d6f 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-overseer" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -16,7 +16,7 @@ polkadot-node-subsystem-types = { path = "../subsystem-types" } polkadot-node-metrics = { path = "../metrics" } polkadot-primitives = { path = "../../primitives" } polkadot-overseer-gen = { path = "./overseer-gen" } -tracing = "0.1.29" +tracing = "0.1.31" lru = "0.7" parity-util-mem = { version = ">= 0.10.1", default-features = false } diff --git a/node/overseer/overseer-gen/Cargo.toml b/node/overseer/overseer-gen/Cargo.toml index 543e984fea18..916fb9477bd7 100644 --- a/node/overseer/overseer-gen/Cargo.toml +++ b/node/overseer/overseer-gen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-overseer-gen" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Generate an overseer including builder pattern and message wrapper from a single struct." diff --git a/node/overseer/overseer-gen/proc-macro/Cargo.toml b/node/overseer/overseer-gen/proc-macro/Cargo.toml index fc1a796854a4..9da80cc291ce 100644 --- a/node/overseer/overseer-gen/proc-macro/Cargo.toml +++ b/node/overseer/overseer-gen/proc-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-overseer-gen-proc-macro" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Generate an overseer including builder pattern and message wrapper from a single annotated struct definition." @@ -15,7 +15,7 @@ proc-macro = true syn = { version = "1.0.86", features = ["full", "extra-traits"] } quote = "1.0.15" proc-macro2 = "1.0.36" -proc-macro-crate = "1.1.0" +proc-macro-crate = "1.1.2" [dev-dependencies] assert_matches = "1.5.0" diff --git a/node/primitives/Cargo.toml b/node/primitives/Cargo.toml index 3d06f789af76..96af76f07c4d 100644 --- a/node/primitives/Cargo.toml +++ b/node/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-primitives" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Primitives types for the Node-side" diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 784c98d6385e..b06b59339e8b 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-service" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -63,7 +63,7 @@ prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https: # External Crates futures = "0.3.21" hex-literal = "0.3.4" -tracing = "0.1.29" +tracing = "0.1.31" serde = { version = "1.0.136", features = ["derive"] } thiserror = "1.0.30" kvdb = "0.10.0" diff --git a/node/subsystem-test-helpers/Cargo.toml b/node/subsystem-test-helpers/Cargo.toml index 386c208e2d80..5a5408bc5984 100644 --- a/node/subsystem-test-helpers/Cargo.toml +++ b/node/subsystem-test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-subsystem-test-helpers" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Subsystem traits and message definitions" diff --git a/node/subsystem-types/Cargo.toml b/node/subsystem-types/Cargo.toml index b97f23a3e1d9..a0e6586c3fd5 100644 --- a/node/subsystem-types/Cargo.toml +++ b/node/subsystem-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-subsystem-types" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Subsystem traits and message definitions" @@ -15,6 +15,6 @@ polkadot-statement-table = { path = "../../statement-table" } polkadot-node-jaeger = { path = "../jaeger" } polkadot-overseer-gen = { path = "../overseer/overseer-gen" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } -smallvec = "1.6.1" +smallvec = "1.8.0" substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.30" diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 4081e051ae59..7b2596a5ac25 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-subsystem-util" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Subsystem traits and message definitions" @@ -11,9 +11,9 @@ futures = "0.3.21" itertools = "0.10" parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } pin-project = "1.0.9" -rand = "0.8.3" +rand = "0.8.5" thiserror = "1.0.30" -tracing = "0.1.29" +tracing = "0.1.31" derive_more = "0.99.17" lru = "0.7.2" diff --git a/node/subsystem/Cargo.toml b/node/subsystem/Cargo.toml index 5fb2ba14e64b..1dc1e208b87f 100644 --- a/node/subsystem/Cargo.toml +++ b/node/subsystem/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-node-subsystem" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" description = "Subsystem traits and message definitions and the generated overseer" diff --git a/node/test/client/Cargo.toml b/node/test/client/Cargo.toml index 7d1f5133832d..e8f404ed870c 100644 --- a/node/test/client/Cargo.toml +++ b/node/test/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-test-client" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index a6c5064bcff8..bd5a5be241d3 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-performance-test" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/node/test/service/Cargo.toml b/node/test/service/Cargo.toml index 9556b4157585..526d02bb6216 100644 --- a/node/test/service/Cargo.toml +++ b/node/test/service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-test-service" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -8,10 +8,10 @@ edition = "2018" futures = "0.3.21" futures01 = { package = "futures", version = "0.1.29" } hex = "0.4.3" -tracing = "0.1.29" -rand = "0.8.3" +tracing = "0.1.31" +rand = "0.8.5" tempfile = "3.2.0" -tokio = "1.15.0" +tokio = "1.17.0" # Polkadot dependencies polkadot-overseer = { path = "../../overseer" } @@ -59,9 +59,9 @@ substrate-test-client = { git = "https://github.com/paritytech/substrate", branc [dev-dependencies] pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -serde_json = "1.0.78" +serde_json = "1.0.79" substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio = { version = "1.15", features = ["macros"] } +tokio = { version = "1.17.0", features = ["macros"] } [features] runtime-metrics=["polkadot-test-runtime/runtime-metrics"] diff --git a/node/zombienet-backchannel/Cargo.toml b/node/zombienet-backchannel/Cargo.toml index cc8d73672ca9..e5ff851d1335 100644 --- a/node/zombienet-backchannel/Cargo.toml +++ b/node/zombienet-backchannel/Cargo.toml @@ -2,14 +2,14 @@ name = "zombienet-backchannel" description = "Zombienet backchannel to notify test runner and coordinate with malus actors." license = "GPL-3.0-only" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" readme = "README.md" publish = false [dependencies] -tokio = { version = "1.0.0", default-features = false, features = ["macros", "net", "rt-multi-thread", "sync"] } +tokio = { version = "1.17.0", default-features = false, features = ["macros", "net", "rt-multi-thread", "sync"] } url = "2.0.0" tokio-tungstenite = "0.16" futures-util = "0.3.21" @@ -17,6 +17,6 @@ lazy_static = "1.4.0" parity-scale-codec = { version = "2.3.1", features = ["derive"] } reqwest = "0.11" thiserror = "1.0.30" -tracing = "0.1.26" +tracing = "0.1.31" serde = { version = "1.0", features = ["derive"] } serde_json = "1" diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index d9cf8fac7e02..1cf1801f4a24 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-parachain" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Types and utilities for creating and working with parachains" edition = "2018" diff --git a/parachain/test-parachains/Cargo.toml b/parachain/test-parachains/Cargo.toml index 36a9236796bf..fc769e898dfb 100644 --- a/parachain/test-parachains/Cargo.toml +++ b/parachain/test-parachains/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-parachains" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Integration tests using the test-parachains" edition = "2018" diff --git a/parachain/test-parachains/adder/Cargo.toml b/parachain/test-parachains/adder/Cargo.toml index 872a8c6dd582..781c27893584 100644 --- a/parachain/test-parachains/adder/Cargo.toml +++ b/parachain/test-parachains/adder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-parachain-adder" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Test parachain which adds to a number as its state transition" edition = "2018" diff --git a/parachain/test-parachains/adder/collator/Cargo.toml b/parachain/test-parachains/adder/collator/Cargo.toml index cb4d066e99de..8f593b0ad91a 100644 --- a/parachain/test-parachains/adder/collator/Cargo.toml +++ b/parachain/test-parachains/adder/collator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-parachain-adder-collator" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Collator for the adder test parachain" edition = "2018" @@ -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.15", features = ["macros"] } +tokio = { version = "1.17.0", features = ["macros"] } diff --git a/parachain/test-parachains/halt/Cargo.toml b/parachain/test-parachains/halt/Cargo.toml index 80db7b78de95..a79f1773c7ef 100644 --- a/parachain/test-parachains/halt/Cargo.toml +++ b/parachain/test-parachains/halt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-parachain-halt" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Test parachain which executes forever" edition = "2018" diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index c750a0774a47..faf41737c0f9 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-primitives" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/primitives/test-helpers/Cargo.toml b/primitives/test-helpers/Cargo.toml index 27eb8eb8b05f..61005169a87c 100644 --- a/primitives/test-helpers/Cargo.toml +++ b/primitives/test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-primitives-test-helpers" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 5496ee8126bd..28ca97b49608 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-rpc" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index e5a216865f1c..ab32e1c172de 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -155,7 +155,6 @@ where client, shared_authority_set, shared_epoch_changes, - deny_unsafe, )?)); let handler: beefy_gadget_rpc::BeefyRpcHandler = beefy_gadget_rpc::BeefyRpcHandler::new( diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 2ff396983c74..da760b960c87 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-runtime-common" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -58,7 +58,7 @@ pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "maste pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } trie-db = "0.23.1" -serde_json = "1.0.78" +serde_json = "1.0.79" libsecp256k1 = "0.7.0" test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../primitives/test-helpers" } diff --git a/runtime/common/slot_range_helper/Cargo.toml b/runtime/common/slot_range_helper/Cargo.toml index e36cb78fe25a..d728f7f7b1f4 100644 --- a/runtime/common/slot_range_helper/Cargo.toml +++ b/runtime/common/slot_range_helper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "slot-range-helper" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/runtime/common/src/crowdloan/migration.rs b/runtime/common/src/crowdloan/migration.rs new file mode 100644 index 000000000000..478471454f39 --- /dev/null +++ b/runtime/common/src/crowdloan/migration.rs @@ -0,0 +1,130 @@ +// Copyright 2017-2020 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 . + +use super::*; +use frame_support::generate_storage_alias; + +/// Migrations for using fund index to create fund accounts instead of para ID. +pub mod crowdloan_index_migration { + use super::*; + + // The old way we generated fund accounts. + fn old_fund_account_id(index: ParaId) -> T::AccountId { + T::PalletId::get().into_sub_account(index) + } + + pub fn pre_migrate() -> Result<(), &'static str> { + // `NextTrieIndex` should have a value. + generate_storage_alias!(Crowdloan, NextTrieIndex => Value); + let next_index = NextTrieIndex::get().unwrap_or_default(); + ensure!(next_index > 0, "Next index is zero, which implies no migration is needed."); + + log::info!( + target: "runtime", + "next trie index: {:?}", + next_index, + ); + + // Each fund should have some non-zero balance. + for (para_id, fund) in Funds::::iter() { + let old_fund_account = old_fund_account_id::(para_id); + let total_balance = CurrencyOf::::total_balance(&old_fund_account); + + log::info!( + target: "runtime", + "para_id={:?}, old_fund_account={:?}, total_balance={:?}, fund.raised={:?}", + para_id, old_fund_account, total_balance, fund.raised + ); + + ensure!( + total_balance >= fund.raised, + "Total balance is not equal to the funds raised." + ); + ensure!(total_balance > Zero::zero(), "Total balance is equal to zero."); + } + + Ok(()) + } + + /// This migration converts crowdloans to use a crowdloan index rather than the parachain id as a + /// unique identifier. This makes it easier to swap two crowdloans between parachains. + pub fn migrate() -> frame_support::weights::Weight { + let mut weight = 0; + + // First migrate `NextTrieIndex` counter to `NextFundIndex`. + generate_storage_alias!(Crowdloan, NextTrieIndex => Value); + + let next_index = NextTrieIndex::take().unwrap_or_default(); + NextFundIndex::::set(next_index); + + weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 2)); + + // Migrate all accounts from `old_fund_account` to `fund_account` using `fund_index`. + for (para_id, fund) in Funds::::iter() { + let old_fund_account = old_fund_account_id::(para_id); + let new_fund_account = Pallet::::fund_account_id(fund.fund_index); + + // Funds should only have a free balance and a reserve balance. Both of these are in the + // `Account` storage item, so we just swap them. + let account_info = frame_system::Account::::take(old_fund_account); + frame_system::Account::::insert(new_fund_account, account_info); + + weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 2)); + } + + weight + } + + pub fn post_migrate() -> Result<(), &'static str> { + // `NextTrieIndex` should not have a value, and `NextFundIndex` should. + generate_storage_alias!(Crowdloan, NextTrieIndex => Value); + ensure!(NextTrieIndex::get().is_none(), "NextTrieIndex still has a value."); + + let next_index = NextFundIndex::::get(); + log::info!( + target: "runtime", + "next fund index: {:?}", + next_index, + ); + + ensure!( + next_index > 0, + "NextFundIndex was not migrated or is zero. We assume it cannot be zero else no migration is needed." + ); + + // Each fund should have balance migrated correctly. + for (para_id, fund) in Funds::::iter() { + // Old fund account is deleted. + let old_fund_account = old_fund_account_id::(para_id); + ensure!( + frame_system::Account::::get(&old_fund_account) == Default::default(), + "Old account wasn't reset to default value." + ); + + // New fund account has the correct balance. + let new_fund_account = Pallet::::fund_account_id(fund.fund_index); + let total_balance = CurrencyOf::::total_balance(&new_fund_account); + + ensure!( + total_balance >= fund.raised, + "Total balance in new account is different than the funds raised." + ); + ensure!(total_balance > Zero::zero(), "Total balance in the account is zero."); + } + + Ok(()) + } +} diff --git a/runtime/common/src/crowdloan.rs b/runtime/common/src/crowdloan/mod.rs similarity index 96% rename from runtime/common/src/crowdloan.rs rename to runtime/common/src/crowdloan/mod.rs index 84b1be08f7ef..44d45e6ec790 100644 --- a/runtime/common/src/crowdloan.rs +++ b/runtime/common/src/crowdloan/mod.rs @@ -49,6 +49,8 @@ //! the parachain remains active. Users can withdraw their funds once the slot is completed and funds are //! returned to the crowdloan account. +pub mod migration; + use crate::{ slot_range::SlotRange, traits::{Auctioneer, Registrar}, @@ -87,7 +89,7 @@ type BalanceOf = as Currency<::Acco type NegativeImbalanceOf = as Currency<::AccountId>>::NegativeImbalance; -type TrieIndex = u32; +type FundIndex = u32; pub trait WeightInfo { fn create() -> Weight; @@ -145,33 +147,33 @@ pub enum LastContribution { #[codec(dumb_trait_bound)] pub struct FundInfo { /// The owning account who placed the deposit. - depositor: AccountId, + pub depositor: AccountId, /// An optional verifier. If exists, contributions must be signed by verifier. - verifier: Option, + pub verifier: Option, /// The amount of deposit placed. - deposit: Balance, + pub deposit: Balance, /// The total amount raised. - raised: Balance, + pub raised: Balance, /// Block number after which the funding must have succeeded. If not successful at this number /// then everyone may withdraw their funds. - end: BlockNumber, + pub end: BlockNumber, /// A hard-cap on the amount that may be contributed. - cap: Balance, + pub cap: Balance, /// The most recent block that this had a contribution. Determines if we make a bid or not. /// If this is `Never`, this fund has never received a contribution. /// If this is `PreEnding(n)`, this fund received a contribution sometime in auction /// number `n` before the ending period. /// If this is `Ending(n)`, this fund received a contribution during the current ending period, /// where `n` is how far into the ending period the contribution was made. - last_contribution: LastContribution, + pub last_contribution: LastContribution, /// First lease period in range to bid on; it's actually a `LeasePeriod`, but that's the same type /// as `BlockNumber`. - first_period: LeasePeriod, + pub first_period: LeasePeriod, /// Last lease period in range to bid on; it's actually a `LeasePeriod`, but that's the same type /// as `BlockNumber`. - last_period: LeasePeriod, - /// Index used for the child trie of this fund - trie_index: TrieIndex, + pub last_period: LeasePeriod, + /// Unique index used to represent this fund. + pub fund_index: FundIndex, } #[frame_support::pallet] @@ -244,10 +246,10 @@ pub mod pallet { #[pallet::getter(fn endings_count)] pub(super) type EndingsCount = StorageValue<_, u32, ValueQuery>; - /// Tracker for the next available trie index + /// Tracker for the next available fund index #[pallet::storage] - #[pallet::getter(fn next_trie_index)] - pub(super) type NextTrieIndex = StorageValue<_, u32, ValueQuery>; + #[pallet::getter(fn next_fund_index)] + pub(super) type NextFundIndex = StorageValue<_, u32, ValueQuery>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -342,7 +344,7 @@ pub mod pallet { // Care needs to be taken by the crowdloan creator that this function will succeed given // the crowdloaning configuration. We do some checks ahead of time in crowdloan `create`. let result = T::Auctioneer::place_bid( - Self::fund_account_id(para_id), + Self::fund_account_id(fund.fund_index), para_id, fund.first_period, fund.last_period, @@ -408,8 +410,8 @@ pub mod pallet { ensure!(depositor == manager, Error::::InvalidOrigin); ensure!(T::Registrar::is_registered(index), Error::::InvalidParaId); - let trie_index = Self::next_trie_index(); - let new_trie_index = trie_index.checked_add(1).ok_or(Error::::Overflow)?; + let fund_index = Self::next_fund_index(); + let new_fund_index = fund_index.checked_add(1).ok_or(Error::::Overflow)?; let deposit = T::SubmissionDeposit::get(); @@ -427,11 +429,11 @@ pub mod pallet { last_contribution: LastContribution::Never, first_period, last_period, - trie_index, + fund_index, }, ); - NextTrieIndex::::put(new_trie_index); + NextFundIndex::::put(new_fund_index); // Add a lock to the para so that the configuration cannot be changed. T::Registrar::apply_lock(index); @@ -479,15 +481,15 @@ pub mod pallet { let mut fund = Self::funds(index).ok_or(Error::::InvalidParaId)?; let now = frame_system::Pallet::::block_number(); - let fund_account = Self::fund_account_id(index); + let fund_account = Self::fund_account_id(fund.fund_index); Self::ensure_crowdloan_ended(now, &fund_account, &fund)?; - let (balance, _) = Self::contribution_get(fund.trie_index, &who); + let (balance, _) = Self::contribution_get(fund.fund_index, &who); ensure!(balance > Zero::zero(), Error::::NoContributions); CurrencyOf::::transfer(&fund_account, &who, balance, AllowDeath)?; - Self::contribution_kill(fund.trie_index, &who); + Self::contribution_kill(fund.fund_index, &who); fund.raised = fund.raised.saturating_sub(balance); Funds::::insert(index, &fund); @@ -510,12 +512,12 @@ pub mod pallet { let mut fund = Self::funds(index).ok_or(Error::::InvalidParaId)?; let now = frame_system::Pallet::::block_number(); - let fund_account = Self::fund_account_id(index); + let fund_account = Self::fund_account_id(fund.fund_index); Self::ensure_crowdloan_ended(now, &fund_account, &fund)?; let mut refund_count = 0u32; // Try killing the crowdloan child trie - let contributions = Self::contribution_iterator(fund.trie_index); + let contributions = Self::contribution_iterator(fund.fund_index); // Assume everyone will be refunded. let mut all_refunded = true; for (who, (balance, _)) in contributions { @@ -525,7 +527,7 @@ pub mod pallet { break } CurrencyOf::::transfer(&fund_account, &who, balance, AllowDeath)?; - Self::contribution_kill(fund.trie_index, &who); + Self::contribution_kill(fund.fund_index, &who); fund.raised = fund.raised.saturating_sub(balance); refund_count += 1; } @@ -561,7 +563,7 @@ pub mod pallet { // Assuming state is not corrupted, the child trie should already be cleaned up // and all funds in the crowdloan account have been returned. If not, governance // can take care of that. - debug_assert!(Self::contribution_iterator(fund.trie_index).count().is_zero()); + debug_assert!(Self::contribution_iterator(fund.fund_index).count().is_zero()); CurrencyOf::::unreserve(&fund.depositor, fund.deposit); Funds::::remove(index); @@ -598,7 +600,7 @@ pub mod pallet { last_contribution: fund.last_contribution, first_period, last_period, - trie_index: fund.trie_index, + fund_index: fund.fund_index, }, ); @@ -616,10 +618,10 @@ pub mod pallet { ensure!(memo.len() <= T::MaxMemoLength::get().into(), Error::::MemoTooLarge); let fund = Self::funds(index).ok_or(Error::::InvalidParaId)?; - let (balance, _) = Self::contribution_get(fund.trie_index, &who); + let (balance, _) = Self::contribution_get(fund.fund_index, &who); ensure!(balance > Zero::zero(), Error::::NoContributions); - Self::contribution_put(fund.trie_index, &who, &balance, &memo); + Self::contribution_put(fund.fund_index, &who, &balance, &memo); Self::deposit_event(Event::::MemoUpdated(who, index, memo)); Ok(()) } @@ -658,11 +660,11 @@ impl Pallet { /// /// This actually does computation. If you need to keep using it, then make sure you cache the /// value and only call this once. - pub fn fund_account_id(index: ParaId) -> T::AccountId { + pub fn fund_account_id(index: FundIndex) -> T::AccountId { T::PalletId::get().into_sub_account(index) } - pub fn id_from_index(index: TrieIndex) -> child::ChildInfo { + pub fn id_from_index(index: FundIndex) -> child::ChildInfo { let mut buf = Vec::new(); buf.extend_from_slice(b"crowdloan"); buf.extend_from_slice(&index.encode()[..]); @@ -670,7 +672,7 @@ impl Pallet { } pub fn contribution_put( - index: TrieIndex, + index: FundIndex, who: &T::AccountId, balance: &BalanceOf, memo: &[u8], @@ -678,22 +680,22 @@ impl Pallet { who.using_encoded(|b| child::put(&Self::id_from_index(index), b, &(balance, memo))); } - pub fn contribution_get(index: TrieIndex, who: &T::AccountId) -> (BalanceOf, Vec) { + pub fn contribution_get(index: FundIndex, who: &T::AccountId) -> (BalanceOf, Vec) { who.using_encoded(|b| { child::get_or_default::<(BalanceOf, Vec)>(&Self::id_from_index(index), b) }) } - pub fn contribution_kill(index: TrieIndex, who: &T::AccountId) { + pub fn contribution_kill(index: FundIndex, who: &T::AccountId) { who.using_encoded(|b| child::kill(&Self::id_from_index(index), b)); } - pub fn crowdloan_kill(index: TrieIndex) -> child::KillStorageResult { + pub fn crowdloan_kill(index: FundIndex) -> child::KillStorageResult { child::kill_storage(&Self::id_from_index(index), Some(T::RemoveKeysLimit::get())) } pub fn contribution_iterator( - index: TrieIndex, + index: FundIndex, ) -> ChildTriePrefixIterator<(T::AccountId, (BalanceOf, Vec))> { ChildTriePrefixIterator::<_>::with_prefix_over_key::( &Self::id_from_index(index), @@ -752,7 +754,7 @@ impl Pallet { ensure!(current_lease_period <= fund.first_period, Error::::ContributionPeriodOver); // Make sure crowdloan has not already won. - let fund_account = Self::fund_account_id(index); + let fund_account = Self::fund_account_id(fund.fund_index); ensure!( !T::Auctioneer::has_won_an_auction(index, &fund_account), Error::::BidOrLeaseActive @@ -762,7 +764,7 @@ impl Pallet { // contributions into the auction when it would not impact the outcome. ensure!(!T::Auctioneer::auction_status(now).is_vrf(), Error::::VrfDelayInProgress); - let (old_balance, memo) = Self::contribution_get(fund.trie_index, &who); + let (old_balance, memo) = Self::contribution_get(fund.fund_index, &who); if let Some(ref verifier) = fund.verifier { let signature = signature.ok_or(Error::::InvalidSignature)?; @@ -776,7 +778,7 @@ impl Pallet { CurrencyOf::::transfer(&who, &fund_account, value, existence)?; let balance = old_balance.saturating_add(value); - Self::contribution_put(fund.trie_index, &who, &balance, &memo); + Self::contribution_put(fund.fund_index, &who, &balance, &memo); if T::Auctioneer::auction_status(now).is_ending().is_some() { match fund.last_contribution { @@ -966,7 +968,8 @@ mod tests { // Emulate what would happen if we won an auction: // balance is reserved and a deposit_held is recorded fn set_winner(para: ParaId, who: u64, winner: bool) { - let account_id = Crowdloan::fund_account_id(para); + let fund = Funds::::get(para).unwrap(); + let account_id = Crowdloan::fund_account_id(fund.fund_index); if winner { let free_balance = Balances::free_balance(&account_id); Balances::reserve(&account_id, free_balance) @@ -1177,7 +1180,7 @@ mod tests { last_contribution: LastContribution::Never, first_period: 1, last_period: 4, - trie_index: 0, + fund_index: 0, }; assert_eq!(Crowdloan::funds(para), Some(fund_info)); // User has deposit removed from their free balance @@ -1217,7 +1220,7 @@ mod tests { last_contribution: LastContribution::Never, first_period: 1, last_period: 4, - trie_index: 0, + fund_index: 0, }; assert_eq!(Crowdloan::funds(ParaId::from(0)), Some(fund_info)); // User has deposit removed from their free balance @@ -1270,6 +1273,7 @@ mod tests { fn contribute_works() { new_test_ext().execute_with(|| { let para = new_para(); + let index = NextFundIndex::::get(); // Set up a crowdloan assert_ok!(Crowdloan::create(Origin::signed(1), para, 1000, 1, 4, 9, None)); @@ -1284,7 +1288,7 @@ mod tests { // Contributions are stored in the trie assert_eq!(Crowdloan::contribution_get(u32::from(para), &1).0, 49); // Contributions appear in free balance of crowdloan - assert_eq!(Balances::free_balance(Crowdloan::fund_account_id(para)), 49); + assert_eq!(Balances::free_balance(Crowdloan::fund_account_id(index)), 49); // Crowdloan is added to NewRaise assert_eq!(Crowdloan::new_raise(), vec![para]); @@ -1300,6 +1304,7 @@ mod tests { fn contribute_with_verifier_works() { new_test_ext().execute_with(|| { let para = new_para(); + let index = NextFundIndex::::get(); let pubkey = crypto::create_ed25519_pubkey(b"//verifier".to_vec()); // Set up a crowdloan assert_ok!(Crowdloan::create( @@ -1364,7 +1369,7 @@ mod tests { assert_ok!(Crowdloan::contribute(Origin::signed(1), para, 10, Some(valid_signature_2))); // Contributions appear in free balance of crowdloan - assert_eq!(Balances::free_balance(Crowdloan::fund_account_id(para)), 59); + assert_eq!(Balances::free_balance(Crowdloan::fund_account_id(index)), 59); // Contribution amount is correct let fund = Crowdloan::funds(para).unwrap(); @@ -1409,9 +1414,10 @@ mod tests { // If a crowdloan has already won, it should not allow contributions. let para_2 = new_para(); + let index = NextFundIndex::::get(); assert_ok!(Crowdloan::create(Origin::signed(1), para_2, 1000, 1, 4, 40, None)); // Emulate a win by leasing out and putting a deposit. Slots pallet would normally do this. - let crowdloan_account = Crowdloan::fund_account_id(para_2); + let crowdloan_account = Crowdloan::fund_account_id(index); set_winner(para_2, crowdloan_account, true); assert_noop!( Crowdloan::contribute(Origin::signed(1), para_2, 49, None), @@ -1478,6 +1484,7 @@ mod tests { fn bidding_works() { new_test_ext().execute_with(|| { let para = new_para(); + let index = NextFundIndex::::get(); let first_period = 1; let last_period = 4; @@ -1493,7 +1500,7 @@ mod tests { 9, None )); - let bidder = Crowdloan::fund_account_id(para); + let bidder = Crowdloan::fund_account_id(index); // Fund crowdloan run_to_block(1); @@ -1524,6 +1531,7 @@ mod tests { fn withdraw_from_failed_works() { new_test_ext().execute_with(|| { let para = new_para(); + let index = NextFundIndex::::get(); // Set up a crowdloan assert_ok!(Crowdloan::create(Origin::signed(1), para, 1000, 1, 1, 9, None)); @@ -1531,7 +1539,7 @@ mod tests { assert_ok!(Crowdloan::contribute(Origin::signed(3), para, 50, None)); run_to_block(10); - let account_id = Crowdloan::fund_account_id(para); + let account_id = Crowdloan::fund_account_id(index); // para has no reserved funds, indicating it did not win the auction. assert_eq!(Balances::reserved_balance(&account_id), 0); // but there's still the funds in its balance. @@ -1553,13 +1561,14 @@ mod tests { fn withdraw_cannot_be_griefed() { new_test_ext().execute_with(|| { let para = new_para(); + let index = NextFundIndex::::get(); // Set up a crowdloan assert_ok!(Crowdloan::create(Origin::signed(1), para, 1000, 1, 1, 9, None)); assert_ok!(Crowdloan::contribute(Origin::signed(2), para, 100, None)); run_to_block(10); - let account_id = Crowdloan::fund_account_id(para); + let account_id = Crowdloan::fund_account_id(index); // user sends the crowdloan funds trying to make an accounting error assert_ok!(Balances::transfer(Origin::signed(1), account_id, 10)); @@ -1583,7 +1592,8 @@ mod tests { fn refund_works() { new_test_ext().execute_with(|| { let para = new_para(); - let account_id = Crowdloan::fund_account_id(para); + let index = NextFundIndex::::get(); + let account_id = Crowdloan::fund_account_id(index); // Set up a crowdloan ending on 9 assert_ok!(Crowdloan::create(Origin::signed(1), para, 1000, 1, 1, 9, None)); @@ -1617,7 +1627,8 @@ mod tests { fn multiple_refund_works() { new_test_ext().execute_with(|| { let para = new_para(); - let account_id = Crowdloan::fund_account_id(para); + let index = NextFundIndex::::get(); + let account_id = Crowdloan::fund_account_id(index); // Set up a crowdloan ending on 9 assert_ok!(Crowdloan::create(Origin::signed(1), para, 100000, 1, 1, 9, None)); @@ -1727,7 +1738,8 @@ mod tests { fn withdraw_from_finished_works() { new_test_ext().execute_with(|| { let para = new_para(); - let account_id = Crowdloan::fund_account_id(para); + let index = NextFundIndex::::get(); + let account_id = Crowdloan::fund_account_id(index); // Set up a crowdloan assert_ok!(Crowdloan::create(Origin::signed(1), para, 1000, 1, 1, 9, None)); @@ -2079,7 +2091,7 @@ mod benchmarking { verify { let fund = Funds::::get(fund_index).expect("fund was created..."); assert_eq!( - Crowdloan::::contribution_get(fund.trie_index, &caller), + Crowdloan::::contribution_get(fund.fund_index, &caller), (T::MinContribution::get(), worst_memo), ); } diff --git a/runtime/common/src/integration_tests.rs b/runtime/common/src/integration_tests.rs index 370073fa4de0..7032c6badc82 100644 --- a/runtime/common/src/integration_tests.rs +++ b/runtime/common/src/integration_tests.rs @@ -20,7 +20,7 @@ use crate::{ auctions, crowdloan, paras_registrar, slot_range::SlotRange, slots, - traits::{AuctionStatus, Auctioneer, Registrar as RegistrarT}, + traits::{AuctionStatus, Auctioneer, Leaser, Registrar as RegistrarT}, }; use frame_support::{ assert_noop, assert_ok, parameter_types, @@ -29,6 +29,7 @@ use frame_support::{ }; use frame_support_test::TestRandomness; use frame_system::EnsureRoot; +use parity_scale_codec::Encode; use primitives::v1::{ BlockNumber, HeadData, Header, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID, }; @@ -41,16 +42,29 @@ use sp_keystore::{testing::KeyStore, KeystoreExt}; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup, One}, transaction_validity::TransactionPriority, + AccountId32, }; -use sp_std::sync::Arc; +use sp_std::{convert::TryInto, sync::Arc}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; -type AccountId = u32; +type AccountId = AccountId32; type Balance = u32; type Moment = u32; +fn account_id(i: u32) -> AccountId32 { + let b4 = i.encode(); + let b32 = [&b4[..], &b4[..], &b4[..], &b4[..], &b4[..], &b4[..], &b4[..], &b4[..]].concat(); + let array: [u8; 32] = b32.try_into().unwrap(); + array.into() +} + +fn signed(i: u32) -> Origin { + let account_id = account_id(i); + Origin::signed(account_id) +} + frame_support::construct_runtime!( pub enum Test where Block = Block, @@ -342,21 +356,21 @@ fn basic_end_to_end_works() { let para_2 = LOWEST_PUBLIC_ID + 1; assert!(System::block_number().is_one()); // User 1 and 2 will own parachains - Balances::make_free_balance_be(&1, 1_000_000_000); - Balances::make_free_balance_be(&2, 1_000_000_000); + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); // First register 2 parathreads let genesis_head = Registrar::worst_head_data(); let validation_code = Registrar::worst_validation_code(); - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(para_1), genesis_head.clone(), validation_code.clone(), )); - assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::reserve(signed(2))); assert_ok!(Registrar::register( - Origin::signed(2), + signed(2), ParaId::from(2001), genesis_head, validation_code, @@ -379,7 +393,7 @@ fn basic_end_to_end_works() { // Para 1 will bid directly for slot 1, 2 // Open a crowdloan for Para 2 for slot 3, 4 assert_ok!(Crowdloan::create( - Origin::signed(2), + signed(2), ParaId::from(para_2), 1_000, // Cap lease_period_index_start + 2, // First Slot @@ -387,17 +401,18 @@ fn basic_end_to_end_works() { 200 + offset, // Block End None, )); - let crowdloan_account = Crowdloan::fund_account_id(ParaId::from(para_2)); + let fund_2 = Crowdloan::funds(ParaId::from(para_2)).unwrap(); + let crowdloan_account = Crowdloan::fund_account_id(fund_2.fund_index); // Auction ending begins on block 100 + offset, so we make a bid before then. run_to_block(90 + offset); - Balances::make_free_balance_be(&10, 1_000_000_000); - Balances::make_free_balance_be(&20, 1_000_000_000); + Balances::make_free_balance_be(&account_id(10), 1_000_000_000); + Balances::make_free_balance_be(&account_id(20), 1_000_000_000); // User 10 will bid directly for parachain 1 assert_ok!(Auctions::bid( - Origin::signed(10), + signed(10), ParaId::from(para_1), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -406,8 +421,8 @@ fn basic_end_to_end_works() { )); // User 2 will be a contribute to crowdloan for parachain 2 - Balances::make_free_balance_be(&2, 1_000_000_000); - assert_ok!(Crowdloan::contribute(Origin::signed(2), ParaId::from(para_2), 920, None)); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(2), ParaId::from(para_2), 920, None)); // Auction ends at block 110 + offset run_to_block(109 + offset); @@ -421,7 +436,7 @@ fn basic_end_to_end_works() { assert_eq!( slots::Leases::::get(ParaId::from(para_1)), // -- 1 --- 2 --- 3 --------- 4 ------------ 5 -------- - vec![None, None, None, Some((10, 910)), Some((10, 910))], + vec![None, None, None, Some((account_id(10), 910)), Some((account_id(10), 910))], ); assert_eq!( slots::Leases::::get(ParaId::from(para_2)), @@ -432,15 +447,15 @@ fn basic_end_to_end_works() { None, None, None, - Some((crowdloan_account, 920)), - Some((crowdloan_account, 920)) + Some((crowdloan_account.clone(), 920)), + Some((crowdloan_account.clone(), 920)) ], ); // Should not be able to contribute to a winning crowdloan - Balances::make_free_balance_be(&3, 1_000_000_000); + Balances::make_free_balance_be(&account_id(3), 1_000_000_000); assert_noop!( - Crowdloan::contribute(Origin::signed(3), ParaId::from(2001), 10, None), + Crowdloan::contribute(signed(3), ParaId::from(2001), 10, None), CrowdloanError::::BidOrLeaseActive ); @@ -508,21 +523,21 @@ fn basic_errors_fail() { assert!(System::block_number().is_one()); let para_id = LOWEST_PUBLIC_ID; // Can't double register - Balances::make_free_balance_be(&1, 1_000_000_000); - Balances::make_free_balance_be(&2, 1_000_000_000); + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); let genesis_head = Registrar::worst_head_data(); let validation_code = Registrar::worst_validation_code(); - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), para_id, genesis_head.clone(), validation_code.clone(), )); - assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::reserve(signed(2))); assert_noop!( - Registrar::register(Origin::signed(2), para_id, genesis_head, validation_code,), + Registrar::register(signed(2), para_id, genesis_head, validation_code,), paras_registrar::Error::::NotOwner ); @@ -534,7 +549,7 @@ fn basic_errors_fail() { // Cannot create a crowdloan if you do not own the para assert_noop!( Crowdloan::create( - Origin::signed(2), + signed(2), para_id, 1_000, // Cap lease_period_index_start + 2, // First Slot @@ -557,12 +572,12 @@ fn competing_slots() { // Create n paras and owners for n in 1..=max_bids { - Balances::make_free_balance_be(&n, 1_000_000_000); + Balances::make_free_balance_be(&account_id(n), 1_000_000_000); let genesis_head = Registrar::worst_head_data(); let validation_code = Registrar::worst_validation_code(); - assert_ok!(Registrar::reserve(Origin::signed(n))); + assert_ok!(Registrar::reserve(signed(n))); assert_ok!(Registrar::register( - Origin::signed(n), + signed(n), para_id + n - 1, genesis_head, validation_code, @@ -581,7 +596,7 @@ fn competing_slots() { // Increment block number run_to_block(System::block_number() + 10); - Balances::make_free_balance_be(&(n * 10), n * 1_000); + Balances::make_free_balance_be(&account_id(n * 10), n * 1_000); let (start, end) = match n { 1 => (0, 0), @@ -599,7 +614,7 @@ fn competing_slots() { // Users will bid directly for parachain assert_ok!(Auctions::bid( - Origin::signed(n * 10), + signed(n * 10), para_id + n - 1, 1, // Auction Index lease_period_index_start + start, // First Slot @@ -617,18 +632,26 @@ fn competing_slots() { assert_eq!( slots::Leases::::get(para_id), // -- 1 --- 2 --- 3 ---------- 4 ------ - vec![None, None, None, Some((10, 900))], + vec![None, None, None, Some((account_id(10), 900))], ); assert_eq!( slots::Leases::::get(para_id + 4), // -- 1 --- 2 --- 3 --- 4 ---------- 5 ------- - vec![None, None, None, None, Some((50, 4500))], + vec![None, None, None, None, Some((account_id(50), 4500))], ); // TODO: Is this right? assert_eq!( slots::Leases::::get(para_id + 8), // -- 1 --- 2 --- 3 --- 4 --- 5 ---------- 6 --------------- 7 ------- - vec![None, None, None, None, None, Some((90, 8100)), Some((90, 8100))], + vec![ + None, + None, + None, + None, + None, + Some((account_id(90), 8100)), + Some((account_id(90), 8100)) + ], ); }); } @@ -642,12 +665,12 @@ fn competing_bids() { let start_para = LOWEST_PUBLIC_ID - 1; // Create 3 paras and owners for n in 1..=3 { - Balances::make_free_balance_be(&n, 1_000_000_000); + Balances::make_free_balance_be(&account_id(n), 1_000_000_000); let genesis_head = Registrar::worst_head_data(); let validation_code = Registrar::worst_validation_code(); - assert_ok!(Registrar::reserve(Origin::signed(n))); + assert_ok!(Registrar::reserve(signed(n))); assert_ok!(Registrar::register( - Origin::signed(n), + signed(n), ParaId::from(start_para + n), genesis_head, validation_code, @@ -666,7 +689,7 @@ fn competing_bids() { for n in 1..=3 { // Create a crowdloan for each para assert_ok!(Crowdloan::create( - Origin::signed(n), + signed(n), ParaId::from(start_para + n), 100_000, // Cap lease_period_index_start + 2, // First Slot @@ -680,14 +703,14 @@ fn competing_bids() { // Increment block number run_to_block(starting_block + n * 10); - Balances::make_free_balance_be(&(n * 10), n * 1_000); + Balances::make_free_balance_be(&account_id(n * 10), n * 1_000); let para = start_para + n % 3 + 1; if n % 2 == 0 { // User 10 will bid directly for parachain 1 assert_ok!(Auctions::bid( - Origin::signed(n * 10), + signed(n * 10), ParaId::from(para), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -697,7 +720,7 @@ fn competing_bids() { } else { // User 20 will be a contribute to crowdloan for parachain 2 assert_ok!(Crowdloan::contribute( - Origin::signed(n * 10), + signed(n * 10), ParaId::from(para), n + 900, None, @@ -709,7 +732,8 @@ fn competing_bids() { run_to_block(starting_block + 110); // Appropriate Paras should have won slots - let crowdloan_2 = Crowdloan::fund_account_id(ParaId::from(2001)); + let fund_1 = Crowdloan::funds(ParaId::from(2000)).unwrap(); + let crowdloan_1 = Crowdloan::fund_account_id(fund_1.fund_index); assert_eq!( slots::Leases::::get(ParaId::from(2000)), // -- 1 --- 2 --- 3 --- 4 --- 5 ------------- 6 ------------------------ 7 ------------- @@ -719,14 +743,14 @@ fn competing_bids() { None, None, None, - Some((crowdloan_2, 1812)), - Some((crowdloan_2, 1812)) + Some((crowdloan_1.clone(), 1812)), + Some((crowdloan_1.clone(), 1812)) ], ); assert_eq!( slots::Leases::::get(ParaId::from(2002)), // -- 1 --- 2 --- 3 ---------- 4 --------------- 5 ------- - vec![None, None, None, Some((80, 7200)), Some((80, 7200))], + vec![None, None, None, Some((account_id(80), 7200)), Some((account_id(80), 7200))], ); }); } @@ -735,21 +759,21 @@ fn competing_bids() { fn basic_swap_works() { // This test will test a swap between a parachain and parathread works successfully. new_test_ext().execute_with(|| { - assert!(System::block_number().is_one()); // So events are emitted - // User 1 and 2 will own paras - Balances::make_free_balance_be(&1, 1_000_000_000); - Balances::make_free_balance_be(&2, 1_000_000_000); + assert!(System::block_number().is_one()); /* So events are emitted */ + // User 1 and 2 will own paras + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); // First register 2 parathreads with different data - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(2000), test_genesis_head(10), test_validation_code(10), )); - assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::reserve(signed(2))); assert_ok!(Registrar::register( - Origin::signed(2), + signed(2), ParaId::from(2001), test_genesis_head(20), test_validation_code(20), @@ -771,7 +795,7 @@ fn basic_swap_works() { // Open a crowdloan for Para 1 for slots 0-3 assert_ok!(Crowdloan::create( - Origin::signed(1), + signed(1), ParaId::from(2000), 1_000_000, // Cap lease_period_index_start + 0, // First Slot @@ -779,13 +803,14 @@ fn basic_swap_works() { 200, // Block End None, )); - let crowdloan_account = Crowdloan::fund_account_id(ParaId::from(2000)); + let fund = Crowdloan::funds(ParaId::from(2000)).unwrap(); + let crowdloan_account = Crowdloan::fund_account_id(fund.fund_index); // Bunch of contributions let mut total = 0; for i in 10..20 { - Balances::make_free_balance_be(&i, 1_000_000_000); - assert_ok!(Crowdloan::contribute(Origin::signed(i), ParaId::from(2000), 900 - i, None)); + Balances::make_free_balance_be(&account_id(i), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(i), ParaId::from(2000), 900 - i, None)); total += 900 - i; } assert!(total > 0); @@ -796,8 +821,8 @@ fn basic_swap_works() { // Deposit is appropriately taken // ----------------------------------------- para deposit --- crowdloan - assert_eq!(Balances::reserved_balance(&1), (500 + 10 * 2 * 1) + 100); - assert_eq!(Balances::reserved_balance(&2), 500 + 20 * 2 * 1); + assert_eq!(Balances::reserved_balance(&account_id(1)), (500 + 10 * 2 * 1) + 100); + assert_eq!(Balances::reserved_balance(&account_id(2)), 500 + 20 * 2 * 1); assert_eq!(Balances::reserved_balance(&crowdloan_account), total); // Crowdloan is appropriately set assert!(Crowdloan::funds(ParaId::from(2000)).is_some()); @@ -839,8 +864,8 @@ fn basic_swap_works() { // Deregister parathread assert_ok!(Registrar::deregister(para_origin(2000).into(), ParaId::from(2000))); // Correct deposit is unreserved - assert_eq!(Balances::reserved_balance(&1), 100); // crowdloan deposit left over - assert_eq!(Balances::reserved_balance(&2), 500 + 20 * 2 * 1); + assert_eq!(Balances::reserved_balance(&account_id(1)), 100); // crowdloan deposit left over + assert_eq!(Balances::reserved_balance(&account_id(2)), 500 + 20 * 2 * 1); // Crowdloan ownership is swapped assert!(Crowdloan::funds(ParaId::from(2000)).is_none()); assert!(Crowdloan::funds(ParaId::from(2001)).is_some()); @@ -850,11 +875,11 @@ fn basic_swap_works() { // Cant dissolve assert_noop!( - Crowdloan::dissolve(Origin::signed(1), ParaId::from(2000)), + Crowdloan::dissolve(signed(1), ParaId::from(2000)), CrowdloanError::::InvalidParaId ); assert_noop!( - Crowdloan::dissolve(Origin::signed(2), ParaId::from(2001)), + Crowdloan::dissolve(signed(2), ParaId::from(2001)), CrowdloanError::::NotReadyToDissolve ); @@ -864,39 +889,198 @@ fn basic_swap_works() { // Withdraw of contributions works assert_eq!(Balances::free_balance(&crowdloan_account), total); for i in 10..20 { - assert_ok!(Crowdloan::withdraw(Origin::signed(i), i, ParaId::from(2001))); + assert_ok!(Crowdloan::withdraw(signed(i), account_id(i), ParaId::from(2001))); } assert_eq!(Balances::free_balance(&crowdloan_account), 0); // Dissolve returns the balance of the person who put a deposit for crowdloan - assert_ok!(Crowdloan::dissolve(Origin::signed(1), ParaId::from(2001))); - assert_eq!(Balances::reserved_balance(&1), 0); - assert_eq!(Balances::reserved_balance(&2), 500 + 20 * 2 * 1); + assert_ok!(Crowdloan::dissolve(signed(1), ParaId::from(2001))); + assert_eq!(Balances::reserved_balance(&account_id(1)), 0); + assert_eq!(Balances::reserved_balance(&account_id(2)), 500 + 20 * 2 * 1); // Final deregister sets everything back to the start assert_ok!(Registrar::deregister(para_origin(2001).into(), ParaId::from(2001))); - assert_eq!(Balances::reserved_balance(&2), 0); + assert_eq!(Balances::reserved_balance(&account_id(2)), 0); + }) +} + +#[test] +fn parachain_swap_works() { + // This test will test a swap between two parachains works successfully. + new_test_ext().execute_with(|| { + assert!(System::block_number().is_one()); /* So events are emitted */ + // User 1 and 2 will own paras + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); + // First register 2 parathreads with different data + assert_ok!(Registrar::reserve(signed(1))); + assert_ok!(Registrar::register( + signed(1), + ParaId::from(2000), + test_genesis_head(10), + test_validation_code(10), + )); + assert_ok!(Registrar::reserve(signed(2))); + assert_ok!(Registrar::register( + signed(2), + ParaId::from(2001), + test_genesis_head(20), + test_validation_code(20), + )); + + // Paras should be onboarding + assert_eq!(Paras::lifecycle(ParaId::from(2000)), Some(ParaLifecycle::Onboarding)); + assert_eq!(Paras::lifecycle(ParaId::from(2001)), Some(ParaLifecycle::Onboarding)); + + assert_eq!( + Balances::total_balance(&Crowdloan::fund_account_id(Crowdloan::next_fund_index())), + 0 + ); + + // Start a new auction in the future + let start_auction = |lease_period_index_start, winner, end| { + let unique_id = winner - 1999u32; + let starting_block = System::block_number(); + let duration = 99u32; + assert_ok!(Auctions::new_auction(Origin::root(), duration, lease_period_index_start)); + + // 2 sessions later they are parathreads + run_to_block(starting_block + 20); + assert_eq!(Paras::lifecycle(ParaId::from(winner)), Some(ParaLifecycle::Parathread)); + + // Open a crowdloan for Para 1 for slots 0-3 + assert_ok!(Crowdloan::create( + signed(unique_id), + ParaId::from(winner), + 1_000_000, // Cap + lease_period_index_start + 0, // First Slot + lease_period_index_start + 7, // Last Slot + end, // Block End + None, + )); + let winner_fund = Crowdloan::funds(ParaId::from(winner)).unwrap(); + let crowdloan_account = Crowdloan::fund_account_id(winner_fund.fund_index); + + // Bunch of contributions + let mut total = 0; + for i in (unique_id * 10)..(unique_id + 1) * 10 { + Balances::make_free_balance_be(&account_id(i), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(i), ParaId::from(winner), 900 - i, None)); + total += 900 - i; + } + assert!(total > 0); + assert_eq!(Balances::free_balance(&crowdloan_account), total); + + // Go to end of auction where everyone won their slots + run_to_block(end); + + // Crowdloan is appropriately set + assert!(Crowdloan::funds(ParaId::from(winner)).is_some()); + + // New leases will start on block lease period index * 100 + let lease_start_block = lease_period_index_start * 100; + run_to_block(lease_start_block); + }; + + start_auction(4u32, 2000, 200); + // Slots are won by Para 1 + assert!(!Slots::lease(ParaId::from(2000)).is_empty()); + assert!(Slots::lease(ParaId::from(2001)).is_empty()); + + // 2 sessions later it is a parachain + run_to_block(4 * 100 + 20); + assert_eq!(Paras::lifecycle(ParaId::from(2000)), Some(ParaLifecycle::Parachain)); + assert_eq!(Paras::lifecycle(ParaId::from(2001)), Some(ParaLifecycle::Parathread)); + + // Let's repeat the process now for another parachain. + start_auction(6u32, 2001, 500); + // Slots are won by Para 1 + assert!(!Slots::lease(ParaId::from(2000)).is_empty()); + assert!(!Slots::lease(ParaId::from(2001)).is_empty()); + + // 2 sessions later it is a parachain + run_to_block(6 * 100 + 20); + assert_eq!(Paras::lifecycle(ParaId::from(2000)), Some(ParaLifecycle::Parachain)); + assert_eq!(Paras::lifecycle(ParaId::from(2001)), Some(ParaLifecycle::Parachain)); + + // Currently we are on lease 6 + assert_eq!( + >::lease_period_index(System::block_number()), + Some((6u32, false)) + ); + + // This means that parachain 1 should only have 6 slots left, and parachain 2 has all 8. + assert_eq!(slots::Leases::::get(ParaId::from(2000)).len(), 6); + assert_eq!(slots::Leases::::get(ParaId::from(2001)).len(), 8); + + let fund_2000 = Crowdloan::funds(ParaId::from(2000)).unwrap(); + assert_eq!(fund_2000.fund_index, 0); + assert_eq!( + Balances::reserved_balance(&Crowdloan::fund_account_id(fund_2000.fund_index)), + fund_2000.raised + ); + + let fund_2001 = Crowdloan::funds(ParaId::from(2001)).unwrap(); + assert_eq!(fund_2001.fund_index, 1); + assert_eq!( + Balances::reserved_balance(&Crowdloan::fund_account_id(fund_2001.fund_index)), + fund_2001.raised + ); + + assert_eq!(Slots::lease(ParaId::from(2000)).len(), 6); + assert_eq!(Slots::lease(ParaId::from(2001)).len(), 8); + + // Now we swap them. + assert_ok!(Registrar::swap( + para_origin(2000).into(), + ParaId::from(2000), + ParaId::from(2001) + )); + assert_ok!(Registrar::swap( + para_origin(2001).into(), + ParaId::from(2001), + ParaId::from(2000) + )); + + // Crowdloan Swapped + let fund_2000 = Crowdloan::funds(ParaId::from(2000)).unwrap(); + assert_eq!(fund_2000.fund_index, 1); + assert_eq!( + Balances::reserved_balance(&Crowdloan::fund_account_id(fund_2000.fund_index)), + fund_2000.raised + ); + + let fund_2001 = Crowdloan::funds(ParaId::from(2001)).unwrap(); + assert_eq!(fund_2001.fund_index, 0); + assert_eq!( + Balances::reserved_balance(&Crowdloan::fund_account_id(fund_2001.fund_index)), + fund_2001.raised + ); + + // Slots Swapped + assert_eq!(Slots::lease(ParaId::from(2000)).len(), 8); + assert_eq!(Slots::lease(ParaId::from(2001)).len(), 6); }) } #[test] fn crowdloan_ending_period_bid() { new_test_ext().execute_with(|| { - assert!(System::block_number().is_one()); // So events are emitted - // User 1 and 2 will own paras - Balances::make_free_balance_be(&1, 1_000_000_000); - Balances::make_free_balance_be(&2, 1_000_000_000); + assert!(System::block_number().is_one()); /* So events are emitted */ + // User 1 and 2 will own paras + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); // First register 2 parathreads - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(2000), test_genesis_head(10), test_validation_code(10), )); - assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::reserve(signed(2))); assert_ok!(Registrar::register( - Origin::signed(2), + signed(2), ParaId::from(2001), test_genesis_head(20), test_validation_code(20), @@ -918,7 +1102,7 @@ fn crowdloan_ending_period_bid() { // Open a crowdloan for Para 1 for slots 0-3 assert_ok!(Crowdloan::create( - Origin::signed(1), + signed(1), ParaId::from(2000), 1_000_000, // Cap lease_period_index_start + 0, // First Slot @@ -926,22 +1110,23 @@ fn crowdloan_ending_period_bid() { 200, // Block End None, )); - let crowdloan_account = Crowdloan::fund_account_id(ParaId::from(2000)); + let fund = Crowdloan::funds(ParaId::from(2000)).unwrap(); + let crowdloan_account = Crowdloan::fund_account_id(fund.fund_index); // Bunch of contributions let mut total = 0; for i in 10..20 { - Balances::make_free_balance_be(&i, 1_000_000_000); - assert_ok!(Crowdloan::contribute(Origin::signed(i), ParaId::from(2000), 900 - i, None)); + Balances::make_free_balance_be(&account_id(i), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(i), ParaId::from(2000), 900 - i, None)); total += 900 - i; } assert!(total > 0); assert_eq!(Balances::free_balance(&crowdloan_account), total); // Bid for para 2 directly - Balances::make_free_balance_be(&2, 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); assert_ok!(Auctions::bid( - Origin::signed(2), + signed(2), ParaId::from(2001), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -953,24 +1138,25 @@ fn crowdloan_ending_period_bid() { run_to_block(100); assert_eq!(Auctions::auction_status(100), AuctionStatus::::EndingPeriod(0, 0)); - let mut winning = [None; SlotRange::SLOT_RANGE_COUNT]; - winning[SlotRange::ZeroOne as u8 as usize] = Some((2, ParaId::from(2001), 900)); + let mut winning = [(); SlotRange::SLOT_RANGE_COUNT].map(|_| None); + + winning[SlotRange::ZeroOne as u8 as usize] = Some((account_id(2), ParaId::from(2001), 900)); winning[SlotRange::ZeroThree as u8 as usize] = - Some((crowdloan_account, ParaId::from(2000), total)); + Some((crowdloan_account.clone(), ParaId::from(2000), total)); assert_eq!(Auctions::winning(0), Some(winning)); run_to_block(101); - Balances::make_free_balance_be(&1234, 1_000_000_000); - assert_ok!(Crowdloan::contribute(Origin::signed(1234), ParaId::from(2000), 900, None)); + Balances::make_free_balance_be(&account_id(1234), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(1234), ParaId::from(2000), 900, None)); // Data propagates correctly run_to_block(102); - let mut winning = [None; SlotRange::SLOT_RANGE_COUNT]; - winning[SlotRange::ZeroOne as u8 as usize] = Some((2, ParaId::from(2001), 900)); + let mut winning = [(); SlotRange::SLOT_RANGE_COUNT].map(|_| None); + winning[SlotRange::ZeroOne as u8 as usize] = Some((account_id(2), ParaId::from(2001), 900)); winning[SlotRange::ZeroThree as u8 as usize] = - Some((crowdloan_account, ParaId::from(2000), total + 900)); + Some((crowdloan_account.clone(), ParaId::from(2000), total + 900)); assert_eq!(Auctions::winning(2), Some(winning)); }) } @@ -978,7 +1164,7 @@ fn crowdloan_ending_period_bid() { #[test] fn auction_bid_requires_registered_para() { new_test_ext().execute_with(|| { - assert!(System::block_number().is_one()); // So events are emitted + assert!(System::block_number().is_one()); /* So events are emitted */ // Start a new auction in the future let duration = 99u32; @@ -986,10 +1172,10 @@ fn auction_bid_requires_registered_para() { assert_ok!(Auctions::new_auction(Origin::root(), duration, lease_period_index_start)); // Can't bid with non-registered paras - Balances::make_free_balance_be(&1, 1_000_000_000); + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); assert_noop!( Auctions::bid( - Origin::signed(1), + signed(1), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -1000,9 +1186,9 @@ fn auction_bid_requires_registered_para() { ); // Now we register the para - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(2000), test_genesis_head(10), test_validation_code(10), @@ -1011,7 +1197,7 @@ fn auction_bid_requires_registered_para() { // Still can't bid until it is fully onboarded assert_noop!( Auctions::bid( - Origin::signed(1), + signed(1), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -1025,9 +1211,9 @@ fn auction_bid_requires_registered_para() { run_to_session(2); // Success - Balances::make_free_balance_be(&1, 1_000_000_000); + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); assert_ok!(Auctions::bid( - Origin::signed(1), + signed(1), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -1040,26 +1226,26 @@ fn auction_bid_requires_registered_para() { #[test] fn gap_bids_work() { new_test_ext().execute_with(|| { - assert!(System::block_number().is_one()); // So events are emitted + assert!(System::block_number().is_one()); /* So events are emitted */ // Start a new auction in the future let duration = 99u32; let lease_period_index_start = 4u32; assert_ok!(Auctions::new_auction(Origin::root(), duration, lease_period_index_start)); - Balances::make_free_balance_be(&1, 1_000_000_000); - Balances::make_free_balance_be(&2, 1_000_000_000); + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); + Balances::make_free_balance_be(&account_id(2), 1_000_000_000); // Now register 2 paras - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(2000), test_genesis_head(10), test_validation_code(10), )); - assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::reserve(signed(2))); assert_ok!(Registrar::register( - Origin::signed(2), + signed(2), ParaId::from(2001), test_genesis_head(10), test_validation_code(10), @@ -1069,11 +1255,11 @@ fn gap_bids_work() { run_to_session(2); // Make bids - Balances::make_free_balance_be(&10, 1_000_000_000); - Balances::make_free_balance_be(&20, 1_000_000_000); + Balances::make_free_balance_be(&account_id(10), 1_000_000_000); + Balances::make_free_balance_be(&account_id(20), 1_000_000_000); // Slot 1 for 100 from 10 assert_ok!(Auctions::bid( - Origin::signed(10), + signed(10), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 0, // First Slot @@ -1082,7 +1268,7 @@ fn gap_bids_work() { )); // Slot 4 for 400 from 10 assert_ok!(Auctions::bid( - Origin::signed(10), + signed(10), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 3, // First Slot @@ -1092,18 +1278,18 @@ fn gap_bids_work() { // A bid for another para is counted separately. assert_ok!(Auctions::bid( - Origin::signed(10), + signed(10), ParaId::from(2001), 1, // Auction Index lease_period_index_start + 1, // First Slot lease_period_index_start + 1, // Last slot 555, // Amount )); - assert_eq!(Balances::reserved_balance(&10), 400 + 555); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400 + 555); // Slot 2 for 800 from 20, overtaking 10's bid assert_ok!(Auctions::bid( - Origin::signed(20), + signed(20), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 1, // First Slot @@ -1112,7 +1298,7 @@ fn gap_bids_work() { )); // Slot 3 for 200 from 20 assert_ok!(Auctions::bid( - Origin::signed(20), + signed(20), ParaId::from(2000), 1, // Auction Index lease_period_index_start + 2, // First Slot @@ -1131,16 +1317,16 @@ fn gap_bids_work() { None, None, None, - Some((10, 100)), - Some((20, 800)), - Some((20, 200)), - Some((10, 400)) + Some((account_id(10), 100)), + Some((account_id(20), 800)), + Some((account_id(20), 200)), + Some((account_id(10), 400)) ], ); // Appropriate amount is reserved (largest of the values) - assert_eq!(Balances::reserved_balance(&10), 400); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400); // Appropriate amount is reserved (largest of the values) - assert_eq!(Balances::reserved_balance(&20), 800); + assert_eq!(Balances::reserved_balance(&account_id(20)), 800); // Progress through the leases and note the correct amount of balance is reserved. @@ -1148,48 +1334,57 @@ fn gap_bids_work() { assert_eq!( slots::Leases::::get(ParaId::from(2000)), // --------- 4 -------------- 5 -------------- 6 -------------- 7 ------- - vec![Some((10, 100)), Some((20, 800)), Some((20, 200)), Some((10, 400))], + vec![ + Some((account_id(10), 100)), + Some((account_id(20), 800)), + Some((account_id(20), 200)), + Some((account_id(10), 400)) + ], ); // Nothing changed. - assert_eq!(Balances::reserved_balance(&10), 400); - assert_eq!(Balances::reserved_balance(&20), 800); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400); + assert_eq!(Balances::reserved_balance(&account_id(20)), 800); // Lease period 4 is done, but nothing is unreserved since user 1 has a debt on lease 7 run_to_block(500); assert_eq!( slots::Leases::::get(ParaId::from(2000)), // --------- 5 -------------- 6 -------------- 7 ------- - vec![Some((20, 800)), Some((20, 200)), Some((10, 400))], + vec![ + Some((account_id(20), 800)), + Some((account_id(20), 200)), + Some((account_id(10), 400)) + ], ); // Nothing changed. - assert_eq!(Balances::reserved_balance(&10), 400); - assert_eq!(Balances::reserved_balance(&20), 800); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400); + assert_eq!(Balances::reserved_balance(&account_id(20)), 800); // Lease period 5 is done, and 20 will unreserve down to 200. run_to_block(600); assert_eq!( slots::Leases::::get(ParaId::from(2000)), // --------- 6 -------------- 7 ------- - vec![Some((20, 200)), Some((10, 400))], + vec![Some((account_id(20), 200)), Some((account_id(10), 400))], ); - assert_eq!(Balances::reserved_balance(&10), 400); - assert_eq!(Balances::reserved_balance(&20), 200); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400); + assert_eq!(Balances::reserved_balance(&account_id(20)), 200); // Lease period 6 is done, and 20 will unreserve everything. run_to_block(700); assert_eq!( slots::Leases::::get(ParaId::from(2000)), // --------- 7 ------- - vec![Some((10, 400))], + vec![Some((account_id(10), 400))], ); - assert_eq!(Balances::reserved_balance(&10), 400); - assert_eq!(Balances::reserved_balance(&20), 0); + assert_eq!(Balances::reserved_balance(&account_id(10)), 400); + assert_eq!(Balances::reserved_balance(&account_id(20)), 0); // All leases are done. Everything is unreserved. run_to_block(800); assert_eq!(slots::Leases::::get(ParaId::from(2000)), vec![]); - assert_eq!(Balances::reserved_balance(&10), 0); - assert_eq!(Balances::reserved_balance(&20), 0); + assert_eq!(Balances::reserved_balance(&account_id(10)), 0); + assert_eq!(Balances::reserved_balance(&account_id(20)), 0); }); } @@ -1198,12 +1393,12 @@ fn gap_bids_work() { #[test] fn cant_bid_on_existing_lease_periods() { new_test_ext().execute_with(|| { - assert!(System::block_number().is_one()); // So events are emitted - Balances::make_free_balance_be(&1, 1_000_000_000); + assert!(System::block_number().is_one()); /* So events are emitted */ + Balances::make_free_balance_be(&account_id(1), 1_000_000_000); // First register a parathread - assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(signed(1))); assert_ok!(Registrar::register( - Origin::signed(1), + signed(1), ParaId::from(2000), test_genesis_head(10), test_validation_code(10), @@ -1220,7 +1415,7 @@ fn cant_bid_on_existing_lease_periods() { // Open a crowdloan for Para 1 for slots 0-3 assert_ok!(Crowdloan::create( - Origin::signed(1), + signed(1), ParaId::from(2000), 1_000_000, // Cap lease_period_index_start + 0, // First Slot @@ -1228,13 +1423,14 @@ fn cant_bid_on_existing_lease_periods() { 400, // Long block end None, )); - let crowdloan_account = Crowdloan::fund_account_id(ParaId::from(2000)); + let fund = Crowdloan::funds(ParaId::from(2000)).unwrap(); + let crowdloan_account = Crowdloan::fund_account_id(fund.fund_index); // Bunch of contributions let mut total = 0; for i in 10..20 { - Balances::make_free_balance_be(&i, 1_000_000_000); - assert_ok!(Crowdloan::contribute(Origin::signed(i), ParaId::from(2000), 900 - i, None)); + Balances::make_free_balance_be(&account_id(i), 1_000_000_000); + assert_ok!(Crowdloan::contribute(signed(i), ParaId::from(2000), 900 - i, None)); total += 900 - i; } assert!(total > 0); @@ -1251,8 +1447,8 @@ fn cant_bid_on_existing_lease_periods() { None, None, None, - Some((crowdloan_account, 8855)), - Some((crowdloan_account, 8855)) + Some((crowdloan_account.clone(), 8855)), + Some((crowdloan_account.clone(), 8855)) ], ); @@ -1263,7 +1459,7 @@ fn cant_bid_on_existing_lease_periods() { assert_ok!(Auctions::new_auction(Origin::root(), duration, lease_period_index_start)); // Poke the crowdloan into `NewRaise` - assert_ok!(Crowdloan::poke(Origin::signed(1), ParaId::from(2000))); + assert_ok!(Crowdloan::poke(signed(1), ParaId::from(2000))); assert_eq!(Crowdloan::new_raise(), vec![ParaId::from(2000)]); // Beginning of ending block. @@ -1272,7 +1468,7 @@ fn cant_bid_on_existing_lease_periods() { // Bids cannot be made which intersect assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start + 0, @@ -1284,7 +1480,7 @@ fn cant_bid_on_existing_lease_periods() { assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start + 1, @@ -1296,7 +1492,7 @@ fn cant_bid_on_existing_lease_periods() { assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start - 1, @@ -1308,7 +1504,7 @@ fn cant_bid_on_existing_lease_periods() { assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start + 0, @@ -1320,7 +1516,7 @@ fn cant_bid_on_existing_lease_periods() { assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start + 1, @@ -1332,7 +1528,7 @@ fn cant_bid_on_existing_lease_periods() { assert_noop!( Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start - 1, @@ -1344,7 +1540,7 @@ fn cant_bid_on_existing_lease_periods() { // Will work when not overlapping assert_ok!(Auctions::bid( - Origin::signed(crowdloan_account), + Origin::signed(crowdloan_account.clone()), ParaId::from(2000), 2, lease_period_index_start + 2, diff --git a/runtime/common/src/paras_registrar.rs b/runtime/common/src/paras_registrar.rs index 3946e7d9aec5..88828283ceee 100644 --- a/runtime/common/src/paras_registrar.rs +++ b/runtime/common/src/paras_registrar.rs @@ -160,6 +160,9 @@ pub mod pallet { NotReserved, /// Registering parachain with empty code is not allowed. EmptyCode, + /// Cannot perform a parachain slot / lifecycle swap. Check that the state of both paras are + /// correct for the swap to work. + CannotSwap, } /// Pending swap operations. @@ -271,31 +274,40 @@ pub mod pallet { pub fn swap(origin: OriginFor, id: ParaId, other: ParaId) -> DispatchResult { Self::ensure_root_para_or_owner(origin, id)?; + // If `id` and `other` is the same id, we treat this as a "clear" function, and exit + // early, since swapping the same id would otherwise be a noop. + if id == other { + PendingSwap::::remove(id); + return Ok(()) + } + + // Sanity check that `id` is even a para. + let id_lifecycle = + paras::Pallet::::lifecycle(id).ok_or(Error::::NotRegistered)?; + if PendingSwap::::get(other) == Some(id) { - if let Some(other_lifecycle) = paras::Pallet::::lifecycle(other) { - if let Some(id_lifecycle) = paras::Pallet::::lifecycle(id) { - // identify which is a parachain and which is a parathread - if id_lifecycle.is_parachain() && other_lifecycle.is_parathread() { - // We check that both paras are in an appropriate lifecycle for a swap, - // so these should never fail. - let res1 = runtime_parachains::schedule_parachain_downgrade::(id); - debug_assert!(res1.is_ok()); - let res2 = runtime_parachains::schedule_parathread_upgrade::(other); - debug_assert!(res2.is_ok()); - T::OnSwap::on_swap(id, other); - } else if id_lifecycle.is_parathread() && other_lifecycle.is_parachain() { - // We check that both paras are in an appropriate lifecycle for a swap, - // so these should never fail. - let res1 = runtime_parachains::schedule_parachain_downgrade::(other); - debug_assert!(res1.is_ok()); - let res2 = runtime_parachains::schedule_parathread_upgrade::(id); - debug_assert!(res2.is_ok()); - T::OnSwap::on_swap(id, other); - } - - PendingSwap::::remove(other); - } + let other_lifecycle = + paras::Pallet::::lifecycle(other).ok_or(Error::::NotRegistered)?; + // identify which is a parachain and which is a parathread + if id_lifecycle == ParaLifecycle::Parachain && + other_lifecycle == ParaLifecycle::Parathread + { + Self::do_thread_and_chain_swap(id, other); + } else if id_lifecycle == ParaLifecycle::Parathread && + other_lifecycle == ParaLifecycle::Parachain + { + Self::do_thread_and_chain_swap(other, id); + } else if id_lifecycle == ParaLifecycle::Parachain && + other_lifecycle == ParaLifecycle::Parachain + { + // If both chains are currently parachains, there is nothing funny we + // need to do for their lifecycle management, just swap the underlying + // data. + T::OnSwap::on_swap(id, other); + } else { + return Err(Error::::CannotSwap.into()) } + PendingSwap::::remove(other); } else { PendingSwap::::insert(id, other); } @@ -564,6 +576,15 @@ impl Pallet { Ok((ParaGenesisArgs { genesis_head, validation_code, parachain }, deposit)) } + + /// Swap a parachain and parathread, which involves scheduling an appropriate lifecycle update. + fn do_thread_and_chain_swap(to_downgrade: ParaId, to_upgrade: ParaId) { + let res1 = runtime_parachains::schedule_parachain_downgrade::(to_downgrade); + debug_assert!(res1.is_ok()); + let res2 = runtime_parachains::schedule_parathread_upgrade::(to_upgrade); + debug_assert!(res2.is_ok()); + T::OnSwap::on_swap(to_upgrade, to_downgrade); + } } #[cfg(test)] @@ -587,6 +608,7 @@ mod tests { transaction_validity::TransactionPriority, Perbill, }; + use sp_std::collections::btree_map::BTreeMap; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -696,7 +718,7 @@ mod tests { type Event = Event; type Origin = Origin; type Currency = Balances; - type OnSwap = (); + type OnSwap = MockSwap; type ParaDeposit = ParaDeposit; type DataDepositPerByte = DataDepositPerByte; type WeightInfo = TestWeightInfo; @@ -724,6 +746,22 @@ mod tests { t.into() } + parameter_types! { + pub static SwapData: BTreeMap = BTreeMap::new(); + } + + pub struct MockSwap; + impl OnSwap for MockSwap { + fn on_swap(one: ParaId, other: ParaId) { + let mut swap_data = SwapData::get(); + let one_data = swap_data.remove(&one).unwrap_or_default(); + let other_data = swap_data.remove(&other).unwrap_or_default(); + swap_data.insert(one, other_data); + swap_data.insert(other, one_data); + SwapData::set(swap_data); + } + } + const BLOCKS_PER_SESSION: u32 = 3; fn run_to_block(n: BlockNumber) { @@ -997,9 +1035,15 @@ mod tests { )); run_to_session(2); - // Upgrade 1023 into a parachain + // Upgrade para 1 into a parachain assert_ok!(Registrar::make_parachain(para_1)); + // Set some mock swap data. + let mut swap_data = SwapData::get(); + swap_data.insert(para_1, 69); + swap_data.insert(para_2, 1337); + SwapData::set(swap_data); + run_to_session(4); // Roles are as we expect @@ -1014,20 +1058,15 @@ mod tests { run_to_session(6); - // Deregister a parathread that was originally a parachain - assert_eq!(Parachains::lifecycle(para_1), Some(ParaLifecycle::Parathread)); - assert_ok!(Registrar::deregister( - runtime_parachains::Origin::Parachain(para_1).into(), - para_1 - )); - - run_to_block(21); - // Roles are swapped assert!(!Parachains::is_parachain(para_1)); assert!(Parachains::is_parathread(para_1)); assert!(Parachains::is_parachain(para_2)); assert!(!Parachains::is_parathread(para_2)); + + // Data is swapped + assert_eq!(SwapData::get().get(¶_1).unwrap(), &1337); + assert_eq!(SwapData::get().get(¶_2).unwrap(), &69); }); } @@ -1059,6 +1098,121 @@ mod tests { assert_noop!(Registrar::swap(Origin::signed(1), para_id, para_id + 2), BadOrigin); }); } + + #[test] + fn swap_handles_bad_states() { + new_test_ext().execute_with(|| { + let para_1 = LOWEST_PUBLIC_ID; + let para_2 = LOWEST_PUBLIC_ID + 1; + run_to_block(1); + // paras are not yet registered + assert!(!Parachains::is_parathread(para_1)); + assert!(!Parachains::is_parathread(para_2)); + + // Cannot even start a swap + assert_noop!( + Registrar::swap(Origin::root(), para_1, para_2), + Error::::NotRegistered + ); + + // We register Paras 1 and 2 + assert_ok!(Registrar::reserve(Origin::signed(1))); + assert_ok!(Registrar::reserve(Origin::signed(2))); + assert_ok!(Registrar::register( + Origin::signed(1), + para_1, + test_genesis_head(32), + test_validation_code(32), + )); + assert_ok!(Registrar::register( + Origin::signed(2), + para_2, + test_genesis_head(32), + test_validation_code(32), + )); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + run_to_session(2); + + // They are now a parathread. + assert!(Parachains::is_parathread(para_1)); + assert!(Parachains::is_parathread(para_2)); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + // Some other external process will elevate one parathread to parachain + assert_ok!(Registrar::make_parachain(para_1)); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + run_to_session(3); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + run_to_session(4); + + // It is now a parachain. + assert!(Parachains::is_parachain(para_1)); + assert!(Parachains::is_parathread(para_2)); + + // Swap works here. + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_ok!(Registrar::swap(Origin::root(), para_2, para_1)); + + run_to_session(5); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + run_to_session(6); + + // Swap worked! + assert!(Parachains::is_parachain(para_2)); + assert!(Parachains::is_parathread(para_1)); + + // Something starts to downgrade a para + assert_ok!(Registrar::make_parathread(para_2)); + + run_to_session(7); + + // Cannot swap + assert_ok!(Registrar::swap(Origin::root(), para_1, para_2)); + assert_noop!( + Registrar::swap(Origin::root(), para_2, para_1), + Error::::CannotSwap + ); + + run_to_session(8); + + assert!(Parachains::is_parathread(para_1)); + assert!(Parachains::is_parathread(para_2)); + }); + } } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index 353142190a52..3615191879e5 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kusama-runtime" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" @@ -14,7 +14,7 @@ rustc-hex = { version = "2.1.0", default-features = false } serde = { version = "1.0.136", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" -smallvec = "1.6.1" +smallvec = "1.8.0" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -98,7 +98,7 @@ tiny-keccak = "2.0.2" keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } separator = "0.4.1" -serde_json = "1.0.78" +serde_json = "1.0.79" [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/runtime/kusama/constants/Cargo.toml b/runtime/kusama/constants/Cargo.toml index f0a6023ebf7b..ab0f9e22645c 100644 --- a/runtime/kusama/constants/Cargo.toml +++ b/runtime/kusama/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "kusama-runtime-constants" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" [dependencies] -smallvec = "1.6.1" +smallvec = "1.8.0" frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 249b43f778fb..543565d0ff6f 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -37,7 +37,6 @@ use runtime_common::{ BlockHashCount, BlockLength, BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit, OffchainSolutionWeightLimit, RocksDbWeight, SlowAdjustingFeeUpdate, }; -use sp_core::u32_trait::{_1, _2, _3, _5}; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; use runtime_parachains::{ @@ -115,13 +114,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kusama"), impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, - spec_version: 9160, + spec_version: 9170, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] apis: version::create_apis_vec![[]], - transaction_version: 9, + transaction_version: 10, state_version: 0, }; @@ -138,17 +137,17 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } -/// Don't allow swaps until parathread story is more mature. +/// We currently allow all calls. pub struct BaseFilter; impl Contains for BaseFilter { - fn contains(c: &Call) -> bool { - !matches!(c, Call::Registrar(paras_registrar::Call::swap { .. })) + fn contains(_c: &Call) -> bool { + true } } type MoreThanHalfCouncil = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionMoreThan, >; parameter_types! { @@ -192,7 +191,7 @@ parameter_types! { type ScheduleOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; /// Used the compare the privilege of an origin inside the scheduler. @@ -459,7 +458,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type ForceOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; type VoterSnapshotPerBlock = VoterSnapshotPerBlock; @@ -553,7 +552,7 @@ parameter_types! { type SlashCancelOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl frame_election_provider_support::onchain::Config for Runtime { @@ -610,33 +609,33 @@ impl pallet_democracy::Config for Runtime { type MinimumDeposit = MinimumDeposit; /// A straight majority of the council can decide what their next motion is. type ExternalOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// A majority can have the next scheduled referendum be a straight majority-carries vote. type ExternalMajorityOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// A unanimous council can have the next scheduled referendum be a straight default-carries /// (NTB) vote. type ExternalDefaultOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote /// be tabled immediately and with a shorter voting/enactment period. type FastTrackOrigin = - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; + pallet_collective::EnsureProportionAtLeast; type InstantOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; + pallet_collective::EnsureProportionAtLeast; type InstantAllowed = InstantAllowed; type FastTrackVotingPeriod = FastTrackVotingPeriod; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. type CancellationOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; type BlacklistOrigin = EnsureRoot; // To cancel a proposal before it has been passed, the technical committee must be unanimous or // Root must agree. type CancelProposalOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, + pallet_collective::EnsureProportionAtLeast, >; // Any single technical committee member may veto a coming council proposal, however they can // only do it once and it lasts only for the cooloff period. @@ -762,7 +761,7 @@ parameter_types! { type ApproveOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl pallet_treasury::Config for Runtime { @@ -930,7 +929,7 @@ impl claims::Config for Runtime { type VestingSchedule = Vesting; type Prefix = Prefix; type MoveClaimOrigin = - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionMoreThan; type WeightInfo = weights::runtime_common_claims::WeightInfo; } @@ -1025,7 +1024,7 @@ impl pallet_society::Config for Runtime { type RotationPeriod = RotationPeriod; type MaxLockDuration = MaxLockDuration; type FounderSetOrigin = - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionMoreThan; type SuspensionJudgementOrigin = pallet_society::EnsureFounder; type ChallengePeriod = ChallengePeriod; type MaxCandidateIntake = MaxCandidateIntake; @@ -1078,12 +1077,15 @@ pub enum ProxyType { IdentityJudgement, CancelProxy, Auction, + Society, } + impl Default for ProxyType { fn default() -> Self { Self::Any } } + impl InstanceFilter for ProxyType { fn filter(&self, c: &Call) -> bool { match self { @@ -1160,6 +1162,7 @@ impl InstanceFilter for ProxyType { c, Call::Auctions(..) | Call::Crowdloan(..) | Call::Registrar(..) | Call::Slots(..) ), + ProxyType::Society => matches!(c, Call::Society(..)), } } fn is_superset(&self, o: &Self) -> bool { @@ -1315,7 +1318,7 @@ parameter_types! { type AuctionInitiate = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl auctions::Config for Runtime { @@ -1497,1456 +1500,25 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (SchedulerMigrationV3, RefundNickPalletDeposit), + CrowdloanIndexMigration, >; /// The payload being signed in the transactions. pub type SignedPayload = generic::SignedPayload; -/// The nicks pallet was removed at block 569325 from the runtime, without any consideration of the -/// fact that numerous accounts had reserved funds in this pallet. This migration is the outcome of -/// an investigation that tries to refund all of the accounts that had a nick set for them prior to -/// removal, if they still have the amount in their reserved balance. Otherwise, we ignore the -/// refund. -pub struct RefundNickPalletDeposit; - -impl RefundNickPalletDeposit { - fn execute(check: bool) -> Weight { - let accounts_and_deposits = vec![ - ( - // FDDy3cQa7JXiChYU2xq1B2WUUJBpZpZ51qn2tiN1DqDMEpS - [ - 116, 157, 220, 147, 166, 93, 254, 195, 175, 39, 204, 116, 120, 33, 44, 183, - 212, 176, 192, 53, 127, 239, 53, 160, 22, 57, 102, 171, 83, 51, 183, 87, - ], - 10000000000, - ), - ( - // G7Ur4BnMSfP2qE7ruSob5gwGQ5nzkGWu7Yqh14FcMqnDtgB - [ - 156, 120, 182, 33, 219, 174, 128, 170, 103, 151, 162, 143, 117, 32, 89, 238, - 241, 171, 215, 99, 218, 189, 163, 89, 85, 96, 160, 52, 143, 248, 46, 57, - ], - 10000000000, - ), - ( - // Ft8UrgCxMoChGP4o7Q92PQqEHaF9UVZQXVW1wbMV7Cf6ost - [ - 146, 73, 247, 0, 26, 190, 182, 82, 240, 43, 224, 199, 223, 167, 173, 151, 130, - 188, 113, 208, 86, 81, 255, 20, 235, 214, 89, 225, 229, 159, 130, 126, - ], - 10000000000000, - ), - ( - // FFdDXFK1VKG5QgjvqwxdVjo8hGrBveaBFfHnWyz1MAmLL82 - [ - 118, 114, 158, 23, 173, 49, 70, 157, 235, 203, 96, 243, 206, 54, 34, 247, 145, - 67, 228, 66, 231, 123, 88, 214, 226, 25, 93, 158, 169, 152, 104, 13, - ], - 10000000000, - ), - ( - // HqE13RoY1yntxvAvySn8ogit5XrX1EAxZe4HPPaFf48q8JM - [ - 232, 139, 71, 107, 182, 41, 146, 230, 64, 3, 205, 166, 216, 146, 173, 149, 225, - 180, 93, 128, 227, 254, 240, 29, 10, 65, 25, 225, 235, 227, 163, 6, - ], - 10000000000, - ), - ( - // GLiebiQp5f6G5vNcc7BgRE9T3hrZSYDwP6evERn3hEczdaM - [ - 166, 145, 93, 111, 179, 12, 211, 3, 103, 242, 49, 148, 198, 136, 66, 166, 1, - 143, 86, 92, 119, 62, 160, 197, 68, 235, 42, 98, 89, 123, 27, 52, - ], - 10000000000000, - ), - ( - // H2LxnKzFLh1KZKjVAGGtpn9R5KSCPuz4ef8HE2Y6BirmV9J - [ - 196, 202, 45, 138, 99, 252, 222, 80, 235, 39, 124, 225, 161, 124, 245, 58, 201, - 169, 220, 211, 178, 228, 57, 232, 95, 139, 4, 107, 208, 220, 253, 4, - ], - 10000000000, - ), - ( - // Ewo4ddXr9qDEBwCwd5SfqLEPYLJLgAC5vgFhKLWhpRg7MQJ - [ - 104, 217, 88, 232, 193, 243, 108, 203, 24, 225, 126, 17, 81, 187, 250, 67, 25, - 203, 79, 181, 120, 177, 79, 11, 116, 184, 178, 140, 178, 213, 240, 31, - ], - 10000000000, - ), - ( - // CanLB42xJughpTRC1vXStUryjWYkE679emign1af47QnAQC - [ - 0, 90, 67, 60, 142, 21, 28, 129, 174, 148, 133, 68, 244, 203, 7, 98, 43, 24, - 168, 67, 4, 128, 222, 111, 198, 225, 163, 139, 196, 111, 156, 39, - ], - 10000000000, - ), - ( - // GPcwRJAb8VXPX452qEGaag3QYDwJLHkGijDrtc1TeBH3FHf - [ - 168, 199, 225, 48, 144, 182, 67, 197, 174, 85, 150, 8, 96, 63, 67, 253, 7, 128, - 178, 243, 213, 59, 77, 181, 81, 101, 86, 29, 34, 92, 124, 45, - ], - 10000000000, - ), - ( - // GAfhRsNqB9hwEmRFPhMZCvicFJ1kVtRF3UChYyKHq612ZV9 - [ - 158, 230, 249, 239, 92, 180, 210, 75, 53, 25, 199, 239, 202, 49, 166, 13, 194, - 124, 33, 81, 0, 1, 78, 80, 248, 135, 31, 235, 56, 26, 235, 186, - ], - 10000000000, - ), - ( - // FhmaBgRFjZYFUWJp91ZHUbuW2Dm32VH4BVhnRQJqfpMmEok - [ - 138, 99, 32, 177, 239, 122, 152, 201, 19, 158, 75, 250, 108, 96, 161, 227, 10, - 115, 59, 39, 247, 217, 221, 83, 214, 72, 194, 124, 225, 114, 108, 56, - ], - 10000000000, - ), - ( - // Gc6YgfbTJ6pYXcwib6mk3KoiwncLm4dfdcN3nwFjvfi4Agd - [ - 178, 75, 194, 233, 30, 119, 193, 28, 8, 253, 181, 124, 87, 91, 64, 84, 177, - 159, 216, 231, 126, 12, 246, 200, 159, 231, 169, 131, 127, 242, 143, 80, - ], - 10000000000, - ), - ( - // GffdZaTf5oBcHVfx4VjnA6AMpHEBa3PiaBzTBUPkt24fUxp - [ - 181, 4, 222, 91, 235, 149, 207, 1, 80, 211, 109, 110, 232, 187, 181, 160, 24, - 78, 166, 154, 54, 198, 207, 12, 252, 44, 151, 122, 57, 70, 214, 176, - ], - 10000000000, - ), - ( - // DrkY92Yq67zJ7T8XWN7SAXbnNDJhzkADutwhhhPyW3tQKTw - [ - 56, 196, 98, 104, 248, 246, 247, 221, 132, 4, 28, 243, 187, 250, 188, 3, 109, - 117, 244, 101, 120, 147, 102, 217, 21, 24, 194, 80, 176, 96, 112, 24, - ], - 10000000000, - ), - ( - // CcKPhXSyZgATZD1wVaRsSk81UfLcQvyuuS2i9FNhsoeQeWr - [ - 1, 134, 17, 101, 243, 129, 19, 73, 139, 78, 95, 178, 240, 204, 18, 192, 163, - 111, 29, 159, 254, 26, 30, 39, 13, 35, 69, 169, 55, 81, 143, 194, - ], - 10000000000, - ), - ( - // HMELERjKFft5puf4xvg9aPADqtpvzwxK3zwbz9cWC9fX3ja - [ - 211, 49, 133, 124, 26, 82, 99, 44, 214, 26, 99, 190, 104, 11, 183, 87, 191, - 209, 240, 131, 56, 101, 64, 111, 117, 30, 16, 150, 203, 224, 42, 124, - ], - 10000000000, - ), - ( - // E58yuhUAwWzhn2V4thF3VciAJU75eePPipMhxWZe9JKVVfq - [ - 66, 54, 226, 49, 17, 165, 160, 250, 25, 161, 182, 182, 242, 59, 234, 70, 243, - 22, 193, 31, 221, 235, 209, 13, 97, 189, 96, 183, 169, 66, 196, 94, - ], - 10000000000, - ), - ( - // Dab4bfYTZRUDMWjYAUQuFbDreQ9mt7nULWu3Dw7jodbzVe9 - [ - 44, 112, 144, 18, 248, 7, 175, 143, 195, 240, 210, 171, 176, 197, 28, 169, 168, - 141, 78, 242, 77, 26, 9, 43, 248, 157, 172, 245, 206, 99, 234, 29, - ], - 10000000000, - ), - ( - // H2QeEejU61uwHSXZPvWb4csGdJGxetcViN3eSkTxgbHa4et - [ - 196, 214, 145, 18, 0, 141, 73, 140, 244, 113, 116, 30, 62, 23, 129, 202, 136, - 189, 254, 234, 4, 99, 219, 98, 117, 43, 180, 149, 31, 45, 166, 42, - ], - 10000000000, - ), - ( - // DbF59HrqrrPh9L2Fi4EBd7gn4xFUSXmrE6zyMzf3pETXLvg - [ - 44, 240, 131, 139, 5, 251, 24, 39, 24, 222, 133, 149, 37, 250, 30, 109, 83, - 213, 87, 229, 252, 246, 49, 238, 159, 244, 76, 97, 152, 16, 212, 59, - ], - 10000000000, - ), - ( - // Em9FTrdPbJRKRrNNteu3NeR98ZJQ7yQmFqxNeafftGnkdZE - [ - 96, 185, 154, 62, 31, 238, 141, 116, 79, 8, 41, 10, 42, 222, 97, 178, 110, 4, - 72, 98, 239, 183, 202, 96, 220, 12, 148, 78, 249, 217, 170, 122, - ], - 10000000000000, - ), - ( - // Gi1kynZMWWcQMrvv5wL1TcGkbqT9R4N7fMibSiphSDH7HJq - [ - 182, 207, 29, 171, 210, 158, 113, 56, 63, 232, 79, 168, 37, 141, 241, 134, 175, - 126, 224, 152, 119, 99, 164, 118, 38, 81, 33, 204, 1, 140, 4, 39, - ], - 10000000000, - ), - ( - // HWAGAxX2PAzNVg7w3ZyTprH5yvwbVwQ8rbWwuZxtQKbQupW - [ - 218, 1, 7, 123, 220, 2, 95, 215, 121, 204, 33, 201, 118, 7, 39, 236, 7, 229, - 42, 161, 50, 65, 11, 130, 229, 250, 186, 203, 111, 69, 176, 85, - ], - 10000000000000, - ), - ( - // DQSRrYtjyikVMNHkdyXWkhimCDHenKqS4FJYk9r781LSFqA - [ - 36, 179, 11, 183, 207, 19, 243, 240, 216, 103, 254, 154, 12, 154, 85, 139, 97, - 128, 92, 13, 220, 178, 241, 104, 6, 214, 139, 218, 162, 142, 92, 126, - ], - 10000000000, - ), - ( - // Gth5jQA6v9EFbpqSPgXcsvpGSrbTdWwmBADnqa36ptjs5m5 - [ - 190, 243, 241, 170, 113, 179, 43, 186, 119, 91, 56, 134, 185, 0, 162, 227, 251, - 79, 65, 99, 213, 140, 27, 206, 10, 174, 207, 224, 181, 92, 27, 95, - ], - 10000000000, - ), - ( - // DMELETGdziwQNCqLRR7JKfgYD3Xahnoxi9n7gUHUmuxwGUN - [ - 34, 64, 150, 111, 139, 218, 171, 2, 162, 146, 155, 46, 84, 108, 118, 149, 171, - 221, 184, 116, 228, 69, 194, 98, 68, 147, 137, 9, 198, 27, 176, 66, - ], - 10000000000, - ), - ( - // EicrAEbyauqktQpp4CdvsF2CQy3Ju7tGGMohj3h5sAPnKHL - [ - 94, 204, 197, 40, 211, 144, 196, 33, 206, 39, 175, 184, 65, 108, 201, 54, 243, - 173, 85, 144, 42, 182, 41, 127, 37, 114, 167, 248, 149, 164, 177, 53, - ], - 10000000000, - ), - ( - // GaVMNNUSnBsEuuYyQXbEEmWiSuTSDyRWgfDKTSKagpzteim - [ - 177, 18, 9, 233, 120, 11, 2, 165, 55, 66, 10, 134, 94, 109, 23, 133, 52, 212, - 151, 67, 79, 143, 238, 215, 36, 124, 107, 222, 202, 23, 151, 86, - ], - 10000000000, - ), - ( - // CsM49wAGnAUo9RUCEZYsyBYtWUKKDT9hvH7fFiqRHeHC1op - [ - 12, 252, 88, 230, 28, 182, 44, 37, 252, 63, 69, 165, 96, 5, 247, 182, 206, 194, - 47, 232, 78, 237, 106, 199, 200, 153, 44, 227, 32, 154, 176, 36, - ], - 10000000000, - ), - ( - // FAGzHVggwv1QRmkGjom1Foc24jzZS1CJGcWUzrGdW8FyXEm - [ - 114, 94, 75, 214, 238, 141, 247, 28, 214, 219, 162, 225, 46, 51, 173, 190, 96, - 181, 41, 240, 0, 11, 168, 158, 115, 135, 144, 32, 185, 110, 151, 142, - ], - 10000000000, - ), - ( - // FAYyBS6arn3X4fvtdybaBUdw5zqVsv3PPwRXXXYRTzTGFDv - [ - 114, 148, 23, 203, 43, 181, 231, 49, 225, 161, 203, 113, 102, 89, 218, 193, - 205, 54, 234, 214, 49, 118, 110, 212, 147, 239, 120, 136, 227, 131, 148, 47, - ], - 10000000000, - ), - ( - // HWpid7FWbuA7GxN1yykrYqSe6cY3ybUaX3qErCoiiFDSqSh - [ - 218, 130, 123, 220, 174, 27, 214, 107, 33, 76, 0, 232, 131, 190, 29, 95, 29, - 117, 67, 1, 172, 212, 188, 13, 174, 147, 197, 98, 216, 92, 250, 14, - ], - 10000000000, - ), - ( - // EPehck28w8fjRZCqZ3VZA7XpwGeipuVU4ETSwv7GkF5BdcG - [ - 80, 85, 88, 32, 26, 242, 233, 133, 139, 76, 38, 98, 125, 118, 2, 38, 102, 115, - 182, 64, 117, 231, 219, 127, 220, 111, 71, 158, 96, 54, 1, 89, - ], - 10000000000, - ), - ( - // GJ7JBaqx4ys5LrkECQKmEWdjGgAoXChsLepjEqdHuKggymK - [ - 164, 147, 222, 101, 93, 106, 87, 193, 54, 226, 40, 40, 244, 107, 133, 50, 226, - 211, 28, 198, 242, 231, 165, 199, 186, 42, 32, 230, 137, 247, 84, 12, - ], - 10000000000, - ), - ( - // HLLfrFFvmVtjsKY4GjjUz3AEKXAhgrWXuXZBtQKgwXZ1kMP - [ - 210, 131, 156, 199, 115, 228, 244, 83, 96, 154, 217, 103, 175, 17, 75, 14, 66, - 224, 223, 195, 68, 225, 127, 149, 37, 12, 131, 145, 38, 83, 106, 91, - ], - 10000000000, - ), - ( - // EJLzRAmQmqHuTdVKFWTUmA2DZHC44C1nVwnEzmd5zoAnTUx - [ - 76, 73, 127, 184, 138, 155, 209, 12, 223, 194, 107, 132, 238, 248, 247, 173, - 215, 128, 71, 244, 15, 76, 59, 10, 185, 14, 138, 29, 107, 106, 185, 69, - ], - 10000000000, - ), - ( - // GZ5xCKCC8JRpJSMgAoDJAFAuQV8gD9Xz2cJca4mR7oRhzL9 - [ - 176, 0, 5, 255, 248, 249, 234, 120, 54, 98, 11, 215, 14, 115, 67, 174, 174, 54, - 227, 157, 128, 171, 217, 69, 20, 210, 10, 41, 26, 91, 115, 90, - ], - 10000000000, - ), - ( - // DydhvUrMzhmvsbtHxCY5PGkWwRP3bRqcnFcwBJ1StZdgpXs - [ - 62, 4, 27, 33, 225, 137, 152, 173, 113, 95, 10, 12, 46, 9, 217, 113, 110, 130, - 72, 166, 241, 50, 146, 87, 245, 127, 114, 38, 95, 98, 38, 13, - ], - 10000000000, - ), - ( - // GstVeDt8rAUm35e15Voytmo4z3wJu4aFGYDhbcrEubgpBLS - [ - 190, 87, 29, 156, 216, 198, 240, 163, 43, 82, 176, 28, 234, 108, 82, 70, 52, - 108, 167, 243, 92, 5, 119, 40, 141, 205, 123, 189, 144, 21, 143, 42, - ], - 10000000000, - ), - ( - // H72hS8xLmSiSBqbBXHND2KbN8PAoevi52B685cbGki6T9nt - [ - 200, 92, 235, 179, 242, 27, 94, 151, 115, 122, 123, 188, 20, 216, 55, 106, 121, - 219, 186, 156, 40, 73, 162, 142, 218, 231, 124, 119, 109, 30, 74, 8, - ], - 10000000000000, - ), - ( - // JHTXKwYBhRZKWPW3nbtwtfE8dfRDYCS65cJXueMhg11k4cs - [ - 252, 141, 45, 218, 128, 204, 60, 241, 174, 68, 89, 62, 144, 165, 22, 79, 237, - 228, 166, 254, 38, 15, 56, 180, 249, 121, 233, 120, 251, 24, 29, 26, - ], - 10000000000, - ), - ( - // DSpbbk6HKKyS78c4KDLSxCetqbwnsemv2iocVXwNe2FAvWC - [ - 38, 132, 41, 39, 201, 138, 80, 171, 29, 67, 154, 180, 95, 33, 197, 190, 182, - 151, 5, 86, 225, 253, 123, 82, 223, 68, 151, 126, 67, 68, 177, 72, - ], - 10000000000, - ), - ( - // EZ7uBY7ZLohavWAugjTSUVVSABLfad77S6RQf4pDe3cV9q4 - [ - 87, 142, 29, 62, 121, 108, 29, 242, 4, 206, 176, 221, 8, 65, 178, 141, 245, - 156, 168, 27, 30, 73, 224, 200, 30, 8, 218, 17, 235, 8, 129, 88, - ], - 10000000000, - ), - ( - // GTzRQPzkcuynHgkEHhsPBFpKdh4sAacVRsnd8vYfPpTMeEY - [ - 172, 29, 45, 130, 196, 166, 155, 22, 195, 206, 158, 181, 208, 182, 243, 79, - 148, 138, 52, 239, 230, 36, 136, 135, 154, 81, 75, 188, 131, 126, 14, 80, - ], - 10000000000, - ), - ( - // HH5CgPv1RAgQMgpJh6p3NdT9juW5RkTgNTZyY14x3YEEY9W - [ - 208, 5, 206, 5, 204, 134, 218, 235, 225, 186, 153, 99, 120, 74, 102, 208, 84, - 228, 131, 225, 190, 177, 118, 185, 155, 36, 206, 72, 87, 238, 80, 32, - ], - 10000000000000, - ), - ( - // EibDgpnEGwqvWDcPUq7EThEB6kPEnqKuZog48E5jga8uWe8 - [ - 94, 199, 73, 120, 162, 242, 8, 23, 215, 18, 155, 218, 139, 12, 63, 8, 208, 0, - 107, 1, 61, 50, 93, 42, 126, 215, 52, 17, 10, 76, 84, 100, - ], - 10000000000, - ), - ( - // EUoo6xidm7okewmbh89tUW3sqaDLYKAvTCCNYc8zh4nPU4s - [ - 84, 68, 47, 183, 214, 88, 97, 47, 53, 200, 162, 127, 59, 172, 138, 84, 186, 12, - 104, 77, 138, 180, 223, 185, 173, 134, 130, 69, 143, 101, 109, 60, - ], - 10000000000, - ), - ( - // HRMhY2CtVMp2yVSieKvq8Y8FHAhRKrGGMd6MoQe3iN6uJ2D - [ - 214, 87, 77, 183, 142, 124, 3, 21, 84, 96, 50, 177, 119, 89, 48, 196, 13, 76, - 202, 117, 98, 233, 33, 12, 189, 233, 51, 68, 170, 215, 170, 84, - ], - 10000000000, - ), - ( - // DFaiE6wT1caQ9u7eLkuphVQqbywWKzYjm5vRsMgk43GSb84 - [ - 29, 241, 183, 189, 149, 102, 45, 153, 129, 74, 88, 239, 30, 85, 203, 179, 88, - 11, 236, 209, 27, 59, 217, 16, 71, 164, 153, 204, 254, 244, 144, 71, - ], - 10000000000, - ), - ( - // Fgqjkry96qFLpRqPZstNzgaqKXiVyrpzTqD55neMdW8PK6g - [ - 137, 173, 231, 47, 194, 130, 205, 124, 98, 243, 203, 146, 205, 8, 243, 191, 44, - 206, 78, 183, 216, 29, 52, 179, 105, 114, 63, 79, 233, 138, 5, 17, - ], - 10000000000, - ), - ( - // GUEWJi5DPxDyjmqqGng5PdSCHYALRhtS1v8KT1uCicRbfxk - [ - 172, 76, 151, 41, 241, 24, 246, 253, 252, 221, 211, 235, 39, 43, 238, 2, 40, - 120, 127, 112, 23, 87, 49, 26, 110, 159, 137, 131, 186, 82, 181, 48, - ], - 10000000000, - ), - ( - // HqFz5RBczgtKrHQGav7DFZwSwrDXxKjLWc95mMDidVdfpwC - [ - 232, 145, 244, 158, 43, 105, 112, 85, 249, 56, 143, 230, 12, 35, 44, 76, 245, - 203, 166, 98, 13, 229, 106, 169, 247, 205, 72, 228, 62, 223, 11, 168, - ], - 10000000000, - ), - ( - // HnKoshkPTzLwTdKhnTJYL6QgnDaSW4ojiSZdQzj7dzufJ7t - [ - 230, 85, 23, 167, 247, 129, 3, 183, 71, 161, 190, 170, 124, 158, 227, 159, 203, - 254, 25, 148, 140, 142, 7, 128, 223, 0, 12, 31, 242, 196, 114, 28, - ], - 10000000000, - ), - ( - // G9vLBYmeiQcD8t53djad6sH2MALaeJy9zaEUyknEVma9sa6 - [ - 158, 84, 254, 3, 146, 145, 60, 195, 136, 149, 185, 184, 207, 106, 198, 130, 4, - 122, 110, 22, 46, 210, 127, 115, 71, 3, 249, 235, 186, 2, 227, 42, - ], - 10000000000, - ), - ( - // F9GaWDFcJUUSV7WzrdZ4Zpq8uRFzFQ23hcKrLT9Bdvxzxxe - [ - 113, 153, 171, 173, 152, 127, 178, 8, 186, 128, 74, 4, 122, 115, 23, 37, 195, - 7, 45, 117, 37, 238, 162, 188, 223, 217, 127, 168, 193, 76, 138, 119, - ], - 10000000000, - ), - ( - // HA5jB52fFL1v4EoEHV4WgEiFZr7wGLiuBDZtSmnwKypvat7 - [ - 202, 176, 219, 89, 39, 158, 40, 198, 66, 87, 82, 88, 21, 250, 227, 20, 1, 88, - 104, 69, 191, 189, 43, 142, 116, 157, 109, 105, 63, 204, 250, 13, - ], - 10000000000, - ), - ( - // EafgFRX24PTgJAjGoaDuQLXQiLX4daSFQQttzGVticSD18o - [ - 88, 188, 84, 163, 42, 93, 248, 215, 47, 249, 108, 212, 218, 212, 67, 74, 181, - 108, 233, 103, 25, 33, 250, 1, 39, 65, 243, 221, 38, 118, 135, 119, - ], - 10000000000, - ), - ( - // FMTCvCG8qyWbRhb6k8Nu4nJkjYxnUpKY5QzSWfbt1fJH2K6 - [ - 122, 228, 100, 83, 103, 128, 129, 0, 139, 109, 242, 81, 134, 220, 106, 165, - 211, 95, 34, 116, 246, 252, 78, 92, 30, 76, 166, 47, 193, 177, 103, 45, - ], - 10000000000, - ), - ( - // CczSz9z41uHpftVviWz91TgjLe3SmbvXfbAc958cjy7F6Qs - [ - 2, 9, 139, 95, 113, 136, 133, 240, 214, 240, 241, 131, 89, 167, 209, 107, 68, - 201, 34, 152, 87, 147, 78, 254, 102, 218, 244, 217, 240, 235, 122, 67, - ], - 10000000000, - ), - ( - // EyibGsAttxpNBkgjMxNTArskxkdEFFbwghYuuaZyvu9rmo2 - [ - 106, 80, 200, 249, 181, 101, 187, 6, 214, 136, 82, 189, 162, 39, 227, 64, 9, - 157, 73, 90, 63, 230, 16, 209, 252, 187, 179, 226, 179, 131, 134, 9, - ], - 10000000000, - ), - ( - // Hqa9LGT3qF96agPYYbdfmUzh5P94MX9sqfF1WN4JnfRRVir - [ - 232, 207, 22, 14, 86, 240, 39, 27, 183, 253, 79, 238, 77, 137, 46, 82, 193, - 251, 178, 183, 99, 123, 143, 109, 81, 154, 2, 219, 196, 194, 80, 48, - ], - 10000000000, - ), - ( - // D2dugfMMD4UEuT1VKwWAEDXYdcdYQ8YyYenqyzov4EQzrWb - [ - 20, 18, 74, 152, 192, 78, 193, 162, 244, 247, 219, 163, 20, 148, 160, 102, 77, - 234, 216, 75, 18, 190, 218, 54, 210, 105, 115, 175, 51, 182, 109, 11, - ], - 10000000000, - ), - ( - // EzR9J3Afvash2tYCk8ZZwPYyq3zy92adVUXKcYjbYN46JWL - [ - 106, 217, 75, 166, 62, 43, 95, 39, 205, 242, 178, 147, 7, 109, 3, 214, 253, - 255, 44, 20, 164, 97, 54, 104, 211, 243, 117, 150, 167, 140, 152, 71, - ], - 10000000000, - ), - ( - // H4PFhp41Lf71DshJoTSoHKpVYN8H7VCs3bs9J5oTLAABDci - [ - 198, 88, 98, 42, 56, 161, 58, 36, 180, 89, 254, 109, 16, 255, 214, 120, 192, - 204, 248, 245, 145, 124, 72, 217, 139, 9, 182, 116, 98, 86, 9, 26, - ], - 10000000000, - ), - ( - // Dtj5dNTPxX6UNfz7DvB3wKUiWcYpjmcDBnjWyYEShgBbtnQ - [ - 58, 69, 248, 95, 254, 189, 177, 143, 25, 199, 92, 139, 237, 97, 234, 17, 219, - 250, 40, 132, 41, 202, 235, 238, 203, 35, 33, 26, 73, 237, 165, 32, - ], - 10000000000, - ), - ( - // CojQi7xkPUni1Rdde7NmuAxRBxXiFDJA4B824wpvhkeWFP5 - [ - 10, 58, 158, 3, 226, 253, 136, 14, 137, 63, 60, 210, 253, 3, 181, 124, 125, 40, - 29, 43, 70, 105, 185, 59, 16, 42, 148, 5, 43, 227, 101, 98, - ], - 10000000000, - ), - ( - // HRuaGanNmkmeQgZPWPXmkZJb944raNS5ni2vhKzhz75zVYP - [ - 214, 194, 154, 124, 57, 206, 228, 91, 14, 4, 90, 148, 8, 27, 193, 136, 239, - 115, 190, 43, 224, 134, 214, 106, 239, 216, 80, 252, 126, 234, 204, 69, - ], - 10000000000, - ), - ( - // EakrutF2hSayUqLJYb5wc6qqXkjr8EkGax1UhNzPi1ujBv9 - [ - 88, 205, 199, 239, 136, 12, 128, 232, 71, 81, 112, 242, 6, 56, 29, 44, 177, 58, - 135, 194, 9, 69, 47, 198, 216, 161, 225, 65, 134, 214, 27, 40, - ], - 10000000000, - ), - ( - // HTrpbES27bqMvCioQGHpmJbBzwji6V5DeuXUfB1gsZ5Vkh1 - [ - 216, 63, 211, 154, 251, 136, 179, 60, 70, 115, 128, 221, 53, 243, 154, 94, 200, - 71, 74, 119, 110, 210, 175, 19, 52, 249, 165, 252, 167, 14, 0, 250, - ], - 10000000000, - ), - ( - // Fk3yTFztZdZa4a7yBpisz9ceMyjgYLtZ9CKSCfFNVhoW2ZC - [ - 140, 32, 212, 111, 134, 36, 46, 234, 137, 196, 0, 213, 196, 120, 32, 126, 5, - 199, 107, 186, 178, 154, 116, 138, 248, 170, 201, 13, 98, 126, 26, 1, - ], - 10000000000, - ), - ( - // GA9YAVVeNdLsToSVa9beeEHtCUncqmT4Pov8h4faQQKR9Fv - [ - 158, 129, 115, 22, 121, 33, 33, 230, 46, 207, 35, 226, 149, 72, 147, 178, 81, - 63, 129, 26, 58, 116, 206, 244, 241, 71, 114, 172, 99, 188, 43, 54, - ], - 10000000000, - ), - ( - // HqGhgHg6YvnhaXSnaAUvyTDiR4FirB6Ssh2XNDedTzwCDv2 - [ - 232, 148, 94, 188, 43, 222, 161, 46, 200, 249, 71, 253, 35, 130, 33, 9, 23, 20, - 110, 38, 238, 99, 169, 248, 31, 132, 26, 83, 213, 104, 77, 66, - ], - 10000000000, - ), - ( - // GXaUd6gyCaEoBVzXnkLVGneCF3idnLNtNZs5RHTugb9dCpY - [ - 174, 217, 142, 21, 227, 237, 57, 46, 56, 101, 66, 21, 195, 209, 250, 129, 67, - 222, 83, 70, 3, 134, 182, 1, 57, 251, 180, 92, 3, 108, 27, 67, - ], - 10000000000, - ), - ( - // DMELEF9YvNDscnK6CKQaQ3APYLhTmzhpQkyUf7QhSuNAE3H - [ - 34, 64, 150, 97, 214, 246, 14, 141, 148, 228, 8, 247, 42, 147, 129, 167, 198, - 62, 144, 167, 202, 254, 85, 116, 78, 30, 144, 61, 82, 21, 151, 0, - ], - 10000000000, - ), - ( - // H1ye1dQ7zVM8obAmb21kfUKA8otRekWXn6fiToKusamaJK9 - [ - 196, 130, 101, 105, 230, 139, 126, 238, 27, 91, 147, 64, 110, 73, 81, 252, 215, - 171, 107, 64, 190, 81, 154, 125, 181, 198, 115, 47, 102, 218, 17, 73, - ], - 10000000000000, - ), - ( - // Gq83oxEvnrHR6Jp6FaoRnTWap1DAGGFC8mtJbA9vCjb4bju - [ - 188, 59, 2, 36, 110, 172, 192, 202, 100, 118, 21, 205, 120, 224, 17, 213, 225, - 34, 73, 18, 118, 25, 22, 51, 60, 72, 29, 235, 42, 156, 233, 89, - ], - 10000000000, - ), - ( - // ELmaX1aPkyEF7TSmYbbyCjmSgrBpGHv9EtpwR2tk1kmpwvG - [ - 78, 34, 194, 150, 213, 40, 215, 124, 187, 67, 218, 102, 148, 204, 199, 47, 251, - 180, 139, 33, 24, 117, 134, 81, 13, 250, 165, 49, 251, 218, 116, 100, - ], - 10000000000, - ), - ( - // DimyMqRfrnqudRLVf5TxAM3T7X23PKvFDp85DDGabFKMQ2a - [ - 50, 175, 64, 84, 102, 12, 28, 188, 163, 212, 53, 115, 236, 52, 208, 208, 222, - 200, 46, 196, 174, 31, 235, 68, 6, 123, 72, 142, 37, 227, 15, 47, - ], - 10000000000, - ), - ( - // DTLcUu92NoQw4gg6VmNgXeYQiNywDhfYMQBPYg2Y1W6AkJF - [ - 38, 233, 51, 113, 227, 226, 183, 195, 139, 229, 42, 201, 30, 142, 166, 33, 165, - 173, 117, 24, 213, 88, 15, 167, 179, 109, 37, 11, 158, 211, 87, 26, - ], - 10000000000, - ), - ( - // GUuKb4xZuZ13JoDgzWNMC4E1u4166uvkWihvNzZTD3VAHiX - [ - 172, 207, 65, 14, 31, 4, 36, 138, 28, 233, 183, 6, 147, 207, 182, 192, 204, - 118, 71, 241, 30, 225, 18, 128, 106, 53, 79, 187, 2, 204, 186, 10, - ], - 10000000000, - ), - ( - // FmQHyUXoRkGTRySqVUy7NBAVhkKFvTtRtkzVTjZgBzbDzum - [ - 141, 40, 121, 231, 35, 137, 62, 40, 201, 167, 170, 213, 59, 124, 47, 70, 78, - 135, 1, 155, 54, 216, 77, 153, 11, 228, 80, 154, 46, 118, 198, 73, - ], - 10000000000, - ), - ( - // Hadx1N8xZq6tRtXWkm6s5madXTXqVhauDNmesZnpMYTufcv - [ - 221, 107, 54, 131, 62, 37, 69, 9, 140, 135, 91, 210, 182, 0, 182, 224, 224, - 233, 42, 167, 21, 60, 26, 16, 39, 67, 41, 99, 185, 219, 192, 7, - ], - 10000000000, - ), - ( - // CinNnPhc4aGFQb7FWhUpnfwCNwXN3brcnCR1MkazkstcDJa - [ - 6, 116, 96, 152, 14, 88, 143, 217, 64, 53, 184, 138, 34, 250, 75, 50, 44, 231, - 194, 234, 6, 55, 242, 93, 75, 36, 255, 243, 235, 79, 48, 111, - ], - 10000000000, - ), - ( - // HedLwr1CHmab4QAyoVtxub6kdZDT2YkPDaXawpwfhuCVFjN - [ - 224, 118, 40, 222, 170, 156, 111, 187, 242, 40, 143, 135, 147, 150, 255, 53, - 102, 135, 28, 13, 188, 232, 92, 158, 35, 118, 77, 21, 184, 16, 101, 127, - ], - 10000000000000, - ), - ( - // GAToWXwmQoMmxHKCmFJ615WbhdGRcRfyDZi7pg7PBRpQuNY - [ - 158, 190, 239, 1, 80, 163, 51, 87, 2, 62, 103, 139, 255, 245, 73, 96, 46, 105, - 67, 181, 184, 93, 139, 253, 181, 132, 115, 153, 47, 207, 175, 99, - ], - 10000000000, - ), - ( - // JDA8ByXeJcn2BfNabC6WbBJKEBwM4k7oBVenVgJdzL32RJc - [ - 249, 69, 160, 164, 183, 194, 136, 23, 133, 55, 221, 199, 43, 27, 253, 13, 45, - 134, 208, 28, 184, 230, 221, 192, 26, 202, 213, 10, 27, 21, 203, 36, - ], - 10000000000, - ), - ( - // GC8hwHbQ4TdbYJJPDS96G7Uj9bivnW5z56UEkqujjwhQPp5 - [ - 160, 5, 36, 41, 34, 103, 145, 187, 241, 152, 109, 214, 46, 243, 193, 47, 211, - 240, 156, 197, 186, 55, 196, 240, 29, 125, 119, 238, 99, 210, 148, 49, - ], - 10000000000, - ), - ( - // HutJhhrkoiTJGvHgYj4AYd3vvFYURXENzRTxnezm6brt1xs - [ - 236, 25, 52, 121, 225, 123, 10, 228, 189, 96, 219, 217, 60, 155, 167, 104, 10, - 228, 63, 67, 190, 121, 196, 236, 128, 13, 243, 224, 105, 213, 103, 71, - ], - 10000000000, - ), - ( - // FcjmeNzPk3vgdENm1rHeiMCxFK96beUoi2kb59FmCoZtkGF - [ - 134, 140, 213, 79, 174, 161, 160, 228, 88, 54, 99, 91, 43, 246, 88, 115, 52, - 54, 236, 105, 197, 86, 125, 101, 27, 229, 146, 57, 44, 187, 105, 220, - ], - 10000000000, - ), - ( - // FBichC4g5HBmdWCu3ebdADWQbvjbN7KdodNKWBYpLFgxCcd - [ - 115, 119, 207, 242, 138, 62, 20, 248, 72, 21, 155, 51, 44, 84, 161, 114, 156, - 231, 107, 83, 114, 165, 164, 33, 172, 203, 20, 247, 149, 190, 77, 18, - ], - 10000000000, - ), - ( - // GD7gFyisd4soaCxswDtiB8Db1w6y8MYzyrpkKKAu8M35231 - [ - 160, 196, 236, 72, 145, 71, 124, 81, 230, 159, 146, 10, 250, 24, 112, 151, 126, - 187, 51, 129, 250, 94, 174, 2, 141, 125, 250, 22, 204, 112, 0, 119, - ], - 10000000000, - ), - ( - // Ghw9swKjtCTZfEqEmzZkkqK4vEKQFz86HctEdGprQbNzpc7 - [ - 182, 191, 157, 11, 214, 231, 26, 222, 121, 107, 197, 21, 181, 99, 44, 71, 187, - 157, 143, 154, 229, 81, 95, 52, 45, 55, 23, 134, 255, 110, 90, 30, - ], - 10000000000, - ), - ( - // DmeL34GUWzFPmQ26c5n2RBzZLx2ujZ6A8UqcUqXSynEiXfc - [ - 52, 223, 65, 212, 9, 22, 214, 227, 212, 155, 75, 177, 234, 219, 232, 82, 181, - 4, 154, 49, 106, 254, 246, 250, 31, 246, 168, 79, 175, 159, 82, 62, - ], - 10000000000, - ), - ( - // ET9SkhNZhY7KT474vkCEJtAjbgJdaqAGW4beeeUJyDQ3SnA - [ - 82, 255, 215, 44, 83, 40, 21, 179, 236, 157, 19, 41, 26, 209, 152, 148, 24, 18, - 156, 62, 137, 73, 154, 145, 142, 136, 77, 91, 243, 251, 176, 53, - ], - 10000000000, - ), - ( - // DaCSCEQBRmMaBLRQQ5y7swdtfRzjcsewVgCCmngeigwLiax - [ - 44, 36, 100, 44, 239, 20, 231, 115, 21, 191, 70, 124, 0, 145, 124, 116, 154, - 25, 195, 229, 166, 223, 112, 85, 72, 166, 122, 167, 173, 10, 209, 56, - ], - 10000000000, - ), - ( - // HcPppbUzAiKC2p2eGoQJRsPR576nf9XGjchHzTuMj3nx2kb - [ - 222, 194, 40, 146, 253, 194, 235, 82, 101, 181, 34, 32, 139, 134, 232, 64, 75, - 150, 162, 147, 156, 25, 243, 8, 157, 141, 60, 211, 55, 134, 236, 48, - ], - 10000000000, - ), - ( - // F4xrhkWsW2PSqZBuBMVJGE3LQy7R2ZWo3J8d6KEsDznrDF8 - [ - 110, 81, 9, 40, 228, 132, 254, 3, 110, 108, 191, 214, 140, 165, 11, 2, 167, - 150, 57, 189, 181, 40, 44, 237, 95, 188, 233, 157, 253, 168, 156, 91, - ], - 10000000000, - ), - ( - // F59ADM2Yxk38AeaVVb2idB3CovryCWc3H1NKXTD8QbJ6pDG - [ - 110, 115, 183, 14, 218, 139, 70, 141, 109, 46, 108, 212, 137, 153, 141, 94, - 222, 178, 203, 156, 34, 89, 117, 7, 133, 138, 221, 78, 97, 157, 149, 120, - ], - 10000000000, - ), - ( - // DrQHiQu5VkaRuv1H3iELXVqsvD3SV3E8xNjJqXUgECSg23R - [ - 56, 128, 56, 162, 69, 94, 134, 59, 122, 81, 168, 198, 194, 1, 92, 60, 16, 1, - 88, 61, 182, 193, 6, 143, 3, 98, 235, 115, 198, 249, 248, 4, - ], - 10000000000, - ), - ( - // CpjsLDC1JFyrhm3ftC9Gs4QoyrkHKhZKtK7YqGTRFtTafgp - [ - 10, 255, 104, 101, 99, 90, 225, 16, 19, 168, 56, 53, 192, 25, 212, 78, 195, - 248, 101, 20, 89, 67, 244, 135, 174, 130, 168, 231, 190, 211, 166, 107, - ], - 10000000000, - ), - ( - // Dm38nyWQsxjS5adN3MzoX1Mu6j38KMZcWSzfMMmmXwsV9Cu - [ - 52, 104, 200, 187, 129, 116, 62, 176, 52, 247, 248, 32, 174, 160, 70, 86, 240, - 60, 168, 60, 101, 92, 144, 175, 197, 203, 123, 46, 164, 82, 42, 6, - ], - 10000000000, - ), - ( - // FkxWhoWEyJVddzcBwogXQ5VtbdLh8xsAeJwRwjYFem6wMFV - [ - 140, 209, 176, 243, 88, 12, 39, 113, 117, 79, 171, 11, 195, 239, 36, 34, 190, - 180, 127, 75, 245, 5, 35, 10, 57, 100, 235, 83, 223, 37, 192, 27, - ], - 10000000000, - ), - ( - // Cs1jHXYHxZyWKsGPvYY1BknhLdpNa1iXGja4Kn8hQZs7BsH - [ - 12, 187, 74, 219, 1, 175, 121, 197, 96, 99, 105, 16, 67, 4, 88, 172, 68, 207, - 95, 185, 226, 68, 130, 39, 145, 145, 230, 173, 138, 163, 49, 72, - ], - 10000000000, - ), - ( - // GZp9fc6uCyoQqu1Bw6DT5riogXskKtCcn9vHW9tZSeB1s3r - [ - 176, 142, 18, 227, 174, 151, 17, 174, 119, 78, 180, 45, 162, 45, 160, 0, 87, - 158, 217, 109, 169, 65, 45, 207, 21, 201, 52, 231, 7, 44, 40, 126, - ], - 10000000000, - ), - ( - // E8QEnkMMyWWrHPTbA7jo547SpkoGcE6yoTXHmrQeXY2sGnT - [ - 68, 179, 250, 88, 167, 55, 209, 192, 137, 140, 149, 195, 79, 198, 18, 124, 214, - 179, 153, 241, 140, 84, 70, 102, 201, 172, 18, 36, 64, 41, 115, 14, - ], - 10000000000, - ), - ( - // GPdebankLfiSGaEPQWJBVULEmX2VpNdnyqsa1uiFJGDhTdT - [ - 168, 202, 69, 2, 85, 97, 173, 35, 211, 0, 12, 239, 1, 15, 177, 73, 1, 186, 50, - 34, 131, 137, 142, 8, 195, 208, 167, 252, 221, 3, 206, 90, - ], - 10000000000, - ), - ( - // HCFcbfVZUpzJ8YwiEno84FG8tH8ms97dSYJZxURx6p8mFQZ - [ - 204, 88, 161, 4, 79, 211, 105, 244, 82, 11, 187, 174, 226, 18, 241, 32, 61, - 124, 179, 97, 27, 84, 80, 153, 243, 137, 134, 27, 145, 28, 2, 90, - ], - 10000000000, - ), - ( - // Eyvj7oeaHyoqJbNPKPi3zjBks2bNoju3X29xJhsxD8d6GeQ - [ - 106, 121, 162, 203, 24, 32, 88, 130, 95, 169, 119, 223, 202, 52, 55, 120, 129, - 89, 194, 250, 93, 200, 69, 168, 106, 208, 238, 146, 161, 0, 104, 113, - ], - 10000000000, - ), - ( - // GFE82PQadBP1KhdUTwqfSeRtThUhuYjc8iHGdwMXoAaN3Bn - [ - 162, 97, 27, 101, 196, 115, 166, 134, 30, 13, 237, 211, 142, 107, 20, 138, 87, - 77, 165, 10, 133, 77, 181, 60, 105, 241, 234, 73, 65, 240, 214, 40, - ], - 0, - ), - ( - // D9rwRxuG8xm8TZf5tgkbPxhhTJK5frCJU9wvp59VRjcMkUf - [ - 25, 148, 223, 91, 240, 244, 67, 66, 177, 113, 155, 251, 177, 86, 18, 134, 189, - 129, 182, 216, 79, 87, 127, 85, 239, 69, 254, 122, 214, 245, 14, 74, - ], - 10000000000, - ), - ( - // DbuPiksDXhFFEWgjsEghUypTJjQKyULiNESYji3Gaose2NV - [ - 45, 113, 130, 238, 19, 162, 123, 68, 29, 49, 1, 21, 100, 148, 84, 69, 89, 225, - 134, 58, 127, 226, 145, 153, 115, 60, 102, 66, 134, 190, 30, 220, - ], - 10000000000, - ), - ( - // Fd9kKxogYUZLCoMz3uvjFTCkSGXRvgrKh7GEdbSK2yHd4oq - [ - 134, 221, 140, 72, 101, 126, 156, 176, 232, 62, 68, 214, 48, 200, 225, 207, - 118, 30, 155, 146, 50, 148, 132, 194, 143, 230, 100, 154, 75, 126, 251, 95, - ], - 10000000000, - ), - ( - // D5Xo7N2jginhYchuMNud2dYtby899koFcaRo2YWNmUquo5H - [ - 22, 71, 114, 192, 73, 219, 243, 18, 244, 59, 179, 240, 129, 255, 55, 239, 226, - 63, 79, 207, 30, 73, 200, 126, 12, 25, 78, 241, 207, 185, 85, 61, - ], - 10000000000000, - ), - ( - // Fsspzse4QY1KqagdyrVqDt7cmVBr3HSVsfJ38WKgxsLVaXo - [ - 146, 24, 163, 171, 202, 106, 170, 124, 218, 48, 242, 73, 62, 87, 229, 38, 27, - 6, 15, 95, 57, 47, 45, 76, 221, 154, 171, 55, 19, 227, 61, 60, - ], - 10000000000, - ), - ( - // EUwcW86EFGDoDfUP2UJYuBwhCWC7cW9SdFH9cPh6UPBvBHj - [ - 84, 94, 128, 100, 248, 137, 138, 41, 212, 129, 30, 9, 178, 7, 207, 51, 2, 229, - 206, 254, 241, 102, 21, 248, 88, 15, 205, 143, 166, 58, 98, 78, - ], - 10000000000, - ), - ( - // DfiSM1qqP11ECaekbA64L2ENcsWEpGk8df8wf1LAfV2sBd4 - [ - 48, 89, 157, 186, 80, 181, 243, 186, 11, 54, 248, 86, 167, 97, 235, 60, 10, - 238, 97, 232, 48, 212, 190, 180, 72, 239, 148, 182, 173, 146, 190, 57, - ], - 10000000000, - ), - ( - // F4cvT6PhxnD3fQyw8x6oXPA2tT7reCd6sTqHt4W5X5pRvHE - [ - 110, 13, 237, 97, 145, 108, 39, 153, 64, 188, 6, 42, 173, 143, 189, 65, 203, - 167, 80, 48, 141, 107, 169, 19, 232, 162, 101, 127, 73, 146, 87, 68, - ], - 10000000000, - ), - ( - // Etij9aH36W1NjjWbR7wB5j41CmfpqAx8D4V4HCJhUydSH9Y - [ - 102, 129, 3, 218, 239, 82, 46, 105, 22, 6, 78, 232, 226, 125, 179, 58, 185, 80, - 226, 212, 240, 101, 39, 111, 124, 157, 134, 239, 189, 171, 59, 125, - ], - 10000000000, - ), - ( - // EXAK2eErCzDKK79EA5fDQKtNTRvJLYhphAuBstQ8YrTXpTb - [ - 86, 15, 189, 117, 179, 219, 150, 239, 113, 227, 59, 97, 96, 14, 63, 55, 169, - 38, 64, 8, 135, 218, 170, 174, 56, 13, 54, 54, 148, 156, 7, 103, - ], - 10000000000, - ), - ( - // HeeJfizAEvorbkinL4GfRUYpxUiFST3dpnUHrh9ga2Z8Cpm - [ - 224, 121, 100, 203, 232, 1, 100, 86, 252, 215, 248, 252, 162, 92, 173, 203, 4, - 92, 94, 114, 186, 225, 244, 221, 152, 80, 73, 57, 214, 213, 165, 53, - ], - 10000000000, - ), - ( - // Eo9RxTKq2WppUvRRycUmLFHJvHtBVoxURhDe78ZKmjoJfWN - [ - 98, 64, 179, 204, 33, 33, 128, 11, 39, 26, 160, 180, 237, 54, 49, 216, 31, 114, - 140, 17, 80, 141, 23, 117, 49, 94, 210, 145, 31, 236, 86, 105, - ], - 10000000000, - ), - ( - // FX7rJbfiTFCqBuCWHLgR8SosDyZh842nv79mdQF4vxnZrhS - [ - 130, 67, 176, 152, 110, 162, 112, 65, 79, 118, 140, 232, 93, 84, 179, 99, 199, - 69, 153, 213, 187, 214, 21, 190, 202, 107, 120, 194, 32, 231, 95, 55, - ], - 10000000000, - ), - ( - // DAT4gSgyMskggCmTQKfEM6hQgRy1NWdhtfMTAuPLsUAGUPy - [ - 26, 7, 191, 89, 235, 128, 113, 81, 98, 128, 119, 89, 38, 44, 176, 61, 151, 78, - 39, 196, 226, 7, 247, 9, 151, 241, 239, 158, 45, 223, 188, 220, - ], - 10000000000, - ), - ( - // Ce8jPXwfeRfqeKpyzmC2kpoX6vWZw2m8eP22yPCMCEyYxcw - [ - 2, 232, 172, 25, 45, 12, 46, 189, 164, 66, 137, 49, 41, 22, 117, 181, 103, 247, - 231, 17, 150, 44, 7, 224, 150, 240, 212, 155, 146, 21, 197, 107, - ], - 10000000000, - ), - ( - // FKJNhxaXraoh85DRvChSzoDKHMAk9cZYxoq5LQW7uqeAQMD - [ - 121, 64, 44, 43, 157, 217, 64, 203, 229, 183, 240, 194, 112, 125, 176, 13, 131, - 14, 21, 25, 169, 130, 93, 65, 164, 66, 156, 206, 10, 237, 24, 124, - ], - 10000000000, - ), - ( - // G7mWyu1Pom5XreLHUzDEcvFp6WaMuLuo4QKxtDB9yJZnH69 - [ - 156, 176, 212, 221, 211, 47, 147, 50, 218, 199, 5, 157, 226, 56, 184, 228, 137, - 175, 181, 85, 2, 209, 117, 109, 127, 80, 183, 139, 88, 226, 12, 112, - ], - 10000000000, - ), - ( - // GhoRyTGK583sJec8aSiyyJCsP2PQXJ2RK7iPGUjLtuX8XCn - [ - 182, 165, 158, 1, 218, 211, 85, 134, 11, 56, 242, 14, 191, 234, 101, 71, 162, - 51, 167, 224, 197, 223, 112, 8, 132, 137, 81, 64, 207, 166, 158, 97, - ], - 10000000000, - ), - ( - // FfN5P9GqDLuW9oJ57uUZ9bCqNULwkgkLB1jMAEJ4KN7WTwd - [ - 136, 141, 138, 82, 196, 158, 126, 104, 39, 20, 125, 31, 146, 211, 87, 73, 176, - 198, 76, 174, 5, 60, 221, 245, 69, 34, 241, 26, 127, 107, 232, 2, - ], - 10000000000, - ), - ( - // DMqJZaktTRwAiWRYKPGYEQAyfV7VPrAsBSVDt5CJ1v88Mof - [ - 34, 182, 79, 171, 34, 75, 101, 227, 82, 53, 184, 60, 171, 165, 228, 0, 115, - 111, 243, 6, 246, 159, 183, 132, 189, 133, 70, 70, 124, 58, 254, 67, - ], - 10000000000, - ), - ( - // Eo4boG437k7gFy75VqPrWP5gHSGi9Sm6CZzLFFsCGYaSPzM - [ - 98, 48, 113, 40, 209, 49, 150, 220, 41, 26, 197, 30, 104, 23, 60, 88, 1, 254, - 107, 172, 227, 3, 162, 34, 210, 101, 146, 85, 217, 222, 191, 39, - ], - 10000000000, - ), - ( - // HeKaZXya7rPQq7h7KgKnb3jG7n7VBFPr7PFTFYd6ZQbZRiU - [ - 224, 58, 91, 65, 248, 94, 85, 75, 170, 11, 103, 76, 45, 177, 93, 178, 177, 179, - 198, 55, 118, 184, 250, 92, 70, 30, 45, 218, 18, 2, 130, 60, - ], - 10000000000, - ), - ( - // HMELEC4joprcWnXLMNeVAamceYFZkCXg94Euz86VqsjzF6P - [ - 211, 49, 133, 108, 166, 208, 233, 202, 70, 80, 11, 242, 205, 226, 237, 79, 251, - 134, 3, 157, 151, 156, 127, 31, 216, 11, 209, 25, 27, 43, 164, 85, - ], - 10000000000, - ), - ( - // EXPniCSoCiE8XhPxsetVm53VD23hrkfPuwHp1VS7Hu6fo9E - [ - 86, 61, 27, 207, 66, 81, 2, 203, 34, 181, 255, 92, 209, 97, 121, 200, 18, 100, - 44, 207, 2, 47, 194, 222, 77, 86, 157, 186, 139, 177, 109, 4, - ], - 10000000000, - ), - ( - // FRbyyQ55VCnCA3zXPjibseiAYKPhpVo5cDVFaboKw182qYb - [ - 126, 14, 235, 61, 109, 21, 197, 144, 25, 21, 20, 56, 131, 123, 27, 161, 176, - 35, 96, 81, 143, 106, 245, 169, 245, 216, 99, 127, 46, 97, 154, 59, - ], - 10000000000, - ), - ( - // E457XaKbj2yTB2URy8N4UuzmyuFRkcdxYs67UvSgVr7HyFb - [ - 65, 102, 157, 121, 132, 111, 238, 194, 1, 104, 35, 12, 164, 206, 137, 184, 133, - 22, 44, 247, 214, 252, 170, 229, 54, 147, 220, 243, 241, 183, 222, 244, - ], - 10000000000, - ), - ( - // D8vZJdm52tKTsfiXcwGXj7nQcXuBQHVGBvPBw6TcH2TfNUB - [ - 24, 221, 206, 222, 170, 178, 160, 16, 221, 180, 199, 113, 236, 20, 25, 192, 55, - 205, 166, 168, 152, 238, 164, 233, 159, 138, 167, 226, 126, 102, 87, 89, - ], - 10000000000000, - ), - ( - // DNDBcYD8zzqAoZEtgNzouVp2sVxsvqzD4UdB5WrAUwjqpL8 - [ - 34, 255, 247, 107, 180, 160, 165, 214, 108, 255, 3, 146, 219, 192, 131, 171, - 186, 195, 179, 4, 111, 111, 204, 50, 138, 191, 13, 221, 22, 202, 8, 55, - ], - 10000000000, - ), - ( - // EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo - [ - 74, 223, 81, 164, 123, 114, 121, 83, 102, 213, 34, 133, 227, 41, 34, 156, 131, - 110, 167, 187, 254, 19, 157, 190, 143, 160, 112, 12, 79, 134, 252, 86, - ], - 10000000000, - ), - ( - // GcqKn3HHodwcFc3Pg3Evcbc43m7qJNMiMv744e5WMSS7TGn - [ - 178, 219, 195, 92, 207, 8, 98, 148, 160, 210, 78, 16, 145, 208, 140, 163, 181, - 194, 164, 135, 7, 28, 79, 181, 64, 112, 230, 102, 204, 153, 224, 45, - ], - 10000000000, - ), - ( - // DbAdiLJQDFzLyaLsoFCzrpBLuaBXXqQKdpewUSxqiWJadmp - [ - 44, 225, 146, 154, 185, 3, 246, 149, 189, 238, 235, 121, 165, 136, 119, 77, - 113, 70, 131, 98, 18, 145, 54, 241, 183, 247, 179, 26, 50, 149, 143, 152, - ], - 10000000000, - ), - ( - // DmELeszyrQ19S4SFXPYXRuJheZMFgrfWz3DZ1uZFpGD2LeT - [ - 52, 142, 128, 117, 34, 81, 102, 203, 114, 134, 7, 177, 134, 189, 53, 41, 64, - 30, 58, 159, 240, 251, 75, 183, 108, 125, 117, 141, 24, 41, 82, 41, - ], - 10000000000, - ), - ( - // DaMuVKJTzz7TNpaFTNSUUGTs5w6mKUHWjJqTWupyqDmCevR - [ - 44, 68, 69, 173, 120, 236, 41, 145, 71, 147, 110, 176, 2, 127, 132, 212, 100, - 135, 196, 218, 172, 126, 104, 88, 138, 144, 106, 174, 50, 61, 249, 99, - ], - 10000000000, - ), - ( - // HgWWnAXFGikrPVD2FrZ6CRk7KnYdVDn7zVyye8hqFPMc5g1 - [ - 225, 229, 168, 53, 106, 31, 6, 6, 126, 94, 246, 40, 97, 249, 219, 25, 46, 101, - 182, 123, 51, 18, 186, 2, 71, 198, 226, 106, 205, 245, 106, 71, - ], - 10000000000, - ), - ( - // FAn2B22Z3D5cUxvZH9MhXP5VsMhxYd76AHrrLio869y3iLL - [ - 114, 192, 7, 78, 245, 97, 65, 152, 172, 35, 180, 217, 199, 59, 91, 127, 225, - 230, 254, 245, 30, 103, 230, 211, 65, 219, 39, 250, 196, 142, 129, 34, - ], - 10000000000, - ), - ( - // Eodfj4xjkw8ZFLLSS5RfP6vCMw8aM6qfM7BfeQMf6ivFWHy - [ - 98, 159, 194, 5, 122, 69, 107, 118, 50, 196, 224, 195, 2, 104, 73, 245, 130, 5, - 95, 50, 156, 116, 238, 194, 191, 41, 10, 40, 127, 229, 151, 99, - ], - 10000000000, - ), - ( - // CsHw8cfzbnKdkCuUq24yuaPyJ1E5a55sNPqejJZ4h7CRtEs - [ - 12, 241, 215, 60, 75, 48, 248, 249, 112, 128, 173, 96, 17, 94, 5, 165, 16, 80, - 37, 32, 29, 186, 208, 233, 94, 36, 92, 109, 120, 244, 56, 5, - ], - 10000000000, - ), - ( - // F4LocUbsPrcC8xVap4wiTgDakzn3xFyXneuYDHRaHxnb6dH - [ - 109, 215, 171, 105, 161, 188, 205, 45, 187, 120, 36, 135, 248, 1, 80, 155, 243, - 174, 217, 125, 185, 73, 43, 153, 240, 212, 231, 173, 8, 137, 110, 28, - ], - 10000000000, - ), - ( - // EFeCdfpLENVJJNajoDCvSJ9f9CwutiaDeUFxWjA54kWEG17 - [ - 74, 57, 178, 227, 115, 68, 109, 109, 245, 153, 149, 60, 11, 6, 1, 198, 109, 38, - 103, 50, 50, 64, 119, 146, 75, 138, 168, 158, 14, 84, 55, 16, - ], - 10000000000, - ), - ( - // HqHeKZnc38rX2BJrmJiXfkqHUEUn56B9Nck6WgdiGeKUYBE - [ - 232, 151, 138, 159, 249, 52, 215, 86, 171, 97, 181, 30, 42, 156, 55, 65, 146, - 129, 43, 130, 190, 75, 212, 215, 118, 161, 102, 92, 115, 170, 17, 22, - ], - 10000000000000, - ), - ( - // CoqysGbay3t3Q7hXgEmGJJquhYYpo8PqLwvW1WsUwR7KvXm - [ - 10, 80, 189, 80, 152, 191, 196, 83, 56, 254, 215, 66, 252, 122, 147, 90, 255, - 158, 208, 88, 197, 55, 123, 32, 17, 101, 133, 144, 127, 16, 98, 1, - ], - 10000000000, - ), - ( - // HUewJvzVuEeyaxH2vx9XiyAPKrpu1Zj5r5Pi9VrGiBVty7q - [ - 216, 219, 16, 252, 127, 132, 90, 57, 63, 57, 202, 86, 17, 129, 143, 137, 218, - 238, 81, 173, 114, 115, 189, 127, 74, 86, 185, 86, 249, 90, 100, 20, - ], - 10000000000, - ), - ( - // FSfBJoCU9sRhCYWwQ55iBNGU5L8eu56iGnYGK9zizHxu8dY - [ - 126, 220, 235, 202, 131, 108, 161, 1, 188, 144, 63, 148, 51, 188, 81, 85, 38, - 238, 250, 182, 87, 121, 251, 106, 187, 233, 165, 95, 88, 152, 55, 53, - ], - 10000000000, - ), - ( - // F8PTaGuZQo5fgRBFuhNnhd5euFiR3KLQNMVhYD5BduPKpHr - [ - 112, 237, 150, 76, 80, 114, 90, 64, 71, 146, 62, 209, 121, 48, 159, 12, 80, 0, - 210, 41, 43, 166, 95, 215, 140, 210, 144, 58, 63, 70, 53, 123, - ], - 10000000000, - ), - ( - // ELvDjZdLvhbX6FpUbXEWoHbwbxFjxt4BCisp3YRh8UE4Jeu - [ - 78, 63, 217, 189, 49, 72, 151, 246, 158, 18, 14, 56, 41, 71, 93, 226, 204, 190, - 236, 149, 223, 97, 88, 63, 70, 197, 154, 56, 210, 232, 110, 90, - ], - 10000000000, - ), - ( - // E3YV13RQNELEH1Tbqp2SPkFzirJ8u6rzraTuetDgUDLT4Xd - [ - 64, 255, 129, 147, 44, 86, 190, 113, 168, 32, 124, 138, 153, 50, 141, 96, 165, - 162, 176, 111, 212, 14, 208, 94, 196, 178, 214, 106, 235, 202, 255, 104, - ], - 10000000000, - ), - ( - // CdEm1ErGKML3waXabLvn3NyqdAGXBQJVngLaM86YM5Yb9dr - [ - 2, 57, 183, 234, 172, 195, 234, 64, 151, 134, 240, 51, 106, 137, 118, 7, 86, - 35, 172, 239, 49, 159, 197, 119, 124, 118, 3, 61, 213, 133, 184, 64, - ], - 10000000000, - ), - ( - // J6d56aFegPWLLQYoJqxPc4pEexCfxguf4p3FyP2z1ePPQjg - [ - 244, 73, 158, 201, 107, 128, 215, 168, 49, 19, 143, 175, 6, 35, 214, 38, 29, - 232, 230, 81, 175, 150, 7, 5, 24, 160, 59, 53, 111, 188, 53, 1, - ], - 10000000000, - ), - ( - // ErhkFXudde5xXFVMGUtNpiPLvZ9zcvqM3ueRLukDdpjszys - [ - 100, 247, 56, 209, 242, 26, 97, 78, 233, 145, 186, 173, 45, 125, 175, 216, 128, - 34, 5, 78, 240, 1, 9, 143, 132, 186, 84, 60, 19, 167, 61, 65, - ], - 10000000000, - ), - ( - // EFjHdypk8xLf3ocDEFPaKFWVcfamH8mpvfUeXHvRWpSBk2M - [ - 74, 74, 210, 31, 116, 72, 227, 24, 60, 24, 184, 49, 79, 254, 207, 11, 56, 32, - 152, 99, 94, 253, 208, 86, 224, 175, 124, 83, 34, 139, 164, 38, - ], - 10000000000, - ), - ( - // E2ZKmzMzajqW838jXVSM5DyoUJUdEQddXNknEjoTwj2zBLj - [ - 64, 63, 23, 117, 0, 211, 219, 12, 220, 9, 11, 21, 101, 188, 193, 21, 181, 15, - 166, 153, 178, 196, 152, 199, 116, 48, 51, 181, 126, 12, 98, 58, - ], - 10000000000, - ), - ( - // GcgPeEtLketwNDVVdV2jEnaTU5RMdGQdpYqVshssBWy1txZ - [ - 178, 189, 176, 215, 116, 152, 102, 37, 73, 142, 11, 95, 206, 134, 12, 125, 88, - 16, 59, 219, 107, 123, 52, 128, 84, 213, 37, 253, 220, 63, 62, 127, - ], - 10000000000, - ), - ( - // J4RcripfeVGe5ZHUfuteYqDdHMkRkLusSfENRKa2kQ2qa96 - [ - 242, 156, 147, 199, 55, 226, 66, 210, 201, 235, 35, 226, 52, 10, 26, 206, 87, - 153, 192, 198, 121, 146, 241, 90, 44, 186, 213, 45, 242, 220, 123, 113, - ], - 10000000000, - ), - ( - // D8BfryaM5xN62UuKUpLK5zbZEUSBtA76yP9YddQTKXi9pkB - [ - 24, 77, 112, 18, 149, 190, 123, 179, 139, 44, 12, 88, 163, 91, 248, 237, 197, - 146, 103, 28, 83, 209, 73, 210, 6, 224, 55, 220, 124, 155, 235, 123, - ], - 10000000000, - ), - ( - // GFrQQ9cMz6mHdZig9bBJdNmP4CySJvefywouoBa6hdCUyjQ - [ - 162, 219, 62, 134, 60, 242, 117, 166, 56, 13, 214, 181, 253, 61, 15, 90, 130, - 152, 127, 31, 70, 121, 10, 175, 193, 162, 219, 145, 58, 181, 57, 71, - ], - 10000000000, - ), - ( - // DwZBcfHnJtRmR7P23VgHQEzaeGPXQvH8jDvuob2qiyTHJMM - [ - 60, 110, 100, 21, 157, 35, 76, 116, 134, 198, 129, 186, 157, 48, 44, 60, 236, - 65, 80, 253, 201, 189, 178, 104, 142, 151, 68, 15, 207, 241, 7, 40, - ], - 10000000000, - ), - ( - // CrzGYAYYnguxoR5pGx4UbwLs2DkoxoLiLJd8kjZMQzDuq8r - [ - 12, 182, 95, 169, 151, 22, 156, 224, 71, 110, 30, 124, 18, 113, 125, 75, 46, - 116, 241, 87, 125, 218, 224, 2, 223, 182, 118, 63, 87, 242, 216, 3, - ], - 10000000000, - ), - ( - // FagAVsTYT8QghxypUtLcfnmnnhPhPpf854UNuptpQKuNndK - [ - 132, 250, 52, 33, 111, 141, 173, 223, 29, 75, 206, 46, 56, 72, 71, 124, 222, - 140, 211, 139, 226, 179, 165, 161, 38, 254, 36, 111, 96, 86, 124, 60, - ], - 10000000000000, - ), - ( - // DMELEokhPzoNDxYNpNPCfEoLs3BEYX297aE733Nzo3UAtVq - [ - 34, 64, 150, 134, 181, 22, 178, 185, 118, 57, 208, 49, 144, 158, 138, 150, 173, - 134, 233, 98, 130, 148, 157, 2, 15, 104, 100, 29, 63, 193, 250, 121, - ], - 10000000000, - ), - ( - // EqyCQvYn1cHBdzFVQHQeL1nHDcxHhjWR8V48KbDyHyuyCGV - [ - 100, 103, 253, 78, 112, 56, 185, 37, 194, 66, 35, 87, 56, 13, 140, 192, 197, - 241, 125, 39, 47, 99, 154, 248, 252, 253, 31, 17, 86, 222, 112, 64, - ], - 10000000000, - ), - ]; - let count = accounts_and_deposits.len() as u64; - accounts_and_deposits.into_iter().map(|(who, deposit)| (AccountId::from(who), deposit)).for_each(|(who, deposit)| { - use frame_support::traits::ReservableCurrency; - use sp_runtime::traits::Zero; - let leftover = Balances::unreserve(&who, deposit); - if check && !leftover.is_zero() { - log::warn!( - target: "runtime::kusama", - "some account {:?} does not have enough balance for the refund ({}), this is not necessarily a problem.", - who, - leftover, - ); - } - }); - - ::DbWeight::get().reads_writes(count, count) - } -} - -impl OnRuntimeUpgrade for RefundNickPalletDeposit { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - if VERSION.spec_version == 9150 { - log::info!(target: "runtime::kusama", "executing the refund migration of https://github.com/paritytech/polkadot/pull/4656"); - Self::execute(false) - } else { - log::warn!(target: "runtime::kusama", "RefundNickPalletDeposit should be removed"); - 0 - } - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - let _ = Self::execute(true); - Ok(()) - } -} - -// Migration for scheduler pallet to move from a plain Call to a CallOrHash. -pub struct SchedulerMigrationV3; - -impl OnRuntimeUpgrade for SchedulerMigrationV3 { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - Scheduler::migrate_v2_to_v3() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - Scheduler::pre_migrate_to_v3() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - Scheduler::post_migrate_to_v3() - } -} - -/// Migrate session-historical from `Session` to the new pallet prefix `Historical` -pub struct SessionHistoricalPalletPrefixMigration; - -impl OnRuntimeUpgrade for SessionHistoricalPalletPrefixMigration { +pub struct CrowdloanIndexMigration; +impl OnRuntimeUpgrade for CrowdloanIndexMigration { fn on_runtime_upgrade() -> frame_support::weights::Weight { - pallet_session::migrations::v1::migrate::() + crowdloan::migration::crowdloan_index_migration::migrate::() } #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::pre_migrate::(); - Ok(()) + crowdloan::migration::crowdloan_index_migration::pre_migrate::() } #[cfg(feature = "try-runtime")] fn post_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::post_migrate::(); - Ok(()) + crowdloan::migration::crowdloan_index_migration::post_migrate::() } } diff --git a/runtime/kusama/src/weights/pallet_staking.rs b/runtime/kusama/src/weights/pallet_staking.rs index 1a8dbe741806..03746cb767a8 100644 --- a/runtime/kusama/src/weights/pallet_staking.rs +++ b/runtime/kusama/src/weights/pallet_staking.rs @@ -16,11 +16,11 @@ //! Autogenerated weights for `pallet_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 +//! DATE: 2022-02-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot +// target/production/polkadot // benchmark // --chain=kusama-dev // --steps=50 @@ -50,7 +50,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (47_083_000 as Weight) + (33_080_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -60,7 +60,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (79_677_000 as Weight) + (55_828_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -74,7 +74,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (87_481_000 as Weight) + (62_236_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -83,7 +83,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn withdraw_unbonded_update(s: u32, ) -> Weight { - (36_547_000 as Weight) + (25_955_000 as Weight) // Standard Error: 0 .saturating_add((23_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) @@ -102,10 +102,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) - fn withdraw_unbonded_kill(s: u32, ) -> Weight { - (72_430_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) + fn withdraw_unbonded_kill(_s: u32, ) -> Weight { + (52_420_000 as Weight) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } @@ -121,16 +119,16 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (55_595_000 as Weight) + (39_883_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) fn kick(k: u32, ) -> Weight { - (10_034_000 as Weight) - // Standard Error: 9_000 - .saturating_add((11_481_000 as Weight).saturating_mul(k as Weight)) + (7_412_000 as Weight) + // Standard Error: 10_000 + .saturating_add((8_439_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -147,9 +145,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForNominators (r:1 w:1) fn nominate(n: u32, ) -> Weight { - (60_257_000 as Weight) - // Standard Error: 8_000 - .saturating_add((4_191_000 as Weight).saturating_mul(n as Weight)) + (44_263_000 as Weight) + // Standard Error: 7_000 + .saturating_add((2_971_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(6 as Weight)) @@ -162,49 +160,49 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (52_552_000 as Weight) + (38_258_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (8_794_000 as Weight) + (6_269_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (18_992_000 as Weight) + (13_119_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (1_619_000 as Weight) + (855_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (1_667_000 as Weight) + (877_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (1_743_000 as Weight) + (892_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (1_677_000 as Weight) + (907_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) fn set_invulnerables(v: u32, ) -> Weight { - (1_852_000 as Weight) + (1_431_000 as Weight) // Standard Error: 0 - .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((50_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -221,18 +219,18 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) fn force_unstake(s: u32, ) -> Weight { - (68_818_000 as Weight) + (48_841_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_104_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((681_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) fn cancel_deferred_slash(s: u32, ) -> Weight { - (966_416_000 as Weight) - // Standard Error: 55_000 - .saturating_add((4_979_000 as Weight).saturating_mul(s as Weight)) + (972_369_000 as Weight) + // Standard Error: 56_000 + .saturating_add((4_959_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -247,9 +245,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (94_709_000 as Weight) - // Standard Error: 17_000 - .saturating_add((32_919_000 as Weight).saturating_mul(n as Weight)) + (69_502_000 as Weight) + // Standard Error: 15_000 + .saturating_add((22_085_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -267,9 +265,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (123_535_000 as Weight) - // Standard Error: 28_000 - .saturating_add((44_813_000 as Weight).saturating_mul(n as Weight)) + (106_569_000 as Weight) + // Standard Error: 22_000 + .saturating_add((30_957_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -282,9 +280,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn rebond(l: u32, ) -> Weight { - (78_279_000 as Weight) - // Standard Error: 4_000 - .saturating_add((55_000 as Weight).saturating_mul(l as Weight)) + (55_386_000 as Weight) + // Standard Error: 3_000 + .saturating_add((46_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -299,8 +297,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn set_history_depth(e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 66_000 - .saturating_add((26_032_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 58_000 + .saturating_add((18_996_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) @@ -319,9 +317,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) fn reap_stash(s: u32, ) -> Weight { - (76_424_000 as Weight) + (54_679_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_103_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((686_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -347,10 +345,10 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 865_000 - .saturating_add((235_921_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 43_000 - .saturating_add((37_925_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 812_000 + .saturating_add((214_379_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 40_000 + .saturating_add((31_034_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(192 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -369,12 +367,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System BlockWeight (r:1 w:1) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 87_000 - .saturating_add((23_516_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 87_000 - .saturating_add((27_548_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 2_968_000 - .saturating_add((21_935_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 84_000 + .saturating_add((17_549_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 84_000 + .saturating_add((21_476_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 2_867_000 + .saturating_add((20_385_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(188 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -385,8 +383,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System BlockWeight (r:1 w:1) fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 28_000 - .saturating_add((9_481_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 23_000 + .saturating_add((6_821_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -398,12 +396,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (4_323_000 as Weight) + (2_647_000 as Weight) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) - // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking MaxNominatorsCount (r:1 w:0) // Storage: Staking CounterForNominators (r:1 w:1) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -412,12 +410,14 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (64_253_000 as Weight) + (47_009_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } + // Storage: Staking MinCommission (r:1 w:0) + // Storage: Staking Validators (r:1 w:1) fn force_apply_min_commission() -> Weight { - (9_652_000 as Weight) + (6_737_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } diff --git a/runtime/metrics/Cargo.toml b/runtime/metrics/Cargo.toml index 97bf343aff67..14aefaa2626f 100644 --- a/runtime/metrics/Cargo.toml +++ b/runtime/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-runtime-metrics" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/runtime/parachains/Cargo.toml b/runtime/parachains/Cargo.toml index 977df4c3ef08..028b749452d9 100644 --- a/runtime/parachains/Cargo.toml +++ b/runtime/parachains/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-runtime-parachains" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" @@ -41,7 +41,7 @@ xcm = { package = "xcm", path = "../../xcm", default-features = false } xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -rand = { version = "0.8.3", default-features = false } +rand = { version = "0.8.5", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } static_assertions = { version = "1.1.0", optional = true } polkadot-runtime-metrics = { path = "../metrics", default-features = false} diff --git a/runtime/parachains/src/paras/mod.rs b/runtime/parachains/src/paras/mod.rs index 5422cf17240e..75fa5f8e012e 100644 --- a/runtime/parachains/src/paras/mod.rs +++ b/runtime/parachains/src/paras/mod.rs @@ -481,10 +481,10 @@ pub mod pallet { /// The given para either initiated or subscribed to a PVF check for the given validation /// code. `code_hash` `para_id` PvfCheckStarted(ValidationCodeHash, ParaId), - /// The given validation code was rejected by the PVF pre-checking vote. + /// The given validation code was accepted by the PVF pre-checking vote. /// `code_hash` `para_id` PvfCheckAccepted(ValidationCodeHash, ParaId), - /// The given validation code was accepted by the PVF pre-checking vote. + /// The given validation code was rejected by the PVF pre-checking vote. /// `code_hash` `para_id` PvfCheckRejected(ValidationCodeHash, ParaId), } diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index 52eb58cb063a..f8f5a5d915bb 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-runtime" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" @@ -14,7 +14,7 @@ rustc-hex = { version = "2.1.0", default-features = false } serde = { version = "1.0.136", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" -smallvec = "1.6.1" +smallvec = "1.8.0" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -94,7 +94,7 @@ tiny-keccak = "2.0.2" keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } trie-db = "0.23.1" -serde_json = "1.0.78" +serde_json = "1.0.79" separator = "0.4.1" [build-dependencies] diff --git a/runtime/polkadot/constants/Cargo.toml b/runtime/polkadot/constants/Cargo.toml index f63232a3565f..2743da8533a0 100644 --- a/runtime/polkadot/constants/Cargo.toml +++ b/runtime/polkadot/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "polkadot-runtime-constants" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" [dependencies] -smallvec = "1.6.1" +smallvec = "1.8.0" frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 09d74520ed28..41f5ffdd34f0 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -64,10 +64,7 @@ use primitives::{ }, v2::SessionInfo, }; -use sp_core::{ - u32_trait::{_1, _2, _3, _4, _5}, - OpaqueMetadata, -}; +use sp_core::OpaqueMetadata; use sp_runtime::{ create_runtime_str, curve::PiecewiseLinear, @@ -114,13 +111,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("polkadot"), impl_name: create_runtime_str!("parity-polkadot"), authoring_version: 0, - spec_version: 9160, + spec_version: 9170, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] apis: version::create_apis_vec![[]], - transaction_version: 10, + transaction_version: 11, state_version: 0, }; @@ -192,7 +189,7 @@ impl Contains for BaseFilter { type MoreThanHalfCouncil = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionMoreThan, >; parameter_types! { @@ -236,7 +233,7 @@ parameter_types! { type ScheduleOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; /// Used the compare the privilege of an origin inside the scheduler. @@ -501,7 +498,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type ForceOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; type VoterSnapshotPerBlock = VoterSnapshotPerBlock; @@ -549,7 +546,7 @@ parameter_types! { type SlashCancelOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl frame_election_provider_support::onchain::Config for Runtime { @@ -631,41 +628,41 @@ impl pallet_democracy::Config for Runtime { type MinimumDeposit = MinimumDeposit; /// A straight majority of the council can decide what their next motion is. type ExternalOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, frame_system::EnsureRoot, >; /// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. type ExternalMajorityOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, frame_system::EnsureRoot, >; /// A unanimous council can have the next scheduled referendum be a straight default-carries /// (NTB) vote. type ExternalDefaultOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, frame_system::EnsureRoot, >; /// Two thirds of the technical committee can have an `ExternalMajority/ExternalDefault` vote /// be tabled immediately and with a shorter voting/enactment period. type FastTrackOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>, + pallet_collective::EnsureProportionAtLeast, frame_system::EnsureRoot, >; type InstantOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, + pallet_collective::EnsureProportionAtLeast, frame_system::EnsureRoot, >; type InstantAllowed = InstantAllowed; type FastTrackVotingPeriod = FastTrackVotingPeriod; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. type CancellationOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, EnsureRoot, >; // To cancel a proposal before it has been passed, the technical committee must be unanimous or // Root must agree. type CancelProposalOrigin = EnsureOneOf< - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, + pallet_collective::EnsureProportionAtLeast, EnsureRoot, >; type BlacklistOrigin = EnsureRoot; @@ -793,7 +790,7 @@ parameter_types! { type ApproveOrigin = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl pallet_treasury::Config for Runtime { @@ -968,7 +965,7 @@ impl claims::Config for Runtime { type Prefix = Prefix; /// At least 3/4 of the council must agree to a claim move before it can happen. type MoveClaimOrigin = - pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; type WeightInfo = weights::runtime_common_claims::WeightInfo; } @@ -1308,7 +1305,7 @@ parameter_types! { type AuctionInitiate = EnsureOneOf< EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; impl auctions::Config for Runtime { @@ -1446,16 +1443,33 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (SchedulerMigrationV3, FixCouncilDepositMigration), + (FixCouncilDepositMigration, CrowdloanIndexMigration), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; +// Migration for crowdloan pallet to use fund index for account generation. +pub struct CrowdloanIndexMigration; +impl OnRuntimeUpgrade for CrowdloanIndexMigration { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + crowdloan::migration::crowdloan_index_migration::migrate::() + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result<(), &'static str> { + crowdloan::migration::crowdloan_index_migration::pre_migrate::() + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade() -> Result<(), &'static str> { + crowdloan::migration::crowdloan_index_migration::post_migrate::() + } +} + /// A migration struct to fix some deposits in the council election pallet. /// /// See more details here: https://github.com/paritytech/polkadot/issues/4160 pub struct FixCouncilDepositMigration; - impl FixCouncilDepositMigration { fn execute(check: bool) -> frame_support::weights::Weight { let accounts = vec![ @@ -1630,7 +1644,7 @@ impl FixCouncilDepositMigration { impl OnRuntimeUpgrade for FixCouncilDepositMigration { fn on_runtime_upgrade() -> frame_support::weights::Weight { - if VERSION.spec_version == 9150 { + if VERSION.spec_version == 9180 { Self::execute(false) } else { log::warn!(target: "runtime::polkadot", "FixCouncilDepositMigration should be removed."); @@ -1645,65 +1659,6 @@ impl OnRuntimeUpgrade for FixCouncilDepositMigration { } } -// Migration for scheduler pallet to move from a plain Call to a CallOrHash. -pub struct SchedulerMigrationV3; - -impl OnRuntimeUpgrade for SchedulerMigrationV3 { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - Scheduler::migrate_v2_to_v3() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - Scheduler::pre_migrate_to_v3() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - Scheduler::post_migrate_to_v3() - } -} - -// Migration to generate pallet staking's `SortedListProvider` from pre-existing nominators. -pub struct StakingBagsListMigrationV8; - -impl OnRuntimeUpgrade for StakingBagsListMigrationV8 { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - pallet_staking::migrations::v8::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - pallet_staking::migrations::v8::pre_migrate::() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - pallet_staking::migrations::v8::post_migrate::() - } -} - -/// Migrate session-historical from `Session` to the new pallet prefix `Historical` -pub struct SessionHistoricalPalletPrefixMigration; - -impl OnRuntimeUpgrade for SessionHistoricalPalletPrefixMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - pallet_session::migrations::v1::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::pre_migrate::(); - Ok(()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::post_migrate::(); - Ok(()) - } -} - #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; diff --git a/runtime/polkadot/src/weights/pallet_staking.rs b/runtime/polkadot/src/weights/pallet_staking.rs index 320bdf414399..0c87c9a18422 100644 --- a/runtime/polkadot/src/weights/pallet_staking.rs +++ b/runtime/polkadot/src/weights/pallet_staking.rs @@ -16,11 +16,11 @@ //! Autogenerated weights for `pallet_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 +//! DATE: 2022-02-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot +// target/production/polkadot // benchmark // --chain=polkadot-dev // --steps=50 @@ -50,7 +50,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (46_648_000 as Weight) + (31_759_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -60,7 +60,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (93_200_000 as Weight) + (56_216_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -74,7 +74,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (85_556_000 as Weight) + (61_282_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -83,9 +83,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn withdraw_unbonded_update(s: u32, ) -> Weight { - (35_593_000 as Weight) + (25_266_000 as Weight) // Standard Error: 0 - .saturating_add((24_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((26_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -102,8 +102,10 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) - fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (69_345_000 as Weight) + fn withdraw_unbonded_kill(s: u32, ) -> Weight { + (50_163_000 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } @@ -119,16 +121,16 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (52_887_000 as Weight) + (38_409_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) fn kick(k: u32, ) -> Weight { - (7_581_000 as Weight) - // Standard Error: 10_000 - .saturating_add((10_632_000 as Weight).saturating_mul(k as Weight)) + (9_845_000 as Weight) + // Standard Error: 6_000 + .saturating_add((7_527_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -145,9 +147,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForNominators (r:1 w:1) fn nominate(n: u32, ) -> Weight { - (58_419_000 as Weight) - // Standard Error: 14_000 - .saturating_add((3_918_000 as Weight).saturating_mul(n as Weight)) + (42_880_000 as Weight) + // Standard Error: 12_000 + .saturating_add((2_791_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(6 as Weight)) @@ -160,49 +162,49 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (50_866_000 as Weight) + (36_530_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (8_781_000 as Weight) + (5_972_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (18_038_000 as Weight) + (12_233_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (1_635_000 as Weight) + (833_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (1_735_000 as Weight) + (878_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (1_745_000 as Weight) + (861_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (1_714_000 as Weight) + (883_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) fn set_invulnerables(v: u32, ) -> Weight { - (1_707_000 as Weight) + (1_224_000 as Weight) // Standard Error: 0 - .saturating_add((54_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -219,18 +221,18 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) fn force_unstake(s: u32, ) -> Weight { - (66_037_000 as Weight) + (47_441_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_110_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((679_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) fn cancel_deferred_slash(s: u32, ) -> Weight { - (972_390_000 as Weight) + (976_712_000 as Weight) // Standard Error: 56_000 - .saturating_add((4_972_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((4_963_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -245,9 +247,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (80_586_000 as Weight) - // Standard Error: 31_000 - .saturating_add((32_648_000 as Weight).saturating_mul(n as Weight)) + (75_103_000 as Weight) + // Standard Error: 13_000 + .saturating_add((21_463_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -265,9 +267,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (113_235_000 as Weight) - // Standard Error: 27_000 - .saturating_add((44_077_000 as Weight).saturating_mul(n as Weight)) + (95_625_000 as Weight) + // Standard Error: 21_000 + .saturating_add((30_353_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -280,9 +282,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn rebond(l: u32, ) -> Weight { - (77_378_000 as Weight) + (54_540_000 as Weight) // Standard Error: 4_000 - .saturating_add((40_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((55_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -297,8 +299,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn set_history_depth(e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 66_000 - .saturating_add((24_764_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 56_000 + .saturating_add((18_323_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) @@ -317,9 +319,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) fn reap_stash(s: u32, ) -> Weight { - (73_759_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_124_000 as Weight).saturating_mul(s as Weight)) + (53_101_000 as Weight) + // Standard Error: 0 + .saturating_add((683_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -345,10 +347,10 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 746_000 - .saturating_add((229_359_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 37_000 - .saturating_add((36_336_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 762_000 + .saturating_add((212_772_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 38_000 + .saturating_add((30_285_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(187 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -367,12 +369,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System BlockWeight (r:1 w:1) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 88_000 - .saturating_add((22_559_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 88_000 - .saturating_add((26_204_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 2_996_000 - .saturating_add((9_344_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 89_000 + .saturating_add((16_677_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 89_000 + .saturating_add((19_907_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 3_042_000 + .saturating_add((9_465_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(183 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -383,8 +385,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System BlockWeight (r:1 w:1) fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) - // Standard Error: 25_000 - .saturating_add((8_862_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 24_000 + .saturating_add((6_471_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -396,12 +398,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (4_177_000 as Weight) + (2_693_000 as Weight) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) - // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking MaxNominatorsCount (r:1 w:0) // Storage: Staking CounterForNominators (r:1 w:1) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -410,12 +412,14 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (61_357_000 as Weight) + (46_426_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } + // Storage: Staking MinCommission (r:1 w:0) + // Storage: Staking Validators (r:1 w:1) fn force_apply_min_commission() -> Weight { - (9_652_000 as Weight) + (6_409_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index ff5155b7e2d3..ac92aeeb2b51 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rococo-runtime" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" @@ -10,7 +10,7 @@ parity-scale-codec = { version = "2.3.1", default-features = false, features = [ scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.136", default-features = false } serde_derive = { version = "1.0.117", optional = true } -smallvec = "1.6.1" +smallvec = "1.8.0" log = { version = "0.4.14", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/rococo/constants/Cargo.toml b/runtime/rococo/constants/Cargo.toml index 3851b6d6c8e8..aab5b507a6c3 100644 --- a/runtime/rococo/constants/Cargo.toml +++ b/runtime/rococo/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "rococo-runtime-constants" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" [dependencies] -smallvec = "1.6.1" +smallvec = "1.8.0" frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index fa65abcc23ce..021d66c37418 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -154,11 +154,29 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (SessionHistoricalModulePrefixMigration,), + (SessionHistoricalModulePrefixMigration, CrowdloanIndexMigration), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; +// Migration for crowdloan pallet to use fund index for account generation. +pub struct CrowdloanIndexMigration; +impl OnRuntimeUpgrade for CrowdloanIndexMigration { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + crowdloan::migration::crowdloan_index_migration::migrate::() + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result<(), &'static str> { + crowdloan::migration::crowdloan_index_migration::pre_migrate::() + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade() -> Result<(), &'static str> { + crowdloan::migration::crowdloan_index_migration::post_migrate::() + } +} + /// Migrate session-historical from `Session` to the new pallet prefix `Historical` pub struct SessionHistoricalModulePrefixMigration; diff --git a/runtime/test-runtime/Cargo.toml b/runtime/test-runtime/Cargo.toml index 4611388bf2e0..45b434f0baa5 100644 --- a/runtime/test-runtime/Cargo.toml +++ b/runtime/test-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-test-runtime" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" @@ -13,7 +13,7 @@ rustc-hex = { version = "2.1.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.136", default-features = false } serde_derive = { version = "1.0.117", optional = true } -smallvec = "1.6.1" +smallvec = "1.8.0" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -69,7 +69,7 @@ hex-literal = "0.3.4" tiny-keccak = "2.0.2" 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.78" +serde_json = "1.0.79" [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/runtime/test-runtime/constants/Cargo.toml b/runtime/test-runtime/constants/Cargo.toml index 5bfac0d79fef..820dcee5083e 100644 --- a/runtime/test-runtime/constants/Cargo.toml +++ b/runtime/test-runtime/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "test-runtime-constants" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" [dependencies] -smallvec = "1.6.1" +smallvec = "1.8.0" frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false } diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 3bd6a73b4356..37ad7429b4d0 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "westend-runtime" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" @@ -13,7 +13,7 @@ log = { version = "0.4.14", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } serde = { version = "1.0.136", default-features = false } serde_derive = { version = "1.0.117", optional = true } -smallvec = "1.6.1" +smallvec = "1.8.0" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -95,7 +95,7 @@ hex-literal = "0.3.4" tiny-keccak = "2.0.2" 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.78" +serde_json = "1.0.79" [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/runtime/westend/constants/Cargo.toml b/runtime/westend/constants/Cargo.toml index e401f22a3611..9a104eadca88 100644 --- a/runtime/westend/constants/Cargo.toml +++ b/runtime/westend/constants/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "westend-runtime-constants" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2021" [dependencies] -smallvec = "1.6.1" +smallvec = "1.8.0" frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index eb5af15c4af5..a23d653dcc60 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -111,13 +111,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("westend"), impl_name: create_runtime_str!("parity-westend"), authoring_version: 2, - spec_version: 9160, + spec_version: 9170, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] apis: version::create_apis_vec![[]], - transaction_version: 9, + transaction_version: 10, state_version: 0, }; @@ -1084,50 +1084,29 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (SessionHistoricalPalletPrefixMigration, SchedulerMigrationV3), + CrowdloanIndexMigration, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; -// Migration for scheduler pallet to move from a plain Call to a CallOrHash. -pub struct SchedulerMigrationV3; - -impl OnRuntimeUpgrade for SchedulerMigrationV3 { +// Migration for crowdloan pallet to use fund index for account generation. +pub struct CrowdloanIndexMigration; +impl OnRuntimeUpgrade for CrowdloanIndexMigration { fn on_runtime_upgrade() -> frame_support::weights::Weight { - Scheduler::migrate_v2_to_v3() + crowdloan::migration::crowdloan_index_migration::migrate::() } #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<(), &'static str> { - Scheduler::pre_migrate_to_v3() + crowdloan::migration::crowdloan_index_migration::pre_migrate::() } #[cfg(feature = "try-runtime")] fn post_upgrade() -> Result<(), &'static str> { - Scheduler::post_migrate_to_v3() + crowdloan::migration::crowdloan_index_migration::post_migrate::() } } -/// Migrate session-historical from `Session` to the new pallet prefix `Historical` -pub struct SessionHistoricalPalletPrefixMigration; - -impl OnRuntimeUpgrade for SessionHistoricalPalletPrefixMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - pallet_session::migrations::v1::migrate::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::pre_migrate::(); - Ok(()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - pallet_session::migrations::v1::post_migrate::(); - Ok(()) - } -} #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; diff --git a/runtime/westend/src/weights/pallet_staking.rs b/runtime/westend/src/weights/pallet_staking.rs index ff0c1414c45f..35153742a39b 100644 --- a/runtime/westend/src/weights/pallet_staking.rs +++ b/runtime/westend/src/weights/pallet_staking.rs @@ -16,11 +16,11 @@ //! Autogenerated weights for `pallet_staking` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 +//! DATE: 2022-02-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: -// target/release/polkadot +// target/production/polkadot // benchmark // --chain=westend-dev // --steps=50 @@ -50,7 +50,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn bond() -> Weight { - (47_262_000 as Weight) + (32_440_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -60,7 +60,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListNodes (r:3 w:3) // Storage: BagsList ListBags (r:2 w:2) fn bond_extra() -> Weight { - (79_887_000 as Weight) + (56_487_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -74,7 +74,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn unbond() -> Weight { - (85_963_000 as Weight) + (61_875_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -83,9 +83,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn withdraw_unbonded_update(s: u32, ) -> Weight { - (35_896_000 as Weight) + (25_863_000 as Weight) // Standard Error: 0 - .saturating_add((26_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((20_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -103,7 +103,7 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Balances Locks (r:1 w:1) // Storage: Staking Payee (r:0 w:1) fn withdraw_unbonded_kill(_s: u32, ) -> Weight { - (72_077_000 as Weight) + (50_959_000 as Weight) .saturating_add(T::DbWeight::get().reads(13 as Weight)) .saturating_add(T::DbWeight::get().writes(11 as Weight)) } @@ -119,16 +119,16 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForValidators (r:1 w:1) fn validate() -> Weight { - (54_511_000 as Weight) + (38_972_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) fn kick(k: u32, ) -> Weight { - (8_643_000 as Weight) - // Standard Error: 10_000 - .saturating_add((10_900_000 as Weight).saturating_mul(k as Weight)) + (7_487_000 as Weight) + // Standard Error: 7_000 + .saturating_add((7_760_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -145,9 +145,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList CounterForListNodes (r:1 w:1) // Storage: Staking CounterForNominators (r:1 w:1) fn nominate(n: u32, ) -> Weight { - (59_971_000 as Weight) - // Standard Error: 12_000 - .saturating_add((4_119_000 as Weight).saturating_mul(n as Weight)) + (43_680_000 as Weight) + // Standard Error: 18_000 + .saturating_add((2_925_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(6 as Weight)) @@ -160,49 +160,49 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill() -> Weight { - (51_777_000 as Weight) + (37_137_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) // Storage: Staking Payee (r:0 w:1) fn set_payee() -> Weight { - (8_915_000 as Weight) + (6_059_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) // Storage: Staking Ledger (r:2 w:2) fn set_controller() -> Weight { - (19_193_000 as Weight) + (13_048_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Staking ValidatorCount (r:0 w:1) fn set_validator_count() -> Weight { - (1_640_000 as Weight) + (890_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_no_eras() -> Weight { - (1_734_000 as Weight) + (948_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era() -> Weight { - (1_674_000 as Weight) + (948_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking ForceEra (r:0 w:1) fn force_new_era_always() -> Weight { - (1_724_000 as Weight) + (956_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Invulnerables (r:0 w:1) fn set_invulnerables(v: u32, ) -> Weight { - (2_123_000 as Weight) + (1_179_000 as Weight) // Standard Error: 0 - .saturating_add((53_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((51_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Staking Bonded (r:1 w:1) @@ -219,18 +219,18 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:2) fn force_unstake(s: u32, ) -> Weight { - (66_317_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_135_000 as Weight).saturating_mul(s as Weight)) + (48_467_000 as Weight) + // Standard Error: 1_000 + .saturating_add((683_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) } // Storage: Staking UnappliedSlashes (r:1 w:1) fn cancel_deferred_slash(s: u32, ) -> Weight { - (974_067_000 as Weight) + (972_637_000 as Weight) // Standard Error: 56_000 - .saturating_add((4_968_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((4_967_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -245,9 +245,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:2 w:0) // Storage: System Account (r:2 w:2) fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (86_009_000 as Weight) - // Standard Error: 28_000 - .saturating_add((31_926_000 as Weight).saturating_mul(n as Weight)) + (66_372_000 as Weight) + // Standard Error: 22_000 + .saturating_add((21_459_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -265,9 +265,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:2 w:2) fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (103_160_000 as Weight) - // Standard Error: 33_000 - .saturating_add((42_579_000 as Weight).saturating_mul(n as Weight)) + (76_580_000 as Weight) + // Standard Error: 26_000 + .saturating_add((29_719_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -280,9 +280,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Bonded (r:1 w:0) // Storage: BagsList ListBags (r:2 w:2) fn rebond(l: u32, ) -> Weight { - (76_896_000 as Weight) + (55_358_000 as Weight) // Standard Error: 3_000 - .saturating_add((51_000 as Weight).saturating_mul(l as Weight)) + .saturating_add((36_000 as Weight).saturating_mul(l as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -297,8 +297,8 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn set_history_depth(e: u32, ) -> Weight { (0 as Weight) - // Standard Error: 64_000 - .saturating_add((25_827_000 as Weight).saturating_mul(e as Weight)) + // Standard Error: 58_000 + .saturating_add((19_212_000 as Weight).saturating_mul(e as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight))) @@ -317,9 +317,9 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking Payee (r:0 w:1) // Storage: Staking SpanSlash (r:0 w:1) fn reap_stash(s: u32, ) -> Weight { - (74_910_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_122_000 as Weight).saturating_mul(s as Weight)) + (54_330_000 as Weight) + // Standard Error: 0 + .saturating_add((684_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(12 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -345,10 +345,10 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking ErasStartSessionIndex (r:0 w:1) fn new_era(v: u32, n: u32, ) -> Weight { (0 as Weight) - // Standard Error: 824_000 - .saturating_add((234_984_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 41_000 - .saturating_add((37_717_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 764_000 + .saturating_add((209_852_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 38_000 + .saturating_add((30_373_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(187 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -367,10 +367,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: System BlockWeight (r:1 w:1) fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { (0 as Weight) - // Standard Error: 92_000 - .saturating_add((23_935_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 92_000 - .saturating_add((26_672_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 84_000 + .saturating_add((17_585_000 as Weight).saturating_mul(v as Weight)) + // Standard Error: 84_000 + .saturating_add((20_706_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 2_887_000 + .saturating_add((16_681_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(183 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(n as Weight))) @@ -382,7 +384,7 @@ impl pallet_staking::WeightInfo for WeightInfo { fn get_npos_targets(v: u32, ) -> Weight { (0 as Weight) // Standard Error: 29_000 - .saturating_add((9_594_000 as Weight).saturating_mul(v as Weight)) + .saturating_add((6_941_000 as Weight).saturating_mul(v as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -394,12 +396,12 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: Staking MaxNominatorsCount (r:0 w:1) // Storage: Staking MinNominatorBond (r:0 w:1) fn set_staking_configs() -> Weight { - (4_215_000 as Weight) + (2_729_000 as Weight) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Staking Ledger (r:1 w:0) - // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking Nominators (r:1 w:1) + // Storage: Staking ChillThreshold (r:1 w:0) // Storage: Staking MaxNominatorsCount (r:1 w:0) // Storage: Staking CounterForNominators (r:1 w:1) // Storage: Staking MinNominatorBond (r:1 w:0) @@ -408,12 +410,14 @@ impl pallet_staking::WeightInfo for WeightInfo { // Storage: BagsList ListBags (r:1 w:1) // Storage: BagsList CounterForListNodes (r:1 w:1) fn chill_other() -> Weight { - (64_678_000 as Weight) + (46_390_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } + // Storage: Staking MinCommission (r:1 w:0) + // Storage: Staking Validators (r:1 w:1) fn force_apply_min_commission() -> Weight { - (9_652_000 as Weight) + (6_606_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } diff --git a/statement-table/Cargo.toml b/statement-table/Cargo.toml index 8892e4a2fbf6..d4f95908775b 100644 --- a/statement-table/Cargo.toml +++ b/statement-table/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-statement-table" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/utils/generate-bags/Cargo.toml b/utils/generate-bags/Cargo.toml index 3561712340a2..4cb2d82e3083 100644 --- a/utils/generate-bags/Cargo.toml +++ b/utils/generate-bags/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-voter-bags" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" diff --git a/utils/remote-ext-tests/bags-list/Cargo.toml b/utils/remote-ext-tests/bags-list/Cargo.toml index fbc42a30c74e..ad4ac13acc4f 100644 --- a/utils/remote-ext-tests/bags-list/Cargo.toml +++ b/utils/remote-ext-tests/bags-list/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "remote-ext-tests-bags-list" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] -polkadot-runtime = { version = "0.9.16", path = "../../../runtime/polkadot" } -kusama-runtime = { version = "0.9.16", path = "../../../runtime/kusama" } -westend-runtime = { version = "0.9.16", path = "../../../runtime/westend" } -polkadot-runtime-constants = { version = "0.9.16", path = "../../../runtime/polkadot/constants" } -kusama-runtime-constants = { version = "0.9.16", path = "../../../runtime/kusama/constants" } -westend-runtime-constants = { version = "0.9.16", path = "../../../runtime/westend/constants" } +polkadot-runtime = { version = "0.9.17", path = "../../../runtime/polkadot" } +kusama-runtime = { version = "0.9.17", path = "../../../runtime/kusama" } +westend-runtime = { version = "0.9.17", path = "../../../runtime/westend" } +polkadot-runtime-constants = { version = "0.9.17", path = "../../../runtime/polkadot/constants" } +kusama-runtime-constants = { version = "0.9.17", path = "../../../runtime/kusama/constants" } +westend-runtime-constants = { version = "0.9.17", path = "../../../runtime/westend/constants" } pallet-bags-list-remote-tests = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -19,4 +19,4 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } clap = { version = "3.0", features = ["derive"] } log = "0.4.14" -tokio = { version = "1", features = ["macros"] } +tokio = { version = "1.17.0", features = ["macros"] } diff --git a/utils/staking-miner/Cargo.toml b/utils/staking-miner/Cargo.toml index 5f7a8026dd0f..63ce86612f80 100644 --- a/utils/staking-miner/Cargo.toml +++ b/utils/staking-miner/Cargo.toml @@ -1,20 +1,20 @@ [package] name = "staking-miner" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] edition = "2018" [dependencies] clap = { version = "3.0", features = ["derive", "env"] } codec = { package = "parity-scale-codec", version = "2.0.0" } -env_logger = "0.9.0" -jsonrpsee = { version = "0.8", features = ["ws-client"] } +tracing-subscriber = { version = "0.3.9", features = ["env-filter"] } +jsonrpsee = { version = "0.8", features = ["ws-client", "macros"] } log = "0.4.11" paste = "1.0.6" serde = "1.0.136" serde_json = "1.0" thiserror = "1.0.30" -tokio = { version = "1.15", features = ["macros", "rt-multi-thread", "sync"] } +tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread", "sync"] } remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/utils/staking-miner/src/dry_run.rs b/utils/staking-miner/src/dry_run.rs index 81d17a21ae33..7c11f7ee106e 100644 --- a/utils/staking-miner/src/dry_run.rs +++ b/utils/staking-miner/src/dry_run.rs @@ -16,12 +16,11 @@ //! The dry-run command. -use crate::{ - prelude::*, rpc_helpers::*, signer::Signer, DryRunConfig, Error, SharedConfig, WsClient, -}; +use crate::{prelude::*, rpc::*, signer::Signer, DryRunConfig, Error, SharedRpcClient}; use codec::Encode; use frame_support::traits::Currency; -use jsonrpsee::rpc_params; +use sp_core::Bytes; +use sp_npos_elections::ElectionScore; /// Forcefully create the snapshot. This can be used to compute the election at anytime. fn force_create_snapshot(ext: &mut Ext) -> Result<(), Error> { @@ -38,10 +37,10 @@ fn force_create_snapshot(ext: &mut Ext) -> Result<(), Error> /// Helper method to print the encoded size of the snapshot. async fn print_info( - client: &WsClient, + rpc: &SharedRpcClient, ext: &mut Ext, raw_solution: &EPM::RawSolution>, - extrinsic: sp_core::Bytes, + extrinsic: &Bytes, ) where ::Currency: Currency, { @@ -63,21 +62,23 @@ async fn print_info( let snapshot_size = >::snapshot_metadata().expect("snapshot must exist by now; qed."); let deposit = EPM::Pallet::::deposit_for(raw_solution, snapshot_size); + + let score = { + let ElectionScore { minimal_stake, sum_stake, sum_stake_squared } = raw_solution.score; + [Token::from(minimal_stake), Token::from(sum_stake), Token::from(sum_stake_squared)] + }; + log::info!( target: LOG_TARGET, "solution score {:?} / deposit {:?} / length {:?}", - &raw_solution.score.iter().map(|x| Token::from(*x)).collect::>(), + score, Token::from(deposit), raw_solution.encode().len(), ); }); - let info = rpc::>( - client, - "payment_queryInfo", - rpc_params! { extrinsic }, - ) - .await; + let info = rpc.payment_query_info(&extrinsic, None).await; + log::info!( target: LOG_TARGET, "payment_queryInfo: (fee = {}) {:?}", @@ -109,14 +110,13 @@ fn find_threshold(ext: &mut Ext, count: usize) { macro_rules! dry_run_cmd_for { ($runtime:ident) => { paste::paste! { /// Execute the dry-run command. pub(crate) async fn []( - client: &WsClient, - shared: SharedConfig, + rpc: SharedRpcClient, config: DryRunConfig, signer: Signer, ) -> Result<(), Error<$crate::[<$runtime _runtime_exports>]::Runtime>> { use $crate::[<$runtime _runtime_exports>]::*; let mut ext = crate::create_election_ext::( - shared.uri.clone(), + rpc.clone(), config.at, vec!["Staking".to_string(), "System".to_string()], ).await?; @@ -124,7 +124,7 @@ macro_rules! dry_run_cmd_for { ($runtime:ident) => { paste::paste! { let (raw_solution, witness) = crate::mine_with::(&config.solver, &mut ext, false)?; - let nonce = crate::get_account_info::(client, &signer.account, config.at) + let nonce = crate::get_account_info::(&rpc, &signer.account, config.at) .await? .map(|i| i.nonce) .expect("signer account is checked to exist upon startup; it can only die if it \ @@ -136,7 +136,7 @@ macro_rules! dry_run_cmd_for { ($runtime:ident) => { paste::paste! { let extrinsic = ext.execute_with(|| create_uxt(raw_solution.clone(), witness, signer.clone(), nonce, tip, era)); let bytes = sp_core::Bytes(extrinsic.encode().to_vec()); - print_info::(client, &mut ext, &raw_solution, bytes.clone()).await; + print_info::(&rpc, &mut ext, &raw_solution, &bytes).await; let feasibility_result = ext.execute_with(|| { EPM::Pallet::::feasibility_check(raw_solution.clone(), EPM::ElectionCompute::Signed) @@ -150,9 +150,8 @@ macro_rules! dry_run_cmd_for { ($runtime:ident) => { paste::paste! { }); log::info!(target: LOG_TARGET, "dispatch result is {:?}", dispatch_result); - let outcome = rpc_decode::(client, "system_dryRun", rpc_params!{ bytes }) - .await - .map_err::, _>(Into::into)?; + let dry_run_fut = rpc.dry_run(&bytes, None); + let outcome: sp_runtime::ApplyExtrinsicResult = await_request_and_decode(dry_run_fut).await.map_err::, _>(Into::into)?; log::info!(target: LOG_TARGET, "dry-run outcome is {:?}", outcome); Ok(()) } diff --git a/utils/staking-miner/src/emergency_solution.rs b/utils/staking-miner/src/emergency_solution.rs index 43bfc389cca9..a59aaa0acada 100644 --- a/utils/staking-miner/src/emergency_solution.rs +++ b/utils/staking-miner/src/emergency_solution.rs @@ -16,19 +16,19 @@ //! The emergency-solution command. -use crate::{prelude::*, EmergencySolutionConfig, Error, SharedConfig}; +use crate::{prelude::*, EmergencySolutionConfig, Error, SharedRpcClient}; use codec::Encode; use std::io::Write; macro_rules! emergency_solution_cmd_for { ($runtime:ident) => { paste::paste! { /// Execute the emergency-solution command. pub(crate) async fn []( - shared: SharedConfig, + client: SharedRpcClient, config: EmergencySolutionConfig, ) -> Result<(), Error<$crate::[<$runtime _runtime_exports>]::Runtime>> { use $crate::[<$runtime _runtime_exports>]::*; - let mut ext = crate::create_election_ext::(shared.uri.clone(), config.at, vec![]).await?; + let mut ext = crate::create_election_ext::(client, config.at, vec![]).await?; let (raw_solution, _witness) = crate::mine_with::(&config.solver, &mut ext, false)?; ext.execute_with(|| { diff --git a/utils/staking-miner/src/main.rs b/utils/staking-miner/src/main.rs index daf29d8c2809..045a849eee5e 100644 --- a/utils/staking-miner/src/main.rs +++ b/utils/staking-miner/src/main.rs @@ -32,7 +32,7 @@ mod dry_run; mod emergency_solution; mod monitor; mod prelude; -mod rpc_helpers; +mod rpc; mod signer; pub(crate) use prelude::*; @@ -43,8 +43,12 @@ use frame_election_provider_support::NposSolver; use frame_support::traits::Get; use jsonrpsee::ws_client::{WsClient, WsClientBuilder}; use remote_externalities::{Builder, Mode, OnlineConfig}; +use rpc::{RpcApiClient, SharedRpcClient}; use sp_npos_elections::ExtendedBalance; use sp_runtime::{traits::Block as BlockT, DeserializeOwned}; +use tracing_subscriber::{fmt, EnvFilter}; + +use std::{ops::Deref, sync::Arc}; pub(crate) enum AnyRuntime { Polkadot, @@ -90,10 +94,10 @@ macro_rules! construct_runtime_prelude { let extra: SignedExtra = crate::[](nonce, tip, era); let raw_payload = SignedPayload::new(call, extra).expect("creating signed payload infallible; qed."); let signature = raw_payload.using_encoded(|payload| { - pair.clone().sign(payload) + pair.sign(payload) }); let (call, extra, _) = raw_payload.deconstruct(); - let address = ::Lookup::unlookup(account.clone()); + let address = ::Lookup::unlookup(account); let extrinsic = UncheckedExtrinsic::new_signed(call, address, signature.into(), extra); log::debug!( target: crate::LOG_TARGET, "constructed extrinsic {} with length {}", @@ -229,7 +233,7 @@ macro_rules! any_runtime_unit { enum Error { Io(#[from] std::io::Error), JsonRpsee(#[from] jsonrpsee::core::Error), - RpcHelperError(#[from] rpc_helpers::RpcHelperError), + RpcHelperError(#[from] rpc::RpcHelperError), Codec(#[from] codec::Error), Crypto(sp_core::crypto::SecretStringError), RemoteExternalities(&'static str), @@ -368,7 +372,7 @@ struct Opt { /// Build the Ext at hash with all the data of `ElectionProviderMultiPhase` and any additional /// pallets. async fn create_election_ext( - uri: String, + client: SharedRpcClient, at: Option, additional: Vec, ) -> Result> { @@ -381,7 +385,7 @@ async fn create_election_ext( pallets.extend(additional); Builder::::new() .mode(Mode::Online(OnlineConfig { - transport: uri.into(), + transport: client.into_inner().into(), at, pallets, ..Default::default() @@ -493,13 +497,13 @@ fn mine_dpos(ext: &mut Ext) -> Result<(), Error> { } pub(crate) async fn check_versions( - client: &WsClient, + rpc: &SharedRpcClient, ) -> Result<(), Error> { let linked_version = T::Version::get(); - let on_chain_version = - rpc_helpers::rpc::(client, "state_getRuntimeVersion", None) - .await - .expect("runtime version RPC should always work; qed"); + let on_chain_version = rpc + .runtime_version(None) + .await + .expect("runtime version RPC should always work; qed"); log::debug!(target: LOG_TARGET, "linked version {:?}", linked_version); log::debug!(target: LOG_TARGET, "on-chain version {:?}", on_chain_version); @@ -517,20 +521,13 @@ pub(crate) async fn check_versions( #[tokio::main] async fn main() { - env_logger::Builder::from_default_env() - .format_module_path(true) - .format_level(true) - .init(); + fmt().with_env_filter(EnvFilter::from_default_env()).init(); + let Opt { shared, command } = Opt::parse(); log::debug!(target: LOG_TARGET, "attempting to connect to {:?}", shared.uri); - let client = loop { - let maybe_client = WsClientBuilder::default() - .connection_timeout(std::time::Duration::new(20, 0)) - .max_request_body_size(u32::MAX) - .build(&shared.uri) - .await; - match maybe_client { + let rpc = loop { + match SharedRpcClient::new(&shared.uri).await { Ok(client) => break client, Err(why) => { log::warn!( @@ -538,14 +535,12 @@ async fn main() { "failed to connect to client due to {:?}, retrying soon..", why ); - std::thread::sleep(std::time::Duration::from_millis(2500)); + tokio::time::sleep(std::time::Duration::from_millis(2500)).await; }, } }; - let chain = rpc_helpers::rpc::(&client, "system_chain", None) - .await - .expect("system_chain infallible; qed."); + let chain: String = rpc.system_chain().await.expect("system_chain infallible; qed."); match chain.to_lowercase().as_str() { "polkadot" | "development" => { sp_core::crypto::set_default_ss58_version( @@ -591,26 +586,26 @@ async fn main() { log::info!(target: LOG_TARGET, "connected to chain {:?}", chain); any_runtime_unit! { - check_versions::(&client).await + check_versions::(&rpc).await }; let signer_account = any_runtime! { - signer::signer_uri_from_string::(&shared.seed, &client) + signer::signer_uri_from_string::(&shared.seed, &rpc) .await .expect("Provided account is invalid, terminating.") }; let outcome = any_runtime! { - match command.clone() { - Command::Monitor(c) => monitor_cmd(client, shared, c, signer_account).await + match command { + Command::Monitor(cmd) => monitor_cmd(rpc, cmd, signer_account).await .map_err(|e| { log::error!(target: LOG_TARGET, "Monitor error: {:?}", e); }), - Command::DryRun(c) => dry_run_cmd(&client, shared, c, signer_account).await + Command::DryRun(cmd) => dry_run_cmd(rpc, cmd, signer_account).await .map_err(|e| { log::error!(target: LOG_TARGET, "DryRun error: {:?}", e); }), - Command::EmergencySolution(c) => emergency_solution_cmd(shared.clone(), c).await + Command::EmergencySolution(cmd) => emergency_solution_cmd(rpc, cmd).await .map_err(|e| { log::error!(target: LOG_TARGET, "EmergencySolution error: {:?}", e); }), diff --git a/utils/staking-miner/src/monitor.rs b/utils/staking-miner/src/monitor.rs index 8d71b242a411..1e7d3a3422fb 100644 --- a/utils/staking-miner/src/monitor.rs +++ b/utils/staking-miner/src/monitor.rs @@ -16,28 +16,21 @@ //! The monitor command. -use crate::{prelude::*, rpc_helpers::*, signer::Signer, Error, MonitorConfig, SharedConfig}; +use crate::{prelude::*, rpc::*, signer::Signer, Error, MonitorConfig, SharedRpcClient}; use codec::Encode; -use jsonrpsee::{ - core::{ - client::{Subscription, SubscriptionClientT}, - Error as RpcError, - }, - rpc_params, - ws_client::WsClient, -}; +use jsonrpsee::core::Error as RpcError; use sc_transaction_pool_api::TransactionStatus; use sp_core::storage::StorageKey; -use std::sync::Arc; use tokio::sync::mpsc; /// Ensure that now is the signed phase. -async fn ensure_signed_phase( - client: &WsClient, +async fn ensure_signed_phase>( + rpc: &SharedRpcClient, at: B::Hash, ) -> Result<(), Error> { let key = StorageKey(EPM::CurrentPhase::::hashed_key().to_vec()); - let phase = get_storage::>(client, rpc_params! {key, at}) + let phase = rpc + .get_storage_and_decode::>(&key, Some(at)) .await .map_err::, _>(Into::into)? .unwrap_or_default(); @@ -71,23 +64,21 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { /// The monitor command. pub(crate) async fn []( - client: WsClient, - shared: SharedConfig, + rpc: SharedRpcClient, config: MonitorConfig, signer: Signer, ) -> Result<(), Error<$crate::[<$runtime _runtime_exports>]::Runtime>> { use $crate::[<$runtime _runtime_exports>]::*; type StakingMinerError = Error<$crate::[<$runtime _runtime_exports>]::Runtime>; - let (sub, unsub) = if config.listen == "head" { - ("chain_subscribeNewHeads", "chain_unsubscribeNewHeads") - } else { - ("chain_subscribeFinalizedHeads", "chain_unsubscribeFinalizedHeads") - }; - - let mut subscription: Subscription
= client.subscribe(&sub, None, &unsub).await?; + let heads_subscription = || + if config.listen == "head" { + rpc.subscribe_new_heads() + } else { + rpc.subscribe_finalized_heads() + }; - let client = Arc::new(client); + let mut subscription = heads_subscription().await?; let (tx, mut rx) = mpsc::unbounded_channel::(); loop { @@ -97,8 +88,8 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { Some(Ok(r)) => r, // Custom `jsonrpsee` message sent by the server if the subscription was closed on the server side. Some(Err(RpcError::SubscriptionClosed(reason))) => { - log::warn!(target: LOG_TARGET, "subscription to {} terminated: {:?}. Retrying..", sub, reason); - subscription = client.subscribe(&sub, None, &unsub).await?; + log::warn!(target: LOG_TARGET, "subscription to `subscribeNewHeads/subscribeFinalizedHeads` terminated: {:?}. Retrying..", reason); + subscription = heads_subscription().await?; continue; } Some(Err(e)) => { @@ -109,8 +100,8 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { // - the connection was closed. // - the subscription could not keep up with the server. None => { - log::warn!(target: LOG_TARGET, "subscription to {} terminated. Retrying..", sub); - subscription = client.subscribe(&sub, None, &unsub).await?; + log::warn!(target: LOG_TARGET, "subscription to `subscribeNewHeads/subscribeFinalizedHeads` terminated. Retrying.."); + subscription = heads_subscription().await?; continue } } @@ -126,17 +117,17 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { // Spawn task and non-recoverable errors are sent back to the main task // such as if the connection has been closed. tokio::spawn( - send_and_watch_extrinsic(client.clone(), tx.clone(), at, signer.clone(), shared.clone(), config.clone()) + send_and_watch_extrinsic(rpc.clone(), tx.clone(), at, signer.clone(), config.clone()) ); + } /// Construct extrinsic at given block and watch it. async fn send_and_watch_extrinsic( - client: Arc, + rpc: SharedRpcClient, tx: mpsc::UnboundedSender, at: Header, signer: Signer, - shared: SharedConfig, config: MonitorConfig, ) { @@ -144,20 +135,20 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { log::trace!(target: LOG_TARGET, "new event at #{:?} ({:?})", at.number, hash); // if the runtime version has changed, terminate. - if let Err(err) = crate::check_versions::(&*client).await { + if let Err(err) = crate::check_versions::(&rpc).await { let _ = tx.send(err.into()); return; } // we prefer doing this check before fetching anything into a remote-ext. - if ensure_signed_phase::(&*client, hash).await.is_err() { + if ensure_signed_phase::(&rpc, hash).await.is_err() { log::debug!(target: LOG_TARGET, "phase closed, not interested in this block at all."); return; } // grab an externalities without staking, just the election snapshot. let mut ext = match crate::create_election_ext::( - shared.uri.clone(), + rpc.clone(), Some(hash), vec![], ).await { @@ -184,7 +175,7 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { log::info!(target: LOG_TARGET, "mined solution with {:?}", &raw_solution.score); - let nonce = match crate::get_account_info::(&*client, &signer.account, Some(hash)).await { + let nonce = match crate::get_account_info::(&rpc, &signer.account, Some(hash)).await { Ok(maybe_account) => { let acc = maybe_account.expect(crate::signer::SIGNER_ACCOUNT_WILL_EXIST); acc.nonce @@ -209,13 +200,7 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { let extrinsic = ext.execute_with(|| create_uxt(raw_solution, witness, signer.clone(), nonce, tip, era)); let bytes = sp_core::Bytes(extrinsic.encode()); - let mut tx_subscription: Subscription< - TransactionStatus<::Hash, ::Hash> - > = match client.subscribe( - "author_submitAndWatchExtrinsic", - rpc_params! { bytes }, - "author_unwatchExtrinsic" - ).await { + let mut tx_subscription = match rpc.watch_extrinsic(&bytes).await { Ok(sub) => sub, Err(RpcError::RestartNeeded(e)) => { let _ = tx.send(RpcError::RestartNeeded(e).into()); @@ -267,11 +252,10 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { let key = StorageKey( frame_support::storage::storage_prefix(b"System", b"Events").to_vec(), ); - let key2 = key.clone(); - let events = match get_storage::< + let events = match rpc.get_storage_and_decode::< Vec::Hash>>, - >(&*client, rpc_params! { key, hash }) + >(&key, Some(hash)) .await { Ok(rp) => rp.unwrap_or_default(), Err(RpcHelperError::JsonRpsee(RpcError::RestartNeeded(e))) => { @@ -281,7 +265,7 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { // Decoding or other RPC error => just terminate the task. Err(e) => { log::warn!(target: LOG_TARGET, "get_storage [key: {:?}, hash: {:?}] failed: {:?}; skip block: {}", - key2, hash, e, at.number + key, hash, e, at.number ); return; } diff --git a/utils/staking-miner/src/prelude.rs b/utils/staking-miner/src/prelude.rs index db9ce4e2c1e2..eeca85c9b704 100644 --- a/utils/staking-miner/src/prelude.rs +++ b/utils/staking-miner/src/prelude.rs @@ -30,11 +30,13 @@ pub type Balance = core_primitives::Balance; pub type Index = core_primitives::AccountIndex; /// The hash type. We re-export it here, but we can easily get it from block as well. pub type Hash = core_primitives::Hash; +/// The header type. We re-export it here, but we can easily get it from block as well. +pub type Header = core_primitives::Header; pub use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; /// Default URI to connect to. -pub const DEFAULT_URI: &str = "wss://rpc.polkadot.io"; +pub const DEFAULT_URI: &str = "wss://rpc.polkadot.io:443"; /// The logging target. pub const LOG_TARGET: &str = "staking-miner"; diff --git a/utils/staking-miner/src/rpc.rs b/utils/staking-miner/src/rpc.rs new file mode 100644 index 000000000000..ad973be2a32e --- /dev/null +++ b/utils/staking-miner/src/rpc.rs @@ -0,0 +1,166 @@ +// Copyright 2021 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 . + +//! JSON-RPC related types and helpers. + +use super::*; +use jsonrpsee::{ + core::{Error as RpcError, RpcResult}, + proc_macros::rpc, +}; +use pallet_transaction_payment::RuntimeDispatchInfo; +use sc_transaction_pool_api::TransactionStatus; +use sp_core::{storage::StorageKey, Bytes}; +use sp_version::RuntimeVersion; +use std::{future::Future, time::Duration}; + +const MAX_CONNECTION_DURATION: Duration = Duration::from_secs(20); +const MAX_REQUEST_DURATION: Duration = Duration::from_secs(60); + +#[derive(frame_support::DebugNoBound, thiserror::Error)] +pub(crate) enum RpcHelperError { + JsonRpsee(#[from] jsonrpsee::core::Error), + Codec(#[from] codec::Error), +} + +impl std::fmt::Display for RpcHelperError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::fmt(self, f) + } +} + +#[rpc(client)] +pub trait RpcApi { + /// Fetch system name. + #[method(name = "system_chain")] + async fn system_chain(&self) -> RpcResult; + + /// Fetch a storage key. + #[method(name = "state_getStorage")] + async fn storage(&self, key: &StorageKey, hash: Option) -> RpcResult>; + + /// Fetch the runtime version. + #[method(name = "state_getRuntimeVersion")] + async fn runtime_version(&self, at: Option) -> RpcResult; + + /// Fetch the payment query info. + #[method(name = "payment_queryInfo")] + async fn payment_query_info( + &self, + encoded_xt: &Bytes, + at: Option<&Hash>, + ) -> RpcResult>; + + /// Dry run an extrinsic at a given block. Return SCALE encoded [`sp_runtine::ApplyExtrinsicResult`]. + #[method(name = "system_dryRun")] + async fn dry_run(&self, extrinsic: &Bytes, at: Option) -> RpcResult; + + /// Submit an extrinsic to watch. + /// + /// See [`TransactionStatus`](sc_transaction_pool_api::TransactionStatus) for details on + /// transaction life cycle. + // + // TODO: https://github.com/paritytech/jsonrpsee/issues/698. + #[subscription( + name = "author_submitAndWatchExtrinsic" => "author_extrinsicUpdate", + item = TransactionStatus, + )] + fn watch_extrinsic(&self, bytes: &Bytes) -> RpcResult<()>; + + /// New head subscription. + #[subscription( + name = "chain_subscribeNewHeads" => "newHead", + item = Header + )] + fn subscribe_new_heads(&self) -> RpcResult<()>; + + /// Finalized head subscription. + #[subscription( + name = "chain_subscribeFinalizedHeads" => "chain_finalizedHead", + item = Header + )] + fn subscribe_finalized_heads(&self) -> RpcResult<()>; +} + +/// Wraps a shared web-socket JSON-RPC client that can be cloned. +#[derive(Clone, Debug)] +pub(crate) struct SharedRpcClient(Arc); + +impl Deref for SharedRpcClient { + type Target = WsClient; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl SharedRpcClient { + /// Consume and extract the inner client. + pub fn into_inner(self) -> Arc { + self.0 + } + + /// Create a new shared JSON-RPC web-socket client. + pub(crate) async fn new(uri: &str) -> Result { + let client = WsClientBuilder::default() + .connection_timeout(MAX_CONNECTION_DURATION) + .max_request_body_size(u32::MAX) + .request_timeout(MAX_REQUEST_DURATION) + .build(uri) + .await?; + Ok(Self(Arc::new(client))) + } + + /// Get a storage item and decode it as `T`. + /// + /// # Return value: + /// + /// The function returns: + /// + /// * `Ok(Some(val))` if successful. + /// * `Ok(None)` if the storage item was not found. + /// * `Err(e)` if the JSON-RPC call failed. + pub(crate) async fn get_storage_and_decode<'a, T: codec::Decode>( + &self, + key: &StorageKey, + hash: Option, + ) -> Result, RpcHelperError> { + if let Some(bytes) = self.storage(key, hash).await? { + let decoded = ::decode(&mut &*bytes.0) + .map_err::(Into::into)?; + Ok(Some(decoded)) + } else { + Ok(None) + } + } +} + +/// Takes a future that returns `Bytes` and tries to decode those bytes into the type `Dec`. +/// Warning: don't use for storage, it will fail for non-existent storage items. +/// +/// # Return value: +/// +/// The function returns: +/// +/// * `Ok(val)` if successful. +/// * `Err(RpcHelperError::JsonRpsee)` if the JSON-RPC call failed. +/// * `Err(RpcHelperError::Codec)` if `Bytes` could not be decoded. +pub(crate) async fn await_request_and_decode<'a, Dec: codec::Decode>( + req: impl Future>, +) -> Result { + let bytes = req.await?; + Dec::decode(&mut &*bytes.0).map_err::(Into::into) +} diff --git a/utils/staking-miner/src/rpc_helpers.rs b/utils/staking-miner/src/rpc_helpers.rs deleted file mode 100644 index 153ca0e65c03..000000000000 --- a/utils/staking-miner/src/rpc_helpers.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2021 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 . - -//! Helper method for RPC. - -use super::*; -use jsonrpsee::core::client::ClientT; -pub(crate) use jsonrpsee::types::ParamsSer; - -#[derive(frame_support::DebugNoBound, thiserror::Error)] -pub(crate) enum RpcHelperError { - JsonRpsee(#[from] jsonrpsee::core::Error), - Codec(#[from] codec::Error), -} - -impl std::fmt::Display for RpcHelperError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - ::fmt(self, f) - } -} - -/// Make the rpc request, returning `Ret`. -pub(crate) async fn rpc<'a, Ret: serde::de::DeserializeOwned>( - client: &WsClient, - method: &'a str, - params: Option>, -) -> Result { - client - .request::(method, params) - .await - .map_err::(Into::into) -} - -/// Make the rpc request, decode the outcome into `Dec`. Don't use for storage, it will fail for -/// non-existent storage items. -pub(crate) async fn rpc_decode<'a, Dec: codec::Decode>( - client: &WsClient, - method: &'a str, - params: Option>, -) -> Result { - let bytes = rpc::(client, method, params) - .await - .map_err::(Into::into)?; - ::decode(&mut &*bytes.0).map_err::(Into::into) -} - -/// Get the storage item. -pub(crate) async fn get_storage<'a, T: codec::Decode>( - client: &WsClient, - params: Option>, -) -> Result, RpcHelperError> { - let maybe_bytes = rpc::>(client, "state_getStorage", params) - .await - .map_err::(Into::into)?; - if let Some(bytes) = maybe_bytes { - let decoded = ::decode(&mut &*bytes.0) - .map_err::(Into::into)?; - Ok(Some(decoded)) - } else { - Ok(None) - } -} diff --git a/utils/staking-miner/src/signer.rs b/utils/staking-miner/src/signer.rs index e976cb8f24aa..6a0e45eabb13 100644 --- a/utils/staking-miner/src/signer.rs +++ b/utils/staking-miner/src/signer.rs @@ -16,8 +16,9 @@ //! Wrappers around creating a signer account. -use crate::{prelude::*, rpc_helpers, AccountId, Error, Index, Pair, WsClient, LOG_TARGET}; -use sp_core::crypto::Pair as _; +use crate::{prelude::*, rpc::SharedRpcClient, AccountId, Error, Index, Pair, LOG_TARGET}; +use frame_system::AccountInfo; +use sp_core::{crypto::Pair as _, storage::StorageKey}; pub(crate) const SIGNER_ACCOUNT_WILL_EXIST: &str = "signer account is checked to exist upon startup; it can only die if it transfers funds out \ @@ -34,17 +35,14 @@ pub(crate) struct Signer { pub(crate) pair: Pair, } -pub(crate) async fn get_account_info( - client: &WsClient, +pub(crate) async fn get_account_info + EPM::Config>( + rpc: &SharedRpcClient, who: &T::AccountId, maybe_at: Option, -) -> Result>, Error> { - rpc_helpers::get_storage::>( - client, - jsonrpsee::rpc_params! { - sp_core::storage::StorageKey(>::hashed_key_for(&who)), - maybe_at - }, +) -> Result>, Error> { + rpc.get_storage_and_decode::>( + &StorageKey(>::hashed_key_for(&who)), + maybe_at, ) .await .map_err(Into::into) @@ -56,10 +54,11 @@ pub(crate) async fn signer_uri_from_string< AccountId = AccountId, Index = Index, AccountData = pallet_balances::AccountData, + Hash = Hash, > + EPM::Config, >( seed: &str, - client: &WsClient, + client: &SharedRpcClient, ) -> Result> { let seed = seed.trim(); diff --git a/xcm/Cargo.toml b/xcm/Cargo.toml index 14cd4e172dbc..560df741b1b5 100644 --- a/xcm/Cargo.toml +++ b/xcm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xcm" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "The basic XCM datastructures." edition = "2018" diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index d59714aad06c..0cc3c4bb0202 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -2,7 +2,7 @@ name = "pallet-xcm-benchmarks" authors = ["Parity Technologies "] edition = "2018" -version = "0.9.16" +version = "0.9.17" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/xcm/pallet-xcm/Cargo.toml b/xcm/pallet-xcm/Cargo.toml index 06ace94bbf1f..b497f3a10f11 100644 --- a/xcm/pallet-xcm/Cargo.toml +++ b/xcm/pallet-xcm/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Parity Technologies "] edition = "2018" name = "pallet-xcm" -version = "0.9.16" +version = "0.9.17" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } diff --git a/xcm/xcm-builder/Cargo.toml b/xcm/xcm-builder/Cargo.toml index 9cda2e4b0f64..36be7d2e41d5 100644 --- a/xcm/xcm-builder/Cargo.toml +++ b/xcm/xcm-builder/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Parity Technologies "] edition = "2018" name = "xcm-builder" description = "Tools & types for building with XCM and its executor." -version = "0.9.16" +version = "0.9.17" [dependencies] parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } diff --git a/xcm/xcm-executor/Cargo.toml b/xcm/xcm-executor/Cargo.toml index 60811ea97095..ac4f1fea5172 100644 --- a/xcm/xcm-executor/Cargo.toml +++ b/xcm/xcm-executor/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Parity Technologies "] edition = "2018" name = "xcm-executor" description = "An abstract and configurable XCM message executor." -version = "0.9.16" +version = "0.9.17" [dependencies] impl-trait-for-tuples = "0.2.2" diff --git a/xcm/xcm-executor/integration-tests/Cargo.toml b/xcm/xcm-executor/integration-tests/Cargo.toml index 221101017f22..89ad1713ab8d 100644 --- a/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/xcm/xcm-executor/integration-tests/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Parity Technologies "] edition = "2018" name = "xcm-executor-integration-tests" description = "Integration tests for the XCM Executor" -version = "0.9.16" +version = "0.9.17" [dependencies] frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/xcm/xcm-simulator/Cargo.toml b/xcm/xcm-simulator/Cargo.toml index deb3ea641784..e3904603b90e 100644 --- a/xcm/xcm-simulator/Cargo.toml +++ b/xcm/xcm-simulator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xcm-simulator" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Test kit to simulate cross-chain message passing and XCM execution" edition = "2018" diff --git a/xcm/xcm-simulator/example/Cargo.toml b/xcm/xcm-simulator/example/Cargo.toml index 64a156849a9b..e4348c838df4 100644 --- a/xcm/xcm-simulator/example/Cargo.toml +++ b/xcm/xcm-simulator/example/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xcm-simulator-example" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Examples of xcm-simulator usage." edition = "2018" diff --git a/xcm/xcm-simulator/fuzzer/Cargo.toml b/xcm/xcm-simulator/fuzzer/Cargo.toml index 59962ca67897..c6b0552d0768 100644 --- a/xcm/xcm-simulator/fuzzer/Cargo.toml +++ b/xcm/xcm-simulator/fuzzer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xcm-simulator-fuzzer" -version = "0.9.16" +version = "0.9.17" authors = ["Parity Technologies "] description = "Examples of xcm-simulator usage." edition = "2018" diff --git a/zombienet_tests/parachains/0001-parachains-smoke-test.toml b/zombienet_tests/parachains/0001-parachains-smoke-test.toml index 43fa65af67e7..861876f58bab 100644 --- a/zombienet_tests/parachains/0001-parachains-smoke-test.toml +++ b/zombienet_tests/parachains/0001-parachains-smoke-test.toml @@ -8,11 +8,11 @@ command = "polkadot" [[relaychain.nodes]] name = "alice" - extra_args = [ "--alice" ] + extra_args = [ "--alice", "-lruntime=debug,parachain=trace" ] [[relaychain.nodes]] name = "bob" - extra_args = [ "--bob" ] + extra_args = [ "--bob", "-lruntime=debug,parachain=trace" ] [[parachains]] id = 100 @@ -22,6 +22,7 @@ addToGenesis = false name = "collator01" image = "{{COL_IMAGE}}" command = "/usr/local/bin/adder-collator" + args = [ "-lruntime=debug,parachain=trace" ] [types.Header] number = "u64"