From 6c038d6f5b573f157eb3b16cded40ebddce15ab6 Mon Sep 17 00:00:00 2001 From: yooml Date: Mon, 16 Aug 2021 19:42:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20bifrost.weight?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 5 + runtime/bifrost/Cargo.toml | 11 +- runtime/bifrost/src/lib.rs | 47 ++++++-- runtime/bifrost/src/weights/mod.rs | 7 ++ .../bifrost/src/weights/pallet_balances.rs | 79 +++++++++++++ .../bifrost/src/weights/pallet_bounties.rs | 110 ++++++++++++++++++ runtime/bifrost/src/weights/pallet_indices.rs | 74 ++++++++++++ .../bifrost/src/weights/pallet_scheduler.rs | 77 ++++++++++++ .../bifrost/src/weights/pallet_timestamp.rs | 57 +++++++++ .../bifrost/src/weights/pallet_treasury.rs | 75 ++++++++++++ runtime/bifrost/src/weights/pallet_utility.rs | 66 +++++++++++ 11 files changed, 598 insertions(+), 10 deletions(-) create mode 100644 runtime/bifrost/src/weights/pallet_balances.rs create mode 100644 runtime/bifrost/src/weights/pallet_bounties.rs create mode 100644 runtime/bifrost/src/weights/pallet_indices.rs create mode 100644 runtime/bifrost/src/weights/pallet_scheduler.rs create mode 100644 runtime/bifrost/src/weights/pallet_timestamp.rs create mode 100644 runtime/bifrost/src/weights/pallet_treasury.rs create mode 100644 runtime/bifrost/src/weights/pallet_utility.rs diff --git a/Cargo.lock b/Cargo.lock index 1c374dafd..3e34e1fe2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5424,6 +5424,7 @@ name = "pallet-bounties" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#74101dc21cfffb4c2d014fcc28edc166d5ca1b16" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-treasury", @@ -5576,6 +5577,7 @@ name = "pallet-indices" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#74101dc21cfffb4c2d014fcc28edc166d5ca1b16" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -5816,6 +5818,7 @@ dependencies = [ "log", "parity-scale-codec", "sp-inherents", + "sp-io", "sp-runtime", "sp-std", "sp-timestamp", @@ -5884,6 +5887,7 @@ name = "pallet-treasury" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#74101dc21cfffb4c2d014fcc28edc166d5ca1b16" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", @@ -5899,6 +5903,7 @@ name = "pallet-utility" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#74101dc21cfffb4c2d014fcc28edc166d5ca1b16" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", diff --git a/runtime/bifrost/Cargo.toml b/runtime/bifrost/Cargo.toml index 8c160a24b..62324a5a6 100644 --- a/runtime/bifrost/Cargo.toml +++ b/runtime/bifrost/Cargo.toml @@ -94,6 +94,7 @@ std = [ "frame-system/std", "node-primitives/std", "pallet-balances/std", + "pallet-bounties/std", "pallet-collective/std", "pallet-democracy/std", "pallet-indices/std", @@ -102,6 +103,7 @@ std = [ "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", + "pallet-treasury/std", "sp-api/std", "sp-arithmetic/std", "sp-block-builder/std", @@ -139,10 +141,17 @@ runtime-benchmarks = [ "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-bounties/runtime-benchmarks", "pallet-collective/runtime-benchmarks", + "pallet-indices/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", ] try-runtime = [ diff --git a/runtime/bifrost/src/lib.rs b/runtime/bifrost/src/lib.rs index 758464358..074527fde 100644 --- a/runtime/bifrost/src/lib.rs +++ b/runtime/bifrost/src/lib.rs @@ -155,8 +155,9 @@ impl Filter for CallFilter { Call::Tokens(orml_tokens::Call::::transfer(..)) => false, Call::Tokens(orml_tokens::Call::::transfer_all(..)) => false, Call::Currencies(orml_currencies::Call::::transfer(..)) => false, - Call::Currencies(orml_currencies::Call::::transfer_native_currency(..)) => - false, + Call::Currencies(orml_currencies::Call::::transfer_native_currency(..)) => { + false + } _ => true, } } @@ -216,7 +217,7 @@ impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = Moment; type OnTimestampSet = (); - type WeightInfo = pallet_timestamp::weights::SubstrateWeight; + type WeightInfo = weights::pallet_timestamp::WeightInfo; } parameter_types! { @@ -231,7 +232,7 @@ parameter_types! { impl pallet_utility::Config for Runtime { type Call = Call; type Event = Event; - type WeightInfo = pallet_utility::weights::SubstrateWeight; + type WeightInfo = weights::pallet_utility::WeightInfo; } parameter_types! { @@ -248,7 +249,7 @@ impl pallet_scheduler::Config for Runtime { type Origin = Origin; type PalletsOrigin = OriginCaller; type ScheduleOrigin = EnsureRoot; - type WeightInfo = pallet_scheduler::weights::SubstrateWeight; + type WeightInfo = weights::pallet_scheduler::WeightInfo; } parameter_types! { @@ -260,7 +261,7 @@ impl pallet_indices::Config for Runtime { type Currency = Balances; type Deposit = IndexDeposit; type Event = Event; - type WeightInfo = pallet_indices::weights::SubstrateWeight; + type WeightInfo = weights::pallet_indices::WeightInfo; } impl pallet_balances::Config for Runtime { @@ -274,7 +275,7 @@ impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; - type WeightInfo = pallet_balances::weights::SubstrateWeight; + type WeightInfo = weights::pallet_balances::WeightInfo; } impl pallet_transaction_payment::Config for Runtime { @@ -583,7 +584,7 @@ impl pallet_treasury::Config for Runtime { type RejectOrigin = EnsureRoot; type SpendFunds = Bounties; type SpendPeriod = SpendPeriod; - type WeightInfo = pallet_treasury::weights::SubstrateWeight; + type WeightInfo = weights::pallet_treasury::WeightInfo; } impl pallet_bounties::Config for Runtime { @@ -595,7 +596,7 @@ impl pallet_bounties::Config for Runtime { type DataDepositPerByte = DataDepositPerByte; type Event = Event; type MaximumReasonLength = MaximumReasonLength; - type WeightInfo = pallet_bounties::weights::SubstrateWeight; + type WeightInfo = weights::pallet_bounties::WeightInfo; } construct_runtime! { @@ -803,6 +804,34 @@ impl_runtime_apis! { } } + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + + let whitelist: Vec = vec![ + // you can whitelist any storage keys you do not want to track here + ]; + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + + // Adding the pallet you will perform thee benchmarking + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_bounties, Bounties); + add_benchmark!(params, batches, pallet_indices, Indices); + add_benchmark!(params, batches, pallet_scheduler, Scheduler); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + add_benchmark!(params, batches, pallet_treasury, Treasury); + add_benchmark!(params, batches, pallet_utility, Utility); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { diff --git a/runtime/bifrost/src/weights/mod.rs b/runtime/bifrost/src/weights/mod.rs index 1ce8ecc51..88c3bf4c2 100644 --- a/runtime/bifrost/src/weights/mod.rs +++ b/runtime/bifrost/src/weights/mod.rs @@ -20,4 +20,11 @@ //! A list of the different weight modules for our runtime. +pub mod pallet_balances; +pub mod pallet_bounties; +pub mod pallet_indices; +pub mod pallet_scheduler; +pub mod pallet_timestamp; +pub mod pallet_treasury; +pub mod pallet_utility; pub mod pallet_vesting; diff --git a/runtime/bifrost/src/weights/pallet_balances.rs b/runtime/bifrost/src/weights/pallet_balances.rs new file mode 100644 index 000000000..655791410 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_balances.rs @@ -0,0 +1,79 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_balances +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_balances +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (248_276_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn transfer_keep_alive() -> Weight { + (184_967_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn set_balance_creating() -> Weight { + (95_890_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn set_balance_killing() -> Weight { + (115_106_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn force_transfer() -> Weight { + (246_112_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn transfer_all() -> Weight { + (226_555_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } +} diff --git a/runtime/bifrost/src/weights/pallet_bounties.rs b/runtime/bifrost/src/weights/pallet_bounties.rs new file mode 100644 index 000000000..cad8a1759 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_bounties.rs @@ -0,0 +1,110 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_bounties +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_bounties +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (137_877_000 as Weight) + // Standard Error: 0 + .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) + } + fn approve_bounty() -> Weight { + (35_317_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 { + (28_655_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 { + (175_914_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn accept_curator() -> Weight { + (118_264_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn award_bounty() -> Weight { + (78_249_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn claim_bounty() -> Weight { + (410_681_000 as Weight) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) + } + fn close_bounty_proposed() -> Weight { + (169_412_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) + } + fn close_bounty_active() -> Weight { + (280_834_000 as Weight) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) + } + fn extend_bounty_expiry() -> Weight { + (74_952_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn spend_funds(b: u32, ) -> Weight { + (1_383_602_000 as Weight) + // Standard Error: 2_279_000 + .saturating_add((150_816_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + } +} diff --git a/runtime/bifrost/src/weights/pallet_indices.rs b/runtime/bifrost/src/weights/pallet_indices.rs new file mode 100644 index 000000000..566610328 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_indices.rs @@ -0,0 +1,74 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_indices +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_indices +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (130_555_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn transfer() -> Weight { + (164_299_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn free() -> Weight { + (132_599_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn force_transfer() -> Weight { + (134_983_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn freeze() -> Weight { + (120_396_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } +} diff --git a/runtime/bifrost/src/weights/pallet_scheduler.rs b/runtime/bifrost/src/weights/pallet_scheduler.rs new file mode 100644 index 000000000..ccd4740c9 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_scheduler.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_scheduler +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_scheduler +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (79_887_000 as Weight) + // Standard Error: 4_000 + .saturating_add((353_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn cancel(s: u32, ) -> Weight { + (75_324_000 as Weight) + // Standard Error: 32_000 + .saturating_add((9_873_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn schedule_named(s: u32, ) -> Weight { + (99_023_000 as Weight) + // Standard Error: 7_000 + .saturating_add((350_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn cancel_named(s: u32, ) -> Weight { + (68_604_000 as Weight) + // Standard Error: 97_000 + .saturating_add((9_926_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } +} diff --git a/runtime/bifrost/src/weights/pallet_timestamp.rs b/runtime/bifrost/src/weights/pallet_timestamp.rs new file mode 100644 index 000000000..72702226c --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_timestamp.rs @@ -0,0 +1,57 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_timestamp +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_timestamp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (24_637_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn on_finalize() -> Weight { + (11_001_000 as Weight) + } +} diff --git a/runtime/bifrost/src/weights/pallet_treasury.rs b/runtime/bifrost/src/weights/pallet_treasury.rs new file mode 100644 index 000000000..5818effa9 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_treasury.rs @@ -0,0 +1,75 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_treasury +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_treasury +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (132_753_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn reject_proposal() -> Weight { + (171_186_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn approve_proposal(p: u32, ) -> Weight { + (38_091_000 as Weight) + // Standard Error: 7_000 + .saturating_add((293_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 { + (150_370_000 as Weight) + // Standard Error: 3_556_000 + .saturating_add((177_794_000 as Weight).saturating_mul(p as Weight)) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) + .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) + } +} diff --git a/runtime/bifrost/src/weights/pallet_utility.rs b/runtime/bifrost/src/weights/pallet_utility.rs new file mode 100644 index 000000000..9d3f50ca0 --- /dev/null +++ b/runtime/bifrost/src/weights/pallet_utility.rs @@ -0,0 +1,66 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Autogenerated weights for pallet_utility +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-08-16, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-genesis"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-genesis +// --steps=50 +// --repeat=20 +// --pallet=pallet_utility +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/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 { + (44_360_000 as Weight) + // Standard Error: 7_000 + .saturating_add((6_778_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn as_derivative() -> Weight { + (19_316_000 as Weight) + } + fn batch_all(c: u32, ) -> Weight { + (638_011_000 as Weight) + // Standard Error: 79_000 + .saturating_add((6_251_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } +} From 264433f75fa8d08e6f54fa29b5ef35205c8aa0de Mon Sep 17 00:00:00 2001 From: yooml Date: Tue, 17 Aug 2021 10:57:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20cargo=20+nightly=20fm?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/bifrost/src/lib.rs | 5 ++--- runtime/bifrost/src/weights/pallet_balances.rs | 1 - runtime/bifrost/src/weights/pallet_bounties.rs | 5 ++--- runtime/bifrost/src/weights/pallet_indices.rs | 1 - runtime/bifrost/src/weights/pallet_scheduler.rs | 9 ++++----- runtime/bifrost/src/weights/pallet_timestamp.rs | 1 - runtime/bifrost/src/weights/pallet_treasury.rs | 5 ++--- runtime/bifrost/src/weights/pallet_utility.rs | 5 ++--- 8 files changed, 12 insertions(+), 20 deletions(-) diff --git a/runtime/bifrost/src/lib.rs b/runtime/bifrost/src/lib.rs index 074527fde..3fc4f3307 100644 --- a/runtime/bifrost/src/lib.rs +++ b/runtime/bifrost/src/lib.rs @@ -155,9 +155,8 @@ impl Filter for CallFilter { Call::Tokens(orml_tokens::Call::::transfer(..)) => false, Call::Tokens(orml_tokens::Call::::transfer_all(..)) => false, Call::Currencies(orml_currencies::Call::::transfer(..)) => false, - Call::Currencies(orml_currencies::Call::::transfer_native_currency(..)) => { - false - } + Call::Currencies(orml_currencies::Call::::transfer_native_currency(..)) => + false, _ => true, } } diff --git a/runtime/bifrost/src/weights/pallet_balances.rs b/runtime/bifrost/src/weights/pallet_balances.rs index 655791410..a0aa9b603 100644 --- a/runtime/bifrost/src/weights/pallet_balances.rs +++ b/runtime/bifrost/src/weights/pallet_balances.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] diff --git a/runtime/bifrost/src/weights/pallet_bounties.rs b/runtime/bifrost/src/weights/pallet_bounties.rs index cad8a1759..1ce6d2f33 100644 --- a/runtime/bifrost/src/weights/pallet_bounties.rs +++ b/runtime/bifrost/src/weights/pallet_bounties.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] @@ -46,7 +45,7 @@ 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 { + fn propose_bounty(d: u32) -> Weight { (137_877_000 as Weight) // Standard Error: 0 .saturating_add((1_000 as Weight).saturating_mul(d as Weight)) @@ -98,7 +97,7 @@ impl pallet_bounties::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - fn spend_funds(b: u32, ) -> Weight { + fn spend_funds(b: u32) -> Weight { (1_383_602_000 as Weight) // Standard Error: 2_279_000 .saturating_add((150_816_000 as Weight).saturating_mul(b as Weight)) diff --git a/runtime/bifrost/src/weights/pallet_indices.rs b/runtime/bifrost/src/weights/pallet_indices.rs index 566610328..5342a9c9d 100644 --- a/runtime/bifrost/src/weights/pallet_indices.rs +++ b/runtime/bifrost/src/weights/pallet_indices.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] diff --git a/runtime/bifrost/src/weights/pallet_scheduler.rs b/runtime/bifrost/src/weights/pallet_scheduler.rs index ccd4740c9..136c0042f 100644 --- a/runtime/bifrost/src/weights/pallet_scheduler.rs +++ b/runtime/bifrost/src/weights/pallet_scheduler.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] @@ -46,28 +45,28 @@ 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 { + fn schedule(s: u32) -> Weight { (79_887_000 as Weight) // Standard Error: 4_000 .saturating_add((353_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - fn cancel(s: u32, ) -> Weight { + fn cancel(s: u32) -> Weight { (75_324_000 as Weight) // Standard Error: 32_000 .saturating_add((9_873_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } - fn schedule_named(s: u32, ) -> Weight { + fn schedule_named(s: u32) -> Weight { (99_023_000 as Weight) // Standard Error: 7_000 .saturating_add((350_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } - fn cancel_named(s: u32, ) -> Weight { + fn cancel_named(s: u32) -> Weight { (68_604_000 as Weight) // Standard Error: 97_000 .saturating_add((9_926_000 as Weight).saturating_mul(s as Weight)) diff --git a/runtime/bifrost/src/weights/pallet_timestamp.rs b/runtime/bifrost/src/weights/pallet_timestamp.rs index 72702226c..5d7aa9073 100644 --- a/runtime/bifrost/src/weights/pallet_timestamp.rs +++ b/runtime/bifrost/src/weights/pallet_timestamp.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] diff --git a/runtime/bifrost/src/weights/pallet_treasury.rs b/runtime/bifrost/src/weights/pallet_treasury.rs index 5818effa9..99fe09534 100644 --- a/runtime/bifrost/src/weights/pallet_treasury.rs +++ b/runtime/bifrost/src/weights/pallet_treasury.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] @@ -56,14 +55,14 @@ impl pallet_treasury::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } - fn approve_proposal(p: u32, ) -> Weight { + fn approve_proposal(p: u32) -> Weight { (38_091_000 as Weight) // Standard Error: 7_000 .saturating_add((293_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 { + fn on_initialize_proposals(p: u32) -> Weight { (150_370_000 as Weight) // Standard Error: 3_556_000 .saturating_add((177_794_000 as Weight).saturating_mul(p as Weight)) diff --git a/runtime/bifrost/src/weights/pallet_utility.rs b/runtime/bifrost/src/weights/pallet_utility.rs index 9d3f50ca0..43b35b921 100644 --- a/runtime/bifrost/src/weights/pallet_utility.rs +++ b/runtime/bifrost/src/weights/pallet_utility.rs @@ -36,7 +36,6 @@ // --header=./HEADER-GPL3 // --output=./runtime/bifrost/src/weights/ - #![allow(unused_parens)] #![allow(unused_imports)] @@ -46,7 +45,7 @@ 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 { + fn batch(c: u32) -> Weight { (44_360_000 as Weight) // Standard Error: 7_000 .saturating_add((6_778_000 as Weight).saturating_mul(c as Weight)) @@ -56,7 +55,7 @@ impl pallet_utility::WeightInfo for WeightInfo { fn as_derivative() -> Weight { (19_316_000 as Weight) } - fn batch_all(c: u32, ) -> Weight { + fn batch_all(c: u32) -> Weight { (638_011_000 as Weight) // Standard Error: 79_000 .saturating_add((6_251_000 as Weight).saturating_mul(c as Weight))