From 985075634120464ebd80b61fc01c3df41275d272 Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Fri, 23 Feb 2024 14:58:20 +0100 Subject: [PATCH 1/2] add elections phragmen benchmarking --- runtime/hydradx/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index a40b4868a..635d59d68 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -699,6 +699,7 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_proxy, Proxy); list_benchmark!(list, extra, pallet_utility, Utility); list_benchmark!(list, extra, pallet_democracy, Democracy); + list_benchmark!(list, extra, pallet_elections_phragmen, Elections); list_benchmark!(list, extra, council, Council); list_benchmark!(list, extra, tech, TechnicalCommittee); list_benchmark!(list, extra, pallet_omnipool_liquidity_mining, OmnipoolLiquidityMining); @@ -782,6 +783,7 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_proxy, Proxy); add_benchmark!(params, batches, pallet_utility, Utility); add_benchmark!(params, batches, pallet_democracy, Democracy); + add_benchmark!(params, batches, pallet_elections_phragmen, Elections); add_benchmark!(params, batches, council, Council); add_benchmark!(params, batches, tech, TechnicalCommittee); add_benchmark!(params, batches, pallet_omnipool_liquidity_mining, OmnipoolLiquidityMining); From 1897ae3f20270ef5de533b6a519ad09e02990526 Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Fri, 23 Feb 2024 16:04:19 +0100 Subject: [PATCH 2/2] rebenchmark tips and elections phragmen --- Cargo.lock | 2 +- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/governance.rs | 4 +- runtime/hydradx/src/lib.rs | 2 +- runtime/hydradx/src/weights/elections.rs | 304 +++++++++++++++++++++++ runtime/hydradx/src/weights/mod.rs | 2 + runtime/hydradx/src/weights/tips.rs | 156 ++++++++++++ 7 files changed, 467 insertions(+), 5 deletions(-) create mode 100644 runtime/hydradx/src/weights/elections.rs create mode 100644 runtime/hydradx/src/weights/tips.rs diff --git a/Cargo.lock b/Cargo.lock index 49c701cbc..ac8f91865 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4621,7 +4621,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "214.0.0" +version = "215.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index e3246eed7..c4e036fed 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "214.0.0" +version = "215.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/governance.rs b/runtime/hydradx/src/governance.rs index d9605160d..3a5b034fc 100644 --- a/runtime/hydradx/src/governance.rs +++ b/runtime/hydradx/src/governance.rs @@ -291,7 +291,7 @@ impl pallet_elections_phragmen::Config for Runtime { type TermDuration = TermDuration; type MaxCandidates = MaxElectionCandidates; type MaxVoters = MaxElectionVoters; - type WeightInfo = (); + type WeightInfo = weights::elections::HydraWeight; type MaxVotesPerVoter = MaxVotesPerVoter; } @@ -312,5 +312,5 @@ impl pallet_tips::Config for Runtime { type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; type Tippers = Elections; - type WeightInfo = (); + type WeightInfo = weights::tips::HydraWeight; } diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 635d59d68..6e0c7d189 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -107,7 +107,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 214, + spec_version: 215, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/hydradx/src/weights/elections.rs b/runtime/hydradx/src/weights/elections.rs new file mode 100644 index 000000000..f6e5501fc --- /dev/null +++ b/runtime/hydradx/src/weights/elections.rs @@ -0,0 +1,304 @@ +// This file is part of HydraDX. + +// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). +// 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. + +//! Autogenerated weights for `pallet_elections_phragmen` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-02-23, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 + +// Executed Command: +// target/release/hydradx +// benchmark +// pallet +// --chain=dev +// --steps=10 +// --repeat=30 +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=.maintain/pallet-weight-template-no-back.hbs +// --pallet=pallet-elections-phragmen +// --output=weights-1.1.0/elections.rs +// --extrinsic=* + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_elections_phragmen`. +pub struct HydraWeight(PhantomData); +impl pallet_elections_phragmen::WeightInfo for HydraWeight { + /// Storage: `Elections::Candidates` (r:1 w:0) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:0) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Voting` (r:1 w:1) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `v` is `[1, 10]`. + fn vote_equal(v: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `430 + v * (80 ±0)` + // Estimated: `4764 + v * (80 ±0)` + // Minimum execution time: 42_972_000 picoseconds. + Weight::from_parts(43_345_925, 4764) + // Standard Error: 4_070 + .saturating_add(Weight::from_parts(114_697, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) + } + /// Storage: `Elections::Candidates` (r:1 w:0) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:0) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Voting` (r:1 w:1) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `v` is `[2, 10]`. + fn vote_more(v: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `399 + v * (80 ±0)` + // Estimated: `4764 + v * (80 ±0)` + // Minimum execution time: 59_265_000 picoseconds. + Weight::from_parts(59_871_116, 4764) + // Standard Error: 4_590 + .saturating_add(Weight::from_parts(86_886, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) + } + /// Storage: `Elections::Candidates` (r:1 w:0) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:0) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Voting` (r:1 w:1) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `v` is `[2, 10]`. + fn vote_less(v: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `431 + v * (80 ±0)` + // Estimated: `4764 + v * (80 ±0)` + // Minimum execution time: 59_321_000 picoseconds. + Weight::from_parts(59_769_987, 4764) + // Standard Error: 5_117 + .saturating_add(Weight::from_parts(87_357, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 80).saturating_mul(v.into())) + } + /// Storage: `Elections::Voting` (r:1 w:1) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + fn remove_voter() -> Weight { + // Proof Size summary in bytes: + // Measured: `761` + // Estimated: `4764` + // Minimum execution time: 61_217_000 picoseconds. + Weight::from_parts(61_805_000, 4764) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Elections::Candidates` (r:1 w:1) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:0) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `c` is `[1, 100]`. + fn submit_candidacy(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2147 + c * (48 ±0)` + // Estimated: `3632 + c * (48 ±0)` + // Minimum execution time: 44_619_000 picoseconds. + Weight::from_parts(45_215_178, 3632) + // Standard Error: 1_011 + .saturating_add(Weight::from_parts(56_084, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into())) + } + /// Storage: `Elections::Candidates` (r:1 w:1) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `c` is `[1, 100]`. + fn renounce_candidacy_candidate(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `350 + c * (48 ±0)` + // Estimated: `1835 + c * (48 ±0)` + // Minimum execution time: 40_339_000 picoseconds. + Weight::from_parts(40_813_195, 1835) + // Standard Error: 712 + .saturating_add(Weight::from_parts(35_439, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 48).saturating_mul(c.into())) + } + /// Storage: `Elections::Members` (r:1 w:1) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:1) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:0 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn renounce_candidacy_members() -> Weight { + // Proof Size summary in bytes: + // Measured: `2379` + // Estimated: `3864` + // Minimum execution time: 55_730_000 picoseconds. + Weight::from_parts(56_491_000, 3864) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Elections::RunnersUp` (r:1 w:1) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn renounce_candidacy_runners_up() -> Weight { + // Proof Size summary in bytes: + // Measured: `1491` + // Estimated: `2976` + // Minimum execution time: 40_384_000 picoseconds. + Weight::from_parts(40_834_000, 2976) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_member_without_replacement() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 500_000_000_000 picoseconds. + Weight::from_parts(500_000_000_000, 0) + } + /// Storage: `Elections::Members` (r:1 w:1) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Elections::RunnersUp` (r:1 w:1) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:1 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:0 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn remove_member_with_replacement() -> Weight { + // Proof Size summary in bytes: + // Measured: `2519` + // Estimated: `6196` + // Minimum execution time: 85_896_000 picoseconds. + Weight::from_parts(87_103_000, 6196) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `Elections::Voting` (r:769 w:768) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:0) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Candidates` (r:1 w:0) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:768 w:768) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:768 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:768 w:768) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `v` is `[384, 768]`. + /// The range of component `d` is `[0, 384]`. + fn clean_defunct_voters(v: u32, _d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `3296 + v * (618 ±0)` + // Estimated: `6665 + v * (3774 ±0)` + // Minimum execution time: 30_522_311_000 picoseconds. + Weight::from_parts(30_569_802_000, 6665) + // Standard Error: 620_586 + .saturating_add(Weight::from_parts(48_149_815, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(v.into()))) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(v.into()))) + .saturating_add(Weight::from_parts(0, 3774).saturating_mul(v.into())) + } + /// Storage: `Elections::Candidates` (r:1 w:1) + /// Proof: `Elections::Candidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:1) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::RunnersUp` (r:1 w:1) + /// Proof: `Elections::RunnersUp` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Voting` (r:769 w:0) + /// Proof: `Elections::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Council::Proposals` (r:1 w:0) + /// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:73 w:73) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Elections::ElectionRounds` (r:1 w:1) + /// Proof: `Elections::ElectionRounds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Members` (r:0 w:1) + /// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Council::Prime` (r:0 w:1) + /// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `c` is `[1, 100]`. + /// The range of component `v` is `[1, 768]`. + /// The range of component `e` is `[768, 7680]`. + fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + e * (27 ±0) + v * (411 ±0)` + // Estimated: `278080 + c * (2122 ±13) + e * (11 ±0) + v * (2542 ±7)` + // Minimum execution time: 3_573_523_000 picoseconds. + Weight::from_parts(3_583_430_000, 278080) + // Standard Error: 910_658 + .saturating_add(Weight::from_parts(17_639_114, 0).saturating_mul(v.into())) + // Standard Error: 95_028 + .saturating_add(Weight::from_parts(953_135, 0).saturating_mul(e.into())) + .saturating_add(T::DbWeight::get().reads(47)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(v.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 2122).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 11).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(0, 2542).saturating_mul(v.into())) + } +} \ No newline at end of file diff --git a/runtime/hydradx/src/weights/mod.rs b/runtime/hydradx/src/weights/mod.rs index a171f5643..263f9b6e2 100644 --- a/runtime/hydradx/src/weights/mod.rs +++ b/runtime/hydradx/src/weights/mod.rs @@ -8,6 +8,7 @@ pub mod currencies; pub mod dca; pub mod democracy; pub mod duster; +pub mod elections; pub mod ema_oracle; pub mod evm_accounts; pub mod identity; @@ -27,6 +28,7 @@ pub mod staking; pub mod system; pub mod technical_committee; pub mod timestamp; +pub mod tips; pub mod tokens; pub mod transaction_pause; pub mod treasury; diff --git a/runtime/hydradx/src/weights/tips.rs b/runtime/hydradx/src/weights/tips.rs new file mode 100644 index 000000000..0fb0fe607 --- /dev/null +++ b/runtime/hydradx/src/weights/tips.rs @@ -0,0 +1,156 @@ +// This file is part of HydraDX. + +// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). +// 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. + +//! Autogenerated weights for `pallet_tips` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-02-23, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 + +// Executed Command: +// target/release/hydradx +// benchmark +// pallet +// --chain=dev +// --steps=10 +// --repeat=30 +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=.maintain/pallet-weight-template-no-back.hbs +// --pallet=pallet-tips +// --output=weights-1.1.0/tips.rs +// --extrinsic=* + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_tips`. +pub struct HydraWeight(PhantomData); +impl pallet_tips::WeightInfo for HydraWeight { + /// Storage: `Tips::Reasons` (r:1 w:1) + /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Tips` (r:1 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1024]`. + fn report_awesome(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 42_222_000 picoseconds. + Weight::from_parts(43_017_038, 3507) + // Standard Error: 67 + .saturating_add(Weight::from_parts(1_804, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Tips::Tips` (r:1 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Reasons` (r:0 w:1) + /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn retract_tip() -> Weight { + // Proof Size summary in bytes: + // Measured: `259` + // Estimated: `3724` + // Minimum execution time: 39_351_000 picoseconds. + Weight::from_parts(39_842_000, 3724) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Reasons` (r:1 w:1) + /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Tips` (r:0 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1024]`. + /// The range of component `t` is `[1, 13]`. + fn tip_new(r: u32, t: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `438 + t * (64 ±0)` + // Estimated: `3903 + t * (64 ±0)` + // Minimum execution time: 27_937_000 picoseconds. + Weight::from_parts(28_197_538, 3903) + // Standard Error: 46 + .saturating_add(Weight::from_parts(1_523, 0).saturating_mul(r.into())) + // Standard Error: 3_893 + .saturating_add(Weight::from_parts(35_746, 0).saturating_mul(t.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(t.into())) + } + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Tips` (r:1 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `t` is `[1, 13]`. + fn tip(t: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `659 + t * (112 ±0)` + // Estimated: `4124 + t * (112 ±0)` + // Minimum execution time: 21_986_000 picoseconds. + Weight::from_parts(22_229_525, 4124) + // Standard Error: 2_907 + .saturating_add(Weight::from_parts(175_185, 0).saturating_mul(t.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 112).saturating_mul(t.into())) + } + /// Storage: `Tips::Tips` (r:1 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Elections::Members` (r:1 w:0) + /// Proof: `Elections::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Tips::Reasons` (r:0 w:1) + /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `t` is `[1, 13]`. + fn close_tip(t: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `801 + t * (112 ±0)` + // Estimated: `6196 + t * (110 ±0)` + // Minimum execution time: 84_369_000 picoseconds. + Weight::from_parts(85_179_519, 6196) + // Standard Error: 11_612 + .saturating_add(Weight::from_parts(168_131, 0).saturating_mul(t.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(Weight::from_parts(0, 110).saturating_mul(t.into())) + } + /// Storage: `Tips::Tips` (r:1 w:1) + /// Proof: `Tips::Tips` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tips::Reasons` (r:0 w:1) + /// Proof: `Tips::Reasons` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `t` is `[1, 13]`. + fn slash_tip(t: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `307` + // Estimated: `3772` + // Minimum execution time: 20_933_000 picoseconds. + Weight::from_parts(21_193_736, 3772) + // Standard Error: 1_766 + .saturating_add(Weight::from_parts(18_154, 0).saturating_mul(t.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} \ No newline at end of file