From 421de7d176bd338564e8eed6576c9225b3594d64 Mon Sep 17 00:00:00 2001 From: antonio-dropulic Date: Wed, 1 Dec 2021 09:24:53 +0100 Subject: [PATCH] Squashed 'bridges/' changes from 23dda62482..407bf44a8a 407bf44a8a add missing license header (#1204) 9babb19810 Custom relay strategy (#1198) c287872a11 fix clippy things (#1200) 3a40e62789 Expose some const value and type (#1186) 32b61476d1 increase sleep before connectingMillau (#1195) aabe7041fa revert messages transactions mortality (#1194) 3651f4f909 Message transactions mortality (#1191) 364d6e155d Bump dependencies (#1180) f0389acc08 cargo +nightly fmt --all (#1192) b270b6a016 Unify error enums in substrate and ethereum clients with `thiserror` (#1094) 58c4946f74 Limit max call size of Rialto/Millau runtimes (#1187) fd56a8cd56 Add UI to the deployment (#1047) 16f01dc736 Westend -> Millau alerts are pending before notifications are sent (#1184) 5628c11ece replace collective flip with babe randomness in Rialto (#1188) 1094a63b00 ignore another (pretty bad) RUSTSEC (#1185) 379fe323ea fix/ignore cargo deny issues (#1183) 92af5e6e64 additional log in finality relay + rephrase "failed" (#1182) b996a3b681 Rialto parachain in test deployments (#1178) 28d9332b44 Resubmit transactions strategy for Polkadot/Kusama (#1175) d0172c6847 Playing with CI (#1179) fb6f42456d fix checks order when registering parachain (#1177) ee828c005a Register-parachain subcommand of substrate-relay (#1170) 8cd2b1a112 Token swap pallet benchmarks (#1174) bb811accb1 fix collision with westend bridge (#1172) 8d2fba70ed add token swaps to test deployments (#1169) b6d1bdfe2c publish rialto parachain collator image (#1171) 834ae4a10a Fix OutboundLaneData types (#1159) 5ee0ea1626 copypasted -> copied (#1168) c3bb835f18 fix spelling (#1167) f90d041dc9 Upgrade `jsonrpsee` to v0.3 (#1051) 598c9b6d0d add some basic tests for swap tokens (#1164) 05e88c61f5 publish images when tag of specific format(e.g. v2021-09-27 + v2021-09-27-1) is published (#1166) 7f3f94a6e0 Fix CI again (#1165) ff37de332f Move calculation relayer reward into `MessageDeliveryAndDispatchPayment` (#1153) 36fbba839b fix clippy warning (#1163) 16da44d018 explicit wasm build (#1158) c9c8226449 Match substrate's fmt (#1148) 2fdd7f3e5e Fix/ignore clippy warnings (#1157) 43dfcc2686 Adding LookupAddress (#1156) 951eaa5582 Add rialto-parachain runtime and node (#1142) 803d266d61 Rename MessageId -> BridgeMessageId (#1152) 5f234484fc Box large arguments of GRANDPA pallet (#1154) cf9abc1011 Fix spelling (#1150) ab83ba2e58 Relay subcommand that performs token RLT <> MLAU token swap (#1141) 832536caf0 Polkadot <> Kusama relayers (#1122) 6d0daa8975 Add `OnMessageAccepted` callback (#1134) 5d03a20b3e Integrate token swap pallet into Millau runtime (#1099) ea4cfa833e Adding MultiAddress type and ValidationCodeHash (#1139) c20325a784 Add tests for `Raw` and `BridgeSendMessage` enum `Call` variants (#1125) 6d802416e2 increase pause before pining Rialto nodes (#1137) b54fa56b62 calculate fee using full message payload (#1132) ca5d8178f5 Add parachain pallets to rialto runtime (#1053) 9eaae4142e fix transaction resubmitter limits for Millau -> Rialto transactions (#1135) 9d4e17783c add --mandatory-headers-only cli option to complex relay (#1129) 1c5e0ec1cb Add local CI info to README (#1131) a8e0929e14 chore: spellchecker fixes (#1130) 3b8e2118e3 set fee for importing mandatory headers to zero (#1127) 49bba9aa52 another bunch of words for spellchecker (#1128) 8a72eafef6 Increase pause before messages generation start (#1126) 1f0ba9a191 Move some associated types from relay_substrate_client::Chain to bp_runtime::Chain (#1087) 74bc1a5b54 Transactions resubmitter (#1083) 21ba001f26 log max balance drop when sending message (#1117) 638a7ddffa Code Cleaning (#1124) be6555c51b Fix buildah logout (#1120) 87539c4a98 Format code work (#1116) 526fe7fdd7 fix spelling (#1119) bd4ce7f241 Fix spelling (#1118) 3c1147858e added missing constants to Kusama/Polkadot primitives (#1114) 52093b22ab Fix delivery transaction estimation used by rational relayer (#1109) 77a2f2fbed Remove fund account checks from upgrade. (#1111) 824334802b Rename param and update comment (#1108) d7784bfe06 Fix spellcheck (#1110) 0b18f5906a Refactor substrate messages source and substrate messages target (#1105) b27240bbff fix compilation (#1107) 9697da4fe8 Emit mortal transactions from relay (#1073) b29396c077 Change vault vars type to env vars (#1084) 35e0bbdc0c Make clippy mandatory. (#1103) a517e8541f Remove unused deps (#1102) 873dae608a Remove unnessary deps (#1101) 13450b74ee Stored conversion rate updater (#1005) 74389829f3 [BREAKING] Migrate messages pallet to frame v2 (#1088) 424da938dd README fix (#1100) 865744c909 upgrade currency exchange pallet to frame v2 (#1097) b5038148b3 Add missing docs (#1095) 0791e911c1 Common crate for substrate-relay (#1082) 3834c9d880 Update high-level-overview.md (#1093) c93553face Increase the time window for messaging alerts. (#1092) 8b9cc3cecd migrate pallet-shift-session-manager to frame v2 (#1090) dc91813c22 migrate eth PoA pallet to frame v2 (#1091) f16bb098cc Migrate dispatch pallet to frame v2 (#1089) 19f4325348 Bridge/This Chain Ids should be exposed as constants on pallet level. (#1085) 6381122df7 Change ChainSpec::from_genesis for Rialto and Millau chains to reflect the chain names. (#1079) 0f1d33e973 Make CI happy again (#1086) 238e65d96f fix typo (#1080) fc008457b6 Token-swap-over-bridge pallet (#944) 3fb97fa5ef Fix full spellcheck (#1076) eae4ed7170 fixed wrong trace (#1075) 219a0fad04 merge two weight-related loops in messages pallet (#1071) fc85632fdb increase_message_fee depends on stored mesage size (#1066) 530f37a23b companion for https://github.com/paritytech/polkadot/pull/3507 (#1067) 53b8cba683 sc_basic_authorship=trace for millau nodes (#1074) 9874e05e98 Improve traces of message generator scripts (#1069) 7b5ee84fbb extract message_details impl into runtime common (#1070) 5a4aed5a8b refund weight for mot pruning messages (#1062) 90e3d1e111 Fix Westend -> Millau sync (#1064) 427d30ddfc When restarting client, also "restart" tokio runtime (#1065) d47c05eeef Change get pipeline sensitive variables from Vault instead of GitLab settings (#1063) d775a85415 use tokio reactor to execute jsonrpsee futures (#1061) 15c8cd61cb Use BABE to author blocks on Rialto (previously: Aura) (#1050) 5186293500 Allow reading suri && password override from file (#1059) b506298262 Update jsonrpsee reference (#1049) 1734d00517 enable weight fee adjustent in Rialto/Millau (#1044) 607265afae Pay dispatch fee at target chain cli option (#1043) ce79ef91be bump dependencies before start referencing polkadot repo (#1048) 924fa24f6d Cli option for greedy relayer + run no-losses relayer by default (#1042) e21eba7b59 Yrong README Fixup + M1 Fixes (#1045) 20d08204a2 Confirm delivery detects when more than expected messages are confirmed (#1039) 994b846b52 pre and post dispatch weights of OnDeliveryConfirmed callback (#1040) 1dd5297e84 give real value to Rialto and Millau tokens (#1038) 035bee8715 Use real conversion rate in greedy relayer strategy (#1035) 9cfaecd0f7 fixed metrics prefix (#1037) 1d8d224937 Use kebab-case for bridge arguments (#1036) f30a4c79a6 Shared reference to conversion rate metric value (#1034) c34d7a5cbb estimate transaction fee (#1015) 93404b18bb change alert period from 2m to 10m for Westend -> Millau (GRANDPA or public node itself is lagging sometimes) (#1032) git-subtree-dir: bridges git-subtree-split: 407bf44a8a5f4e60aceef2dc755cd9ff09929ac3 --- polkadot/file_header.txt | 15 - .../adder/collator/bin/puppet_worker.rs | 17 - .../westend/src/weights/pallet_balances.rs | 76 - .../src/weights/runtime_common_crowdloan.rs | 99 - polkadot/src/main.rs | 27 - relay/kusama/Cargo.toml | 264 --- relay/kusama/build.rs | 25 - relay/kusama/src/constants.rs | 114 - relay/kusama/src/lib.rs | 1883 ----------------- relay/kusama/src/tests.rs | 169 -- relay/kusama/src/weights/frame_system.rs | 81 - relay/kusama/src/weights/mod.rs | 44 - relay/kusama/src/weights/pallet_balances.rs | 76 - relay/kusama/src/weights/pallet_bounties.rs | 107 - relay/kusama/src/weights/pallet_democracy.rs | 207 -- .../pallet_election_provider_multi_phase.rs | 95 - .../src/weights/pallet_elections_phragmen.rs | 116 - relay/kusama/src/weights/pallet_identity.rs | 179 -- relay/kusama/src/weights/pallet_im_online.rs | 55 - relay/kusama/src/weights/pallet_indices.rs | 71 - relay/kusama/src/weights/pallet_membership.rs | 94 - relay/kusama/src/weights/pallet_multisig.rs | 122 -- relay/kusama/src/weights/pallet_proxy.rs | 119 -- relay/kusama/src/weights/pallet_scheduler.rs | 74 - relay/kusama/src/weights/pallet_session.rs | 56 - relay/kusama/src/weights/pallet_staking.rs | 230 -- relay/kusama/src/weights/pallet_timestamp.rs | 54 - relay/kusama/src/weights/pallet_tips.rs | 88 - relay/kusama/src/weights/pallet_treasury.rs | 72 - relay/kusama/src/weights/pallet_utility.rs | 59 - relay/kusama/src/weights/pallet_vesting.rs | 88 - .../src/weights/runtime_common_auctions.rs | 66 - .../src/weights/runtime_common_claims.rs | 71 - .../src/weights/runtime_common_crowdloan.rs | 99 - .../weights/runtime_common_paras_registrar.rs | 71 - .../src/weights/runtime_common_slots.rs | 74 - relay/polkadot/Cargo.toml | 239 --- relay/polkadot/README.adoc | 5 - relay/polkadot/build.rs | 25 - relay/polkadot/src/constants.rs | 113 - relay/polkadot/src/lib.rs | 1567 -------------- relay/polkadot/src/weights/frame_system.rs | 81 - relay/polkadot/src/weights/mod.rs | 39 - relay/polkadot/src/weights/pallet_balances.rs | 76 - relay/polkadot/src/weights/pallet_bounties.rs | 107 - .../polkadot/src/weights/pallet_democracy.rs | 207 -- .../pallet_election_provider_multi_phase.rs | 95 - .../src/weights/pallet_elections_phragmen.rs | 127 -- relay/polkadot/src/weights/pallet_identity.rs | 179 -- .../polkadot/src/weights/pallet_im_online.rs | 55 - relay/polkadot/src/weights/pallet_indices.rs | 71 - .../polkadot/src/weights/pallet_membership.rs | 92 - relay/polkadot/src/weights/pallet_multisig.rs | 122 -- relay/polkadot/src/weights/pallet_proxy.rs | 119 -- .../polkadot/src/weights/pallet_scheduler.rs | 74 - relay/polkadot/src/weights/pallet_session.rs | 56 - relay/polkadot/src/weights/pallet_staking.rs | 230 -- .../polkadot/src/weights/pallet_timestamp.rs | 54 - relay/polkadot/src/weights/pallet_tips.rs | 88 - relay/polkadot/src/weights/pallet_treasury.rs | 72 - relay/polkadot/src/weights/pallet_utility.rs | 59 - relay/polkadot/src/weights/pallet_vesting.rs | 88 - .../src/weights/runtime_common_claims.rs | 71 - 63 files changed, 9268 deletions(-) delete mode 100644 polkadot/file_header.txt delete mode 100644 polkadot/parachain/test-parachains/adder/collator/bin/puppet_worker.rs delete mode 100644 polkadot/runtime/westend/src/weights/pallet_balances.rs delete mode 100644 polkadot/runtime/westend/src/weights/runtime_common_crowdloan.rs delete mode 100644 polkadot/src/main.rs delete mode 100644 relay/kusama/Cargo.toml delete mode 100644 relay/kusama/build.rs delete mode 100644 relay/kusama/src/constants.rs delete mode 100644 relay/kusama/src/lib.rs delete mode 100644 relay/kusama/src/tests.rs delete mode 100644 relay/kusama/src/weights/frame_system.rs delete mode 100644 relay/kusama/src/weights/mod.rs delete mode 100644 relay/kusama/src/weights/pallet_balances.rs delete mode 100644 relay/kusama/src/weights/pallet_bounties.rs delete mode 100644 relay/kusama/src/weights/pallet_democracy.rs delete mode 100644 relay/kusama/src/weights/pallet_election_provider_multi_phase.rs delete mode 100644 relay/kusama/src/weights/pallet_elections_phragmen.rs delete mode 100644 relay/kusama/src/weights/pallet_identity.rs delete mode 100644 relay/kusama/src/weights/pallet_im_online.rs delete mode 100644 relay/kusama/src/weights/pallet_indices.rs delete mode 100644 relay/kusama/src/weights/pallet_membership.rs delete mode 100644 relay/kusama/src/weights/pallet_multisig.rs delete mode 100644 relay/kusama/src/weights/pallet_proxy.rs delete mode 100644 relay/kusama/src/weights/pallet_scheduler.rs delete mode 100644 relay/kusama/src/weights/pallet_session.rs delete mode 100644 relay/kusama/src/weights/pallet_staking.rs delete mode 100644 relay/kusama/src/weights/pallet_timestamp.rs delete mode 100644 relay/kusama/src/weights/pallet_tips.rs delete mode 100644 relay/kusama/src/weights/pallet_treasury.rs delete mode 100644 relay/kusama/src/weights/pallet_utility.rs delete mode 100644 relay/kusama/src/weights/pallet_vesting.rs delete mode 100644 relay/kusama/src/weights/runtime_common_auctions.rs delete mode 100644 relay/kusama/src/weights/runtime_common_claims.rs delete mode 100644 relay/kusama/src/weights/runtime_common_crowdloan.rs delete mode 100644 relay/kusama/src/weights/runtime_common_paras_registrar.rs delete mode 100644 relay/kusama/src/weights/runtime_common_slots.rs delete mode 100644 relay/polkadot/Cargo.toml delete mode 100644 relay/polkadot/README.adoc delete mode 100644 relay/polkadot/build.rs delete mode 100644 relay/polkadot/src/constants.rs delete mode 100644 relay/polkadot/src/lib.rs delete mode 100644 relay/polkadot/src/weights/frame_system.rs delete mode 100644 relay/polkadot/src/weights/mod.rs delete mode 100644 relay/polkadot/src/weights/pallet_balances.rs delete mode 100644 relay/polkadot/src/weights/pallet_bounties.rs delete mode 100644 relay/polkadot/src/weights/pallet_democracy.rs delete mode 100644 relay/polkadot/src/weights/pallet_election_provider_multi_phase.rs delete mode 100644 relay/polkadot/src/weights/pallet_elections_phragmen.rs delete mode 100644 relay/polkadot/src/weights/pallet_identity.rs delete mode 100644 relay/polkadot/src/weights/pallet_im_online.rs delete mode 100644 relay/polkadot/src/weights/pallet_indices.rs delete mode 100644 relay/polkadot/src/weights/pallet_membership.rs delete mode 100644 relay/polkadot/src/weights/pallet_multisig.rs delete mode 100644 relay/polkadot/src/weights/pallet_proxy.rs delete mode 100644 relay/polkadot/src/weights/pallet_scheduler.rs delete mode 100644 relay/polkadot/src/weights/pallet_session.rs delete mode 100644 relay/polkadot/src/weights/pallet_staking.rs delete mode 100644 relay/polkadot/src/weights/pallet_timestamp.rs delete mode 100644 relay/polkadot/src/weights/pallet_tips.rs delete mode 100644 relay/polkadot/src/weights/pallet_treasury.rs delete mode 100644 relay/polkadot/src/weights/pallet_utility.rs delete mode 100644 relay/polkadot/src/weights/pallet_vesting.rs delete mode 100644 relay/polkadot/src/weights/runtime_common_claims.rs diff --git a/polkadot/file_header.txt b/polkadot/file_header.txt deleted file mode 100644 index f3a8b8eb30..0000000000 --- a/polkadot/file_header.txt +++ /dev/null @@ -1,15 +0,0 @@ -// 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 . \ No newline at end of file diff --git a/polkadot/parachain/test-parachains/adder/collator/bin/puppet_worker.rs b/polkadot/parachain/test-parachains/adder/collator/bin/puppet_worker.rs deleted file mode 100644 index 4b026e96a8..0000000000 --- a/polkadot/parachain/test-parachains/adder/collator/bin/puppet_worker.rs +++ /dev/null @@ -1,17 +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 . - -polkadot_node_core_pvf::decl_puppet_worker_main!(); diff --git a/polkadot/runtime/westend/src/weights/pallet_balances.rs b/polkadot/runtime/westend/src/weights/pallet_balances.rs deleted file mode 100644 index 1fdbb034d6..0000000000 --- a/polkadot/runtime/westend/src/weights/pallet_balances.rs +++ /dev/null @@ -1,76 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_balances -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=westend-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/westend/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_balances. -pub struct WeightInfo(PhantomData); -impl pallet_balances::WeightInfo for WeightInfo { - fn transfer() -> Weight { - (72_675_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer_keep_alive() -> Weight { - (53_454_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_creating() -> Weight { - (28_750_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_killing() -> Weight { - (35_013_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_transfer() -> Weight { - (72_130_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn transfer_all() -> Weight { - (66_281_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/polkadot/runtime/westend/src/weights/runtime_common_crowdloan.rs b/polkadot/runtime/westend/src/weights/runtime_common_crowdloan.rs deleted file mode 100644 index 060e481ed6..0000000000 --- a/polkadot/runtime/westend/src/weights/runtime_common_crowdloan.rs +++ /dev/null @@ -1,99 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::crowdloan -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-24, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=westend-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::crowdloan -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/westend/src/weights/runtime_common_crowdloan.rs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::crowdloan. -pub struct WeightInfo(PhantomData); -impl runtime_common::crowdloan::WeightInfo for WeightInfo { - fn create() -> Weight { - (95_715_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn contribute() -> Weight { - (500_788_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn withdraw() -> Weight { - (127_448_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn refund(k: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 53_000 - .saturating_add((56_113_000 as Weight).saturating_mul(k as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(k as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(k as Weight))) - } - fn dissolve() -> Weight { - (71_359_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn edit() -> Weight { - (43_194_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn add_memo() -> Weight { - (65_648_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn poke() -> Weight { - (51_082_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_initialize(n: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 31_000 - .saturating_add((134_501_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(5 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)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight))) - } -} diff --git a/polkadot/src/main.rs b/polkadot/src/main.rs deleted file mode 100644 index 14d62fbb9a..0000000000 --- a/polkadot/src/main.rs +++ /dev/null @@ -1,27 +0,0 @@ -// 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 . - -//! Polkadot CLI - -#![warn(missing_docs)] - -use color_eyre::eyre; - -fn main() -> eyre::Result<()> { - color_eyre::install()?; - polkadot_cli::run()?; - Ok(()) -} diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml deleted file mode 100644 index 17464e963c..0000000000 --- a/relay/kusama/Cargo.toml +++ /dev/null @@ -1,264 +0,0 @@ -[package] -name = "kusama-runtime" -version = "0.9.7" -authors = ["Parity Technologies "] -edition = "2018" -build = "build.rs" - -[dependencies] -bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] } -log = { version = "0.4.14", default-features = false } -rustc-hex = { version = "2.1.0", default-features = false } -serde = { version = "1.0.123", default-features = false } -serde_derive = { version = "1.0.117", optional = true } -static_assertions = "1.1.0" -smallvec = "1.6.1" - -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 } -beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-gilt = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-staking-reward-fn = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false } -frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -hex-literal = { version = "0.3.1", optional = true } - -runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } -runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } -primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } - -xcm = { package = "xcm", path = "../../xcm", default-features = false } -xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", default-features = false } -xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false } - -max-encoded-len = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -[dev-dependencies] -hex-literal = "0.3.1" -libsecp256k1 = "0.3.5" -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.61" - -[build-dependencies] -substrate-wasm-builder = "3.0.0" - -[features] -default = ["std"] -no_std = [] -only-staking = [] -std = [ - "authority-discovery-primitives/std", - "bitvec/std", - "primitives/std", - "rustc-hex/std", - "parity-scale-codec/std", - "inherents/std", - "sp-core/std", - "sp-api/std", - "tx-pool-api/std", - "block-builder-api/std", - "offchain-primitives/std", - "sp-std/std", - "sp-io/std", - "frame-support/std", - "frame-executive/std", - "pallet-authority-discovery/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-bounties/std", - "pallet-transaction-payment/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-collective/std", - "pallet-elections-phragmen/std", - "pallet-election-provider-multi-phase/std", - "pallet-democracy/std", - "pallet-gilt/std", - "pallet-grandpa/std", - "pallet-identity/std", - "pallet-im-online/std", - "pallet-indices/std", - "pallet-membership/std", - "pallet-multisig/std", - "pallet-nicks/std", - "pallet-offences/std", - "pallet-proxy/std", - "pallet-recovery/std", - "pallet-scheduler/std", - "pallet-session/std", - "pallet-society/std", - "pallet-staking/std", - "pallet-staking-reward-fn/std", - "pallet-timestamp/std", - "pallet-tips/std", - "pallet-treasury/std", - "pallet-utility/std", - "pallet-vesting/std", - "pallet-babe/std", - "pallet-xcm/std", - "sp-runtime/std", - "sp-staking/std", - "frame-system/std", - "frame-system-rpc-runtime-api/std", - "sp-version/std", - "serde_derive", - "serde/std", - "log/std", - "babe-primitives/std", - "sp-session/std", - "runtime-common/std", - "runtime-parachains/std", - "frame-try-runtime/std", - "sp-npos-elections/std", - "beefy-primitives/std", - "pallet-mmr-primitives/std", - "xcm/std", - "xcm-executor/std", - "xcm-builder/std", - "max-encoded-len/std", - "frame-election-provider-support/std", -] -runtime-benchmarks = [ - "runtime-common/runtime-benchmarks", - "frame-benchmarking", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "pallet-babe/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-bounties/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-democracy/runtime-benchmarks", - "pallet-elections-phragmen/runtime-benchmarks", - "pallet-election-provider-multi-phase/runtime-benchmarks", - "pallet-gilt/runtime-benchmarks", - "pallet-grandpa/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-im-online/runtime-benchmarks", - "pallet-indices/runtime-benchmarks", - "pallet-membership/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-society/runtime-benchmarks", - "pallet-staking/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-tips/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", - "pallet-offences-benchmarking", - "pallet-session-benchmarking", - "pallet-xcm/runtime-benchmarks", - "frame-system-benchmarking", - "hex-literal", - "xcm-builder/runtime-benchmarks", - "frame-election-provider-support/runtime-benchmarks", -] -try-runtime = [ - "frame-executive/try-runtime", - "frame-try-runtime", - "frame-system/try-runtime", - "pallet-authority-discovery/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-bounties/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-collective/try-runtime", - "pallet-elections-phragmen/try-runtime", - "pallet-election-provider-multi-phase/try-runtime", - "pallet-democracy/try-runtime", - "pallet-grandpa/try-runtime", - "pallet-identity/try-runtime", - "pallet-im-online/try-runtime", - "pallet-indices/try-runtime", - "pallet-membership/try-runtime", - "pallet-multisig/try-runtime", - "pallet-nicks/try-runtime", - "pallet-offences/try-runtime", - "pallet-proxy/try-runtime", - "pallet-recovery/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-session/try-runtime", - "pallet-society/try-runtime", - "pallet-staking/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-tips/try-runtime", - "pallet-treasury/try-runtime", - "pallet-utility/try-runtime", - "pallet-vesting/try-runtime", - "pallet-babe/try-runtime", - "runtime-common/try-runtime", -] -# When enabled, the runtime api will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime api exported functions -# in WASM. -disable-runtime-api = [] - -# A feature that should be enabled when the runtime should be build for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller like logging for example. -on-chain-release-build = [ - "sp-api/disable-logging", -] diff --git a/relay/kusama/build.rs b/relay/kusama/build.rs deleted file mode 100644 index a75ebb4edb..0000000000 --- a/relay/kusama/build.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019-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 substrate_wasm_builder::WasmBuilder; - -fn main() { - WasmBuilder::new() - .with_current_project() - .import_memory() - .export_heap_base() - .build() -} diff --git a/relay/kusama/src/constants.rs b/relay/kusama/src/constants.rs deleted file mode 100644 index 29040efb48..0000000000 --- a/relay/kusama/src/constants.rs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2019-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 . - -/// Money matters. -pub mod currency { - use primitives::v0::Balance; - - pub const UNITS: Balance = 1_000_000_000_000; - pub const CENTS: Balance = UNITS / 30_000; - pub const GRAND: Balance = CENTS * 100_000; - pub const MILLICENTS: Balance = CENTS / 1_000; - - pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 2_000 * CENTS + (bytes as Balance) * 100 * MILLICENTS - } -} - -/// Time and blocks. -pub mod time { - use primitives::v0::{Moment, BlockNumber}; - pub const MILLISECS_PER_BLOCK: Moment = 6000; - pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 * HOURS; - - // These time units are defined in number of blocks. - pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); - pub const HOURS: BlockNumber = MINUTES * 60; - pub const DAYS: BlockNumber = HOURS * 24; - pub const WEEKS: BlockNumber = DAYS * 7; - - // 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. - pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); -} - -/// Fee-related. -pub mod fee { - pub use sp_runtime::Perbill; - use primitives::v0::Balance; - use runtime_common::ExtrinsicBaseWeight; - use frame_support::weights::{ - WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, - }; - use smallvec::smallvec; - - /// The block saturation level. Fees will be updates based on this value. - pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); - - /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the - /// node's balance type. - /// - /// This should typically create a mapping between the following ranges: - /// - [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: - /// - Setting it to `0` will essentially disable the weight fee. - /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. - pub struct WeightToFee; - impl WeightToFeePolynomial for WeightToFee { - type Balance = Balance; - fn polynomial() -> WeightToFeeCoefficients { - // in Kusama, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: - let p = super::currency::CENTS; - let q = 10 * Balance::from(ExtrinsicBaseWeight::get()); - smallvec![WeightToFeeCoefficient { - degree: 1, - negative: false, - coeff_frac: Perbill::from_rational(p % q, q), - coeff_integer: p / q, - }] - } - } -} - -#[cfg(test)] -mod tests { - use frame_support::weights::WeightToFeePolynomial; - use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight}; - use super::fee::WeightToFee; - use super::currency::{CENTS, MILLICENTS}; - - #[test] - // 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 1,600 CENTS - println!("Base: {}", ExtrinsicBaseWeight::get()); - let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT); - let y = 16 * 100 * CENTS; - assert!(x.max(y) - x.min(y) < MILLICENTS); - } - - #[test] - // 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 y = CENTS / 10; - assert!(x.max(y) - x.min(y) < MILLICENTS); - } -} diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs deleted file mode 100644 index b0c1a1d006..0000000000 --- a/relay/kusama/src/lib.rs +++ /dev/null @@ -1,1883 +0,0 @@ -// 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 . - -//! The Kusama runtime. This can be compiled with `#[no_std]`, ready for Wasm. - -#![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] - -use pallet_transaction_payment::CurrencyAdapter; -use sp_std::prelude::*; -use sp_std::collections::btree_map::BTreeMap; -use sp_core::u32_trait::{_1, _2, _3, _5}; -use parity_scale_codec::{Encode, Decode}; -use primitives::v1::{ - AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt, - CoreState, GroupRotationInfo, Hash, Id as ParaId, Moment, Nonce, OccupiedCoreAssumption, - PersistedValidationData, Signature, ValidationCode, ValidationCodeHash, ValidatorId, - ValidatorIndex, InboundDownwardMessage, InboundHrmpMessage, SessionInfo, -}; -use runtime_common::{ - claims, paras_registrar, xcm_sender, slots, auctions, crowdloan, - SlowAdjustingFeeUpdate, CurrencyToVote, impls::DealWithFees, - BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit, OffchainSolutionLengthLimit, - ToAuthor, -}; - -use runtime_parachains::origin as parachains_origin; -use runtime_parachains::configuration as parachains_configuration; -use runtime_parachains::shared as parachains_shared; -use runtime_parachains::inclusion as parachains_inclusion; -use runtime_parachains::paras_inherent as parachains_paras_inherent; -use runtime_parachains::initializer as parachains_initializer; -use runtime_parachains::session_info as parachains_session_info; -use runtime_parachains::paras as parachains_paras; -use runtime_parachains::dmp as parachains_dmp; -use runtime_parachains::ump as parachains_ump; -use runtime_parachains::hrmp as parachains_hrmp; -use runtime_parachains::scheduler as parachains_scheduler; -use runtime_parachains::reward_points as parachains_reward_points; -use runtime_parachains::runtime_api_impl::v1 as parachains_runtime_api_impl; - -use xcm::v0::{MultiLocation::{self, Null, X1}, NetworkId, BodyId, Xcm, Junction::Parachain}; -use xcm::v0::MultiAsset::{self, AllConcreteFungible}; -use xcm_builder::{ - AccountId32Aliases, ChildParachainConvertsVia, SovereignSignedViaLocation, CurrencyAdapter as XcmCurrencyAdapter, - ChildParachainAsNative, SignedAccountId32AsNative, ChildSystemParachainAsSuperuser, LocationInverter, - IsConcrete, FixedWeightBounds, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - IsChildSystemParachain, UsingComponents, BackingToPlurality, SignedToAccountId32, -}; -use xcm_executor::XcmExecutor; -use sp_arithmetic::Perquintill; -use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, - ApplyExtrinsicResult, KeyTypeId, Percent, Permill, Perbill, - transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, - traits::{ - BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, - Extrinsic as ExtrinsicT, SaturatedConversion, Verify, - }, -}; -#[cfg(feature = "runtime-benchmarks")] -use sp_runtime::RuntimeString; -use sp_version::RuntimeVersion; -use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; -#[cfg(any(feature = "std", test))] -use sp_version::NativeVersion; -use sp_core::OpaqueMetadata; -use sp_staking::SessionIndex; -use frame_support::{ - parameter_types, construct_runtime, RuntimeDebug, PalletId, - traits::{KeyOwnerProofSystem, LockIdentifier, Filter, InstanceFilter, All, MaxEncodedLen}, - weights::Weight, -}; -use frame_system::{EnsureRoot, EnsureOneOf}; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; -use pallet_session::historical as session_historical; -use static_assertions::const_assert; -use beefy_primitives::crypto::AuthorityId as BeefyId; -use pallet_mmr_primitives as mmr; - -#[cfg(feature = "std")] -pub use pallet_staking::StakerStatus; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use pallet_timestamp::Call as TimestampCall; -pub use pallet_balances::Call as BalancesCall; - -/// Constant values used within the runtime. -pub mod constants; -use constants::{time::*, currency::*, fee::*}; - -// Weights used in the runtime. -mod weights; - -#[cfg(test)] -mod tests; - -// Make the WASM binary available. -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -/// Runtime version (Kusama). -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("kusama"), - impl_name: create_runtime_str!("parity-kusama"), - authoring_version: 2, - spec_version: 9070, - 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: 5, -}; - -/// The BABE epoch configuration at genesis. -pub const BABE_GENESIS_EPOCH_CONFIG: babe_primitives::BabeEpochConfiguration = - babe_primitives::BabeEpochConfiguration { - c: PRIMARY_PROBABILITY, - allowed_slots: babe_primitives::AllowedSlots::PrimaryAndSecondaryVRFSlots - }; - -/// Native version. -#[cfg(any(feature = "std", test))] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -/// Don't allow swaps until parathread story is more mature. -pub struct BaseFilter; -impl Filter for BaseFilter { - fn filter(c: &Call) -> bool { - !matches!(c, - Call::Registrar(paras_registrar::Call::swap(..)) - ) - } -} - -type MoreThanHalfCouncil = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> ->; - -parameter_types! { - pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 2; -} - -impl frame_system::Config for Runtime { - type BaseCallFilter = BaseFilter; - type BlockWeights = BlockWeights; - type BlockLength = BlockLength; - type Origin = Origin; - type Call = Call; - type Index = Nonce; - type BlockNumber = BlockNumber; - type Hash = Hash; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = AccountIdLookup; - type Header = generic::Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - type Version = Version; - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = weights::frame_system::WeightInfo; - type SS58Prefix = SS58Prefix; - type OnSetCode = (); -} - -parameter_types! { - pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * - BlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; -} - -type ScheduleOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> ->; - -impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = ScheduleOrigin; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = weights::pallet_scheduler::WeightInfo; -} - -parameter_types! { - pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64; - pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; - pub const ReportLongevity: u64 = - BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); -} - -impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ExpectedBlockTime; - - // session module is the trigger - type EpochChangeTrigger = pallet_babe::ExternalTrigger; - - type KeyOwnerProof = >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type KeyOwnerProofSystem = Historical; - - type HandleEquivocation = - pallet_babe::EquivocationHandler; - - type WeightInfo = (); -} - -parameter_types! { - pub const IndexDeposit: Balance = 100 * CENTS; -} - -impl pallet_indices::Config for Runtime { - type AccountIndex = AccountIndex; - type Currency = Balances; - type Deposit = IndexDeposit; - type Event = Event; - type WeightInfo = weights::pallet_indices::WeightInfo; -} - -parameter_types! { - pub const ExistentialDeposit: Balance = 1 * CENTS; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type Balance = Balance; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type WeightInfo = weights::pallet_balances::WeightInfo; -} - -parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLICENTS; -} - -impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = CurrencyAdapter>; - type TransactionByteFee = TransactionByteFee; - type WeightToFee = WeightToFee; - type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} -impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = Babe; - type MinimumPeriod = MinimumPeriod; - type WeightInfo = weights::pallet_timestamp::WeightInfo; -} - -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - -impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; - type FilterUncle = (); - type EventHandler = (Staking, ImOnline); -} - -parameter_types! { - pub const Period: BlockNumber = 10 * MINUTES; - pub const Offset: BlockNumber = 0; -} - -impl_opaque_keys! { - pub struct SessionKeys { - pub grandpa: Grandpa, - pub babe: Babe, - pub im_online: ImOnline, - pub para_validator: ParasInitializer, - pub para_assignment: ParasSessionInfo, - pub authority_discovery: AuthorityDiscovery, - } -} - -parameter_types! { - pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); -} - -impl pallet_session::Config for Runtime { - type Event = Event; - type ValidatorId = AccountId; - type ValidatorIdOf = pallet_staking::StashOf; - type ShouldEndSession = Babe; - type NextSessionRotation = Babe; - type SessionManager = pallet_session::historical::NoteHistoricalRoot; - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type DisabledValidatorsThreshold = DisabledValidatorsThreshold; - type WeightInfo = weights::pallet_session::WeightInfo; -} - -impl pallet_session::historical::Config for Runtime { - type FullIdentification = pallet_staking::Exposure; - type FullIdentificationOf = pallet_staking::ExposureOf; -} - -parameter_types! { - // no signed phase for now, just unsigned. - pub const SignedPhase: u32 = 0; - pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; - - // fallback: run election on-chain. - pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = - pallet_election_provider_multi_phase::FallbackStrategy::Nothing; - pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000); - - // miner configs - pub const MinerMaxIterations: u32 = 10; - pub OffchainRepeat: BlockNumber = 5; -} - -sp_npos_elections::generate_solution_type!( - #[compact] - pub struct NposCompactSolution24::< - VoterIndex = u32, - TargetIndex = u16, - Accuracy = sp_runtime::PerU16, - >(24) -); - -impl pallet_election_provider_multi_phase::Config for Runtime { - type Event = Event; - type Currency = Balances; - type UnsignedPhase = UnsignedPhase; - type SignedPhase = SignedPhase; - type SolutionImprovementThreshold = SolutionImprovementThreshold; - type MinerMaxIterations = MinerMaxIterations; - type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking. - type MinerMaxLength = OffchainSolutionLengthLimit; - type OffchainRepeat = OffchainRepeat; - type MinerTxPriority = NposSolutionPriority; - type DataProvider = Staking; - type CompactSolution = NposCompactSolution24; - type OnChainAccuracy = Perbill; - type Fallback = Fallback; - type BenchmarkingConfig = (); - type ForceOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, - >; - type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; -} - -fn era_payout( - total_staked: Balance, - non_gilt_issuance: Balance, - max_annual_inflation: Perquintill, - period_fraction: Perquintill, - auctioned_slots: u64, -) -> (Balance, Balance) { - use sp_arithmetic::traits::Saturating; - use pallet_staking_reward_fn::compute_inflation; - - let min_annual_inflation = Perquintill::from_rational(25u64, 1000u64); - let delta_annual_inflation = max_annual_inflation.saturating_sub(min_annual_inflation); - - // 30% reserved for up to 60 slots. - let auction_proportion = Perquintill::from_rational(auctioned_slots.min(60), 200u64); - - // Therefore the ideal amount at stake (as a percentage of total issuance) is 75% less the amount that we expect - // to be taken up with auctions. - let ideal_stake = Perquintill::from_percent(75) - .saturating_sub(auction_proportion); - - let stake = Perquintill::from_rational(total_staked, non_gilt_issuance); - let falloff = Perquintill::from_percent(5); - let adjustment = compute_inflation(stake, ideal_stake, falloff); - let staking_inflation = min_annual_inflation.saturating_add(delta_annual_inflation * adjustment); - - let max_payout = period_fraction * max_annual_inflation * non_gilt_issuance; - let staking_payout = (period_fraction * staking_inflation) * non_gilt_issuance; - let rest = max_payout.saturating_sub(staking_payout); - - let other_issuance = non_gilt_issuance.saturating_sub(total_staked); - if total_staked > other_issuance { - let _cap_rest = Perquintill::from_rational(other_issuance, total_staked) * staking_payout; - // We don't do anything with this, but if we wanted to, we could introduce a cap on the treasury amount - // with: `rest = rest.min(cap_rest);` - } - (staking_payout, rest) -} - -pub struct EraPayout; -impl pallet_staking::EraPayout for EraPayout { - fn era_payout( - total_staked: Balance, - _total_issuance: Balance, - era_duration_millis: u64, - ) -> (Balance, Balance) { - // TODO: #3011 Update with proper auctioned slots tracking. - // This should be fine for the first year of parachains. - let auctioned_slots: u64 = auctions::Pallet::::auction_counter().into(); - const MAX_ANNUAL_INFLATION: Perquintill = Perquintill::from_percent(10); - const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100; - - era_payout( - total_staked, - Gilt::issuance().non_gilt, - MAX_ANNUAL_INFLATION, - Perquintill::from_rational(era_duration_millis, MILLISECONDS_PER_YEAR), - auctioned_slots, - ) - } -} - -parameter_types! { - // Six sessions in an era (6 hours). - pub const SessionsPerEra: SessionIndex = 6; - // 28 eras for unbonding (7 days). - pub const BondingDuration: pallet_staking::EraIndex = 28; - // 27 eras in which slashes can be cancelled (slightly less than 7 days). - pub const SlashDeferDuration: pallet_staking::EraIndex = 27; - pub const MaxNominatorRewardedPerValidator: u32 = 256; -} - -type SlashCancelOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> ->; - -impl pallet_staking::Config for Runtime { - const MAX_NOMINATIONS: u32 = ::LIMIT as u32; - type Currency = Balances; - type UnixTime = Timestamp; - type CurrencyToVote = CurrencyToVote; - type ElectionProvider = ElectionProviderMultiPhase; - type GenesisElectionProvider = - frame_election_provider_support::onchain::OnChainSequentialPhragmen< - pallet_election_provider_multi_phase::OnChainConfig - >; - type RewardRemainder = Treasury; - type Event = Event; - type Slash = Treasury; - type Reward = (); - type SessionsPerEra = SessionsPerEra; - type BondingDuration = BondingDuration; - type SlashDeferDuration = SlashDeferDuration; - // A majority of the council or root can cancel the slash. - type SlashCancelOrigin = SlashCancelOrigin; - type SessionInterface = Self; - type EraPayout = EraPayout; - type NextNewSession = Session; - type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; - type WeightInfo = weights::pallet_staking::WeightInfo; -} - -parameter_types! { - pub const LaunchPeriod: BlockNumber = 7 * DAYS; - pub const VotingPeriod: BlockNumber = 7 * DAYS; - pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; - pub const MinimumDeposit: Balance = 100 * CENTS; - pub const EnactmentPeriod: BlockNumber = 8 * DAYS; - pub const CooloffPeriod: BlockNumber = 7 * DAYS; - // One cent: $10,000 / MB - pub const PreimageByteDeposit: Balance = 10 * MILLICENTS; - pub const InstantAllowed: bool = true; - pub const MaxVotes: u32 = 100; - pub const MaxProposals: u32 = 100; -} - -impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; - type Currency = Balances; - type EnactmentPeriod = EnactmentPeriod; - type LaunchPeriod = LaunchPeriod; - type VotingPeriod = VotingPeriod; - 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>; - /// A majority can have the next scheduled referendum be a straight majority-carries vote. - type ExternalMajorityOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; - /// 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>; - /// 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>; - type InstantOrigin = pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; - 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< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, - >; - 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< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, - >; - // 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. - type VetoOrigin = pallet_collective::EnsureMember; - type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; - type Slash = Treasury; - type Scheduler = Scheduler; - type PalletsOrigin = OriginCaller; - type MaxVotes = MaxVotes; - type WeightInfo = weights::pallet_democracy::WeightInfo; - type MaxProposals = MaxProposals; -} - -parameter_types! { - pub const CouncilMotionDuration: BlockNumber = 3 * DAYS; - pub const CouncilMaxProposals: u32 = 100; - pub const CouncilMaxMembers: u32 = 100; -} - -type CouncilCollective = pallet_collective::Instance1; -impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; - type MotionDuration = CouncilMotionDuration; - type MaxProposals = CouncilMaxProposals; - type MaxMembers = CouncilMaxMembers; - type DefaultVote = pallet_collective::PrimeDefaultVote; - type WeightInfo = weights::pallet_collective::WeightInfo; -} - -parameter_types! { - pub const CandidacyBond: Balance = 100 * CENTS; - // 1 storage item created, key size is 32 bytes, value size is 16+16. - pub const VotingBondBase: Balance = deposit(1, 64); - // additional data per vote is 32 bytes (account id). - pub const VotingBondFactor: Balance = deposit(0, 32); - /// Daily council elections - pub const TermDuration: BlockNumber = 24 * HOURS; - pub const DesiredMembers: u32 = 19; - pub const DesiredRunnersUp: u32 = 19; - pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; -} - -// Make sure that there are no more than MaxMembers members elected via phragmen. -const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); - -impl pallet_elections_phragmen::Config for Runtime { - type Event = Event; - type Currency = Balances; - type ChangeMembers = Council; - type InitializeMembers = Council; - type CurrencyToVote = frame_support::traits::U128CurrencyToVote; - type CandidacyBond = CandidacyBond; - type VotingBondBase = VotingBondBase; - type VotingBondFactor = VotingBondFactor; - type LoserCandidate = Treasury; - type KickedMember = Treasury; - type DesiredMembers = DesiredMembers; - type DesiredRunnersUp = DesiredRunnersUp; - type TermDuration = TermDuration; - type PalletId = PhragmenElectionPalletId; - type WeightInfo = weights::pallet_elections_phragmen::WeightInfo; -} - -parameter_types! { - pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS; - pub const TechnicalMaxProposals: u32 = 100; - pub const TechnicalMaxMembers: u32 = 100; -} - -type TechnicalCollective = pallet_collective::Instance2; -impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; - type MotionDuration = TechnicalMotionDuration; - type MaxProposals = TechnicalMaxProposals; - type MaxMembers = TechnicalMaxMembers; - type DefaultVote = pallet_collective::PrimeDefaultVote; - type WeightInfo = weights::pallet_collective::WeightInfo; -} - -impl pallet_membership::Config for Runtime { - type Event = Event; - type AddOrigin = MoreThanHalfCouncil; - type RemoveOrigin = MoreThanHalfCouncil; - type SwapOrigin = MoreThanHalfCouncil; - type ResetOrigin = MoreThanHalfCouncil; - type PrimeOrigin = MoreThanHalfCouncil; - type MembershipInitialized = TechnicalCommittee; - type MembershipChanged = TechnicalCommittee; - type MaxMembers = TechnicalMaxMembers; - type WeightInfo = weights::pallet_membership::WeightInfo; -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 2000 * CENTS; - pub const SpendPeriod: BlockNumber = 6 * DAYS; - pub const Burn: Permill = Permill::from_perthousand(2); - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); - - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 100 * CENTS; - pub const DataDepositPerByte: Balance = 1 * CENTS; - pub const BountyDepositBase: Balance = 100 * CENTS; - pub const BountyDepositPayoutDelay: BlockNumber = 4 * DAYS; - pub const BountyUpdatePeriod: BlockNumber = 90 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 200 * CENTS; - pub const MaxApprovals: u32 = 100; -} - -type ApproveOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> ->; - -impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryPalletId; - type Currency = Balances; - type ApproveOrigin = ApproveOrigin; - type RejectOrigin = MoreThanHalfCouncil; - type Event = Event; - type OnSlash = Treasury; - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = Society; - type MaxApprovals = MaxApprovals; - type WeightInfo = weights::pallet_treasury::WeightInfo; - type SpendFunds = Bounties; -} - -impl pallet_bounties::Config for Runtime { - type BountyDepositBase = BountyDepositBase; - type BountyDepositPayoutDelay = BountyDepositPayoutDelay; - type BountyUpdatePeriod = BountyUpdatePeriod; - type BountyCuratorDeposit = BountyCuratorDeposit; - type BountyValueMinimum = BountyValueMinimum; - type DataDepositPerByte = DataDepositPerByte; - type Event = Event; - type MaximumReasonLength = MaximumReasonLength; - type WeightInfo = weights::pallet_bounties::WeightInfo; -} - -impl pallet_tips::Config for Runtime { - type MaximumReasonLength = MaximumReasonLength; - type DataDepositPerByte = DataDepositPerByte; - type Tippers = PhragmenElection; - type TipCountdown = TipCountdown; - type TipFindersFee = TipFindersFee; - type TipReportDepositBase = TipReportDepositBase; - type Event = Event; - type WeightInfo = weights::pallet_tips::WeightInfo; -} - -impl pallet_offences::Config for Runtime { - type Event = Event; - type IdentificationTuple = pallet_session::historical::IdentificationTuple; - type OnOffenceHandler = Staking; -} - -impl pallet_authority_discovery::Config for Runtime {} - -parameter_types! { - pub NposSolutionPriority: TransactionPriority = - Perbill::from_percent(90) * TransactionPriority::max_value(); - pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); -} - -impl pallet_im_online::Config for Runtime { - type AuthorityId = ImOnlineId; - type Event = Event; - type ValidatorSet = Historical; - type NextSessionRotation = Babe; - type ReportUnresponsiveness = Offences; - type UnsignedPriority = ImOnlineUnsignedPriority; - type WeightInfo = weights::pallet_im_online::WeightInfo; -} - -impl pallet_grandpa::Config for Runtime { - type Event = Event; - type Call = Call; - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type KeyOwnerProofSystem = Historical; - - type HandleEquivocation = - pallet_grandpa::EquivocationHandler; - - type WeightInfo = (); -} - -/// Submits transaction with the node's public and signature type. Adheres to the signed extension -/// format of the chain. -impl frame_system::offchain::CreateSignedTransaction for Runtime where - Call: From, -{ - fn create_transaction>( - call: Call, - public: ::Signer, - account: AccountId, - nonce: ::Index, - ) -> Option<(Call, ::SignaturePayload)> { - use sp_runtime::traits::StaticLookup; - // take the biggest period possible. - let period = BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; - - let current_block = System::block_number() - .saturated_into::() - // The `System::block_number` is initialized with `n+1`, - // so the actual block number is `n`. - .saturating_sub(1); - let tip = 0; - let extra: SignedExtra = ( - frame_system::CheckSpecVersion::::new(), - frame_system::CheckTxVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - frame_system::CheckNonce::::from(nonce), - frame_system::CheckWeight::::new(), - pallet_transaction_payment::ChargeTransactionPayment::::from(tip), - ); - let raw_payload = SignedPayload::new(call, extra).map_err(|e| { - log::warn!("Unable to create signed payload: {:?}", e); - }).ok()?; - let signature = raw_payload.using_encoded(|payload| { - C::sign(payload, public) - })?; - let (call, extra, _) = raw_payload.deconstruct(); - let address = ::Lookup::unlookup(account); - Some((call, (address, signature, extra))) - } -} - -impl frame_system::offchain::SigningTypes for Runtime { - type Public = ::Signer; - type Signature = Signature; -} - -impl frame_system::offchain::SendTransactionTypes for Runtime where - Call: From, -{ - type Extrinsic = UncheckedExtrinsic; - type OverarchingCall = Call; -} - -parameter_types! { - pub Prefix: &'static [u8] = b"Pay KSMs to the Kusama account:"; -} - -impl claims::Config for Runtime { - type Event = Event; - type VestingSchedule = Vesting; - type Prefix = Prefix; - type MoveClaimOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; - type WeightInfo = weights::runtime_common_claims::WeightInfo; -} - -parameter_types! { - // Minimum 100 bytes/KSM deposited (1 CENT/byte) - pub const BasicDeposit: Balance = 1000 * CENTS; // 258 bytes on-chain - pub const FieldDeposit: Balance = 250 * CENTS; // 66 bytes on-chain - pub const SubAccountDeposit: Balance = 200 * CENTS; // 53 bytes on-chain - pub const MaxSubAccounts: u32 = 100; - pub const MaxAdditionalFields: u32 = 100; - pub const MaxRegistrars: u32 = 20; -} - -impl pallet_identity::Config for Runtime { - type Event = Event; - type Currency = Balances; - type BasicDeposit = BasicDeposit; - type FieldDeposit = FieldDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = MaxSubAccounts; - type MaxAdditionalFields = MaxAdditionalFields; - type MaxRegistrars = MaxRegistrars; - type Slashed = Treasury; - type ForceOrigin = MoreThanHalfCouncil; - type RegistrarOrigin = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_identity::WeightInfo; -} - -impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; - type WeightInfo = weights::pallet_utility::WeightInfo; -} - -parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); - pub const MaxSignatories: u16 = 100; -} - -impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; - type Currency = Balances; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = MaxSignatories; - type WeightInfo = weights::pallet_multisig::WeightInfo; -} - -parameter_types! { - pub const ConfigDepositBase: Balance = 500 * CENTS; - pub const FriendDepositFactor: Balance = 50 * CENTS; - pub const MaxFriends: u16 = 9; - pub const RecoveryDeposit: Balance = 500 * CENTS; -} - -impl pallet_recovery::Config for Runtime { - type Event = Event; - type Call = Call; - type Currency = Balances; - type ConfigDepositBase = ConfigDepositBase; - type FriendDepositFactor = FriendDepositFactor; - type MaxFriends = MaxFriends; - type RecoveryDeposit = RecoveryDeposit; -} - -parameter_types! { - pub const CandidateDeposit: Balance = 1000 * CENTS; - pub const WrongSideDeduction: Balance = 200 * CENTS; - pub const MaxStrikes: u32 = 10; - pub const RotationPeriod: BlockNumber = 7 * DAYS; - pub const PeriodSpend: Balance = 50000 * CENTS; - pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS; - pub const ChallengePeriod: BlockNumber = 7 * DAYS; - pub const MaxCandidateIntake: u32 = 1; - pub const SocietyPalletId: PalletId = PalletId(*b"py/socie"); -} - -impl pallet_society::Config for Runtime { - type Event = Event; - type Currency = Balances; - type Randomness = pallet_babe::RandomnessFromOneEpochAgo; - type CandidateDeposit = CandidateDeposit; - type WrongSideDeduction = WrongSideDeduction; - type MaxStrikes = MaxStrikes; - type PeriodSpend = PeriodSpend; - type MembershipChanged = (); - type RotationPeriod = RotationPeriod; - type MaxLockDuration = MaxLockDuration; - type FounderSetOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; - type SuspensionJudgementOrigin = pallet_society::EnsureFounder; - type ChallengePeriod = ChallengePeriod; - type MaxCandidateIntake = MaxCandidateIntake; - type PalletId = SocietyPalletId; -} - -parameter_types! { - pub const MinVestedTransfer: Balance = 100 * CENTS; -} - -impl pallet_vesting::Config for Runtime { - type Event = Event; - type Currency = Balances; - type BlockNumberToBalance = ConvertInto; - type MinVestedTransfer = MinVestedTransfer; - type WeightInfo = weights::pallet_vesting::WeightInfo; -} - -parameter_types! { - // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = deposit(1, 8); - // Additional storage item size of 33 bytes. - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const MaxProxies: u16 = 32; - pub const AnnouncementDepositBase: Balance = deposit(1, 8); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); - pub const MaxPending: u16 = 32; -} - -/// The type used to represent the kinds of proxying allowed. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen)] -pub enum ProxyType { - Any, - NonTransfer, - Governance, - Staking, - IdentityJudgement, - CancelProxy, -} -impl Default for ProxyType { fn default() -> Self { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => matches!(c, - Call::System(..) | - Call::Babe(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim(..)) | - Call::Indices(pallet_indices::Call::free(..)) | - Call::Indices(pallet_indices::Call::freeze(..)) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Staking(..) | - Call::Session(..) | - Call::Grandpa(..) | - Call::ImOnline(..) | - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::PhragmenElection(..) | - Call::TechnicalMembership(..) | - Call::Treasury(..) | - Call::Bounties(..) | - Call::Tips(..) | - Call::Claims(..) | - Call::Utility(..) | - Call::Identity(..) | - Call::Society(..) | - Call::Recovery(pallet_recovery::Call::as_recovered(..)) | - Call::Recovery(pallet_recovery::Call::vouch_recovery(..)) | - Call::Recovery(pallet_recovery::Call::claim_recovery(..)) | - Call::Recovery(pallet_recovery::Call::close_recovery(..)) | - Call::Recovery(pallet_recovery::Call::remove_recovery(..)) | - Call::Recovery(pallet_recovery::Call::cancel_recovered(..)) | - // Specifically omitting Recovery `create_recovery`, `initiate_recovery` - Call::Vesting(pallet_vesting::Call::vest(..)) | - Call::Vesting(pallet_vesting::Call::vest_other(..)) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Scheduler(..) | - Call::Proxy(..) | - Call::Multisig(..) | - Call::Gilt(..) | - Call::Registrar(paras_registrar::Call::register(..)) | - Call::Registrar(paras_registrar::Call::deregister(..)) | - // Specifically omitting Registrar `swap` - Call::Registrar(paras_registrar::Call::reserve(..)) | - Call::Crowdloan(..) | - Call::Slots(..) | - Call::Auctions(..) - // Specifically omitting the entire XCM Pallet - ), - ProxyType::Governance => matches!(c, - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::PhragmenElection(..) | - Call::Treasury(..) | - Call::Bounties(..) | - Call::Tips(..) | - Call::Utility(..) - ), - ProxyType::Staking => matches!(c, - Call::Staking(..) | - Call::Session(..) | - Call::Utility(..) - ), - ProxyType::IdentityJudgement => matches!(c, - Call::Identity(pallet_identity::Call::provide_judgement(..)) | - Call::Utility(..) - ), - ProxyType::CancelProxy => matches!(c, - Call::Proxy(pallet_proxy::Call::reject_announcement(..)) - ) - } - } - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::NonTransfer, _) => true, - _ => false, - } - } -} - -impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; - type WeightInfo = weights::pallet_proxy::WeightInfo; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; -} - -impl parachains_origin::Config for Runtime {} - -impl parachains_configuration::Config for Runtime {} - -impl parachains_shared::Config for Runtime {} - -impl parachains_session_info::Config for Runtime {} - -impl parachains_inclusion::Config for Runtime { - type Event = Event; - type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints; -} - -impl parachains_paras::Config for Runtime { - type Origin = Origin; - type Event = Event; -} - -parameter_types! { - pub const FirstMessageFactorPercent: u64 = 100; -} - -impl parachains_ump::Config for Runtime { - type Event = Event; - type UmpSink = crate::parachains_ump::XcmSink, Runtime>; - type FirstMessageFactorPercent = FirstMessageFactorPercent; -} - -impl parachains_dmp::Config for Runtime {} - -impl parachains_hrmp::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; -} - -impl parachains_paras_inherent::Config for Runtime {} - -impl parachains_scheduler::Config for Runtime {} - -impl parachains_initializer::Config for Runtime { - type Randomness = pallet_babe::RandomnessFromOneEpochAgo; - type ForceOrigin = EnsureRoot; -} - -parameter_types! { - pub const ParaDeposit: Balance = 40 * UNITS; -} - -impl paras_registrar::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type OnSwap = (Crowdloan, Slots); - type ParaDeposit = ParaDeposit; - type DataDepositPerByte = DataDepositPerByte; - type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo; -} - -parameter_types! { - // 6 weeks - pub const LeasePeriod: BlockNumber = 6 * WEEKS; -} - -impl slots::Config for Runtime { - type Event = Event; - type Currency = Balances; - type Registrar = Registrar; - type LeasePeriod = LeasePeriod; - type WeightInfo = weights::runtime_common_slots::WeightInfo; -} - -parameter_types! { - pub const CrowdloanId: PalletId = PalletId(*b"py/cfund"); - pub const SubmissionDeposit: Balance = 3 * GRAND; // ~ 10 KSM - pub const MinContribution: Balance = 3_000 * CENTS; // ~ .1 KSM - pub const RemoveKeysLimit: u32 = 1000; - // Allow 32 bytes for an additional memo to a crowdloan. - pub const MaxMemoLength: u8 = 32; -} - -impl crowdloan::Config for Runtime { - type Event = Event; - type PalletId = CrowdloanId; - type SubmissionDeposit = SubmissionDeposit; - type MinContribution = MinContribution; - type RemoveKeysLimit = RemoveKeysLimit; - type Registrar = Registrar; - type Auctioneer = Auctions; - type MaxMemoLength = MaxMemoLength; - type WeightInfo = weights::runtime_common_crowdloan::WeightInfo; -} - -parameter_types! { - // The average auction is 7 days long, so this will be 70% for ending period. - // 5 Days = 72000 Blocks @ 6 sec per block - pub const EndingPeriod: BlockNumber = 5 * DAYS; - // ~ 1000 samples per day -> ~ 20 blocks per sample -> 2 minute samples - pub const SampleLength: BlockNumber = 2 * MINUTES; -} - -type AuctionInitiate = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective> ->; - -impl auctions::Config for Runtime { - type Event = Event; - type Leaser = Slots; - type Registrar = Registrar; - type EndingPeriod = EndingPeriod; - type SampleLength = SampleLength; - type Randomness = pallet_babe::RandomnessFromOneEpochAgo; - type InitiateOrigin = AuctionInitiate; - type WeightInfo = weights::runtime_common_auctions::WeightInfo; -} - -parameter_types! { - /// The location of the KSM token, from the context of this chain. Since this token is native to this - /// chain, we make it synonymous with it and thus it is the `Null` location, which means "equivalent to - /// the context". - pub const KsmLocation: MultiLocation = MultiLocation::Null; - /// The Kusama network ID. This is named. - pub const KusamaNetwork: NetworkId = NetworkId::Kusama; - /// Our XCM location ancestry - i.e. what, if anything, `Parent` means evaluated in our context. Since - /// Kusama is a top-level relay-chain, there is no ancestry. - pub const Ancestry: MultiLocation = MultiLocation::Null; - /// The check account, which holds any native assets that have been teleported out and not back in (yet). - pub CheckAccount: AccountId = XcmPallet::check_account(); -} - -/// The canonical means of converting a `MultiLocation` into an `AccountId`, used when we want to determine -/// the sovereign account controlled by a location. -pub type SovereignAccountOf = ( - // We can convert a child parachain using the standard `AccountId` conversion. - ChildParachainConvertsVia, - // We can directly alias an `AccountId32` into a local account. - AccountId32Aliases, -); - -/// Our asset transactor. This is what allows us to interest with the runtime facilities from the point of -/// view of XCM-only concepts like `MultiLocation` and `MultiAsset`. -/// -/// Ours is only aware of the Balances pallet, which is mapped to `KsmLocation`. -pub type LocalAssetTransactor = - XcmCurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // We can convert the MultiLocations with our converter above: - SovereignAccountOf, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We track our teleports in/out to keep total issuance correct. - CheckAccount, - >; - -/// The means that we convert an the XCM message origin location into a local dispatch origin. -type LocalOriginConverter = ( - // A `Signed` origin of the sovereign account that the original location controls. - SovereignSignedViaLocation, - // A child parachain, natively expressed, has the `Parachain` origin. - ChildParachainAsNative, - // The AccountId32 location type can be expressed natively as a `Signed` origin. - SignedAccountId32AsNative, - // A system child parachain, expressed as a Superuser, converts to the `Root` origin. - ChildSystemParachainAsSuperuser, -); - -parameter_types! { - /// The amount of weight an XCM operation takes. This is a safe overestimate. - pub const BaseXcmWeight: Weight = 1_000_000_000; -} - -/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our -/// individual routers. -pub type XcmRouter = ( - // Only one router so far - use DMP to communicate with child parachains. - xcm_sender::ChildParachainRouter, -); - -parameter_types! { - pub const KusamaForStatemint: (MultiAsset, MultiLocation) = - (AllConcreteFungible { id: Null }, X1(Parachain(1000))); -} -pub type TrustedTeleporters = ( - xcm_builder::Case, -); - -/// The barriers one of which must be passed for an XCM message to be executed. -pub type Barrier = ( - // Weight that is paid for may be consumed. - TakeWeightCredit, - // If the message is one that immediately attemps to pay for execution, then allow it. - AllowTopLevelPaidExecutionFrom>, - // Messages coming from system parachains need not pay for execution. - AllowUnpaidExecutionFrom>, -); - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = LocalOriginConverter; - type IsReserve = (); - type IsTeleporter = TrustedTeleporters; - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - // The weight trader piggybacks on the existing transaction-fee conversion logic. - type Trader = UsingComponents>; - type ResponseHandler = (); -} - -parameter_types! { - pub const CouncilBodyId: BodyId = BodyId::Executive; -} - -/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location -/// of this chain. -pub type LocalOriginToLocation = ( - // We allow an origin from the Collective pallet to be used in XCM as a corresponding Plurality of the - // `Unit` body. - BackingToPlurality, CouncilBodyId>, - // And a usual Signed origin to be used in XCM as a corresponding AccountId32 - SignedToAccountId32, -); - -pub struct OnlyWithdrawTeleportForAccounts; -impl frame_support::traits::Contains<(MultiLocation, Xcm)> for OnlyWithdrawTeleportForAccounts { - fn contains((ref origin, ref msg): &(MultiLocation, Xcm)) -> bool { - use xcm::v0::{ - Xcm::WithdrawAsset, Order::{BuyExecution, InitiateTeleport, DepositAsset}, - MultiAsset::{All, ConcreteFungible}, Junction::{AccountId32, Plurality}, - }; - match origin { - // Root and council are are allowed to execute anything. - Null | X1(Plurality { .. }) => true, - X1(AccountId32 { .. }) => { - // An account ID trying to send a message. We ensure that it's sensible. - // This checks that it's of the form: - // WithdrawAsset { - // assets: [ ConcreteFungible { id: Null } ], - // effects: [ BuyExecution, InitiateTeleport { - // assets: All, - // dest: Parachain, - // effects: [ BuyExecution, DepositAssets { - // assets: All, - // dest: AccountId32, - // } ] - // } ] - // } - matches!(msg, WithdrawAsset { ref assets, ref effects } - if assets.len() == 1 - && matches!(assets[0], ConcreteFungible { id: Null, .. }) - && effects.len() == 2 - && matches!(effects[0], BuyExecution { .. }) - && matches!(effects[1], InitiateTeleport { ref assets, dest: X1(Parachain(..)), ref effects } - if assets.len() == 1 - && matches!(assets[0], All) - && effects.len() == 2 - && matches!(effects[0], BuyExecution { .. }) - && matches!(effects[1], DepositAsset { ref assets, dest: X1(AccountId32{..}) } - if assets.len() == 1 - && matches!(assets[0], All) - ) - ) - ) - } - // Nobody else is allowed to execute anything. - _ => false, - } - } -} - -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; - type XcmRouter = XcmRouter; - // Anyone can execute XCM messages locally... - type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; - // ...but they must match our filter, which requires them to be a simple withdraw + teleport. - type XcmExecuteFilter = OnlyWithdrawTeleportForAccounts; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = All<(MultiLocation, Vec)>; - type XcmReserveTransferFilter = All<(MultiLocation, Vec)>; - type Weigher = FixedWeightBounds; -} - -parameter_types! { - pub IgnoredIssuance: Balance = Treasury::pot(); - pub const QueueCount: u32 = 300; - pub const MaxQueueLen: u32 = 1000; - pub const FifoQueueLen: u32 = 250; - pub const GiltPeriod: BlockNumber = 30 * DAYS; - pub const MinFreeze: Balance = 10_000 * CENTS; - pub const IntakePeriod: BlockNumber = 5 * MINUTES; - pub const MaxIntakeBids: u32 = 100; -} - -impl pallet_gilt::Config for Runtime { - type Event = Event; - type Currency = Balances; - type CurrencyBalance = Balance; - type AdminOrigin = MoreThanHalfCouncil; - type Deficit = (); // Mint - type Surplus = (); // Burn - type IgnoredIssuance = IgnoredIssuance; - type QueueCount = QueueCount; - type MaxQueueLen = MaxQueueLen; - type FifoQueueLen = FifoQueueLen; - type Period = GiltPeriod; - type MinFreeze = MinFreeze; - type IntakePeriod = IntakePeriod; - type MaxIntakeBids = MaxIntakeBids; - type WeightInfo = weights::pallet_gilt::WeightInfo; -} - -construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = primitives::v1::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - // Basic stuff; balances is uncallable initially. - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, - - // Must be before session. - Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 1, - - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 3, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 4, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, - - // Consensus support. - Authorship: pallet_authorship::{Pallet, Call, Storage} = 5, - Staking: pallet_staking::{Pallet, Call, Storage, Config, Event} = 6, - Offences: pallet_offences::{Pallet, Storage, Event} = 7, - Historical: session_historical::{Pallet} = 34, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 8, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 10, - ImOnline: pallet_im_online::{Pallet, Call, Storage, Event, ValidateUnsigned, Config} = 11, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config} = 12, - - // Governance stuff; uncallable initially. - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 13, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 14, - TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 15, - PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config} = 16, - TechnicalMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 17, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 18, - - // Claims. Usable initially. - Claims: claims::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 19, - - // Utility module. - Utility: pallet_utility::{Pallet, Call, Event} = 24, - - // Less simple identity module. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 25, - - // Society module. - Society: pallet_society::{Pallet, Call, Storage, Event} = 26, - - // Social recovery module. - Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 27, - - // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 28, - - // System scheduler. - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 29, - - // Proxy module. Late addition. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 30, - - // Multisig module. Late addition. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 31, - - // Bounties module. - Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 35, - - // Tips module. - Tips: pallet_tips::{Pallet, Call, Storage, Event} = 36, - - // Election pallet. Only works with staking, but placed here to maintain indices. - ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event, ValidateUnsigned} = 37, - - // Gilts pallet. - Gilt: pallet_gilt::{Pallet, Call, Storage, Event, Config} = 38, - - // Parachains pallets. Start indices at 50 to leave room. - ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50, - ParachainsConfiguration: parachains_configuration::{Pallet, Call, Storage, Config} = 51, - ParasShared: parachains_shared::{Pallet, Call, Storage} = 52, - ParasInclusion: parachains_inclusion::{Pallet, Call, Storage, Event} = 53, - ParasInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent} = 54, - ParasScheduler: parachains_scheduler::{Pallet, Call, Storage} = 55, - Paras: parachains_paras::{Pallet, Call, Storage, Event, Config} = 56, - ParasInitializer: parachains_initializer::{Pallet, Call, Storage} = 57, - ParasDmp: parachains_dmp::{Pallet, Call, Storage} = 58, - ParasUmp: parachains_ump::{Pallet, Call, Storage, Event} = 59, - ParasHrmp: parachains_hrmp::{Pallet, Call, Storage, Event} = 60, - ParasSessionInfo: parachains_session_info::{Pallet, Call, Storage} = 61, - - // Parachain Onboarding Pallets. Start indices at 70 to leave room. - Registrar: paras_registrar::{Pallet, Call, Storage, Event} = 70, - Slots: slots::{Pallet, Call, Storage, Event} = 71, - Auctions: auctions::{Pallet, Call, Storage, Event} = 72, - Crowdloan: crowdloan::{Pallet, Call, Storage, Event} = 73, - - // Pallet for sending XCM. - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 99, - } -} - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckMortality, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPallets, - RemoveCollectiveFlip, ->; -/// The payload being signed in the transactions. -pub type SignedPayload = generic::SignedPayload; - -pub struct RemoveCollectiveFlip; -impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { - fn on_runtime_upgrade() -> Weight { - use frame_support::storage::migration; - // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` - migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); - ::DbWeight::get().writes(1) - } -} - -#[cfg(not(feature = "disable-runtime-api"))] -sp_api::impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: Block) { - Executive::execute_block(block); - } - - fn initialize_block(header: &::Header) { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - Runtime::metadata().into() - } - } - - impl block_builder_api::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents( - block: Block, - data: inherents::InherentData, - ) -> inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl tx_pool_api::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx) - } - } - - impl offchain_primitives::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl primitives::v1::ParachainHost for Runtime { - fn validators() -> Vec { - parachains_runtime_api_impl::validators::() - } - - fn validator_groups() -> (Vec>, GroupRotationInfo) { - parachains_runtime_api_impl::validator_groups::() - } - - fn availability_cores() -> Vec> { - parachains_runtime_api_impl::availability_cores::() - } - - fn persisted_validation_data(para_id: ParaId, assumption: OccupiedCoreAssumption) - -> Option> { - parachains_runtime_api_impl::persisted_validation_data::(para_id, assumption) - } - - fn check_validation_outputs( - para_id: ParaId, - outputs: primitives::v1::CandidateCommitments, - ) -> bool { - parachains_runtime_api_impl::check_validation_outputs::(para_id, outputs) - } - - fn session_index_for_child() -> SessionIndex { - parachains_runtime_api_impl::session_index_for_child::() - } - - fn validation_code(para_id: ParaId, assumption: OccupiedCoreAssumption) - -> Option { - parachains_runtime_api_impl::validation_code::(para_id, assumption) - } - - fn candidate_pending_availability(para_id: ParaId) -> Option> { - parachains_runtime_api_impl::candidate_pending_availability::(para_id) - } - - fn candidate_events() -> Vec> { - parachains_runtime_api_impl::candidate_events::(|ev| { - match ev { - Event::ParasInclusion(ev) => { - Some(ev) - } - _ => None, - } - }) - } - - fn session_info(index: SessionIndex) -> Option { - parachains_runtime_api_impl::session_info::(index) - } - - fn dmq_contents(recipient: ParaId) -> Vec> { - parachains_runtime_api_impl::dmq_contents::(recipient) - } - - fn inbound_hrmp_channels_contents( - recipient: ParaId - ) -> BTreeMap>> { - parachains_runtime_api_impl::inbound_hrmp_channels_contents::(recipient) - } - - fn validation_code_by_hash(hash: ValidationCodeHash) -> Option { - parachains_runtime_api_impl::validation_code_by_hash::(hash) - } - } - - impl beefy_primitives::BeefyApi for Runtime { - fn validator_set() -> beefy_primitives::ValidatorSet { - // dummy implementation due to lack of BEEFY pallet. - beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 } - } - } - - impl mmr::MmrApi for Runtime { - fn generate_proof(_leaf_index: u64) - -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> - { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::GenerateProof) - } - - fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof) - -> Result<(), mmr::Error> - { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::Verify) - } - - fn verify_proof_stateless( - _root: Hash, - _leaf: mmr::EncodableOpaqueLeaf, - _proof: mmr::Proof - ) -> Result<(), mmr::Error> { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::Verify) - } - } - - impl fg_primitives::GrandpaApi for Runtime { - fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { - Grandpa::grandpa_authorities() - } - - fn submit_report_equivocation_unsigned_extrinsic( - equivocation_proof: fg_primitives::EquivocationProof< - ::Hash, - sp_runtime::traits::NumberFor, - >, - key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Grandpa::submit_unsigned_equivocation_report( - equivocation_proof, - key_owner_proof, - ) - } - - fn generate_key_ownership_proof( - _set_id: fg_primitives::SetId, - authority_id: fg_primitives::AuthorityId, - ) -> Option { - use parity_scale_codec::Encode; - - Historical::prove((fg_primitives::KEY_TYPE, authority_id)) - .map(|p| p.encode()) - .map(fg_primitives::OpaqueKeyOwnershipProof::new) - } - } - - impl babe_primitives::BabeApi for Runtime { - fn configuration() -> babe_primitives::BabeGenesisConfiguration { - // The choice of `c` parameter (where `1 - c` represents the - // probability of a slot being empty), is done in accordance to the - // slot duration and expected target block time, for safely - // resisting network delays of maximum two seconds. - // - babe_primitives::BabeGenesisConfiguration { - slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), - c: BABE_GENESIS_EPOCH_CONFIG.c, - genesis_authorities: Babe::authorities(), - randomness: Babe::randomness(), - allowed_slots: BABE_GENESIS_EPOCH_CONFIG.allowed_slots, - } - } - - fn current_epoch_start() -> babe_primitives::Slot { - Babe::current_epoch_start() - } - - fn current_epoch() -> babe_primitives::Epoch { - Babe::current_epoch() - } - - fn next_epoch() -> babe_primitives::Epoch { - Babe::next_epoch() - } - - fn generate_key_ownership_proof( - _slot: babe_primitives::Slot, - authority_id: babe_primitives::AuthorityId, - ) -> Option { - use parity_scale_codec::Encode; - - Historical::prove((babe_primitives::KEY_TYPE, authority_id)) - .map(|p| p.encode()) - .map(babe_primitives::OpaqueKeyOwnershipProof::new) - } - - fn submit_report_equivocation_unsigned_extrinsic( - equivocation_proof: babe_primitives::EquivocationProof<::Header>, - key_owner_proof: babe_primitives::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Babe::submit_unsigned_equivocation_report( - equivocation_proof, - key_owner_proof, - ) - } - } - - impl authority_discovery_primitives::AuthorityDiscoveryApi for Runtime { - fn authorities() -> Vec { - parachains_runtime_api_impl::relevant_authority_ids::() - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - Balance, - > for Runtime { - fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { - log::info!("try-runtime::on_runtime_upgrade kusama."); - let weight = Executive::try_runtime_upgrade()?; - Ok((weight, BlockWeights::get().max_block)) - } - } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues. - // To get around that, we separated the Session benchmarks into its own crate, which is why - // we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; - use frame_system_benchmarking::Pallet as SystemBench; - - impl pallet_session_benchmarking::Config for Runtime {} - impl pallet_offences_benchmarking::Config for Runtime {} - impl frame_system_benchmarking::Config for Runtime {} - - let whitelist: Vec = vec![ - // Block Number - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), - // Total Issuance - hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), - // Execution Phase - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), - // Event Count - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), - // System Events - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), - // Treasury Account - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec().into(), - ]; - - let mut batches = Vec::::new(); - let params = (&config, &whitelist); - // Polkadot - // NOTE: Make sure to prefix these `runtime_common::` so that path resolves correctly - // in the generated file. - add_benchmark!(params, batches, runtime_common::auctions, Auctions); - add_benchmark!(params, batches, runtime_common::crowdloan, Crowdloan); - add_benchmark!(params, batches, runtime_common::claims, Claims); - add_benchmark!(params, batches, runtime_common::slots, Slots); - add_benchmark!(params, batches, runtime_common::paras_registrar, Registrar); - // Substrate - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_bounties, Bounties); - add_benchmark!(params, batches, pallet_collective, Council); - add_benchmark!(params, batches, pallet_democracy, Democracy); - add_benchmark!(params, batches, pallet_elections_phragmen, PhragmenElection); - add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); - add_benchmark!(params, batches, pallet_gilt, Gilt); - add_benchmark!(params, batches, pallet_identity, Identity); - add_benchmark!(params, batches, pallet_im_online, ImOnline); - add_benchmark!(params, batches, pallet_indices, Indices); - add_benchmark!(params, batches, pallet_membership, TechnicalMembership); - add_benchmark!(params, batches, pallet_multisig, Multisig); - add_benchmark!(params, batches, pallet_offences, OffencesBench::); - add_benchmark!(params, batches, pallet_proxy, Proxy); - add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, pallet_session, SessionBench::); - add_benchmark!(params, batches, pallet_staking, Staking); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_tips, Tips); - add_benchmark!(params, batches, pallet_treasury, Treasury); - add_benchmark!(params, batches, pallet_utility, Utility); - add_benchmark!(params, batches, pallet_vesting, Vesting); - - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } - Ok(batches) - } - } -} diff --git a/relay/kusama/src/tests.rs b/relay/kusama/src/tests.rs deleted file mode 100644 index c6423ae9eb..0000000000 --- a/relay/kusama/src/tests.rs +++ /dev/null @@ -1,169 +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 . - -//! Tests for the Kusama Runtime Configuration - -use crate::*; -use frame_support::weights::WeightToFeePolynomial; -use sp_runtime::FixedPointNumber; -use frame_support::weights::GetDispatchInfo; -use parity_scale_codec::Encode; -use pallet_transaction_payment::Multiplier; -use separator::Separatable; - -#[test] -fn remove_keys_weight_is_sensible() { - use runtime_common::crowdloan::WeightInfo; - let max_weight = ::WeightInfo::refund(RemoveKeysLimit::get()); - // Max remove keys limit should be no more than half the total block weight. - assert!(max_weight * 2 < BlockWeights::get().max_block); -} - -#[test] -fn sample_size_is_sensible() { - use runtime_common::auctions::WeightInfo; - // Need to clean up all samples at the end of an auction. - let samples: BlockNumber = EndingPeriod::get() / SampleLength::get(); - let max_weight: Weight = RocksDbWeight::get().reads_writes(samples.into(), samples.into()); - // Max sample cleanup should be no more than half the total block weight. - assert!(max_weight * 2 < BlockWeights::get().max_block); - assert!(::WeightInfo::on_initialize() * 2 < BlockWeights::get().max_block); -} - -#[test] -fn payout_weight_portion() { - use pallet_staking::WeightInfo; - let payout_weight = - ::WeightInfo::payout_stakers_alive_staked( - MaxNominatorRewardedPerValidator::get(), - ) as f64; - let block_weight = BlockWeights::get().max_block as f64; - - println!( - "a full payout takes {:.2} of the block weight [{} / {}]", - payout_weight / block_weight, - payout_weight, - block_weight - ); - assert!(payout_weight * 2f64 < block_weight); -} - -#[test] -#[ignore] -fn block_cost() { - let max_block_weight = BlockWeights::get().max_block; - let raw_fee = WeightToFee::calc(&max_block_weight); - - println!( - "Full Block weight == {} // WeightToFee(full_block) == {} plank", - max_block_weight, - raw_fee.separated_string(), - ); -} - -#[test] -#[ignore] -fn transfer_cost_min_multiplier() { - let min_multiplier = runtime_common::MinimumMultiplier::get(); - let call = >::transfer_keep_alive(Default::default(), Default::default()); - let info = call.get_dispatch_info(); - // convert to outer call. - let call = Call::Balances(call); - let len = call.using_encoded(|e| e.len()) as u32; - - let mut ext = sp_io::TestExternalities::new_empty(); - let mut test_with_multiplier = |m| { - ext.execute_with(|| { - pallet_transaction_payment::NextFeeMultiplier::::put(m); - let fee = TransactionPayment::compute_fee(len, &info, 0); - println!( - "weight = {:?} // multiplier = {:?} // full transfer fee = {:?}", - info.weight.separated_string(), - pallet_transaction_payment::NextFeeMultiplier::::get(), - fee.separated_string(), - ); - }); - }; - - test_with_multiplier(min_multiplier); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000_000u128)); -} - -#[test] -fn nominator_limit() { - use pallet_election_provider_multi_phase::WeightInfo; - // starting point of the nominators. - let all_voters: u32 = 10_000; - - // assuming we want around 5k candidates and 1k active validators. - let all_targets: u32 = 5_000; - let desired: u32 = 1_000; - let weight_with = |active| { - ::WeightInfo::submit_unsigned( - all_voters.max(active), - all_targets, - active, - desired, - ) - }; - - let mut active = 1; - while weight_with(active) <= OffchainSolutionWeightLimit::get() || active == all_voters { - active += 1; - } - - println!("can support {} nominators to yield a weight of {}", active, weight_with(active)); -} - -#[test] -fn compute_inflation_should_give_sensible_results() { - assert_eq!(pallet_staking_reward_fn::compute_inflation( - Perquintill::from_percent(75), - Perquintill::from_percent(75), - Perquintill::from_percent(5), - ), Perquintill::one()); - assert_eq!(pallet_staking_reward_fn::compute_inflation( - Perquintill::from_percent(50), - Perquintill::from_percent(75), - Perquintill::from_percent(5), - ), Perquintill::from_rational(2u64, 3u64)); - assert_eq!(pallet_staking_reward_fn::compute_inflation( - Perquintill::from_percent(80), - Perquintill::from_percent(75), - Perquintill::from_percent(5), - ), Perquintill::from_rational(1u64, 2u64)); -} - -#[test] -fn era_payout_should_give_sensible_results() { - assert_eq!(era_payout( - 75, - 100, - Perquintill::from_percent(10), - Perquintill::one(), - 0, - ), (10, 0)); - assert_eq!(era_payout( - 80, - 100, - Perquintill::from_percent(10), - Perquintill::one(), - 0, - ), (6, 4)); -} diff --git a/relay/kusama/src/weights/frame_system.rs b/relay/kusama/src/weights/frame_system.rs deleted file mode 100644 index e5c7f504a0..0000000000 --- a/relay/kusama/src/weights/frame_system.rs +++ /dev/null @@ -1,81 +0,0 @@ -// 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 . -//! Autogenerated weights for frame_system -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=frame_system -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for frame_system. -pub struct WeightInfo(PhantomData); -impl frame_system::WeightInfo for WeightInfo { - fn remark(_b: u32, ) -> Weight { - (1_234_000 as Weight) - } - fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) - } - fn set_heap_pages() -> Weight { - (1_670_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_changes_trie_config() -> Weight { - (9_897_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn set_storage(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((529_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) - } - fn kill_storage(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((381_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) - } - fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((788_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) - } -} diff --git a/relay/kusama/src/weights/mod.rs b/relay/kusama/src/weights/mod.rs deleted file mode 100644 index a83b57bfcd..0000000000 --- a/relay/kusama/src/weights/mod.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! A list of the different weight modules for our runtime. - -pub mod frame_system; -pub mod pallet_balances; -pub mod pallet_bounties; -pub mod pallet_collective; -pub mod pallet_democracy; -pub mod pallet_elections_phragmen; -pub mod pallet_election_provider_multi_phase; -pub mod pallet_gilt; -pub mod pallet_identity; -pub mod pallet_im_online; -pub mod pallet_indices; -pub mod pallet_membership; -pub mod pallet_multisig; -pub mod pallet_proxy; -pub mod pallet_scheduler; -pub mod pallet_session; -pub mod pallet_staking; -pub mod pallet_timestamp; -pub mod pallet_tips; -pub mod pallet_treasury; -pub mod pallet_utility; -pub mod pallet_vesting; -pub mod runtime_common_auctions; -pub mod runtime_common_claims; -pub mod runtime_common_crowdloan; -pub mod runtime_common_paras_registrar; -pub mod runtime_common_slots; diff --git a/relay/kusama/src/weights/pallet_balances.rs b/relay/kusama/src/weights/pallet_balances.rs deleted file mode 100644 index c030c3dcaf..0000000000 --- a/relay/kusama/src/weights/pallet_balances.rs +++ /dev/null @@ -1,76 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_balances -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_balances. -pub struct WeightInfo(PhantomData); -impl pallet_balances::WeightInfo for WeightInfo { - fn transfer() -> Weight { - (72_443_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer_keep_alive() -> Weight { - (52_788_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_creating() -> Weight { - (28_510_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_killing() -> Weight { - (34_621_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_transfer() -> Weight { - (70_962_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn transfer_all() -> Weight { - (66_162_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_bounties.rs b/relay/kusama/src/weights/pallet_bounties.rs deleted file mode 100644 index c8d37d90a3..0000000000 --- a/relay/kusama/src/weights/pallet_bounties.rs +++ /dev/null @@ -1,107 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_bounties -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_bounties -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_bounties. -pub struct WeightInfo(PhantomData); -impl pallet_bounties::WeightInfo for WeightInfo { - fn propose_bounty(d: u32, ) -> Weight { - (42_863_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn approve_bounty() -> Weight { - (11_260_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn propose_curator() -> Weight { - (8_487_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn unassign_curator() -> Weight { - (52_302_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn accept_curator() -> Weight { - (36_396_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn award_bounty() -> Weight { - (24_492_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn claim_bounty() -> Weight { - (124_315_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - } - fn close_bounty_proposed() -> Weight { - (51_443_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn close_bounty_active() -> Weight { - (82_325_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn extend_bounty_expiry() -> Weight { - (23_740_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn spend_funds(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 12_000 - .saturating_add((59_403_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) - } -} diff --git a/relay/kusama/src/weights/pallet_democracy.rs b/relay/kusama/src/weights/pallet_democracy.rs deleted file mode 100644 index 5637385586..0000000000 --- a/relay/kusama/src/weights/pallet_democracy.rs +++ /dev/null @@ -1,207 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_democracy -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_democracy -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_democracy. -pub struct WeightInfo(PhantomData); -impl pallet_democracy::WeightInfo for WeightInfo { - fn propose() -> Weight { - (57_057_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn second(s: u32, ) -> Weight { - (38_340_000 as Weight) - // Standard Error: 0 - .saturating_add((139_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)) - } - fn vote_new(r: u32, ) -> Weight { - (43_376_000 as Weight) - // Standard Error: 0 - .saturating_add((182_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn vote_existing(r: u32, ) -> Weight { - (43_661_000 as Weight) - // Standard Error: 0 - .saturating_add((173_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn emergency_cancel() -> Weight { - (28_302_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn blacklist(p: u32, ) -> Weight { - (76_895_000 as Weight) - // Standard Error: 4_000 - .saturating_add((467_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn external_propose(v: u32, ) -> Weight { - (13_005_000 as Weight) - // Standard Error: 0 - .saturating_add((84_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn external_propose_majority() -> Weight { - (2_734_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn external_propose_default() -> Weight { - (2_716_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn fast_track() -> Weight { - (27_335_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn veto_external(v: u32, ) -> Weight { - (27_918_000 as Weight) - // Standard Error: 0 - .saturating_add((119_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn cancel_proposal(p: u32, ) -> Weight { - (50_828_000 as Weight) - // Standard Error: 0 - .saturating_add((440_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn cancel_referendum() -> Weight { - (17_244_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn cancel_queued(r: u32, ) -> Weight { - (33_078_000 as Weight) - // Standard Error: 15_000 - .saturating_add((4_660_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn on_initialize_base(r: u32, ) -> Weight { - (7_135_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_086_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - } - fn delegate(r: u32, ) -> Weight { - (53_113_000 as Weight) - // Standard Error: 5_000 - .saturating_add((7_074_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - } - fn undelegate(r: u32, ) -> Weight { - (23_010_000 as Weight) - // Standard Error: 5_000 - .saturating_add((7_048_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - } - fn clear_public_proposals() -> Weight { - (2_640_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn note_preimage(b: u32, ) -> Weight { - (41_512_000 as Weight) - // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn note_imminent_preimage(b: u32, ) -> Weight { - (26_759_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn reap_preimage(b: u32, ) -> Weight { - (37_154_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn unlock_remove(r: u32, ) -> Weight { - (37_083_000 as Weight) - // Standard Error: 0 - .saturating_add((49_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn unlock_set(r: u32, ) -> Weight { - (34_821_000 as Weight) - // Standard Error: 0 - .saturating_add((159_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn remove_vote(r: u32, ) -> Weight { - (19_491_000 as Weight) - // Standard Error: 0 - .saturating_add((148_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_other_vote(r: u32, ) -> Weight { - (19_498_000 as Weight) - // Standard Error: 0 - .saturating_add((148_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_election_provider_multi_phase.rs b/relay/kusama/src/weights/pallet_election_provider_multi_phase.rs deleted file mode 100644 index 675578ddaa..0000000000 --- a/relay/kusama/src/weights/pallet_election_provider_multi_phase.rs +++ /dev/null @@ -1,95 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_election_provider_multi_phase -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_election_provider_multi_phase -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_election_provider_multi_phase. -pub struct WeightInfo(PhantomData); -impl pallet_election_provider_multi_phase::WeightInfo for WeightInfo { - fn on_initialize_nothing() -> Weight { - (22_984_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - } - fn on_initialize_open_signed() -> Weight { - (83_667_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_initialize_open_unsigned_with_snapshot() -> Weight { - (83_403_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_initialize_open_unsigned_without_snapshot() -> Weight { - (18_070_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn elect_queued() -> Weight { - (8_641_847_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 13_000 - .saturating_add((4_805_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 44_000 - .saturating_add((305_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 13_000 - .saturating_add((16_090_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 67_000 - .saturating_add((5_619_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 8_000 - .saturating_add((4_729_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 29_000 - .saturating_add((124_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 8_000 - .saturating_add((13_511_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 44_000 - .saturating_add((4_469_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_elections_phragmen.rs b/relay/kusama/src/weights/pallet_elections_phragmen.rs deleted file mode 100644 index df20c7b17a..0000000000 --- a/relay/kusama/src/weights/pallet_elections_phragmen.rs +++ /dev/null @@ -1,116 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_elections_phragmen -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-12-09, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_elections_phragmen -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_elections_phragmen. -pub struct WeightInfo(PhantomData); -impl pallet_elections_phragmen::WeightInfo for WeightInfo { - fn vote_equal(v: u32, ) -> Weight { - (54_923_000 as Weight) - .saturating_add((324_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vote_more(v: u32, ) -> Weight { - (83_389_000 as Weight) - .saturating_add((341_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vote_less(v: u32, ) -> Weight { - (78_865_000 as Weight) - .saturating_add((343_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_voter() -> Weight { - (72_370_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn submit_candidacy(c: u32, ) -> Weight { - (68_455_000 as Weight) - .saturating_add((370_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn renounce_candidacy_candidate(c: u32, ) -> Weight { - (54_009_000 as Weight) - .saturating_add((200_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn renounce_candidacy_members() -> Weight { - (84_797_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn renounce_candidacy_runners_up() -> Weight { - (59_095_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_member_with_replacement() -> Weight { - (132_820_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - } - fn remove_member_wrong_refund() -> Weight { - (8_551_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - fn clean_defunct_voters(v: u32, _d: u32, ) -> Weight { - (0 as Weight) - .saturating_add((151_754_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) - } - fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { - (0 as Weight) - .saturating_add((134_602_000 as Weight).saturating_mul(c as Weight)) - .saturating_add((111_037_000 as Weight).saturating_mul(v as Weight)) - .saturating_add((7_150_000 as Weight).saturating_mul(e as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c 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).saturating_mul(c as Weight))) - } -} diff --git a/relay/kusama/src/weights/pallet_identity.rs b/relay/kusama/src/weights/pallet_identity.rs deleted file mode 100644 index 8d93e14be4..0000000000 --- a/relay/kusama/src/weights/pallet_identity.rs +++ /dev/null @@ -1,179 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_identity -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_identity -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_identity. -pub struct WeightInfo(PhantomData); -impl pallet_identity::WeightInfo for WeightInfo { - fn add_registrar(r: u32, ) -> Weight { - (21_467_000 as Weight) - // Standard Error: 2_000 - .saturating_add((200_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_identity(r: u32, x: u32, ) -> Weight { - (52_103_000 as Weight) - // Standard Error: 15_000 - .saturating_add((201_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 1_000 - .saturating_add((932_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_subs_new(s: u32, ) -> Weight { - (40_048_000 as Weight) - // Standard Error: 1_000 - .saturating_add((6_295_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn set_subs_old(p: u32, ) -> Weight { - (40_539_000 as Weight) - // Standard Error: 0 - .saturating_add((1_996_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) - } - fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - (49_774_000 as Weight) - // Standard Error: 5_000 - .saturating_add((139_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_985_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((602_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn request_judgement(r: u32, x: u32, ) -> Weight { - (53_847_000 as Weight) - // Standard Error: 4_000 - .saturating_add((235_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_156_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn cancel_request(r: u32, x: u32, ) -> Weight { - (49_428_000 as Weight) - // Standard Error: 6_000 - .saturating_add((147_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_142_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_fee(r: u32, ) -> Weight { - (7_739_000 as Weight) - // Standard Error: 1_000 - .saturating_add((168_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_account_id(r: u32, ) -> Weight { - (8_326_000 as Weight) - // Standard Error: 0 - .saturating_add((175_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_fields(r: u32, ) -> Weight { - (7_725_000 as Weight) - // Standard Error: 1_000 - .saturating_add((170_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn provide_judgement(r: u32, x: u32, ) -> Weight { - (35_272_000 as Weight) - // Standard Error: 4_000 - .saturating_add((188_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_147_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight { - (63_036_000 as Weight) - // Standard Error: 5_000 - .saturating_add((88_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_987_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((10_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn add_sub(s: u32, ) -> Weight { - (53_817_000 as Weight) - // Standard Error: 0 - .saturating_add((145_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn rename_sub(s: u32, ) -> Weight { - (16_130_000 as Weight) - // Standard Error: 0 - .saturating_add((21_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_sub(s: u32, ) -> Weight { - (54_744_000 as Weight) - // Standard Error: 0 - .saturating_add((127_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn quit_sub(s: u32, ) -> Weight { - (33_675_000 as Weight) - // Standard Error: 0 - .saturating_add((123_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_im_online.rs b/relay/kusama/src/weights/pallet_im_online.rs deleted file mode 100644 index f226108c72..0000000000 --- a/relay/kusama/src/weights/pallet_im_online.rs +++ /dev/null @@ -1,55 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_im_online -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_im_online -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_im_online. -pub struct WeightInfo(PhantomData); -impl pallet_im_online::WeightInfo for WeightInfo { - fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { - (87_465_000 as Weight) - // Standard Error: 0 - .saturating_add((169_000 as Weight).saturating_mul(k as Weight)) - // Standard Error: 1_000 - .saturating_add((335_000 as Weight).saturating_mul(e as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_indices.rs b/relay/kusama/src/weights/pallet_indices.rs deleted file mode 100644 index d37264f7fa..0000000000 --- a/relay/kusama/src/weights/pallet_indices.rs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_indices -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_indices -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_indices. -pub struct WeightInfo(PhantomData); -impl pallet_indices::WeightInfo for WeightInfo { - fn claim() -> Weight { - (39_903_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer() -> Weight { - (48_162_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn free() -> Weight { - (39_958_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_transfer() -> Weight { - (40_459_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn freeze() -> Weight { - (37_761_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_membership.rs b/relay/kusama/src/weights/pallet_membership.rs deleted file mode 100644 index 7878243a20..0000000000 --- a/relay/kusama/src/weights/pallet_membership.rs +++ /dev/null @@ -1,94 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_membership -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_membership -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_membership. -pub struct WeightInfo(PhantomData); -impl pallet_membership::WeightInfo for WeightInfo { - fn add_member(m: u32, ) -> Weight { - (23_510_000 as Weight) - // Standard Error: 1_000 - .saturating_add((126_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn remove_member(m: u32, ) -> Weight { - (28_576_000 as Weight) - // Standard Error: 0 - .saturating_add((102_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn swap_member(m: u32, ) -> Weight { - (28_826_000 as Weight) - // Standard Error: 0 - .saturating_add((117_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn reset_member(m: u32, ) -> Weight { - (29_556_000 as Weight) - // Standard Error: 0 - .saturating_add((271_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn change_key(m: u32, ) -> Weight { - (30_300_000 as Weight) - // Standard Error: 0 - .saturating_add((113_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn set_prime(m: u32, ) -> Weight { - (7_436_000 as Weight) - // Standard Error: 0 - .saturating_add((84_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn clear_prime(m: u32, ) -> Weight { - (2_947_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_multisig.rs b/relay/kusama/src/weights/pallet_multisig.rs deleted file mode 100644 index 2d05d2d877..0000000000 --- a/relay/kusama/src/weights/pallet_multisig.rs +++ /dev/null @@ -1,122 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_multisig -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_multisig -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_multisig. -pub struct WeightInfo(PhantomData); -impl pallet_multisig::WeightInfo for WeightInfo { - fn as_multi_threshold_1(_z: u32, ) -> Weight { - (10_273_000 as Weight) - } - fn as_multi_create(s: u32, z: u32, ) -> Weight { - (50_795_000 as Weight) - // Standard Error: 0 - .saturating_add((85_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (56_223_000 as Weight) - // Standard Error: 0 - .saturating_add((91_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (29_190_000 as Weight) - // Standard Error: 0 - .saturating_add((86_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (53_138_000 as Weight) - // Standard Error: 0 - .saturating_add((98_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (73_267_000 as Weight) - // Standard Error: 2_000 - .saturating_add((195_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn approve_as_multi_create(s: u32, ) -> Weight { - (50_201_000 as Weight) - // Standard Error: 0 - .saturating_add((83_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn approve_as_multi_approve(s: u32, ) -> Weight { - (28_525_000 as Weight) - // Standard Error: 0 - .saturating_add((88_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)) - } - fn approve_as_multi_complete(s: u32, ) -> Weight { - (120_751_000 as Weight) - // Standard Error: 0 - .saturating_add((196_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn cancel_as_multi(s: u32, ) -> Weight { - (86_776_000 as Weight) - // Standard Error: 0 - .saturating_add((86_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_proxy.rs b/relay/kusama/src/weights/pallet_proxy.rs deleted file mode 100644 index 195a8613a6..0000000000 --- a/relay/kusama/src/weights/pallet_proxy.rs +++ /dev/null @@ -1,119 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_proxy -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_proxy -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_proxy. -pub struct WeightInfo(PhantomData); -impl pallet_proxy::WeightInfo for WeightInfo { - fn proxy(p: u32, ) -> Weight { - (24_270_000 as Weight) - // Standard Error: 1_000 - .saturating_add((130_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - fn proxy_announced(a: u32, p: u32, ) -> Weight { - (54_046_000 as Weight) - // Standard Error: 1_000 - .saturating_add((503_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 1_000 - .saturating_add((107_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_announcement(a: u32, _p: u32, ) -> Weight { - (36_894_000 as Weight) - // Standard Error: 1_000 - .saturating_add((489_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn reject_announcement(a: u32, _p: u32, ) -> Weight { - (36_533_000 as Weight) - // Standard Error: 1_000 - .saturating_add((497_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn announce(a: u32, p: u32, ) -> Weight { - (49_934_000 as Weight) - // Standard Error: 1_000 - .saturating_add((495_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 1_000 - .saturating_add((111_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn add_proxy(p: u32, ) -> Weight { - (34_641_000 as Weight) - // Standard Error: 1_000 - .saturating_add((190_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_proxy(p: u32, ) -> Weight { - (34_496_000 as Weight) - // Standard Error: 2_000 - .saturating_add((213_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_proxies(p: u32, ) -> Weight { - (33_022_000 as Weight) - // Standard Error: 1_000 - .saturating_add((139_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn anonymous(p: u32, ) -> Weight { - (47_629_000 as Weight) - // Standard Error: 1_000 - .saturating_add((33_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn kill_anonymous(p: u32, ) -> Weight { - (34_875_000 as Weight) - // Standard Error: 1_000 - .saturating_add((135_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_scheduler.rs b/relay/kusama/src/weights/pallet_scheduler.rs deleted file mode 100644 index 4b00baa217..0000000000 --- a/relay/kusama/src/weights/pallet_scheduler.rs +++ /dev/null @@ -1,74 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_scheduler -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_scheduler -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_scheduler. -pub struct WeightInfo(PhantomData); -impl pallet_scheduler::WeightInfo for WeightInfo { - fn schedule(s: u32, ) -> Weight { - (28_189_000 as Weight) - // Standard Error: 0 - .saturating_add((42_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)) - } - fn cancel(s: u32, ) -> Weight { - (27_165_000 as Weight) - // Standard Error: 14_000 - .saturating_add((4_332_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn schedule_named(s: u32, ) -> Weight { - (33_852_000 as Weight) - // Standard Error: 1_000 - .saturating_add((62_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn cancel_named(s: u32, ) -> Weight { - (29_352_000 as Weight) - // Standard Error: 14_000 - .saturating_add((4_346_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_session.rs b/relay/kusama/src/weights/pallet_session.rs deleted file mode 100644 index 92bbfe9443..0000000000 --- a/relay/kusama/src/weights/pallet_session.rs +++ /dev/null @@ -1,56 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_session -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_session -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_session. -pub struct WeightInfo(PhantomData); -impl pallet_session::WeightInfo for WeightInfo { - fn set_keys() -> Weight { - (70_343_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } - fn purge_keys() -> Weight { - (40_249_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_staking.rs b/relay/kusama/src/weights/pallet_staking.rs deleted file mode 100644 index 068f6953f7..0000000000 --- a/relay/kusama/src/weights/pallet_staking.rs +++ /dev/null @@ -1,230 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_staking -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_staking -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_staking. -pub struct WeightInfo(PhantomData); -impl pallet_staking::WeightInfo for WeightInfo { - fn bond() -> Weight { - (68_483_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn bond_extra() -> Weight { - (52_724_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn unbond() -> Weight { - (56_614_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn withdraw_unbonded_update(s: u32, ) -> Weight { - (48_650_000 as Weight) - // Standard Error: 0 - .saturating_add((28_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn withdraw_unbonded_kill(s: u32, ) -> Weight { - (79_902_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_200_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn validate() -> Weight { - (29_119_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn kick(k: u32, ) -> Weight { - (10_981_000 as Weight) - // Standard Error: 6_000 - .saturating_add((17_518_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))) - } - fn nominate(n: u32, ) -> Weight { - (35_585_000 as Weight) - // Standard Error: 6_000 - .saturating_add((5_106_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn chill() -> Weight { - (16_193_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - fn set_payee() -> Weight { - (10_861_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_controller() -> Weight { - (23_628_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn set_validator_count() -> Weight { - (2_081_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_no_eras() -> Weight { - (2_358_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era() -> Weight { - (2_338_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era_always() -> Weight { - (2_312_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_invulnerables(v: u32, ) -> Weight { - (2_285_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_unstake(s: u32, ) -> Weight { - (55_848_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_197_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn cancel_deferred_slash(s: u32, ) -> Weight { - (3_386_960_000 as Weight) - // Standard Error: 221_000 - .saturating_add((19_794_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)) - } - fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (109_960_000 as Weight) - // Standard Error: 16_000 - .saturating_add((47_064_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)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) - } - fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (145_438_000 as Weight) - // Standard Error: 24_000 - .saturating_add((59_384_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)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) - } - fn rebond(l: u32, ) -> Weight { - (45_646_000 as Weight) - // Standard Error: 1_000 - .saturating_add((72_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn set_history_depth(e: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 70_000 - .saturating_add((32_189_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))) - } - fn reap_stash(s: u32, ) -> Weight { - (66_554_000 as Weight) - // Standard Error: 0 - .saturating_add((2_198_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn new_era(v: u32, n: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 749_000 - .saturating_add((299_115_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 37_000 - .saturating_add((46_619_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(v as Weight))) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) - } - fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 97_000 - .saturating_add((24_261_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 97_000 - .saturating_add((27_765_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_310_000 - .saturating_add((22_891_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - } - fn get_npos_targets(v: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 31_000 - .saturating_add((10_297_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) - } - fn update_staking_limits() -> Weight { - (4_799_000 as Weight) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn chill_other() -> Weight { - (31_294_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_timestamp.rs b/relay/kusama/src/weights/pallet_timestamp.rs deleted file mode 100644 index 094e394eb4..0000000000 --- a/relay/kusama/src/weights/pallet_timestamp.rs +++ /dev/null @@ -1,54 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_timestamp -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_timestamp -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_timestamp. -pub struct WeightInfo(PhantomData); -impl pallet_timestamp::WeightInfo for WeightInfo { - fn set() -> Weight { - (10_330_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_finalize() -> Weight { - (4_458_000 as Weight) - } -} diff --git a/relay/kusama/src/weights/pallet_tips.rs b/relay/kusama/src/weights/pallet_tips.rs deleted file mode 100644 index 370c01ef39..0000000000 --- a/relay/kusama/src/weights/pallet_tips.rs +++ /dev/null @@ -1,88 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_tips -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_tips -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_tips. -pub struct WeightInfo(PhantomData); -impl pallet_tips::WeightInfo for WeightInfo { - fn report_awesome(r: u32, ) -> Weight { - (50_649_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn retract_tip() -> Weight { - (45_588_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn tip_new(r: u32, t: u32, ) -> Weight { - (29_606_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((124_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn tip(t: u32, ) -> Weight { - (18_751_000 as Weight) - // Standard Error: 0 - .saturating_add((567_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn close_tip(t: u32, ) -> Weight { - (81_517_000 as Weight) - // Standard Error: 0 - .saturating_add((318_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn slash_tip(t: u32, ) -> Weight { - (24_467_000 as Weight) - // Standard Error: 0 - .saturating_add((7_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_treasury.rs b/relay/kusama/src/weights/pallet_treasury.rs deleted file mode 100644 index 24c2c1c36a..0000000000 --- a/relay/kusama/src/weights/pallet_treasury.rs +++ /dev/null @@ -1,72 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_treasury -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_treasury -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_treasury. -pub struct WeightInfo(PhantomData); -impl pallet_treasury::WeightInfo for WeightInfo { - fn propose_spend() -> Weight { - (40_599_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn reject_proposal() -> Weight { - (49_321_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn approve_proposal(p: u32, ) -> Weight { - (12_230_000 as Weight) - // Standard Error: 0 - .saturating_add((34_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_initialize_proposals(p: u32, ) -> Weight { - (75_382_000 as Weight) - // Standard Error: 16_000 - .saturating_add((59_314_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) - } -} diff --git a/relay/kusama/src/weights/pallet_utility.rs b/relay/kusama/src/weights/pallet_utility.rs deleted file mode 100644 index 02dda17218..0000000000 --- a/relay/kusama/src/weights/pallet_utility.rs +++ /dev/null @@ -1,59 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_utility -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_utility -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_utility. -pub struct WeightInfo(PhantomData); -impl pallet_utility::WeightInfo for WeightInfo { - fn batch(c: u32, ) -> Weight { - (14_911_000 as Weight) - // Standard Error: 0 - .saturating_add((2_456_000 as Weight).saturating_mul(c as Weight)) - } - fn as_derivative() -> Weight { - (5_087_000 as Weight) - } - fn batch_all(c: u32, ) -> Weight { - (16_211_000 as Weight) - // Standard Error: 0 - .saturating_add((3_296_000 as Weight).saturating_mul(c as Weight)) - } -} diff --git a/relay/kusama/src/weights/pallet_vesting.rs b/relay/kusama/src/weights/pallet_vesting.rs deleted file mode 100644 index acf043b67e..0000000000 --- a/relay/kusama/src/weights/pallet_vesting.rs +++ /dev/null @@ -1,88 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_vesting -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_vesting -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_vesting. -pub struct WeightInfo(PhantomData); -impl pallet_vesting::WeightInfo for WeightInfo { - fn vest_locked(l: u32, ) -> Weight { - (41_675_000 as Weight) - // Standard Error: 7_000 - .saturating_add((159_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn vest_unlocked(l: u32, ) -> Weight { - (44_454_000 as Weight) - // Standard Error: 4_000 - .saturating_add((129_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vest_other_locked(l: u32, ) -> Weight { - (41_313_000 as Weight) - // Standard Error: 7_000 - .saturating_add((161_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vest_other_unlocked(l: u32, ) -> Weight { - (44_088_000 as Weight) - // Standard Error: 4_000 - .saturating_add((131_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn vested_transfer(l: u32, ) -> Weight { - (95_360_000 as Weight) - // Standard Error: 6_000 - .saturating_add((152_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn force_vested_transfer(l: u32, ) -> Weight { - (94_577_000 as Weight) - // Standard Error: 6_000 - .saturating_add((149_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } -} diff --git a/relay/kusama/src/weights/runtime_common_auctions.rs b/relay/kusama/src/weights/runtime_common_auctions.rs deleted file mode 100644 index f33b909ae1..0000000000 --- a/relay/kusama/src/weights/runtime_common_auctions.rs +++ /dev/null @@ -1,66 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::auctions -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-24, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::auctions -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/runtime_common_auctions.rs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::auctions. -pub struct WeightInfo(PhantomData); -impl runtime_common::auctions::WeightInfo for WeightInfo { - fn new_auction() -> Weight { - (29_554_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn bid() -> Weight { - (154_464_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_initialize() -> Weight { - (33_239_172_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3688 as Weight)) - .saturating_add(T::DbWeight::get().writes(3683 as Weight)) - } - fn cancel_auction() -> Weight { - (7_021_314_000 as Weight) - .saturating_add(T::DbWeight::get().reads(73 as Weight)) - .saturating_add(T::DbWeight::get().writes(3673 as Weight)) - } -} diff --git a/relay/kusama/src/weights/runtime_common_claims.rs b/relay/kusama/src/weights/runtime_common_claims.rs deleted file mode 100644 index 0277b96f3f..0000000000 --- a/relay/kusama/src/weights/runtime_common_claims.rs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::claims -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::claims -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::claims. -pub struct WeightInfo(PhantomData); -impl runtime_common::claims::WeightInfo for WeightInfo { - fn claim() -> Weight { - (443_398_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn mint_claim() -> Weight { - (12_397_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn claim_attest() -> Weight { - (444_202_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn attest() -> Weight { - (130_109_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } - fn move_claim() -> Weight { - (27_762_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } -} diff --git a/relay/kusama/src/weights/runtime_common_crowdloan.rs b/relay/kusama/src/weights/runtime_common_crowdloan.rs deleted file mode 100644 index 0f4382bb1a..0000000000 --- a/relay/kusama/src/weights/runtime_common_crowdloan.rs +++ /dev/null @@ -1,99 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::crowdloan -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-24, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::crowdloan -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/runtime_common_crowdloan.rs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::crowdloan. -pub struct WeightInfo(PhantomData); -impl runtime_common::crowdloan::WeightInfo for WeightInfo { - fn create() -> Weight { - (93_538_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn contribute() -> Weight { - (581_495_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn withdraw() -> Weight { - (127_588_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn refund(k: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 52_000 - .saturating_add((56_719_000 as Weight).saturating_mul(k as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(k as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(k as Weight))) - } - fn dissolve() -> Weight { - (68_758_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn edit() -> Weight { - (42_049_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn add_memo() -> Weight { - (65_306_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn poke() -> Weight { - (51_610_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_initialize(n: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 32_000 - .saturating_add((131_978_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(5 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)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight))) - } -} diff --git a/relay/kusama/src/weights/runtime_common_paras_registrar.rs b/relay/kusama/src/weights/runtime_common_paras_registrar.rs deleted file mode 100644 index a10b1215f4..0000000000 --- a/relay/kusama/src/weights/runtime_common_paras_registrar.rs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::paras_registrar -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-21, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::paras_registrar -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/runtime_common_paras_registrar.rs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::paras_registrar. -pub struct WeightInfo(PhantomData); -impl runtime_common::paras_registrar::WeightInfo for WeightInfo { - fn reserve() -> Weight { - (59_279_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn register() -> Weight { - (4_148_907_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn force_register() -> Weight { - (4_144_844_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn deregister() -> Weight { - (90_495_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn swap() -> Weight { - (80_604_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - } -} diff --git a/relay/kusama/src/weights/runtime_common_slots.rs b/relay/kusama/src/weights/runtime_common_slots.rs deleted file mode 100644 index 0762ded1a1..0000000000 --- a/relay/kusama/src/weights/runtime_common_slots.rs +++ /dev/null @@ -1,74 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::slots -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-25, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=kusama-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::slots -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/runtime_common_slots.rs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::slots. -pub struct WeightInfo(PhantomData); -impl runtime_common::slots::WeightInfo for WeightInfo { - fn force_lease() -> Weight { - (54_624_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn manage_lease_period_start(c: u32, t: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 36_000 - .saturating_add((19_526_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 36_000 - .saturating_add((42_887_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(t as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(t as Weight))) - } - fn clear_all_leases() -> Weight { - (230_377_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(9 as Weight)) - } - fn trigger_onboard() -> Weight { - (45_884_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } -} diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml deleted file mode 100644 index 4c48db7858..0000000000 --- a/relay/polkadot/Cargo.toml +++ /dev/null @@ -1,239 +0,0 @@ -[package] -name = "polkadot-runtime" -version = "0.9.7" -authors = ["Parity Technologies "] -edition = "2018" -build = "build.rs" - -[dependencies] -bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] } -log = { version = "0.4.14", default-features = false } -rustc-hex = { version = "2.1.0", default-features = false } -serde = { version = "1.0.123", default-features = false } -serde_derive = { version = "1.0.117", optional = true } -static_assertions = "1.1.0" -smallvec = "1.6.1" - -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 } -beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } -block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } -frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } -hex-literal = { version = "0.3.1", optional = true } - -runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } -primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } - -max-encoded-len = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } - -[dev-dependencies] -hex-literal = "0.3.1" -libsecp256k1 = "0.3.5" -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.22.3" -serde_json = "1.0.61" -separator = "0.4.1" - -[build-dependencies] -substrate-wasm-builder = "3.0.0" - -[features] -default = ["std"] -no_std = [] -only-staking = [] -std = [ - "authority-discovery-primitives/std", - "bitvec/std", - "primitives/std", - "rustc-hex/std", - "parity-scale-codec/std", - "inherents/std", - "sp-core/std", - "sp-api/std", - "tx-pool-api/std", - "block-builder-api/std", - "offchain-primitives/std", - "sp-std/std", - "frame-support/std", - "frame-executive/std", - "pallet-authority-discovery/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-bounties/std", - "pallet-transaction-payment/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-collective/std", - "pallet-elections-phragmen/std", - "pallet-election-provider-multi-phase/std", - "pallet-democracy/std", - "pallet-grandpa/std", - "pallet-identity/std", - "pallet-im-online/std", - "pallet-indices/std", - "pallet-membership/std", - "pallet-multisig/std", - "pallet-nicks/std", - "pallet-offences/std", - "pallet-proxy/std", - "pallet-scheduler/std", - "pallet-session/std", - "pallet-staking/std", - "pallet-timestamp/std", - "pallet-treasury/std", - "pallet-tips/std", - "pallet-babe/std", - "pallet-vesting/std", - "pallet-utility/std", - "sp-runtime/std", - "sp-staking/std", - "frame-system/std", - "frame-system-rpc-runtime-api/std", - "sp-version/std", - "serde_derive", - "serde/std", - "log/std", - "babe-primitives/std", - "sp-session/std", - "runtime-common/std", - "frame-try-runtime/std", - "sp-npos-elections/std", - "beefy-primitives/std", - "pallet-mmr-primitives/std", - "max-encoded-len/std", - "frame-election-provider-support/std", -] -runtime-benchmarks = [ - "runtime-common/runtime-benchmarks", - "frame-benchmarking", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "pallet-babe/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-democracy/runtime-benchmarks", - "pallet-elections-phragmen/runtime-benchmarks", - "pallet-election-provider-multi-phase/runtime-benchmarks", - "pallet-grandpa/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-im-online/runtime-benchmarks", - "pallet-indices/runtime-benchmarks", - "pallet-membership/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-staking/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-bounties/runtime-benchmarks", - "pallet-tips/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", - "pallet-offences-benchmarking", - "pallet-session-benchmarking", - "frame-system-benchmarking", - "hex-literal", - "frame-election-provider-support/runtime-benchmarks", -] -try-runtime = [ - "frame-executive/try-runtime", - "frame-try-runtime", - "frame-system/try-runtime", - "pallet-authority-discovery/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-bounties/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-collective/try-runtime", - "pallet-elections-phragmen/try-runtime", - "pallet-election-provider-multi-phase/try-runtime", - "pallet-democracy/try-runtime", - "pallet-grandpa/try-runtime", - "pallet-identity/try-runtime", - "pallet-im-online/try-runtime", - "pallet-indices/try-runtime", - "pallet-membership/try-runtime", - "pallet-multisig/try-runtime", - "pallet-nicks/try-runtime", - "pallet-offences/try-runtime", - "pallet-proxy/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-session/try-runtime", - "pallet-staking/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-treasury/try-runtime", - "pallet-tips/try-runtime", - "pallet-babe/try-runtime", - "pallet-vesting/try-runtime", - "pallet-utility/try-runtime", - "runtime-common/try-runtime", -] -# When enabled, the runtime api will not be build. -# -# This is required by Cumulus to access certain types of the -# runtime without clashing with the runtime api exported functions -# in WASM. -disable-runtime-api = [] - -# A feature that should be enabled when the runtime should be build for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller like logging for example. -on-chain-release-build = [ - "sp-api/disable-logging", -] diff --git a/relay/polkadot/README.adoc b/relay/polkadot/README.adoc deleted file mode 100644 index 3337331081..0000000000 --- a/relay/polkadot/README.adoc +++ /dev/null @@ -1,5 +0,0 @@ - -= Polkadot Runtime - -placeholder -//TODO Write content :) (https://github.com/paritytech/polkadot/issues/159) diff --git a/relay/polkadot/build.rs b/relay/polkadot/build.rs deleted file mode 100644 index e4a139a06a..0000000000 --- a/relay/polkadot/build.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019-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. - -// Substrate 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 substrate_wasm_builder::WasmBuilder; - -fn main() { - WasmBuilder::new() - .with_current_project() - .import_memory() - .export_heap_base() - .build() -} diff --git a/relay/polkadot/src/constants.rs b/relay/polkadot/src/constants.rs deleted file mode 100644 index ecfa74d786..0000000000 --- a/relay/polkadot/src/constants.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2019-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 . - -/// Money matters. -pub mod currency { - use primitives::v0::Balance; - - pub const UNITS: Balance = 10_000_000_000; - pub const DOLLARS: Balance = UNITS; // 10_000_000_000 - pub const CENTS: Balance = DOLLARS / 100; // 100_000_000 - pub const MILLICENTS: Balance = CENTS / 1_000; // 100_000 - - pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS - } -} - -/// Time and blocks. -pub mod time { - use primitives::v0::{Moment, BlockNumber}; - pub const MILLISECS_PER_BLOCK: Moment = 6000; - pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 4 * HOURS; - - // These time units are defined in number of blocks. - pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); - pub const HOURS: BlockNumber = MINUTES * 60; - pub const DAYS: BlockNumber = HOURS * 24; - - // 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. - pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); -} - -/// Fee-related. -pub mod fee { - pub use sp_runtime::Perbill; - use primitives::v0::Balance; - use runtime_common::ExtrinsicBaseWeight; - use frame_support::weights::{ - WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, - }; - use smallvec::smallvec; - - /// The block saturation level. Fees will be updates based on this value. - pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); - - /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the - /// node's balance type. - /// - /// This should typically create a mapping between the following ranges: - /// - [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: - /// - Setting it to `0` will essentially disable the weight fee. - /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. - pub struct WeightToFee; - impl WeightToFeePolynomial for WeightToFee { - type Balance = Balance; - fn polynomial() -> WeightToFeeCoefficients { - // in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: - let p = super::currency::CENTS; - let q = 10 * Balance::from(ExtrinsicBaseWeight::get()); - smallvec![WeightToFeeCoefficient { - degree: 1, - negative: false, - coeff_frac: Perbill::from_rational(p % q, q), - coeff_integer: p / q, - }] - } - } -} - -#[cfg(test)] -mod tests { - use frame_support::weights::WeightToFeePolynomial; - 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 `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(&MAXIMUM_BLOCK_WEIGHT); - let y = 16 * DOLLARS; - assert!(x.max(y) - x.min(y) < MILLICENTS); - } - - #[test] - // 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 y = CENTS / 10; - assert!(x.max(y) - x.min(y) < MILLICENTS); - } -} diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs deleted file mode 100644 index ebbc80a642..0000000000 --- a/relay/polkadot/src/lib.rs +++ /dev/null @@ -1,1567 +0,0 @@ -// 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 . - -//! The Polkadot runtime. This can be compiled with `#[no_std]`, ready for Wasm. - -#![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] - -use pallet_transaction_payment::CurrencyAdapter; -use runtime_common::{ - claims, SlowAdjustingFeeUpdate, CurrencyToVote, - impls::DealWithFees, - BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, - OffchainSolutionWeightLimit, OffchainSolutionLengthLimit, - ParachainSessionKeyPlaceholder, AssignmentSessionKeyPlaceholder, -}; - -use sp_std::prelude::*; -use sp_std::collections::btree_map::BTreeMap; -use sp_core::u32_trait::{_1, _2, _3, _4, _5}; -use parity_scale_codec::{Encode, Decode}; -use primitives::v1::{ - AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt, - CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption, - PersistedValidationData, Signature, ValidationCode, ValidationCodeHash, ValidatorId, - ValidatorIndex, InboundDownwardMessage, InboundHrmpMessage, SessionInfo, -}; -use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, - KeyTypeId, Percent, Permill, Perbill, curve::PiecewiseLinear, - transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, - traits::{ - BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, - Extrinsic as ExtrinsicT, SaturatedConversion, Verify, - }, -}; -#[cfg(feature = "runtime-benchmarks")] -use sp_runtime::RuntimeString; -use sp_version::RuntimeVersion; -use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; -#[cfg(any(feature = "std", test))] -use sp_version::NativeVersion; -use sp_core::OpaqueMetadata; -use sp_staking::SessionIndex; -use frame_support::{ - parameter_types, construct_runtime, RuntimeDebug, PalletId, - traits::{KeyOwnerProofSystem, LockIdentifier, Filter, MaxEncodedLen}, - weights::Weight, -}; -use frame_system::{EnsureRoot, EnsureOneOf}; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; -use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; -use pallet_session::historical as session_historical; -use static_assertions::const_assert; -use beefy_primitives::crypto::AuthorityId as BeefyId; -use pallet_mmr_primitives as mmr; - -#[cfg(feature = "std")] -pub use pallet_staking::StakerStatus; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use pallet_timestamp::Call as TimestampCall; -pub use pallet_balances::Call as BalancesCall; - -/// Constant values used within the runtime. -pub mod constants; -use constants::{time::*, currency::*, fee::*}; -use frame_support::traits::InstanceFilter; - -// Weights used in the runtime. -mod weights; - -// Make the WASM binary available. -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -// Polkadot version identifier; -/// Runtime version (Polkadot). -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("polkadot"), - impl_name: create_runtime_str!("parity-polkadot"), - authoring_version: 0, - spec_version: 9070, - 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: 7, -}; - -/// The BABE epoch configuration at genesis. -pub const BABE_GENESIS_EPOCH_CONFIG: babe_primitives::BabeEpochConfiguration = - babe_primitives::BabeEpochConfiguration { - c: PRIMARY_PROBABILITY, - allowed_slots: babe_primitives::AllowedSlots::PrimaryAndSecondaryVRFSlots - }; - -/// Native version. -#[cfg(any(feature = "std", test))] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -pub struct BaseFilter; -impl Filter for BaseFilter { - fn filter(call: &Call) -> bool { - match call { - // These modules are all allowed to be called by transactions: - Call::Democracy(_) | Call::Council(_) | Call::TechnicalCommittee(_) | - Call::TechnicalMembership(_) | Call::Treasury(_) | Call::PhragmenElection(_) | - Call::System(_) | Call::Scheduler(_) | Call::Indices(_) | - Call::Babe(_) | Call::Timestamp(_) | Call::Balances(_) | - Call::Authorship(_) | Call::Staking(_) | - Call::Session(_) | Call::Grandpa(_) | Call::ImOnline(_) | - Call::Utility(_) | Call::Claims(_) | Call::Vesting(_) | - Call::Identity(_) | Call::Proxy(_) | Call::Multisig(_) | - Call::Bounties(_) | Call::Tips(_) | Call::ElectionProviderMultiPhase(_) - => true, - } - } -} - -type MoreThanHalfCouncil = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> ->; - -parameter_types! { - pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 0; -} - -impl frame_system::Config for Runtime { - type BaseCallFilter = BaseFilter; - type BlockWeights = BlockWeights; - type BlockLength = BlockLength; - type Origin = Origin; - type Call = Call; - type Index = Nonce; - type BlockNumber = BlockNumber; - type Hash = Hash; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = AccountIdLookup; - type Header = generic::Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - type Version = Version; - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = weights::frame_system::WeightInfo; - type SS58Prefix = SS58Prefix; - type OnSetCode = (); -} - -parameter_types! { - pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * - BlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; -} - -type ScheduleOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> ->; - -impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = ScheduleOrigin; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = weights::pallet_scheduler::WeightInfo; -} - -parameter_types! { - pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64; - pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; - pub const ReportLongevity: u64 = - BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); -} - -impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ExpectedBlockTime; - - // session module is the trigger - type EpochChangeTrigger = pallet_babe::ExternalTrigger; - - type KeyOwnerProofSystem = Historical; - - type KeyOwnerProof = >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type HandleEquivocation = - pallet_babe::EquivocationHandler; - - type WeightInfo = (); -} - -parameter_types! { - pub const IndexDeposit: Balance = 10 * DOLLARS; -} - -impl pallet_indices::Config for Runtime { - type AccountIndex = AccountIndex; - type Currency = Balances; - type Deposit = IndexDeposit; - type Event = Event; - type WeightInfo = weights::pallet_indices::WeightInfo; -} - -parameter_types! { - pub const ExistentialDeposit: Balance = 100 * CENTS; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type Balance = Balance; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type WeightInfo = weights::pallet_balances::WeightInfo; -} - -parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLICENTS; -} - -impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = CurrencyAdapter>; - type TransactionByteFee = TransactionByteFee; - type WeightToFee = WeightToFee; - type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} -impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = Babe; - type MinimumPeriod = MinimumPeriod; - type WeightInfo = weights::pallet_timestamp::WeightInfo; -} - -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - -// TODO: substrate#2986 implement this properly -impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; - type FilterUncle = (); - type EventHandler = (Staking, ImOnline); -} - -impl_opaque_keys! { - pub struct SessionKeys { - pub grandpa: Grandpa, - pub babe: Babe, - pub im_online: ImOnline, - pub para_validator: ParachainSessionKeyPlaceholder, - pub para_assignment: AssignmentSessionKeyPlaceholder, - pub authority_discovery: AuthorityDiscovery, - } -} - -parameter_types! { - pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); -} - -impl pallet_session::Config for Runtime { - type Event = Event; - type ValidatorId = AccountId; - type ValidatorIdOf = pallet_staking::StashOf; - type ShouldEndSession = Babe; - type NextSessionRotation = Babe; - type SessionManager = pallet_session::historical::NoteHistoricalRoot; - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type DisabledValidatorsThreshold = DisabledValidatorsThreshold; - type WeightInfo = weights::pallet_session::WeightInfo; -} - -impl pallet_session::historical::Config for Runtime { - type FullIdentification = pallet_staking::Exposure; - type FullIdentificationOf = pallet_staking::ExposureOf; -} - -parameter_types! { - // no signed phase for now, just unsigned. - pub const SignedPhase: u32 = 0; - pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; - - // fallback: run election on-chain. - pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = - pallet_election_provider_multi_phase::FallbackStrategy::Nothing; - pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000); - - // miner configs - pub const MinerMaxIterations: u32 = 10; - pub OffchainRepeat: BlockNumber = 5; -} - -sp_npos_elections::generate_solution_type!( - #[compact] - pub struct NposCompactSolution16::< - VoterIndex = u32, - TargetIndex = u16, - Accuracy = sp_runtime::PerU16, - >(16) -); - -impl pallet_election_provider_multi_phase::Config for Runtime { - type Event = Event; - type Currency = Balances; - type SignedPhase = SignedPhase; - type UnsignedPhase = UnsignedPhase; - type SolutionImprovementThreshold = SolutionImprovementThreshold; - type MinerMaxIterations = MinerMaxIterations; - type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking. - type MinerMaxLength = OffchainSolutionLengthLimit; - type OffchainRepeat = OffchainRepeat; - type MinerTxPriority = NposSolutionPriority; - type DataProvider = Staking; - type OnChainAccuracy = Perbill; - type CompactSolution = NposCompactSolution16; - type Fallback = Fallback; - type BenchmarkingConfig = (); - type ForceOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, - >; - type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; -} - -// TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and -// re-built in case input parameters have changed. The `ideal_stake` should be determined by the -// amount of parachain slots being bid on: this should be around `(75 - 25.min(slots / 4))%`. -pallet_staking_reward_curve::build! { - const REWARD_CURVE: PiecewiseLinear<'static> = curve!( - min_inflation: 0_025_000, - max_inflation: 0_100_000, - // 3:2:1 staked : parachains : float. - // while there's no parachains, then this is 75% staked : 25% float. - ideal_stake: 0_750_000, - falloff: 0_050_000, - max_piece_count: 40, - test_precision: 0_005_000, - ); -} - -parameter_types! { - // Six sessions in an era (24 hours). - pub const SessionsPerEra: SessionIndex = 6; - // 28 eras for unbonding (28 days). - pub const BondingDuration: pallet_staking::EraIndex = 28; - pub const SlashDeferDuration: pallet_staking::EraIndex = 27; - pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; - pub const MaxNominatorRewardedPerValidator: u32 = 256; -} - -type SlashCancelOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective> ->; - -impl pallet_staking::Config for Runtime { - const MAX_NOMINATIONS: u32 = ::LIMIT as u32; - type Currency = Balances; - type UnixTime = Timestamp; - type CurrencyToVote = CurrencyToVote; - type RewardRemainder = Treasury; - type Event = Event; - type Slash = Treasury; - type Reward = (); - type SessionsPerEra = SessionsPerEra; - type BondingDuration = BondingDuration; - type SlashDeferDuration = SlashDeferDuration; - // A super-majority of the council can cancel the slash. - type SlashCancelOrigin = SlashCancelOrigin; - type SessionInterface = Self; - type EraPayout = pallet_staking::ConvertCurve; - type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; - type NextNewSession = Session; - type ElectionProvider = ElectionProviderMultiPhase; - type GenesisElectionProvider = - frame_election_provider_support::onchain::OnChainSequentialPhragmen< - pallet_election_provider_multi_phase::OnChainConfig - >; - type WeightInfo = weights::pallet_staking::WeightInfo; -} - -parameter_types! { - // Minimum 4 CENTS/byte - pub const BasicDeposit: Balance = deposit(1, 258); - pub const FieldDeposit: Balance = deposit(0, 66); - pub const SubAccountDeposit: Balance = deposit(1, 53); - pub const MaxSubAccounts: u32 = 100; - pub const MaxAdditionalFields: u32 = 100; - pub const MaxRegistrars: u32 = 20; -} - -impl pallet_identity::Config for Runtime { - type Event = Event; - type Currency = Balances; - type BasicDeposit = BasicDeposit; - type FieldDeposit = FieldDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = MaxSubAccounts; - type MaxAdditionalFields = MaxAdditionalFields; - type MaxRegistrars = MaxRegistrars; - type Slashed = Treasury; - type ForceOrigin = MoreThanHalfCouncil; - type RegistrarOrigin = MoreThanHalfCouncil; - type WeightInfo = weights::pallet_identity::WeightInfo; -} - -parameter_types! { - pub const LaunchPeriod: BlockNumber = 28 * DAYS; - pub const VotingPeriod: BlockNumber = 28 * DAYS; - pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; - pub const MinimumDeposit: Balance = 100 * DOLLARS; - pub const EnactmentPeriod: BlockNumber = 28 * DAYS; - pub const CooloffPeriod: BlockNumber = 7 * DAYS; - // One cent: $10,000 / MB - pub const PreimageByteDeposit: Balance = 1 * CENTS; - pub const InstantAllowed: bool = true; - pub const MaxVotes: u32 = 100; - pub const MaxProposals: u32 = 100; -} - -impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; - type Currency = Balances; - type EnactmentPeriod = EnactmentPeriod; - type LaunchPeriod = LaunchPeriod; - type VotingPeriod = VotingPeriod; - type MinimumDeposit = MinimumDeposit; - /// A straight majority of the council can decide what their next motion is. - type ExternalOrigin = frame_system::EnsureOneOf, - frame_system::EnsureRoot, - >; - /// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. - type ExternalMajorityOrigin = frame_system::EnsureOneOf, - frame_system::EnsureRoot, - >; - /// A unanimous council can have the next scheduled referendum be a straight default-carries - /// (NTB) vote. - type ExternalDefaultOrigin = frame_system::EnsureOneOf, - 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 = frame_system::EnsureOneOf, - frame_system::EnsureRoot, - >; - type InstantOrigin = frame_system::EnsureOneOf, - 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, - EnsureRoot, - >; - // To cancel a proposal before it has been passed, the technical committee must be unanimous or - // Root must agree. - type CancelProposalOrigin = EnsureOneOf, - EnsureRoot, - >; - type BlacklistOrigin = EnsureRoot; - // 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. - type VetoOrigin = pallet_collective::EnsureMember; - type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; - type Slash = Treasury; - type Scheduler = Scheduler; - type PalletsOrigin = OriginCaller; - type MaxVotes = MaxVotes; - type WeightInfo = weights::pallet_democracy::WeightInfo; - type MaxProposals = MaxProposals; -} - -parameter_types! { - pub const CouncilMotionDuration: BlockNumber = 7 * DAYS; - pub const CouncilMaxProposals: u32 = 100; - pub const CouncilMaxMembers: u32 = 100; -} - -type CouncilCollective = pallet_collective::Instance1; -impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; - type MotionDuration = CouncilMotionDuration; - type MaxProposals = CouncilMaxProposals; - type MaxMembers = CouncilMaxMembers; - type DefaultVote = pallet_collective::PrimeDefaultVote; - type WeightInfo = weights::pallet_collective::WeightInfo; -} - -parameter_types! { - pub const CandidacyBond: Balance = 100 * DOLLARS; - // 1 storage item created, key size is 32 bytes, value size is 16+16. - pub const VotingBondBase: Balance = deposit(1, 64); - // additional data per vote is 32 bytes (account id). - pub const VotingBondFactor: Balance = deposit(0, 32); - /// Weekly council elections; scaling up to monthly eventually. - pub const TermDuration: BlockNumber = 7 * DAYS; - /// 13 members initially, to be increased to 23 eventually. - pub const DesiredMembers: u32 = 13; - pub const DesiredRunnersUp: u32 = 20; - pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; -} -// Make sure that there are no more than `MaxMembers` members elected via phragmen. -const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); - -impl pallet_elections_phragmen::Config for Runtime { - type Event = Event; - type PalletId = PhragmenElectionPalletId; - type Currency = Balances; - type ChangeMembers = Council; - type InitializeMembers = Council; - type CurrencyToVote = frame_support::traits::U128CurrencyToVote; - type CandidacyBond = CandidacyBond; - type VotingBondBase = VotingBondBase; - type VotingBondFactor = VotingBondFactor; - type LoserCandidate = Treasury; - type KickedMember = Treasury; - type DesiredMembers = DesiredMembers; - type DesiredRunnersUp = DesiredRunnersUp; - type TermDuration = TermDuration; - type WeightInfo = weights::pallet_elections_phragmen::WeightInfo; -} - -parameter_types! { - pub const TechnicalMotionDuration: BlockNumber = 7 * DAYS; - pub const TechnicalMaxProposals: u32 = 100; - pub const TechnicalMaxMembers: u32 = 100; -} - -type TechnicalCollective = pallet_collective::Instance2; -impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; - type Event = Event; - type MotionDuration = TechnicalMotionDuration; - type MaxProposals = TechnicalMaxProposals; - type MaxMembers = TechnicalMaxMembers; - type DefaultVote = pallet_collective::PrimeDefaultVote; - type WeightInfo = weights::pallet_collective::WeightInfo; -} - -impl pallet_membership::Config for Runtime { - type Event = Event; - type AddOrigin = MoreThanHalfCouncil; - type RemoveOrigin = MoreThanHalfCouncil; - type SwapOrigin = MoreThanHalfCouncil; - type ResetOrigin = MoreThanHalfCouncil; - type PrimeOrigin = MoreThanHalfCouncil; - type MembershipInitialized = TechnicalCommittee; - type MembershipChanged = TechnicalCommittee; - type MaxMembers = TechnicalMaxMembers; - type WeightInfo = weights::pallet_membership::WeightInfo; -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 100 * DOLLARS; - pub const SpendPeriod: BlockNumber = 24 * DAYS; - pub const Burn: Permill = Permill::from_percent(1); - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); - - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * DOLLARS; - pub const DataDepositPerByte: Balance = 1 * CENTS; - pub const BountyDepositBase: Balance = 1 * DOLLARS; - pub const BountyDepositPayoutDelay: BlockNumber = 8 * DAYS; - pub const BountyUpdatePeriod: BlockNumber = 90 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 10 * DOLLARS; - pub const MaxApprovals: u32 = 100; -} - -type ApproveOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> ->; - -impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryPalletId; - type Currency = Balances; - type ApproveOrigin = ApproveOrigin; - type RejectOrigin = MoreThanHalfCouncil; - type Event = Event; - type OnSlash = Treasury; - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); - type SpendFunds = Bounties; - type MaxApprovals = MaxApprovals; - type WeightInfo = weights::pallet_treasury::WeightInfo; -} - -impl pallet_bounties::Config for Runtime { - type Event = Event; - type BountyDepositBase = BountyDepositBase; - type BountyDepositPayoutDelay = BountyDepositPayoutDelay; - type BountyUpdatePeriod = BountyUpdatePeriod; - type BountyCuratorDeposit = BountyCuratorDeposit; - type BountyValueMinimum = BountyValueMinimum; - type DataDepositPerByte = DataDepositPerByte; - type MaximumReasonLength = MaximumReasonLength; - type WeightInfo = weights::pallet_bounties::WeightInfo; -} - -impl pallet_tips::Config for Runtime { - type Event = Event; - type DataDepositPerByte = DataDepositPerByte; - type MaximumReasonLength = MaximumReasonLength; - type Tippers = PhragmenElection; - type TipCountdown = TipCountdown; - type TipFindersFee = TipFindersFee; - type TipReportDepositBase = TipReportDepositBase; - type WeightInfo = weights::pallet_tips::WeightInfo; -} - -impl pallet_offences::Config for Runtime { - type Event = Event; - type IdentificationTuple = pallet_session::historical::IdentificationTuple; - type OnOffenceHandler = Staking; -} - -impl pallet_authority_discovery::Config for Runtime {} - -parameter_types! { - pub NposSolutionPriority: TransactionPriority = - Perbill::from_percent(90) * TransactionPriority::max_value(); - pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); -} - -impl pallet_im_online::Config for Runtime { - type AuthorityId = ImOnlineId; - type Event = Event; - type ValidatorSet = Historical; - type NextSessionRotation = Babe; - type ReportUnresponsiveness = Offences; - type UnsignedPriority = ImOnlineUnsignedPriority; - type WeightInfo = weights::pallet_im_online::WeightInfo; -} - -impl pallet_grandpa::Config for Runtime { - type Event = Event; - type Call = Call; - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type KeyOwnerProofSystem = Historical; - - type HandleEquivocation = - pallet_grandpa::EquivocationHandler; - - type WeightInfo = (); -} - -/// Submits a transaction with the node's public and signature type. Adheres to the signed extension -/// format of the chain. -impl frame_system::offchain::CreateSignedTransaction for Runtime where - Call: From, -{ - fn create_transaction>( - call: Call, - public: ::Signer, - account: AccountId, - nonce: ::Index, - ) -> Option<(Call, ::SignaturePayload)> { - use sp_runtime::traits::StaticLookup; - // take the biggest period possible. - let period = BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; - - let current_block = System::block_number() - .saturated_into::() - // The `System::block_number` is initialized with `n+1`, - // so the actual block number is `n`. - .saturating_sub(1); - let tip = 0; - let extra: SignedExtra = ( - frame_system::CheckSpecVersion::::new(), - frame_system::CheckTxVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - frame_system::CheckNonce::::from(nonce), - frame_system::CheckWeight::::new(), - pallet_transaction_payment::ChargeTransactionPayment::::from(tip), - claims::PrevalidateAttests::::new(), - ); - let raw_payload = SignedPayload::new(call, extra).map_err(|e| { - log::warn!("Unable to create signed payload: {:?}", e); - }).ok()?; - let signature = raw_payload.using_encoded(|payload| { - C::sign(payload, public) - })?; - let (call, extra, _) = raw_payload.deconstruct(); - let address = ::Lookup::unlookup(account); - Some((call, (address, signature, extra))) - } -} - -impl frame_system::offchain::SigningTypes for Runtime { - type Public = ::Signer; - type Signature = Signature; -} - -impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From { - type Extrinsic = UncheckedExtrinsic; - type OverarchingCall = Call; -} - -parameter_types! { - pub const ParathreadDeposit: Balance = 500 * DOLLARS; - pub const QueueSize: usize = 2; - pub const MaxRetries: u32 = 3; -} - -parameter_types! { - pub Prefix: &'static [u8] = b"Pay DOTs to the Polkadot account:"; -} - -impl claims::Config for Runtime { - type Event = Event; - type VestingSchedule = Vesting; - 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>; - type WeightInfo = weights::runtime_common_claims::WeightInfo; -} - -parameter_types! { - pub const MinVestedTransfer: Balance = 1 * DOLLARS; -} - -impl pallet_vesting::Config for Runtime { - type Event = Event; - type Currency = Balances; - type BlockNumberToBalance = ConvertInto; - type MinVestedTransfer = MinVestedTransfer; - type WeightInfo = weights::pallet_vesting::WeightInfo; -} - -impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; - type WeightInfo = weights::pallet_utility::WeightInfo; -} - -parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); - pub const MaxSignatories: u16 = 100; -} - -impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; - type Currency = Balances; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = MaxSignatories; - type WeightInfo = weights::pallet_multisig::WeightInfo; -} - -parameter_types! { - // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = deposit(1, 8); - // Additional storage item size of 33 bytes. - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const MaxProxies: u16 = 32; - pub const AnnouncementDepositBase: Balance = deposit(1, 8); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); - pub const MaxPending: u16 = 32; -} - -/// The type used to represent the kinds of proxying allowed. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen)] -pub enum ProxyType { - Any = 0, - NonTransfer = 1, - Governance = 2, - Staking = 3, - // Skip 4 as it is now removed (was SudoBalances) - IdentityJudgement = 5, - CancelProxy = 6, -} - -#[cfg(test)] -mod proxy_type_tests { - use super::*; - - #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)] - pub enum OldProxyType { - Any, - NonTransfer, - Governance, - Staking, - SudoBalances, - IdentityJudgement, - } - - #[test] - fn proxy_type_decodes_correctly() { - for (i, j) in vec![ - (OldProxyType::Any, ProxyType::Any), - (OldProxyType::NonTransfer, ProxyType::NonTransfer), - (OldProxyType::Governance, ProxyType::Governance), - (OldProxyType::Staking, ProxyType::Staking), - (OldProxyType::IdentityJudgement, ProxyType::IdentityJudgement), - ].into_iter() { - assert_eq!(i.encode(), j.encode()); - } - assert!(ProxyType::decode(&mut &OldProxyType::SudoBalances.encode()[..]).is_err()); - } -} - -impl Default for ProxyType { fn default() -> Self { Self::Any } } -impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => matches!(c, - Call::System(..) | - Call::Scheduler(..) | - Call::Babe(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim(..)) | - Call::Indices(pallet_indices::Call::free(..)) | - Call::Indices(pallet_indices::Call::freeze(..)) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Staking(..) | - Call::Session(..) | - Call::Grandpa(..) | - Call::ImOnline(..) | - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::PhragmenElection(..) | - Call::TechnicalMembership(..) | - Call::Treasury(..) | - Call::Bounties(..) | - Call::Tips(..) | - Call::Claims(..) | - Call::Vesting(pallet_vesting::Call::vest(..)) | - Call::Vesting(pallet_vesting::Call::vest_other(..)) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Utility(..) | - Call::Identity(..) | - Call::Proxy(..) | - Call::Multisig(..) - ), - ProxyType::Governance => matches!(c, - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::PhragmenElection(..) | - Call::Treasury(..) | - Call::Bounties(..) | - Call::Tips(..) | - Call::Utility(..) - ), - ProxyType::Staking => matches!(c, - Call::Staking(..) | - Call::Session(..) | - Call::Utility(..) - ), - ProxyType::IdentityJudgement => matches!(c, - Call::Identity(pallet_identity::Call::provide_judgement(..)) | - Call::Utility(..) - ), - ProxyType::CancelProxy => matches!(c, - Call::Proxy(pallet_proxy::Call::reject_announcement(..)) - ) - } - } - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::NonTransfer, _) => true, - _ => false, - } - } -} - -impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; - type WeightInfo = weights::pallet_proxy::WeightInfo; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; -} - -construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = primitives::v1::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - // Basic stuff; balances is uncallable initially. - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 1, - - // Must be before session. - Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 2, - - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 4, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 5, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 32, - - // Consensus support. - Authorship: pallet_authorship::{Pallet, Call, Storage} = 6, - Staking: pallet_staking::{Pallet, Call, Storage, Config, Event} = 7, - Offences: pallet_offences::{Pallet, Storage, Event} = 8, - Historical: session_historical::{Pallet} = 33, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 9, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 11, - ImOnline: pallet_im_online::{Pallet, Call, Storage, Event, ValidateUnsigned, Config} = 12, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config} = 13, - - // Governance stuff. - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 14, - Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 15, - TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 16, - PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config} = 17, - TechnicalMembership: pallet_membership::::{Pallet, Call, Storage, Event, Config} = 18, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 19, - - // Claims. Usable initially. - Claims: claims::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 24, - // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 25, - // Cunning utilities. Usable initially. - Utility: pallet_utility::{Pallet, Call, Event} = 26, - - // Identity. Late addition. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 28, - - // Proxy module. Late addition. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 29, - - // Multisig dispatch. Late addition. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 30, - - // Bounties module. - Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 34, - - // Tips module. - Tips: pallet_tips::{Pallet, Call, Storage, Event} = 35, - - // Election pallet. Only works with staking, but placed here to maintain indices. - ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event, ValidateUnsigned} = 36, - - } -} - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckMortality, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - claims::PrevalidateAttests, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPallets, - RemoveCollectiveFlip, ->; -/// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; - -pub struct RemoveCollectiveFlip; -impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { - fn on_runtime_upgrade() -> Weight { - use frame_support::storage::migration; - // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` - migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); - ::DbWeight::get().writes(1) - } -} - -#[cfg(not(feature = "disable-runtime-api"))] -sp_api::impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: Block) { - Executive::execute_block(block); - } - - fn initialize_block(header: &::Header) { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - Runtime::metadata().into() - } - } - - impl block_builder_api::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents( - block: Block, - data: inherents::InherentData, - ) -> inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl tx_pool_api::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx) - } - } - - impl offchain_primitives::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl primitives::v1::ParachainHost for Runtime { - fn validators() -> Vec { - Vec::new() - } - - fn validator_groups() -> (Vec>, GroupRotationInfo) { - (Vec::new(), GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 0, now: 0 }) - } - - fn availability_cores() -> Vec> { - Vec::new() - } - - fn persisted_validation_data(_: Id, _: OccupiedCoreAssumption) - -> Option> { - None - } - - fn check_validation_outputs(_: Id, _: primitives::v1::CandidateCommitments) -> bool { - false - } - - fn session_index_for_child() -> SessionIndex { - 0 - } - - fn session_info(_: SessionIndex) -> Option { - None - } - - fn validation_code(_: Id, _: OccupiedCoreAssumption) -> Option { - None - } - - fn candidate_pending_availability(_: Id) -> Option> { - None - } - - fn candidate_events() -> Vec> { - Vec::new() - } - - fn dmq_contents( - _recipient: Id, - ) -> Vec> { - Vec::new() - } - - fn inbound_hrmp_channels_contents( - _recipient: Id - ) -> BTreeMap>> { - BTreeMap::new() - } - - fn validation_code_by_hash(_hash: ValidationCodeHash) -> Option { - None - } - } - - impl beefy_primitives::BeefyApi for Runtime { - fn validator_set() -> beefy_primitives::ValidatorSet { - // dummy implementation due to lack of BEEFY pallet. - beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 } - } - } - - impl mmr::MmrApi for Runtime { - fn generate_proof(_leaf_index: u64) - -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> - { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::GenerateProof) - } - - fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof) - -> Result<(), mmr::Error> - { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::Verify) - } - - fn verify_proof_stateless( - _root: Hash, - _leaf: mmr::EncodableOpaqueLeaf, - _proof: mmr::Proof - ) -> Result<(), mmr::Error> { - // dummy implementation due to lack of MMR pallet. - Err(mmr::Error::Verify) - } - } - - impl fg_primitives::GrandpaApi for Runtime { - fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { - Grandpa::grandpa_authorities() - } - - fn submit_report_equivocation_unsigned_extrinsic( - equivocation_proof: fg_primitives::EquivocationProof< - ::Hash, - sp_runtime::traits::NumberFor, - >, - key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Grandpa::submit_unsigned_equivocation_report( - equivocation_proof, - key_owner_proof, - ) - } - - fn generate_key_ownership_proof( - _set_id: fg_primitives::SetId, - authority_id: fg_primitives::AuthorityId, - ) -> Option { - use parity_scale_codec::Encode; - - Historical::prove((fg_primitives::KEY_TYPE, authority_id)) - .map(|p| p.encode()) - .map(fg_primitives::OpaqueKeyOwnershipProof::new) - } - } - - impl babe_primitives::BabeApi for Runtime { - fn configuration() -> babe_primitives::BabeGenesisConfiguration { - // The choice of `c` parameter (where `1 - c` represents the - // probability of a slot being empty), is done in accordance to the - // slot duration and expected target block time, for safely - // resisting network delays of maximum two seconds. - // - babe_primitives::BabeGenesisConfiguration { - slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), - c: BABE_GENESIS_EPOCH_CONFIG.c, - genesis_authorities: Babe::authorities(), - randomness: Babe::randomness(), - allowed_slots: BABE_GENESIS_EPOCH_CONFIG.allowed_slots, - } - } - - fn current_epoch_start() -> babe_primitives::Slot { - Babe::current_epoch_start() - } - - fn current_epoch() -> babe_primitives::Epoch { - Babe::current_epoch() - } - - fn next_epoch() -> babe_primitives::Epoch { - Babe::next_epoch() - } - - fn generate_key_ownership_proof( - _slot: babe_primitives::Slot, - authority_id: babe_primitives::AuthorityId, - ) -> Option { - use parity_scale_codec::Encode; - - Historical::prove((babe_primitives::KEY_TYPE, authority_id)) - .map(|p| p.encode()) - .map(babe_primitives::OpaqueKeyOwnershipProof::new) - } - - fn submit_report_equivocation_unsigned_extrinsic( - equivocation_proof: babe_primitives::EquivocationProof<::Header>, - key_owner_proof: babe_primitives::OpaqueKeyOwnershipProof, - ) -> Option<()> { - let key_owner_proof = key_owner_proof.decode()?; - - Babe::submit_unsigned_equivocation_report( - equivocation_proof, - key_owner_proof, - ) - } - } - - impl authority_discovery_primitives::AuthorityDiscoveryApi for Runtime { - fn authorities() -> Vec { - AuthorityDiscovery::authorities() - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - Balance, - > for Runtime { - fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { - log::info!("try-runtime::on_runtime_upgrade polkadot."); - let weight = Executive::try_runtime_upgrade()?; - Ok((weight, BlockWeights::get().max_block)) - } - } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues. - // To get around that, we separated the Session benchmarks into its own crate, which is why - // we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; - use frame_system_benchmarking::Pallet as SystemBench; - - impl pallet_session_benchmarking::Config for Runtime {} - impl pallet_offences_benchmarking::Config for Runtime {} - impl frame_system_benchmarking::Config for Runtime {} - - let whitelist: Vec = vec![ - // Block Number - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), - // Total Issuance - hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), - // Execution Phase - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), - // Event Count - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), - // System Events - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), - // Treasury Account - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec().into(), - ]; - - let mut batches = Vec::::new(); - let params = (&config, &whitelist); - // Polkadot - // NOTE: Make sure to prefix these `runtime_common::` so that path resolves correctly - // in the generated file. - add_benchmark!(params, batches, runtime_common::claims, Claims); - // Substrate - add_benchmark!(params, batches, pallet_balances, Balances); - add_benchmark!(params, batches, pallet_bounties, Bounties); - add_benchmark!(params, batches, pallet_collective, Council); - add_benchmark!(params, batches, pallet_democracy, Democracy); - add_benchmark!(params, batches, pallet_elections_phragmen, PhragmenElection); - add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); - add_benchmark!(params, batches, pallet_identity, Identity); - add_benchmark!(params, batches, pallet_im_online, ImOnline); - add_benchmark!(params, batches, pallet_indices, Indices); - add_benchmark!(params, batches, pallet_membership, TechnicalMembership); - add_benchmark!(params, batches, pallet_multisig, Multisig); - add_benchmark!(params, batches, pallet_offences, OffencesBench::); - add_benchmark!(params, batches, pallet_proxy, Proxy); - add_benchmark!(params, batches, pallet_scheduler, Scheduler); - add_benchmark!(params, batches, pallet_session, SessionBench::); - add_benchmark!(params, batches, pallet_staking, Staking); - add_benchmark!(params, batches, frame_system, SystemBench::); - add_benchmark!(params, batches, pallet_timestamp, Timestamp); - add_benchmark!(params, batches, pallet_tips, Tips); - add_benchmark!(params, batches, pallet_treasury, Treasury); - add_benchmark!(params, batches, pallet_utility, Utility); - add_benchmark!(params, batches, pallet_vesting, Vesting); - - if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } - Ok(batches) - } - } -} - -#[cfg(test)] -mod test_fees { - use super::*; - use frame_support::weights::WeightToFeePolynomial; - use sp_runtime::FixedPointNumber; - use frame_support::weights::GetDispatchInfo; - use parity_scale_codec::Encode; - use pallet_transaction_payment::Multiplier; - use separator::Separatable; - - #[test] - fn payout_weight_portion() { - use pallet_staking::WeightInfo; - let payout_weight = - ::WeightInfo::payout_stakers_alive_staked( - MaxNominatorRewardedPerValidator::get(), - ) as f64; - let block_weight = BlockWeights::get().max_block as f64; - - println!( - "a full payout takes {:.2} of the block weight [{} / {}]", - payout_weight / block_weight, - payout_weight, - block_weight - ); - assert!(payout_weight * 2f64 < block_weight); - } - - #[test] - #[ignore] - fn block_cost() { - let max_block_weight = BlockWeights::get().max_block; - let raw_fee = WeightToFee::calc(&max_block_weight); - - println!( - "Full Block weight == {} // WeightToFee(full_block) == {} plank", - max_block_weight, - raw_fee.separated_string(), - ); - } - - #[test] - #[ignore] - fn transfer_cost_min_multiplier() { - let min_multiplier = runtime_common::MinimumMultiplier::get(); - let call = >::transfer_keep_alive(Default::default(), Default::default()); - let info = call.get_dispatch_info(); - // convert to outer call. - let call = Call::Balances(call); - let len = call.using_encoded(|e| e.len()) as u32; - - let mut ext = sp_io::TestExternalities::new_empty(); - let mut test_with_multiplier = |m| { - ext.execute_with(|| { - pallet_transaction_payment::NextFeeMultiplier::::put(m); - let fee = TransactionPayment::compute_fee(len, &info, 0); - println!( - "weight = {:?} // multiplier = {:?} // full transfer fee = {:?}", - info.weight.separated_string(), - pallet_transaction_payment::NextFeeMultiplier::::get(), - fee.separated_string(), - ); - }); - }; - - test_with_multiplier(min_multiplier); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000u128)); - test_with_multiplier(Multiplier::saturating_from_rational(1, 1_000_000_000u128)); - } - - #[test] - fn full_block_council_election_cost() { - // the number of voters needed to consume almost a full block in council election, and how - // much it is going to cost. - use pallet_elections_phragmen::WeightInfo; - - // Loser candidate lose a lot of money; sybil attack by candidates is even more expensive, - // and we don't care about it here. For now, we assume no extra candidates, and only - // superfluous voters. - let candidates = DesiredMembers::get() + DesiredRunnersUp::get(); - let mut voters = 1u32; - let weight_with = |v| { - ::WeightInfo::election_phragmen( - candidates, - v, - v * 16, - ) - }; - - while weight_with(voters) <= BlockWeights::get().max_block { - voters += 1; - } - - let cost = voters as Balance * (VotingBondBase::get() + 16 * VotingBondFactor::get()); - let cost_dollars = cost / DOLLARS; - println!( - "can support {} voters in a single block for council elections; total bond {}", - voters, - cost_dollars, - ); - assert!(cost_dollars > 150_000); // DOLLAR ~ new DOT ~ 10e10 - } - - #[test] - fn nominator_limit() { - use pallet_election_provider_multi_phase::WeightInfo; - // starting point of the nominators. - let target_voters: u32 = 50_000; - - // assuming we want around 5k candidates and 1k active validators. (March 31, 2021) - let all_targets: u32 = 5_000; - let desired: u32 = 1_000; - let weight_with = |active| { - ::WeightInfo::submit_unsigned( - active, - all_targets, - active, - desired, - ) - }; - - let mut active = target_voters; - while weight_with(active) <= OffchainSolutionWeightLimit::get() || active == target_voters { - active += 1; - } - - println!("can support {} nominators to yield a weight of {}", active, weight_with(active)); - assert!(active > target_voters, "we need to reevaluate the weight of the election system"); - } -} diff --git a/relay/polkadot/src/weights/frame_system.rs b/relay/polkadot/src/weights/frame_system.rs deleted file mode 100644 index e6c489b993..0000000000 --- a/relay/polkadot/src/weights/frame_system.rs +++ /dev/null @@ -1,81 +0,0 @@ -// 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 . -//! Autogenerated weights for frame_system -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=frame_system -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for frame_system. -pub struct WeightInfo(PhantomData); -impl frame_system::WeightInfo for WeightInfo { - fn remark(_b: u32, ) -> Weight { - (990_000 as Weight) - } - fn remark_with_event(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) - } - fn set_heap_pages() -> Weight { - (1_353_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_changes_trie_config() -> Weight { - (9_064_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn set_storage(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((546_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) - } - fn kill_storage(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((402_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) - } - fn kill_prefix(p: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((790_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) - } -} diff --git a/relay/polkadot/src/weights/mod.rs b/relay/polkadot/src/weights/mod.rs deleted file mode 100644 index 6f72ddc2d7..0000000000 --- a/relay/polkadot/src/weights/mod.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! A list of the different weight modules for our runtime. - -pub mod frame_system; -pub mod pallet_balances; -pub mod pallet_collective; -pub mod pallet_democracy; -pub mod pallet_elections_phragmen; -pub mod pallet_election_provider_multi_phase; -pub mod pallet_identity; -pub mod pallet_im_online; -pub mod pallet_indices; -pub mod pallet_membership; -pub mod pallet_multisig; -pub mod pallet_proxy; -pub mod pallet_scheduler; -pub mod pallet_session; -pub mod pallet_staking; -pub mod pallet_timestamp; -pub mod pallet_treasury; -pub mod pallet_utility; -pub mod pallet_vesting; -pub mod pallet_bounties; -pub mod pallet_tips; -pub mod runtime_common_claims; diff --git a/relay/polkadot/src/weights/pallet_balances.rs b/relay/polkadot/src/weights/pallet_balances.rs deleted file mode 100644 index fd39857ec6..0000000000 --- a/relay/polkadot/src/weights/pallet_balances.rs +++ /dev/null @@ -1,76 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_balances -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_balances -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_balances. -pub struct WeightInfo(PhantomData); -impl pallet_balances::WeightInfo for WeightInfo { - fn transfer() -> Weight { - (68_987_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer_keep_alive() -> Weight { - (50_696_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_creating() -> Weight { - (27_340_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_balance_killing() -> Weight { - (33_128_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_transfer() -> Weight { - (67_909_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn transfer_all() -> Weight { - (63_138_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_bounties.rs b/relay/polkadot/src/weights/pallet_bounties.rs deleted file mode 100644 index 08a7b17b88..0000000000 --- a/relay/polkadot/src/weights/pallet_bounties.rs +++ /dev/null @@ -1,107 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_bounties -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_bounties -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_bounties. -pub struct WeightInfo(PhantomData); -impl pallet_bounties::WeightInfo for WeightInfo { - fn propose_bounty(d: u32, ) -> Weight { - (41_122_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn approve_bounty() -> Weight { - (10_042_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn propose_curator() -> Weight { - (7_654_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn unassign_curator() -> Weight { - (50_121_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn accept_curator() -> Weight { - (34_663_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn award_bounty() -> Weight { - (23_054_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn claim_bounty() -> Weight { - (120_265_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - } - fn close_bounty_proposed() -> Weight { - (49_587_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn close_bounty_active() -> Weight { - (79_774_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn extend_bounty_expiry() -> Weight { - (22_533_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn spend_funds(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 14_000 - .saturating_add((57_405_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) - } -} diff --git a/relay/polkadot/src/weights/pallet_democracy.rs b/relay/polkadot/src/weights/pallet_democracy.rs deleted file mode 100644 index 6dcdf6a973..0000000000 --- a/relay/polkadot/src/weights/pallet_democracy.rs +++ /dev/null @@ -1,207 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_democracy -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_democracy -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_democracy. -pub struct WeightInfo(PhantomData); -impl pallet_democracy::WeightInfo for WeightInfo { - fn propose() -> Weight { - (55_166_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn second(s: u32, ) -> Weight { - (36_768_000 as Weight) - // Standard Error: 0 - .saturating_add((143_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)) - } - fn vote_new(r: u32, ) -> Weight { - (42_144_000 as Weight) - // Standard Error: 0 - .saturating_add((183_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn vote_existing(r: u32, ) -> Weight { - (42_316_000 as Weight) - // Standard Error: 0 - .saturating_add((174_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn emergency_cancel() -> Weight { - (26_501_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn blacklist(p: u32, ) -> Weight { - (73_883_000 as Weight) - // Standard Error: 4_000 - .saturating_add((460_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn external_propose(v: u32, ) -> Weight { - (12_461_000 as Weight) - // Standard Error: 0 - .saturating_add((78_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn external_propose_majority() -> Weight { - (2_393_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn external_propose_default() -> Weight { - (2_401_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn fast_track() -> Weight { - (25_767_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn veto_external(v: u32, ) -> Weight { - (26_834_000 as Weight) - // Standard Error: 0 - .saturating_add((116_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn cancel_proposal(p: u32, ) -> Weight { - (49_339_000 as Weight) - // Standard Error: 0 - .saturating_add((436_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn cancel_referendum() -> Weight { - (15_793_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn cancel_queued(r: u32, ) -> Weight { - (27_553_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_614_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn on_initialize_base(r: u32, ) -> Weight { - (6_724_000 as Weight) - // Standard Error: 4_000 - .saturating_add((5_014_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - } - fn delegate(r: u32, ) -> Weight { - (50_940_000 as Weight) - // Standard Error: 4_000 - .saturating_add((7_009_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - } - fn undelegate(r: u32, ) -> Weight { - (22_520_000 as Weight) - // Standard Error: 5_000 - .saturating_add((6_964_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) - } - fn clear_public_proposals() -> Weight { - (2_251_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn note_preimage(b: u32, ) -> Weight { - (40_109_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn note_imminent_preimage(b: u32, ) -> Weight { - (25_678_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn reap_preimage(b: u32, ) -> Weight { - (36_132_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn unlock_remove(r: u32, ) -> Weight { - (36_160_000 as Weight) - // Standard Error: 0 - .saturating_add((51_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn unlock_set(r: u32, ) -> Weight { - (33_706_000 as Weight) - // Standard Error: 0 - .saturating_add((165_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn remove_vote(r: u32, ) -> Weight { - (18_398_000 as Weight) - // Standard Error: 0 - .saturating_add((149_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_other_vote(r: u32, ) -> Weight { - (18_520_000 as Weight) - // Standard Error: 0 - .saturating_add((151_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_election_provider_multi_phase.rs b/relay/polkadot/src/weights/pallet_election_provider_multi_phase.rs deleted file mode 100644 index 81f7680364..0000000000 --- a/relay/polkadot/src/weights/pallet_election_provider_multi_phase.rs +++ /dev/null @@ -1,95 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_election_provider_multi_phase -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_election_provider_multi_phase -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_election_provider_multi_phase. -pub struct WeightInfo(PhantomData); -impl pallet_election_provider_multi_phase::WeightInfo for WeightInfo { - fn on_initialize_nothing() -> Weight { - (23_244_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - } - fn on_initialize_open_signed() -> Weight { - (82_453_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_initialize_open_unsigned_with_snapshot() -> Weight { - (81_883_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_initialize_open_unsigned_without_snapshot() -> Weight { - (17_601_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn elect_queued() -> Weight { - (5_408_539_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 15_000 - .saturating_add((3_352_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 52_000 - .saturating_add((150_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 15_000 - .saturating_add((10_531_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 78_000 - .saturating_add((3_302_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 10_000 - .saturating_add((3_365_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 34_000 - .saturating_add((295_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 10_000 - .saturating_add((8_438_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 52_000 - .saturating_add((3_606_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_elections_phragmen.rs b/relay/polkadot/src/weights/pallet_elections_phragmen.rs deleted file mode 100644 index 52ae5f90b9..0000000000 --- a/relay/polkadot/src/weights/pallet_elections_phragmen.rs +++ /dev/null @@ -1,127 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_elections_phragmen -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_elections_phragmen -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_elections_phragmen. -pub struct WeightInfo(PhantomData); -impl pallet_elections_phragmen::WeightInfo for WeightInfo { - fn vote_equal(v: u32, ) -> Weight { - (40_098_000 as Weight) - // Standard Error: 3_000 - .saturating_add((251_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vote_more(v: u32, ) -> Weight { - (62_907_000 as Weight) - // Standard Error: 5_000 - .saturating_add((244_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vote_less(v: u32, ) -> Weight { - (62_646_000 as Weight) - // Standard Error: 5_000 - .saturating_add((275_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_voter() -> Weight { - (57_669_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn submit_candidacy(c: u32, ) -> Weight { - (51_325_000 as Weight) - // Standard Error: 0 - .saturating_add((246_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn renounce_candidacy_candidate(c: u32, ) -> Weight { - (42_877_000 as Weight) - // Standard Error: 0 - .saturating_add((129_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn renounce_candidacy_members() -> Weight { - (65_943_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn renounce_candidacy_runners_up() -> Weight { - (45_901_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_member_with_replacement() -> Weight { - (84_434_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - } - fn remove_member_wrong_refund() -> Weight { - (6_294_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - fn clean_defunct_voters(v: u32, d: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 34_000 - .saturating_add((106_858_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 32_000 - .saturating_add((212_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) - } - fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 2_605_000 - .saturating_add((122_952_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 1_083_000 - .saturating_add((102_007_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 74_000 - .saturating_add((6_719_000 as Weight).saturating_mul(e as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c 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).saturating_mul(c as Weight))) - } -} diff --git a/relay/polkadot/src/weights/pallet_identity.rs b/relay/polkadot/src/weights/pallet_identity.rs deleted file mode 100644 index e30e902f71..0000000000 --- a/relay/polkadot/src/weights/pallet_identity.rs +++ /dev/null @@ -1,179 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_identity -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_identity -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_identity. -pub struct WeightInfo(PhantomData); -impl pallet_identity::WeightInfo for WeightInfo { - fn add_registrar(r: u32, ) -> Weight { - (20_387_000 as Weight) - // Standard Error: 2_000 - .saturating_add((201_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_identity(r: u32, x: u32, ) -> Weight { - (50_833_000 as Weight) - // Standard Error: 14_000 - .saturating_add((180_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 1_000 - .saturating_add((936_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_subs_new(s: u32, ) -> Weight { - (38_886_000 as Weight) - // Standard Error: 2_000 - .saturating_add((6_241_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn set_subs_old(p: u32, ) -> Weight { - (39_842_000 as Weight) - // Standard Error: 0 - .saturating_add((2_003_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) - } - fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { - (48_868_000 as Weight) - // Standard Error: 11_000 - .saturating_add((159_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 1_000 - .saturating_add((2_003_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 1_000 - .saturating_add((597_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn request_judgement(r: u32, x: u32, ) -> Weight { - (52_307_000 as Weight) - // Standard Error: 5_000 - .saturating_add((221_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_168_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn cancel_request(r: u32, x: u32, ) -> Weight { - (47_911_000 as Weight) - // Standard Error: 7_000 - .saturating_add((163_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_130_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_fee(r: u32, ) -> Weight { - (7_595_000 as Weight) - // Standard Error: 1_000 - .saturating_add((159_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_account_id(r: u32, ) -> Weight { - (8_265_000 as Weight) - // Standard Error: 1_000 - .saturating_add((161_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_fields(r: u32, ) -> Weight { - (7_644_000 as Weight) - // Standard Error: 1_000 - .saturating_add((157_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn provide_judgement(r: u32, x: u32, ) -> Weight { - (33_454_000 as Weight) - // Standard Error: 5_000 - .saturating_add((202_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((1_143_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight { - (63_116_000 as Weight) - // Standard Error: 4_000 - .saturating_add((54_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((2_003_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn add_sub(s: u32, ) -> Weight { - (52_871_000 as Weight) - // Standard Error: 0 - .saturating_add((141_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn rename_sub(s: u32, ) -> Weight { - (16_359_000 as Weight) - // Standard Error: 0 - .saturating_add((21_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_sub(s: u32, ) -> Weight { - (54_147_000 as Weight) - // Standard Error: 0 - .saturating_add((122_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn quit_sub(s: u32, ) -> Weight { - (33_116_000 as Weight) - // Standard Error: 0 - .saturating_add((122_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_im_online.rs b/relay/polkadot/src/weights/pallet_im_online.rs deleted file mode 100644 index 803a819723..0000000000 --- a/relay/polkadot/src/weights/pallet_im_online.rs +++ /dev/null @@ -1,55 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_im_online -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_im_online -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_im_online. -pub struct WeightInfo(PhantomData); -impl pallet_im_online::WeightInfo for WeightInfo { - fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { - (88_108_000 as Weight) - // Standard Error: 0 - .saturating_add((162_000 as Weight).saturating_mul(k as Weight)) - // Standard Error: 2_000 - .saturating_add((314_000 as Weight).saturating_mul(e as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_indices.rs b/relay/polkadot/src/weights/pallet_indices.rs deleted file mode 100644 index 4b799601b1..0000000000 --- a/relay/polkadot/src/weights/pallet_indices.rs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_indices -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_indices -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_indices. -pub struct WeightInfo(PhantomData); -impl pallet_indices::WeightInfo for WeightInfo { - fn claim() -> Weight { - (38_147_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer() -> Weight { - (46_258_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn free() -> Weight { - (38_012_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_transfer() -> Weight { - (38_762_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn freeze() -> Weight { - (36_160_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_membership.rs b/relay/polkadot/src/weights/pallet_membership.rs deleted file mode 100644 index b4892d3d66..0000000000 --- a/relay/polkadot/src/weights/pallet_membership.rs +++ /dev/null @@ -1,92 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_membership -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_membership -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_membership. -pub struct WeightInfo(PhantomData); -impl pallet_membership::WeightInfo for WeightInfo { - fn add_member(m: u32, ) -> Weight { - (22_281_000 as Weight) - // Standard Error: 1_000 - .saturating_add((121_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn remove_member(m: u32, ) -> Weight { - (27_105_000 as Weight) - // Standard Error: 0 - .saturating_add((96_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn swap_member(m: u32, ) -> Weight { - (27_225_000 as Weight) - // Standard Error: 0 - .saturating_add((110_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn reset_member(m: u32, ) -> Weight { - (27_835_000 as Weight) - // Standard Error: 0 - .saturating_add((264_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn change_key(m: u32, ) -> Weight { - (28_699_000 as Weight) - // Standard Error: 0 - .saturating_add((108_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn set_prime(m: u32, ) -> Weight { - (6_983_000 as Weight) - // Standard Error: 0 - .saturating_add((78_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn clear_prime(_m: u32, ) -> Weight { - (2_735_000 as Weight) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_multisig.rs b/relay/polkadot/src/weights/pallet_multisig.rs deleted file mode 100644 index 52d90bc642..0000000000 --- a/relay/polkadot/src/weights/pallet_multisig.rs +++ /dev/null @@ -1,122 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_multisig -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_multisig -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_multisig. -pub struct WeightInfo(PhantomData); -impl pallet_multisig::WeightInfo for WeightInfo { - fn as_multi_threshold_1(_z: u32, ) -> Weight { - (8_469_000 as Weight) - } - fn as_multi_create(s: u32, z: u32, ) -> Weight { - (48_033_000 as Weight) - // Standard Error: 0 - .saturating_add((87_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn as_multi_create_store(s: u32, z: u32, ) -> Weight { - (53_076_000 as Weight) - // Standard Error: 0 - .saturating_add((91_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn as_multi_approve(s: u32, z: u32, ) -> Weight { - (27_924_000 as Weight) - // Standard Error: 0 - .saturating_add((87_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn as_multi_approve_store(s: u32, z: u32, ) -> Weight { - (50_732_000 as Weight) - // Standard Error: 0 - .saturating_add((102_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn as_multi_complete(s: u32, z: u32, ) -> Weight { - (64_066_000 as Weight) - // Standard Error: 0 - .saturating_add((196_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn approve_as_multi_create(s: u32, ) -> Weight { - (47_877_000 as Weight) - // Standard Error: 0 - .saturating_add((86_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn approve_as_multi_approve(s: u32, ) -> Weight { - (27_217_000 as Weight) - // Standard Error: 0 - .saturating_add((87_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)) - } - fn approve_as_multi_complete(s: u32, ) -> Weight { - (108_186_000 as Weight) - // Standard Error: 0 - .saturating_add((196_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn cancel_as_multi(s: u32, ) -> Weight { - (80_428_000 as Weight) - // Standard Error: 0 - .saturating_add((83_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_proxy.rs b/relay/polkadot/src/weights/pallet_proxy.rs deleted file mode 100644 index bfb932c3a9..0000000000 --- a/relay/polkadot/src/weights/pallet_proxy.rs +++ /dev/null @@ -1,119 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_proxy -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_proxy -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_proxy. -pub struct WeightInfo(PhantomData); -impl pallet_proxy::WeightInfo for WeightInfo { - fn proxy(p: u32, ) -> Weight { - (21_441_000 as Weight) - // Standard Error: 1_000 - .saturating_add((124_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - fn proxy_announced(a: u32, p: u32, ) -> Weight { - (50_942_000 as Weight) - // Standard Error: 1_000 - .saturating_add((495_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((100_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn remove_announcement(a: u32, _p: u32, ) -> Weight { - (35_895_000 as Weight) - // Standard Error: 1_000 - .saturating_add((485_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn reject_announcement(a: u32, _p: u32, ) -> Weight { - (35_800_000 as Weight) - // Standard Error: 1_000 - .saturating_add((488_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn announce(a: u32, p: u32, ) -> Weight { - (48_613_000 as Weight) - // Standard Error: 2_000 - .saturating_add((498_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((106_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn add_proxy(p: u32, ) -> Weight { - (34_308_000 as Weight) - // Standard Error: 1_000 - .saturating_add((176_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_proxy(p: u32, ) -> Weight { - (33_775_000 as Weight) - // Standard Error: 2_000 - .saturating_add((206_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_proxies(p: u32, ) -> Weight { - (32_306_000 as Weight) - // Standard Error: 1_000 - .saturating_add((130_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn anonymous(p: u32, ) -> Weight { - (45_964_000 as Weight) - // Standard Error: 1_000 - .saturating_add((31_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn kill_anonymous(p: u32, ) -> Weight { - (33_990_000 as Weight) - // Standard Error: 1_000 - .saturating_add((132_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_scheduler.rs b/relay/polkadot/src/weights/pallet_scheduler.rs deleted file mode 100644 index 17564ec684..0000000000 --- a/relay/polkadot/src/weights/pallet_scheduler.rs +++ /dev/null @@ -1,74 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_scheduler -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_scheduler -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_scheduler. -pub struct WeightInfo(PhantomData); -impl pallet_scheduler::WeightInfo for WeightInfo { - fn schedule(s: u32, ) -> Weight { - (22_755_000 as Weight) - // Standard Error: 0 - .saturating_add((47_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)) - } - fn cancel(s: u32, ) -> Weight { - (22_112_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_354_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn schedule_named(s: u32, ) -> Weight { - (29_156_000 as Weight) - // Standard Error: 1_000 - .saturating_add((64_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn cancel_named(s: u32, ) -> Weight { - (24_505_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_376_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_session.rs b/relay/polkadot/src/weights/pallet_session.rs deleted file mode 100644 index cd2aa13953..0000000000 --- a/relay/polkadot/src/weights/pallet_session.rs +++ /dev/null @@ -1,56 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_session -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_session -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_session. -pub struct WeightInfo(PhantomData); -impl pallet_session::WeightInfo for WeightInfo { - fn set_keys() -> Weight { - (68_529_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } - fn purge_keys() -> Weight { - (38_184_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_staking.rs b/relay/polkadot/src/weights/pallet_staking.rs deleted file mode 100644 index b233c567ef..0000000000 --- a/relay/polkadot/src/weights/pallet_staking.rs +++ /dev/null @@ -1,230 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_staking -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_staking -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_staking. -pub struct WeightInfo(PhantomData); -impl pallet_staking::WeightInfo for WeightInfo { - fn bond() -> Weight { - (66_434_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn bond_extra() -> Weight { - (51_531_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn unbond() -> Weight { - (54_336_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn withdraw_unbonded_update(s: u32, ) -> Weight { - (47_505_000 as Weight) - // Standard Error: 0 - .saturating_add((24_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)) - } - fn withdraw_unbonded_kill(s: u32, ) -> Weight { - (77_865_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_194_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn validate() -> Weight { - (28_555_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn kick(k: u32, ) -> Weight { - (10_886_000 as Weight) - // Standard Error: 6_000 - .saturating_add((15_538_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))) - } - fn nominate(n: u32, ) -> Weight { - (34_708_000 as Weight) - // Standard Error: 9_000 - .saturating_add((5_034_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn chill() -> Weight { - (15_837_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - } - fn set_payee() -> Weight { - (10_696_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_controller() -> Weight { - (23_482_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn set_validator_count() -> Weight { - (1_815_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_no_eras() -> Weight { - (2_048_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era() -> Weight { - (2_052_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_new_era_always() -> Weight { - (2_047_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_invulnerables(v: u32, ) -> Weight { - (1_969_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_unstake(s: u32, ) -> Weight { - (54_672_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_189_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn cancel_deferred_slash(s: u32, ) -> Weight { - (3_374_694_000 as Weight) - // Standard Error: 221_000 - .saturating_add((19_788_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)) - } - fn payout_stakers_dead_controller(n: u32, ) -> Weight { - (95_732_000 as Weight) - // Standard Error: 17_000 - .saturating_add((45_189_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)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight))) - } - fn payout_stakers_alive_staked(n: u32, ) -> Weight { - (123_745_000 as Weight) - // Standard Error: 22_000 - .saturating_add((58_409_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)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight))) - } - fn rebond(l: u32, ) -> Weight { - (44_585_000 as Weight) - // Standard Error: 1_000 - .saturating_add((63_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn set_history_depth(e: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 69_000 - .saturating_add((31_931_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))) - } - fn reap_stash(s: u32, ) -> Weight { - (65_438_000 as Weight) - // Standard Error: 0 - .saturating_add((2_182_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) - } - fn new_era(v: u32, n: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 786_000 - .saturating_add((286_767_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 39_000 - .saturating_add((46_380_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(v as Weight))) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight))) - } - fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 93_000 - .saturating_add((23_941_000 as Weight).saturating_mul(v as Weight)) - // Standard Error: 93_000 - .saturating_add((26_505_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 3_172_000 - .saturating_add((25_012_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(v as Weight))) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - } - fn get_npos_targets(v: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 31_000 - .saturating_add((10_079_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight))) - } - fn update_staking_limits() -> Weight { - (4_524_000 as Weight) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn chill_other() -> Weight { - (30_191_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_timestamp.rs b/relay/polkadot/src/weights/pallet_timestamp.rs deleted file mode 100644 index 53a369db2f..0000000000 --- a/relay/polkadot/src/weights/pallet_timestamp.rs +++ /dev/null @@ -1,54 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_timestamp -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_timestamp -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_timestamp. -pub struct WeightInfo(PhantomData); -impl pallet_timestamp::WeightInfo for WeightInfo { - fn set() -> Weight { - (9_868_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_finalize() -> Weight { - (4_337_000 as Weight) - } -} diff --git a/relay/polkadot/src/weights/pallet_tips.rs b/relay/polkadot/src/weights/pallet_tips.rs deleted file mode 100644 index 157148b261..0000000000 --- a/relay/polkadot/src/weights/pallet_tips.rs +++ /dev/null @@ -1,88 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_tips -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_tips -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_tips. -pub struct WeightInfo(PhantomData); -impl pallet_tips::WeightInfo for WeightInfo { - fn report_awesome(r: u32, ) -> Weight { - (45_075_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn retract_tip() -> Weight { - (42_197_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn tip_new(r: u32, t: u32, ) -> Weight { - (27_673_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 0 - .saturating_add((117_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn tip(t: u32, ) -> Weight { - (17_648_000 as Weight) - // Standard Error: 0 - .saturating_add((536_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn close_tip(t: u32, ) -> Weight { - (77_210_000 as Weight) - // Standard Error: 0 - .saturating_add((301_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn slash_tip(t: u32, ) -> Weight { - (22_593_000 as Weight) - // Standard Error: 0 - .saturating_add((6_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_treasury.rs b/relay/polkadot/src/weights/pallet_treasury.rs deleted file mode 100644 index 3b37e87370..0000000000 --- a/relay/polkadot/src/weights/pallet_treasury.rs +++ /dev/null @@ -1,72 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_treasury -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_treasury -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_treasury. -pub struct WeightInfo(PhantomData); -impl pallet_treasury::WeightInfo for WeightInfo { - fn propose_spend() -> Weight { - (37_918_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn reject_proposal() -> Weight { - (47_245_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn approve_proposal(p: u32, ) -> Weight { - (11_005_000 as Weight) - // Standard Error: 0 - .saturating_add((35_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn on_initialize_proposals(p: u32, ) -> Weight { - (38_570_000 as Weight) - // Standard Error: 15_000 - .saturating_add((56_410_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) - } -} diff --git a/relay/polkadot/src/weights/pallet_utility.rs b/relay/polkadot/src/weights/pallet_utility.rs deleted file mode 100644 index 7c81ce2a7a..0000000000 --- a/relay/polkadot/src/weights/pallet_utility.rs +++ /dev/null @@ -1,59 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_utility -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_utility -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_utility. -pub struct WeightInfo(PhantomData); -impl pallet_utility::WeightInfo for WeightInfo { - fn batch(c: u32, ) -> Weight { - (13_742_000 as Weight) - // Standard Error: 0 - .saturating_add((607_000 as Weight).saturating_mul(c as Weight)) - } - fn as_derivative() -> Weight { - (3_045_000 as Weight) - } - fn batch_all(c: u32, ) -> Weight { - (13_513_000 as Weight) - // Standard Error: 0 - .saturating_add((1_026_000 as Weight).saturating_mul(c as Weight)) - } -} diff --git a/relay/polkadot/src/weights/pallet_vesting.rs b/relay/polkadot/src/weights/pallet_vesting.rs deleted file mode 100644 index bfef0b1268..0000000000 --- a/relay/polkadot/src/weights/pallet_vesting.rs +++ /dev/null @@ -1,88 +0,0 @@ -// 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 . -//! Autogenerated weights for pallet_vesting -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_vesting -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for pallet_vesting. -pub struct WeightInfo(PhantomData); -impl pallet_vesting::WeightInfo for WeightInfo { - fn vest_locked(l: u32, ) -> Weight { - (40_549_000 as Weight) - // Standard Error: 7_000 - .saturating_add((162_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn vest_unlocked(l: u32, ) -> Weight { - (43_713_000 as Weight) - // Standard Error: 4_000 - .saturating_add((129_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vest_other_locked(l: u32, ) -> Weight { - (40_331_000 as Weight) - // Standard Error: 7_000 - .saturating_add((154_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn vest_other_unlocked(l: u32, ) -> Weight { - (43_179_000 as Weight) - // Standard Error: 4_000 - .saturating_add((130_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn vested_transfer(l: u32, ) -> Weight { - (92_890_000 as Weight) - // Standard Error: 5_000 - .saturating_add((156_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn force_vested_transfer(l: u32, ) -> Weight { - (92_001_000 as Weight) - // Standard Error: 5_000 - .saturating_add((155_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } -} diff --git a/relay/polkadot/src/weights/runtime_common_claims.rs b/relay/polkadot/src/weights/runtime_common_claims.rs deleted file mode 100644 index 3b5047ea94..0000000000 --- a/relay/polkadot/src/weights/runtime_common_claims.rs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 . -//! Autogenerated weights for runtime_common::claims -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 -//! DATE: 2021-06-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128 - -// Executed Command: -// target/release/polkadot -// benchmark -// --chain=polkadot-dev -// --steps=50 -// --repeat=20 -// --pallet=runtime_common::claims -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for runtime_common::claims. -pub struct WeightInfo(PhantomData); -impl runtime_common::claims::WeightInfo for WeightInfo { - fn claim() -> Weight { - (435_155_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn mint_claim() -> Weight { - (11_642_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn claim_attest() -> Weight { - (437_198_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn attest() -> Weight { - (124_628_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } - fn move_claim() -> Weight { - (25_441_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - } -}