From f28333aedb6b032b07484024563282c0c72b64d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 8 Dec 2020 13:55:57 +0100 Subject: [PATCH] Companion for #6629 (weight params refactor) (#1420) * Change branch. * Update runtime. * Revert "Change branch." This reverts commit 841c59f3398136c27cc235a29d7d459e8a4c8ce0. * Update substrate. * Fix tests. * Fix compilation. * Fix frame system imports. * Fix usages of system * Fix stuff. * Fix compilation. * Fixes. * Fix block_weight usage. * Bump substrate. --- polkadot/Cargo.lock | 272 +++++++++--------- polkadot/runtime/common/src/claims.rs | 15 +- polkadot/runtime/common/src/crowdfund.rs | 16 +- polkadot/runtime/common/src/impls.rs | 23 +- polkadot/runtime/common/src/lib.rs | 82 ++++-- .../runtime/common/src/paras_registrar.rs | 19 +- polkadot/runtime/common/src/purchase.rs | 17 +- polkadot/runtime/common/src/slots.rs | 18 +- polkadot/runtime/kusama/src/constants.rs | 8 +- polkadot/runtime/kusama/src/lib.rs | 29 +- polkadot/runtime/parachains/src/mock.rs | 26 +- polkadot/runtime/polkadot/src/constants.rs | 8 +- polkadot/runtime/polkadot/src/lib.rs | 22 +- polkadot/runtime/rococo/src/constants.rs | 13 +- polkadot/runtime/rococo/src/lib.rs | 17 +- polkadot/runtime/test-runtime/src/lib.rs | 17 +- polkadot/runtime/westend/src/constants.rs | 8 +- polkadot/runtime/westend/src/lib.rs | 20 +- 18 files changed, 298 insertions(+), 332 deletions(-) diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index c06db85aa9..d64b5c9030 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -1462,7 +1462,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", ] @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -1488,7 +1488,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "chrono", "frame-benchmarking", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -1526,7 +1526,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "12.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "serde", @@ -1537,7 +1537,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "bitflags", "frame-metadata", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support-procedural-tools", "proc-macro2 1.0.24", @@ -1573,7 +1573,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1585,7 +1585,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", @@ -1595,7 +1595,7 @@ dependencies = [ [[package]] name = "frame-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "impl-trait-for-tuples 0.1.3", @@ -1611,7 +1611,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -1625,7 +1625,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-api", @@ -3798,7 +3798,7 @@ checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" [[package]] name = "pallet-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -3814,7 +3814,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -3829,7 +3829,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3854,7 +3854,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3868,7 +3868,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3884,7 +3884,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3899,7 +3899,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3914,7 +3914,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3935,7 +3935,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "enumflags2", "frame-benchmarking", @@ -3951,7 +3951,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3971,7 +3971,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3988,7 +3988,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4002,7 +4002,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4018,7 +4018,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4032,7 +4032,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4047,7 +4047,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4068,7 +4068,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4084,7 +4084,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4097,7 +4097,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "enumflags2", "frame-support", @@ -4112,7 +4112,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4127,7 +4127,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4147,7 +4147,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4163,7 +4163,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4177,7 +4177,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4199,7 +4199,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4224,7 +4224,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4242,7 +4242,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "frame-system", @@ -4259,7 +4259,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4277,7 +4277,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-support", "parity-scale-codec", @@ -4290,7 +4290,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4305,7 +4305,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4321,7 +4321,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6571,7 +6571,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "async-trait", "derive_more", @@ -6599,7 +6599,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-timer 3.0.2", @@ -6622,7 +6622,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6639,7 +6639,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-trait-for-tuples 0.1.3", "parity-scale-codec", @@ -6660,7 +6660,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -6671,7 +6671,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "atty", "chrono", @@ -6714,7 +6714,7 @@ dependencies = [ [[package]] name = "sc-cli-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -6725,7 +6725,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "fnv", @@ -6759,7 +6759,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "blake2-rfc", "hash-db", @@ -6789,7 +6789,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "sc-client-api", "sp-blockchain", @@ -6800,7 +6800,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "fork-tree", @@ -6845,7 +6845,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "futures 0.3.8", @@ -6869,7 +6869,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6882,7 +6882,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-timer 3.0.2", @@ -6908,7 +6908,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "sc-client-api", @@ -6922,7 +6922,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "lazy_static", @@ -6951,7 +6951,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "parity-scale-codec", @@ -6967,7 +6967,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "parity-scale-codec", @@ -6982,7 +6982,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "parity-scale-codec", @@ -7000,7 +7000,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "finality-grandpa", @@ -7037,7 +7037,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "finality-grandpa", @@ -7061,7 +7061,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "ansi_term 0.12.1", "futures 0.3.8", @@ -7079,7 +7079,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "async-trait", "derive_more", @@ -7099,7 +7099,7 @@ dependencies = [ [[package]] name = "sc-light" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "hash-db", "lazy_static", @@ -7118,7 +7118,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "async-std", "async-trait", @@ -7172,7 +7172,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-timer 3.0.2", @@ -7187,7 +7187,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "bytes 0.5.6", "fnv", @@ -7214,7 +7214,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "libp2p", @@ -7227,7 +7227,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7236,7 +7236,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "hash-db", @@ -7270,7 +7270,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "futures 0.3.8", @@ -7294,7 +7294,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -7312,7 +7312,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "directories 3.0.1", "exit-future", @@ -7376,7 +7376,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "parity-scale-codec", @@ -7391,7 +7391,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -7411,7 +7411,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-timer 3.0.2", @@ -7432,7 +7432,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "ansi_term 0.12.1", "erased-serde", @@ -7456,7 +7456,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "futures 0.3.8", @@ -7478,7 +7478,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-diagnose", @@ -7933,7 +7933,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "sp-core", @@ -7945,7 +7945,7 @@ dependencies = [ [[package]] name = "sp-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "hash-db", "parity-scale-codec", @@ -7961,7 +7961,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -7973,7 +7973,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "serde", @@ -7985,7 +7985,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "integer-sqrt", "num-traits 0.2.12", @@ -7998,7 +7998,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-api", @@ -8010,7 +8010,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8021,7 +8021,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-api", @@ -8033,7 +8033,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "log", @@ -8051,7 +8051,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "serde", "serde_json", @@ -8060,7 +8060,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-timer 3.0.2", @@ -8086,7 +8086,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "merlin", "parity-scale-codec", @@ -8106,7 +8106,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8115,7 +8115,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -8127,7 +8127,7 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "base58", "blake2-rfc", @@ -8171,7 +8171,7 @@ dependencies = [ [[package]] name = "sp-database" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -8180,7 +8180,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", @@ -8190,7 +8190,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "environmental", "parity-scale-codec", @@ -8201,7 +8201,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "finality-grandpa", "log", @@ -8218,7 +8218,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "parking_lot 0.10.2", @@ -8230,7 +8230,7 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "hash-db", @@ -8254,7 +8254,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "lazy_static", "sp-core", @@ -8265,7 +8265,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "async-trait", "derive_more", @@ -8281,7 +8281,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "serde", @@ -8293,7 +8293,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -8304,7 +8304,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "sp-api", "sp-core", @@ -8314,7 +8314,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "backtrace", ] @@ -8322,7 +8322,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "serde", "sp-core", @@ -8331,7 +8331,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "either", "hash256-std-hasher", @@ -8352,7 +8352,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-trait-for-tuples 0.1.3", "parity-scale-codec", @@ -8369,7 +8369,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "Inflector", "proc-macro-crate", @@ -8381,7 +8381,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "serde", "serde_json", @@ -8390,7 +8390,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-api", @@ -8403,7 +8403,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8413,7 +8413,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "hash-db", "log", @@ -8435,12 +8435,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" [[package]] name = "sp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8453,7 +8453,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "sp-core", @@ -8466,7 +8466,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-trait-for-tuples 0.1.3", "parity-scale-codec", @@ -8480,7 +8480,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "log", "parity-scale-codec", @@ -8493,7 +8493,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "derive_more", "futures 0.3.8", @@ -8509,7 +8509,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "hash-db", "memory-db", @@ -8523,7 +8523,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "futures-core", @@ -8535,7 +8535,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8547,7 +8547,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "impl-trait-for-tuples 0.1.3", "parity-scale-codec", @@ -8689,7 +8689,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "chrono", "console_error_panic_hook", @@ -8715,7 +8715,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "platforms", ] @@ -8723,7 +8723,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.8", @@ -8746,7 +8746,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "async-std", "derive_more", @@ -8760,7 +8760,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.1.29", "futures 0.3.8", @@ -8787,7 +8787,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "futures 0.3.8", "substrate-test-utils-derive", @@ -8797,7 +8797,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eaab146094360ca02538f5287abe859b2d815c3c" +source = "git+https://github.com/paritytech/substrate#332399d16668a6c769f1a7db154bb9ea3b50e61c" dependencies = [ "proc-macro-crate", "quote 1.0.7", diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index 176c1cd4bd..1d6f02bfe0 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -636,7 +636,7 @@ mod tests { use parity_scale_codec::Encode; // The testing primitives are very useful for avoiding having to work with signatures // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. - use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, Identity}, testing::Header}; + use sp_runtime::{traits::{BlakeTwo256, IdentityLookup, Identity}, testing::Header}; use frame_support::{ impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, assert_noop, parameter_types, ord_parameter_types, weights::{Pays, GetDispatchInfo}, traits::ExistenceRequirement, @@ -661,12 +661,12 @@ mod tests { pub struct Test; parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } impl frame_system::Config for Test { type BaseCallFilter = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Call = Call; type Index = u64; @@ -678,13 +678,6 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/common/src/crowdfund.rs b/polkadot/runtime/common/src/crowdfund.rs index 1c0895bc0c..b3a2310889 100644 --- a/polkadot/runtime/common/src/crowdfund.rs +++ b/polkadot/runtime/common/src/crowdfund.rs @@ -579,7 +579,7 @@ mod tests { // The testing primitives are very useful for avoiding having to work with signatures // or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried. use sp_runtime::{ - Perbill, Permill, Percent, testing::Header, DispatchResult, + Permill, Percent, testing::Header, DispatchResult, traits::{BlakeTwo256, IdentityLookup}, }; use crate::slots::Registrar; @@ -595,12 +595,13 @@ mod tests { pub struct Test; parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } + impl frame_system::Config for Test { type BaseCallFilter = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Call = (); type Index = u64; @@ -612,13 +613,6 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/common/src/impls.rs b/polkadot/runtime/common/src/impls.rs index 64b881f6d4..b9bace0098 100644 --- a/polkadot/runtime/common/src/impls.rs +++ b/polkadot/runtime/common/src/impls.rs @@ -72,7 +72,8 @@ where #[cfg(test)] mod tests { use super::*; - use frame_support::{impl_outer_origin, parameter_types, weights::Weight}; + use frame_system::limits; + use frame_support::{impl_outer_origin, parameter_types, weights::DispatchClass}; use frame_support::traits::FindAuthor; use sp_core::H256; use sp_runtime::{ @@ -91,9 +92,15 @@ mod tests { parameter_types! { pub const BlockHashCount: u64 = 250; - pub const ExtrinsicBaseWeight: u64 = 100; - pub const MaximumBlockWeight: Weight = 1024; - pub const MaximumBlockLength: u32 = 2 * 1024; + pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder() + .for_class(DispatchClass::all(), |weight| { + weight.base_extrinsic = 100; + }) + .for_class(DispatchClass::non_mandatory(), |weight| { + weight.max_total = Some(1024); + }) + .build_or_panic(); + pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024); pub const AvailableBlockRatio: Perbill = Perbill::one(); } @@ -110,13 +117,9 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; + type BlockLength = BlockLength; + type BlockWeights = BlockWeights; type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/common/src/lib.rs b/polkadot/runtime/common/src/lib.rs index 3f867579eb..06475ee54e 100644 --- a/polkadot/runtime/common/src/lib.rs +++ b/polkadot/runtime/common/src/lib.rs @@ -28,10 +28,11 @@ pub mod paras_sudo_wrapper; pub mod paras_registrar; use primitives::v1::{BlockNumber, ValidatorId}; -use sp_runtime::{Perquintill, Perbill, FixedPointNumber, traits::Saturating}; +use sp_runtime::{Perquintill, Perbill, FixedPointNumber}; +use frame_system::limits; use frame_support::{ parameter_types, traits::{Currency}, - weights::{Weight, constants::WEIGHT_PER_SECOND}, + weights::{Weight, constants::WEIGHT_PER_SECOND, DispatchClass}, }; use pallet_transaction_payment::{TargetedFeeAdjustment, Multiplier}; use static_assertions::const_assert; @@ -55,22 +56,19 @@ const WASM_MAGIC: &[u8] = &[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]; /// We assume that an on-initialize consumes 2.5% of the weight on average, hence a single extrinsic /// will not be allowed to consume more than `AvailableBlockRatio - 2.5%`. -pub const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_perthousand(25); +pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25); +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used +/// by Operational extrinsics. +const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); +/// We allow for 2 seconds of compute with a 6 second average block time. +pub const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; + +const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); // Common constants used in all runtimes. parameter_types! { pub const BlockHashCount: BlockNumber = 2400; - /// Block time that can be used by weights. - pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND; - /// Portion of the block available to normal class of dispatches. - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); - /// Maximum weight that a _single_ extrinsic can take. - pub MaximumExtrinsicWeight: Weight = - AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT) - * MaximumBlockWeight::get(); - /// Maximum length of block. 5MB. - pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; - /// The portion of the `AvailableBlockRatio` that we adjust the fees with. Blocks filled less + /// The portion of the `NORMAL_DISPATCH_RATIO` that we adjust the fees with. Blocks filled less /// than this will decrease the weight and more will increase. pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); /// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to @@ -80,9 +78,41 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); + /// Maximum length of block. Up to 5MB. + pub BlockLength: limits::BlockLength = + limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + /// Block weights base values and limits. + pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have an extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT, + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); } -const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct()); +parameter_types! { + /// A limit for off-chain phragmen unsigned solution submission. + /// + /// We want to keep it as high as possible, but can't risk having it reject, + /// so we always subtract the base block execution weight. + pub OffchainSolutionWeightLimit: Weight = BlockWeights::get() + .get(DispatchClass::Normal) + .max_extrinsic + .expect("Normal extrinsics have weight limit configured by default; qed") + .saturating_sub(BlockExecutionWeight::get()); +} /// Parameterized slow adjusting fee updated based on /// https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html#-2.-slow-adjusting-mechanism @@ -148,14 +178,18 @@ mod multiplier_tests { parameter_types! { pub const BlockHashCount: u64 = 250; - pub const ExtrinsicBaseWeight: u64 = 100; - pub const MaximumBlockWeight: Weight = 1024; - pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub BlockLength: frame_system::limits::BlockLength = + frame_system::limits::BlockLength::max(2 * 1024); + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); } impl frame_system::Config for Runtime { type BaseCallFilter = (); + type BlockWeights = BlockWeights; + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Index = u64; type BlockNumber = u64; @@ -167,13 +201,6 @@ mod multiplier_tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = (); @@ -188,7 +215,7 @@ mod multiplier_tests { let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default().build_storage::().unwrap().into(); t.execute_with(|| { - System::set_block_limits(w, 0); + System::set_block_consumed_resources(w, 0); assertions() }); } @@ -196,7 +223,8 @@ mod multiplier_tests { #[test] fn multiplier_can_grow_from_zero() { let minimum_multiplier = MinimumMultiplier::get(); - let target = TargetBlockFullness::get() * (AvailableBlockRatio::get() * MaximumBlockWeight::get()); + let target = TargetBlockFullness::get() * + BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap(); // if the min is too small, then this will not change, and we are doomed forever. // the weight is 1/10th bigger than target. run_with_system_weight(target * 101 / 100, || { diff --git a/polkadot/runtime/common/src/paras_registrar.rs b/polkadot/runtime/common/src/paras_registrar.rs index 177ec3180a..a813f07060 100644 --- a/polkadot/runtime/common/src/paras_registrar.rs +++ b/polkadot/runtime/common/src/paras_registrar.rs @@ -264,6 +264,7 @@ mod tests { use primitives::v1::{ Balance, BlockNumber, Header, Signature, AuthorityDiscoveryId, }; + use frame_system::limits; use frame_support::{ traits::{Randomness, OnInitialize, OnFinalize}, impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types, @@ -299,11 +300,13 @@ mod tests { #[derive(Clone, Eq, PartialEq)] pub struct Test; + const NORMAL_RATIO: Perbill = Perbill::from_percent(75); parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); + pub BlockWeights: limits::BlockWeights = + limits::BlockWeights::with_sensible_defaults(4 * 1024 * 1024, NORMAL_RATIO); + pub BlockLength: limits::BlockLength = + limits::BlockLength::max_with_normal_ratio(4 * 1024 * 1024, NORMAL_RATIO); } impl frame_system::Config for Test { @@ -319,13 +322,9 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; @@ -416,7 +415,7 @@ mod tests { type UnsignedPriority = StakingUnsignedPriority; type MaxIterations = (); type MinSolutionScoreBump = (); - type OffchainSolutionWeightLimit = MaximumBlockWeight; + type OffchainSolutionWeightLimit = (); type WeightInfo = (); } diff --git a/polkadot/runtime/common/src/purchase.rs b/polkadot/runtime/common/src/purchase.rs index 7a29b4641a..2efb61ae4a 100644 --- a/polkadot/runtime/common/src/purchase.rs +++ b/polkadot/runtime/common/src/purchase.rs @@ -382,7 +382,7 @@ pub fn remove_pallet() -> frame_support::weights::Weight remove_storage_prefix(b"Purchase", b"Statement", b""); remove_storage_prefix(b"Purchase", b"UnlockBlock", b""); - T::MaximumBlockWeight::get() + ::BlockWeights::get().max_block } #[cfg(test)] @@ -393,7 +393,7 @@ mod tests { // The testing primitives are very useful for avoiding having to work with signatures // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use sp_runtime::{ - Perbill, MultiSignature, + MultiSignature, traits::{BlakeTwo256, IdentityLookup, Identity, Verify, IdentifyAccount, Dispatchable}, testing::Header }; @@ -424,12 +424,12 @@ mod tests { pub struct Test; parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } impl frame_system::Config for Test { type BaseCallFilter = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Call = Call; type Index = u64; @@ -441,13 +441,6 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/common/src/slots.rs b/polkadot/runtime/common/src/slots.rs index ec51aa539b..284f1afa52 100644 --- a/polkadot/runtime/common/src/slots.rs +++ b/polkadot/runtime/common/src/slots.rs @@ -942,10 +942,7 @@ mod tests { use std::{collections::HashMap, cell::RefCell}; use sp_core::H256; - use sp_runtime::{ - Perbill, - traits::{BlakeTwo256, Hash, IdentityLookup}, - }; + use sp_runtime::traits::{BlakeTwo256, Hash, IdentityLookup}; use frame_support::{ impl_outer_origin, parameter_types, assert_ok, assert_noop, traits::{OnInitialize, OnFinalize} @@ -964,12 +961,12 @@ mod tests { pub struct Test; parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } impl frame_system::Config for Test { type BaseCallFilter = (); + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Call = (); type Index = u64; @@ -981,13 +978,6 @@ mod tests { type Header = Header; type Event = (); type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/kusama/src/constants.rs b/polkadot/runtime/kusama/src/constants.rs index 5d81cf0bb8..91d6b35452 100644 --- a/polkadot/runtime/kusama/src/constants.rs +++ b/polkadot/runtime/kusama/src/constants.rs @@ -69,7 +69,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, frame_system::MaximumBlockWeight] + /// - [0, MAXIMUM_BLOCK_WEIGHT] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: @@ -95,16 +95,16 @@ pub mod fee { #[cfg(test)] mod tests { use frame_support::weights::WeightToFeePolynomial; - use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight}; + use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight}; use super::fee::WeightToFee; use super::currency::{CENTS, DOLLARS, MILLICENTS}; #[test] - // This function tests that the fee for `MaximumBlockWeight` of weight is correct + // This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct fn full_block_fee_is_correct() { // A full block should cost 16 DOLLARS println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&MaximumBlockWeight::get()); + let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT); let y = 16 * DOLLARS; assert!(x.max(y) - x.min(y) < MILLICENTS); } diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 5e47f9e61a..b6d4b8512c 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -34,9 +34,8 @@ use primitives::v1::{ use runtime_common::{ claims, SlowAdjustingFeeUpdate, CurrencyToVote, impls::DealWithFees, - BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, - MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, - MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder, + BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit, + ParachainSessionKeyPlaceholder, }; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, ModuleId, @@ -129,6 +128,8 @@ parameter_types! { impl frame_system::Config for Runtime { type BaseCallFilter = BaseFilter; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; type Origin = Origin; type Call = Call; type Index = Nonce; @@ -140,13 +141,7 @@ impl frame_system::Config for Runtime { type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; type DbWeight = RocksDbWeight; - type BlockExecutionWeight = BlockExecutionWeight; - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumExtrinsicWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; @@ -156,6 +151,8 @@ impl frame_system::Config for Runtime { } parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * + BlockWeights::get().max_block; pub const MaxScheduledPerBlock: u32 = 50; } @@ -164,7 +161,7 @@ impl pallet_scheduler::Config for Runtime { type Origin = Origin; type PalletsOrigin = OriginCaller; type Call = Call; - type MaximumWeight = MaximumBlockWeight; + type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; @@ -326,9 +323,6 @@ parameter_types! { pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4; pub const MaxIterations: u32 = 10; pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); - pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get() - .saturating_sub(BlockExecutionWeight::get()) - .saturating_sub(ExtrinsicBaseWeight::get()); } type SlashCancelOrigin = EnsureOneOf< @@ -557,7 +551,7 @@ impl pallet_treasury::Config for Runtime { } parameter_types! { - pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); + pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block; } impl pallet_offences::Config for Runtime { @@ -1107,7 +1101,7 @@ impl frame_support::traits::OnRuntimeUpgrade for FixCouncilHistoricalVotes { }; }); frame_support::debug::info!("Migration to fix voters happened. Accounts with inaccurate reserved amount: {}", failure); - ::MaximumBlockWeight::get() + ::BlockWeights::get().max_block } } @@ -1534,11 +1528,12 @@ mod test_fees { #[test] #[ignore] fn block_cost() { - let raw_fee = WeightToFee::calc(&MaximumBlockWeight::get()); + let max_block_weight = BlockWeights::get().max_block; + let raw_fee = WeightToFee::calc(&max_block_weight); println!( "Full Block weight == {} // WeightToFee(full_block) == {} plank", - MaximumBlockWeight::get(), + max_block_weight, raw_fee.separated_string(), ); } diff --git a/polkadot/runtime/parachains/src/mock.rs b/polkadot/runtime/parachains/src/mock.rs index 0934493c15..0481c1941f 100644 --- a/polkadot/runtime/parachains/src/mock.rs +++ b/polkadot/runtime/parachains/src/mock.rs @@ -17,17 +17,14 @@ //! Mocks for all the traits. use sp_io::TestExternalities; -use sp_core::{H256}; -use sp_runtime::{ - Perbill, - traits::{ - BlakeTwo256, IdentityLookup, - }, +use sp_core::H256; +use sp_runtime::traits::{ + BlakeTwo256, IdentityLookup, }; use primitives::v1::{AuthorityDiscoveryId, BlockNumber, Header}; use frame_support::{ impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types, - weights::Weight, traits::Randomness as RandomnessT, + traits::Randomness as RandomnessT, }; use crate::inclusion; use crate as parachains; @@ -65,13 +62,15 @@ impl RandomnessT for TestRandomness { parameter_types! { pub const BlockHashCount: u32 = 250; - pub const MaximumBlockWeight: Weight = 4 * 1024 * 1024; - pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(4 * 1024 * 1024); } impl frame_system::Config for Test { type BaseCallFilter = (); + type BlockWeights = BlockWeights; + type BlockLength = (); + type DbWeight = (); type Origin = Origin; type Call = Call; type Index = u64; @@ -83,13 +82,6 @@ impl frame_system::Config for Test { type Header = Header; type Event = TestEvent; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type PalletInfo = (); type AccountData = pallet_balances::AccountData; diff --git a/polkadot/runtime/polkadot/src/constants.rs b/polkadot/runtime/polkadot/src/constants.rs index f784e9fca1..d6704f3eb0 100644 --- a/polkadot/runtime/polkadot/src/constants.rs +++ b/polkadot/runtime/polkadot/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, frame_system::MaximumBlockWeight] + /// - [0, MAXIMUM_BLOCK_WEIGHT] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: @@ -87,16 +87,16 @@ pub mod fee { #[cfg(test)] mod tests { use frame_support::weights::WeightToFeePolynomial; - use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight}; + use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight}; use super::fee::WeightToFee; use super::currency::{CENTS, DOLLARS, MILLICENTS}; #[test] - // This function tests that the fee for `MaximumBlockWeight` of weight is correct + // This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct fn full_block_fee_is_correct() { // A full block should cost 16 DOLLARS println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&MaximumBlockWeight::get()); + let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT); let y = 16 * DOLLARS; assert!(x.max(y) - x.min(y) < MILLICENTS); } diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index 373f93a8ee..01073651f7 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -24,9 +24,8 @@ use pallet_transaction_payment::CurrencyAdapter; use runtime_common::{ claims, SlowAdjustingFeeUpdate, CurrencyToVote, impls::DealWithFees, - BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, - MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, - MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder, + BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit, + ParachainSessionKeyPlaceholder, }; use sp_std::prelude::*; @@ -142,6 +141,8 @@ parameter_types! { impl frame_system::Config for Runtime { type BaseCallFilter = BaseFilter; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; type Origin = Origin; type Call = Call; type Index = Nonce; @@ -153,13 +154,7 @@ impl frame_system::Config for Runtime { type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; type DbWeight = RocksDbWeight; - type BlockExecutionWeight = BlockExecutionWeight; - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumExtrinsicWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; @@ -169,6 +164,8 @@ impl frame_system::Config for Runtime { } parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * + BlockWeights::get().max_block; pub const MaxScheduledPerBlock: u32 = 50; } @@ -177,7 +174,7 @@ impl pallet_scheduler::Config for Runtime { type Origin = Origin; type PalletsOrigin = OriginCaller; type Call = Call; - type MaximumWeight = MaximumBlockWeight; + type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; @@ -333,9 +330,6 @@ parameter_types! { pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 16; pub const MaxIterations: u32 = 10; pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); - pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get() - .saturating_sub(BlockExecutionWeight::get()) - .saturating_sub(ExtrinsicBaseWeight::get()); } type SlashCancelOrigin = EnsureOneOf< @@ -603,7 +597,7 @@ impl pallet_treasury::Config for Runtime { } parameter_types! { - pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); + pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block; } impl pallet_offences::Config for Runtime { diff --git a/polkadot/runtime/rococo/src/constants.rs b/polkadot/runtime/rococo/src/constants.rs index 31f8a97ce4..616c28de1e 100644 --- a/polkadot/runtime/rococo/src/constants.rs +++ b/polkadot/runtime/rococo/src/constants.rs @@ -87,8 +87,8 @@ pub mod fee { #[cfg(test)] mod tests { - use frame_support::weights::WeightToFeePolynomial; - use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight}; + use frame_support::weights::{WeightToFeePolynomial, DispatchClass}; + use runtime_common::BlockWeights; use super::fee::WeightToFee; use super::currency::{CENTS, DOLLARS, MILLICENTS}; @@ -96,8 +96,8 @@ mod tests { // This function tests that the fee for `MaximumBlockWeight` of weight is correct fn full_block_fee_is_correct() { // A full block should cost 16 DOLLARS - println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&MaximumBlockWeight::get()); + println!("Base: {}", BlockWeights::get().get(DispatchClass::Normal).base_extrinsic); + let x = WeightToFee::calc(&BlockWeights::get().max_block); let y = 16 * DOLLARS; assert!(x.max(y) - x.min(y) < MILLICENTS); } @@ -106,8 +106,9 @@ mod tests { // This function tests that the fee for `ExtrinsicBaseWeight` of weight is correct fn extrinsic_base_fee_is_correct() { // `ExtrinsicBaseWeight` should cost 1/10 of a CENT - println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&ExtrinsicBaseWeight::get()); + let base_weight = BlockWeights::get().get(DispatchClass::Normal).base_extrinsic; + println!("Base: {}", base_weight); + let x = WeightToFee::calc(&base_weight); let y = CENTS / 10; assert!(x.max(y) - x.min(y) < MILLICENTS); } diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 51735ed3da..1a8d9cfdf8 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -33,8 +33,7 @@ use primitives::v1::{ use runtime_common::{ SlowAdjustingFeeUpdate, impls::ToAuthor, - BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength, - BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight, + BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, OffchainSolutionWeightLimit, }; use runtime_parachains::{ self, @@ -212,6 +211,9 @@ parameter_types! { impl frame_system::Config for Runtime { type BaseCallFilter = BaseFilter; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; + type DbWeight = RocksDbWeight; type Origin = Origin; type Call = Call; type Index = Nonce; @@ -223,13 +225,6 @@ impl frame_system::Config for Runtime { type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = RocksDbWeight; - type BlockExecutionWeight = BlockExecutionWeight; - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumExtrinsicWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; @@ -364,7 +359,7 @@ impl pallet_staking::Config for Runtime { type Call = Call; type UnsignedPriority = StakingUnsignedPriority; type MaxIterations = MaxIterations; - type OffchainSolutionWeightLimit = MaximumBlockWeight; + type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit; type MinSolutionScoreBump = MinSolutionScoreBump; type WeightInfo = (); } @@ -398,7 +393,7 @@ parameter_types! { } parameter_types! { - pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); + pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block; } impl pallet_offences::Config for Runtime { diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 6597247b54..8b4c55391d 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -45,8 +45,7 @@ use primitives::v1::{ }; use runtime_common::{ claims, SlowAdjustingFeeUpdate, paras_sudo_wrapper, - BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, - MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, + BlockHashCount, BlockWeights, BlockLength, }; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, @@ -125,6 +124,9 @@ parameter_types! { impl frame_system::Config for Runtime { type BaseCallFilter = (); + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; + type DbWeight = (); type Origin = Origin; type Call = Call; type Index = Nonce; @@ -136,13 +138,6 @@ impl frame_system::Config for Runtime { type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = BlockExecutionWeight; - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumBlockWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; @@ -331,7 +326,7 @@ impl pallet_staking::Config for Runtime { type Call = Call; type UnsignedPriority = StakingUnsignedPriority; type MaxIterations = MaxIterations; - type OffchainSolutionWeightLimit = MaximumBlockWeight; + type OffchainSolutionWeightLimit = (); type MinSolutionScoreBump = MinSolutionScoreBump; type WeightInfo = (); @@ -401,7 +396,7 @@ impl frame_system::offchain::SigningTypes for Runtime { } parameter_types! { - pub storage OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); + pub storage OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block; } impl pallet_offences::Config for Runtime { diff --git a/polkadot/runtime/westend/src/constants.rs b/polkadot/runtime/westend/src/constants.rs index 6fb7e934e1..ed74000704 100644 --- a/polkadot/runtime/westend/src/constants.rs +++ b/polkadot/runtime/westend/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, frame_system::MaximumBlockWeight] + /// - [0, MAXIMUM_BLOCK_WEIGHT] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: @@ -87,16 +87,16 @@ pub mod fee { #[cfg(test)] mod tests { use frame_support::weights::WeightToFeePolynomial; - use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight}; + use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight}; use super::fee::WeightToFee; use super::currency::{CENTS, DOLLARS, MILLICENTS}; #[test] - // This function tests that the fee for `MaximumBlockWeight` of weight is correct + // This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct fn full_block_fee_is_correct() { // A full block should cost 16 DOLLARS println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&MaximumBlockWeight::get()); + let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT); let y = 16 * DOLLARS; assert!(x.max(y) - x.min(y) < MILLICENTS); } diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 119e98e48f..236aaf434f 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -33,8 +33,7 @@ use primitives::v1::{ use runtime_common::{ SlowAdjustingFeeUpdate, CurrencyToVote, impls::ToAuthor, - BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength, - BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight, + BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, OffchainSolutionWeightLimit, ParachainSessionKeyPlaceholder, }; use sp_runtime::{ @@ -120,6 +119,8 @@ parameter_types! { impl frame_system::Config for Runtime { type BaseCallFilter = BaseFilter; + type BlockWeights = BlockWeights; + type BlockLength = BlockLength; type Origin = Origin; type Call = Call; type Index = Nonce; @@ -131,13 +132,7 @@ impl frame_system::Config for Runtime { type Header = generic::Header; type Event = Event; type BlockHashCount = BlockHashCount; - type MaximumBlockWeight = MaximumBlockWeight; type DbWeight = RocksDbWeight; - type BlockExecutionWeight = BlockExecutionWeight; - type ExtrinsicBaseWeight = ExtrinsicBaseWeight; - type MaximumExtrinsicWeight = MaximumExtrinsicWeight; - type MaximumBlockLength = MaximumBlockLength; - type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; @@ -147,6 +142,8 @@ impl frame_system::Config for Runtime { } parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * + BlockWeights::get().max_block; pub const MaxScheduledPerBlock: u32 = 50; } @@ -155,7 +152,7 @@ impl pallet_scheduler::Config for Runtime { type Origin = Origin; type PalletsOrigin = OriginCaller; type Call = Call; - type MaximumWeight = MaximumBlockWeight; + type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; @@ -312,9 +309,6 @@ parameter_types! { pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4; pub const MaxIterations: u32 = 10; pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); - pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get() - .saturating_sub(BlockExecutionWeight::get()) - .saturating_sub(ExtrinsicBaseWeight::get()); } impl pallet_staking::Config for Runtime { @@ -356,7 +350,7 @@ parameter_types! { } parameter_types! { - pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); + pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block; } impl pallet_offences::Config for Runtime {