From ec751f8fca2464fe838aab323ed1918e2ea8c847 Mon Sep 17 00:00:00 2001 From: Squirrel Date: Fri, 21 Jan 2022 08:11:01 +0000 Subject: [PATCH] merge of: Add system weights to Statemint (#762) (#918) * Add system weights to Statemint (#762) * waiting for weights from bm * frame_system weights added * cargo toml fix + fmt * removed non-existent set_changes_trie_config Co-authored-by: Ignacio Palacios --- polkadot-parachains/statemine/src/lib.rs | 2 +- .../statemine/src/weights/frame_system.rs | 86 +++++++++++++++++++ .../statemine/src/weights/mod.rs | 1 + polkadot-parachains/statemint/src/lib.rs | 2 +- .../statemint/src/weights/frame_system.rs | 86 +++++++++++++++++++ .../statemint/src/weights/mod.rs | 1 + polkadot-parachains/westmint/src/lib.rs | 2 +- .../westmint/src/weights/frame_system.rs | 86 +++++++++++++++++++ .../westmint/src/weights/mod.rs | 1 + scripts/benchmarks.sh | 1 + 10 files changed, 265 insertions(+), 3 deletions(-) create mode 100644 polkadot-parachains/statemine/src/weights/frame_system.rs create mode 100644 polkadot-parachains/statemint/src/weights/frame_system.rs create mode 100644 polkadot-parachains/westmint/src/weights/frame_system.rs diff --git a/polkadot-parachains/statemine/src/lib.rs b/polkadot-parachains/statemine/src/lib.rs index e672dc495a..368f4a5ea3 100644 --- a/polkadot-parachains/statemine/src/lib.rs +++ b/polkadot-parachains/statemine/src/lib.rs @@ -151,7 +151,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type AccountData = pallet_balances::AccountData; - type SystemWeightInfo = (); + type SystemWeightInfo = weights::frame_system::WeightInfo; type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; diff --git a/polkadot-parachains/statemine/src/weights/frame_system.rs b/polkadot-parachains/statemine/src/weights/frame_system.rs new file mode 100644 index 0000000000..9081090b63 --- /dev/null +++ b/polkadot-parachains/statemine/src/weights/frame_system.rs @@ -0,0 +1,86 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/polkadot-collator +// benchmark +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=frame_system +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --raw +// --header=./file_header.txt +// --output=./polkadot-parachains/statemine/src/weights + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `frame_system`. +pub struct WeightInfo(PhantomData); +impl frame_system::WeightInfo for WeightInfo { + fn remark(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + } + fn remark_with_event(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + (4_791_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn set_storage(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((737_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_storage(i: u32, ) -> Weight { + (1_312_000 as Weight) + // Standard Error: 0 + .saturating_add((496_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_prefix(p: u32, ) -> Weight { + (3_976_000 as Weight) + // Standard Error: 1_000 + .saturating_add((737_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/polkadot-parachains/statemine/src/weights/mod.rs b/polkadot-parachains/statemine/src/weights/mod.rs index 90afa8388a..487bd01819 100644 --- a/polkadot-parachains/statemine/src/weights/mod.rs +++ b/polkadot-parachains/statemine/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; pub mod pallet_collator_selection; diff --git a/polkadot-parachains/statemint/src/lib.rs b/polkadot-parachains/statemint/src/lib.rs index c7c7200181..b83752e267 100644 --- a/polkadot-parachains/statemint/src/lib.rs +++ b/polkadot-parachains/statemint/src/lib.rs @@ -163,7 +163,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type AccountData = pallet_balances::AccountData; - type SystemWeightInfo = (); + type SystemWeightInfo = weights::frame_system::WeightInfo; type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; diff --git a/polkadot-parachains/statemint/src/weights/frame_system.rs b/polkadot-parachains/statemint/src/weights/frame_system.rs new file mode 100644 index 0000000000..685423ad5a --- /dev/null +++ b/polkadot-parachains/statemint/src/weights/frame_system.rs @@ -0,0 +1,86 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/polkadot-collator +// benchmark +// --chain=statemint-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=frame_system +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --raw +// --header=./file_header.txt +// --output=./polkadot-parachains/statemint/src/weights + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `frame_system`. +pub struct WeightInfo(PhantomData); +impl frame_system::WeightInfo for WeightInfo { + fn remark(b: u32, ) -> Weight { + (814_000 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + } + fn remark_with_event(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + (4_802_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn set_storage(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((740_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_storage(i: u32, ) -> Weight { + (1_709_000 as Weight) + // Standard Error: 0 + .saturating_add((497_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_prefix(p: u32, ) -> Weight { + (4_520_000 as Weight) + // Standard Error: 0 + .saturating_add((732_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/polkadot-parachains/statemint/src/weights/mod.rs b/polkadot-parachains/statemint/src/weights/mod.rs index 90afa8388a..487bd01819 100644 --- a/polkadot-parachains/statemint/src/weights/mod.rs +++ b/polkadot-parachains/statemint/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; pub mod pallet_collator_selection; diff --git a/polkadot-parachains/westmint/src/lib.rs b/polkadot-parachains/westmint/src/lib.rs index 89963675dc..9521ea8305 100644 --- a/polkadot-parachains/westmint/src/lib.rs +++ b/polkadot-parachains/westmint/src/lib.rs @@ -151,7 +151,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type AccountData = pallet_balances::AccountData; - type SystemWeightInfo = (); + type SystemWeightInfo = weights::frame_system::WeightInfo; type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; diff --git a/polkadot-parachains/westmint/src/weights/frame_system.rs b/polkadot-parachains/westmint/src/weights/frame_system.rs new file mode 100644 index 0000000000..c4bf8beb0b --- /dev/null +++ b/polkadot-parachains/westmint/src/weights/frame_system.rs @@ -0,0 +1,86 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus 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. + +// Cumulus 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 Cumulus. If not, see . + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westmint-dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/polkadot-collator +// benchmark +// --chain=westmint-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=frame_system +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --raw +// --header=./file_header.txt +// --output=./polkadot-parachains/westmint/src/weights + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `frame_system`. +pub struct WeightInfo(PhantomData); +impl frame_system::WeightInfo for WeightInfo { + fn remark(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + } + fn remark_with_event(b: u32, ) -> Weight { + (606_000 as Weight) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + (4_704_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn set_storage(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((770_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_storage(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 0 + .saturating_add((510_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_prefix(p: u32, ) -> Weight { + (3_350_000 as Weight) + // Standard Error: 1_000 + .saturating_add((739_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/polkadot-parachains/westmint/src/weights/mod.rs b/polkadot-parachains/westmint/src/weights/mod.rs index 90afa8388a..487bd01819 100644 --- a/polkadot-parachains/westmint/src/weights/mod.rs +++ b/polkadot-parachains/westmint/src/weights/mod.rs @@ -1,3 +1,4 @@ +pub mod frame_system; pub mod pallet_assets; pub mod pallet_balances; pub mod pallet_collator_selection; diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index 6bcb2d3980..2cd207a103 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -21,6 +21,7 @@ pallets=( pallet_timestamp pallet_utility pallet_uniques + frame_system ) for p in ${pallets[@]}