diff --git a/.github/workflows/generate_calamari_weights_files.yml b/.github/workflows/generate_calamari_weights_files.yml index b2f76ddaf..84ea76016 100644 --- a/.github/workflows/generate_calamari_weights_files.yml +++ b/.github/workflows/generate_calamari_weights_files.yml @@ -107,58 +107,66 @@ jobs: - extrinsic: id: '*' - name: pallet_democracy + name: calamari_vesting pallet: - id: pallet_democracy - name: pallet_democracy + id: calamari_vesting + name: calamari_vesting iterations: 20 - extrinsic: id: '*' - name: pallet_collective + name: frame_system pallet: - id: pallet_collective - name: pallet_collective + id: frame_system + name: frame_system iterations: 20 - extrinsic: id: '*' - name: pallet_membership + name: pallet_balances pallet: - id: pallet_membership - name: pallet_membership + id: pallet_balances + name: pallet_balances iterations: 20 - extrinsic: id: '*' - name: pallet_scheduler + name: pallet_collective pallet: - id: pallet_scheduler - name: pallet_scheduler + id: pallet_collective + name: pallet_collective iterations: 20 - extrinsic: id: '*' - name: pallet_balances + name: pallet_democracy pallet: - id: pallet_balances - name: pallet_balances + id: pallet_democracy + name: pallet_democracy iterations: 20 - extrinsic: id: '*' - name: calamari_vesting + name: pallet_membership pallet: - id: calamari_vesting - name: calamari_vesting + id: pallet_membership + name: pallet_membership iterations: 20 - extrinsic: id: '*' - name: frame_system + name: pallet_multisig pallet: - id: frame_system - name: frame_system + id: pallet_multisig + name: pallet_multisig + iterations: 20 + - + extrinsic: + id: '*' + name: pallet_scheduler + pallet: + id: pallet_scheduler + name: pallet_scheduler iterations: 20 - extrinsic: @@ -179,10 +187,10 @@ jobs: - extrinsic: id: '*' - name: pallet_multisig + name: pallet_utility pallet: - id: pallet_multisig - name: pallet_multisig + id: pallet_utility + name: pallet_utility iterations: 20 steps: - diff --git a/runtime/calamari/src/lib.rs b/runtime/calamari/src/lib.rs index e4f1f3158..066a9b114 100644 --- a/runtime/calamari/src/lib.rs +++ b/runtime/calamari/src/lib.rs @@ -107,7 +107,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("calamari"), impl_name: create_runtime_str!("calamari"), authoring_version: 1, - spec_version: 3100, + spec_version: 3101, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -221,9 +221,9 @@ impl Contains for BaseFilter { | Call::TechnicalMembership(_) | Call::Scheduler(_) | Call::CalamariVesting(_) - | Call::Balances(_) => true, + | Call::Balances(_) + | Call::Utility(_) => true, _ => false, - // Filter Utility to prevent users from setting keys and selecting collator for parachain (couldn't use now). // Filter Session and CollatorSelection to prevent users from utility operation. // Filter XCM pallet. } @@ -333,7 +333,7 @@ impl pallet_multisig::Config for Runtime { impl pallet_utility::Config for Runtime { type Event = Event; type Call = Call; - type WeightInfo = pallet_utility::weights::SubstrateWeight; + type WeightInfo = weights::pallet_utility::SubstrateWeight; } impl pallet_sudo::Config for Runtime { diff --git a/runtime/calamari/src/weights/mod.rs b/runtime/calamari/src/weights/mod.rs index 62e060e38..277c49aba 100644 --- a/runtime/calamari/src/weights/mod.rs +++ b/runtime/calamari/src/weights/mod.rs @@ -26,3 +26,4 @@ pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; pub mod pallet_tx_pause; +pub mod pallet_utility; diff --git a/runtime/calamari/src/weights/pallet_utility.rs b/runtime/calamari/src/weights/pallet_utility.rs new file mode 100644 index 000000000..6c941a32d --- /dev/null +++ b/runtime/calamari/src/weights/pallet_utility.rs @@ -0,0 +1,85 @@ +// Copyright 2020-2021 Manta Network. +// This file is part of Manta. + +// Manta 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. + +// Manta 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 Manta. If not, see . + +//! Autogenerated weights for pallet_utility +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-26, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("calamari-dev"), DB CACHE: 128 + +// Executed Command: +// manta +// benchmark +// --chain=calamari-dev +// --pallet=pallet_utility +// --extrinsic=* +// --execution=Wasm +// --wasm-execution=Compiled +// --heap-pages=4096 +// --repeat=20 +// --steps=50 +// --template=.github/resources/frame-weight-template.hbs +// --output=pallet_utility.rs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_utility. +pub trait WeightInfo { + fn batch(c: u32, ) -> Weight; + fn as_derivative() -> Weight; + fn batch_all(c: u32, ) -> Weight; +} + +/// Weights for pallet_utility using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl pallet_utility::WeightInfo for SubstrateWeight { + fn batch(c: u32, ) -> Weight { + (43_160_000 as Weight) + // Standard Error: 6_000 + .saturating_add((14_311_000 as Weight).saturating_mul(c as Weight)) + } + fn as_derivative() -> Weight { + (7_671_000 as Weight) + } + fn batch_all(c: u32, ) -> Weight { + (26_924_000 as Weight) + // Standard Error: 4_000 + .saturating_add((15_469_000 as Weight).saturating_mul(c as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn batch(c: u32, ) -> Weight { + (43_160_000 as Weight) + // Standard Error: 6_000 + .saturating_add((14_311_000 as Weight).saturating_mul(c as Weight)) + } + fn as_derivative() -> Weight { + (7_671_000 as Weight) + } + fn batch_all(c: u32, ) -> Weight { + (26_924_000 as Weight) + // Standard Error: 4_000 + .saturating_add((15_469_000 as Weight).saturating_mul(c as Weight)) + } +} diff --git a/runtime/manta/src/lib.rs b/runtime/manta/src/lib.rs index 6fc977d44..39db0ab70 100644 --- a/runtime/manta/src/lib.rs +++ b/runtime/manta/src/lib.rs @@ -106,7 +106,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("manta"), impl_name: create_runtime_str!("manta"), authoring_version: 1, - spec_version: 3100, + spec_version: 3101, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,