diff --git a/pallets/bonds/src/weights.rs b/pallets/bonds/src/weights.rs index 41cdea802..52726b15b 100644 --- a/pallets/bonds/src/weights.rs +++ b/pallets/bonds/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of HydraDX. -// Copyright (C) 2020-2021 Intergalactic, Limited (GIB). +// Copyright (C) 2020-2023 Intergalactic, Limited (GIB). // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_bonds //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-17, STEPS: 5, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2023-08-11, STEPS: 10, REPEAT: 30, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=dev -// --steps=5 -// --repeat=20 +// --steps=10 +// --repeat=30 // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 @@ -35,6 +35,7 @@ // --pallet=pallet-bonds // --output=bonds.rs // --extrinsic=* + #![allow(unused_parens)] #![allow(unused_imports)] #![allow(clippy::unnecessary_cast)] @@ -55,22 +56,104 @@ pub trait WeightInfo { pub struct HydraWeight(PhantomData); impl WeightInfo for HydraWeight { + // Storage: AssetRegistry Assets (r:1 w:1) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Bonds BondIds (r:1 w:1) + // Proof: Bonds BondIds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: AssetRegistry NextAssetId (r:1 w:1) + // Proof: AssetRegistry NextAssetId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:1 w:0) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AcceptedCurrencies (r:1 w:0) + // Proof: MultiTransactionPayment AcceptedCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: Bonds Bonds (r:0 w:1) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: AssetRegistry AssetIds (r:0 w:1) + // Proof: AssetRegistry AssetIds (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) fn issue() -> Weight { - Weight::zero() + // Minimum execution time: 154_679 nanoseconds. + Weight::from_ref_time(159_169_000 as u64) + .saturating_add(T::DbWeight::get().reads(11 as u64)) + .saturating_add(T::DbWeight::get().writes(10 as u64)) } - + // Storage: Bonds Bonds (r:1 w:0) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: AssetRegistry Assets (r:1 w:0) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:0 w:1) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) fn redeem() -> Weight { - Weight::zero() + // Minimum execution time: 114_799 nanoseconds. + Weight::from_ref_time(116_103_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } } // For backwards compatibility and tests impl WeightInfo for () { + // Storage: AssetRegistry Assets (r:1 w:1) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Bonds BondIds (r:1 w:1) + // Proof: Bonds BondIds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: AssetRegistry NextAssetId (r:1 w:1) + // Proof: AssetRegistry NextAssetId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:1 w:0) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AcceptedCurrencies (r:1 w:0) + // Proof: MultiTransactionPayment AcceptedCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: Bonds Bonds (r:0 w:1) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: AssetRegistry AssetIds (r:0 w:1) + // Proof: AssetRegistry AssetIds (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) fn issue() -> Weight { - Weight::zero() + // Minimum execution time: 154_679 nanoseconds. + Weight::from_ref_time(159_169_000) + .saturating_add(RocksDbWeight::get().reads(11)) + .saturating_add(RocksDbWeight::get().writes(10)) } - + // Storage: Bonds Bonds (r:1 w:0) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: AssetRegistry Assets (r:1 w:0) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:0 w:1) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) fn redeem() -> Weight { - Weight::zero() + // Minimum execution time: 114_799 nanoseconds. + Weight::from_ref_time(116_103_000) + .saturating_add(RocksDbWeight::get().reads(7)) + .saturating_add(RocksDbWeight::get().writes(5)) } } diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 5eaeb5b5f..d0a739624 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -511,7 +511,7 @@ impl pallet_bonds::Config for Runtime { type AssetTypeWhitelist = AssetTypeWhitelist; type ProtocolFee = ProtocolFee; type FeeReceiver = TreasuryAccount; - type WeightInfo = (); + type WeightInfo = weights::bonds::HydraWeight; } // Staking diff --git a/runtime/hydradx/src/weights/bonds.rs b/runtime/hydradx/src/weights/bonds.rs new file mode 100644 index 000000000..1ebc76393 --- /dev/null +++ b/runtime/hydradx/src/weights/bonds.rs @@ -0,0 +1,103 @@ +// 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_bonds +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-08-11, STEPS: 10, REPEAT: 30, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// target/release/hydradx +// benchmark +// pallet +// --chain=dev +// --steps=10 +// --repeat=30 +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=.maintain/pallet-weight-template-no-back.hbs +// --pallet=pallet-bonds +// --output=bonds.rs +// --extrinsic=* + +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_std::marker::PhantomData; + +use pallet_bonds::weights::WeightInfo; + +/// Weights for pallet_bonds using the hydraDX node and recommended hardware. +pub struct HydraWeight(PhantomData); + +impl WeightInfo for HydraWeight { + // Storage: AssetRegistry Assets (r:1 w:1) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Bonds BondIds (r:1 w:1) + // Proof: Bonds BondIds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: AssetRegistry NextAssetId (r:1 w:1) + // Proof: AssetRegistry NextAssetId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:1 w:0) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AcceptedCurrencies (r:1 w:0) + // Proof: MultiTransactionPayment AcceptedCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: Bonds Bonds (r:0 w:1) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: AssetRegistry AssetIds (r:0 w:1) + // Proof: AssetRegistry AssetIds (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn issue() -> Weight { + // Minimum execution time: 154_679 nanoseconds. + Weight::from_ref_time(159_169_000 as u64) + .saturating_add(T::DbWeight::get().reads(11 as u64)) + .saturating_add(T::DbWeight::get().writes(10 as u64)) + } + // Storage: Bonds Bonds (r:1 w:0) + // Proof: Bonds Bonds (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) + // Storage: Timestamp Now (r:1 w:0) + // Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + // Storage: AssetRegistry Assets (r:1 w:0) + // Proof: AssetRegistry Assets (max_values: None, max_size: Some(87), added: 2562, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: MultiTransactionPayment AccountCurrencyMap (r:0 w:1) + // Proof: MultiTransactionPayment AccountCurrencyMap (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Minimum execution time: 114_799 nanoseconds. + Weight::from_ref_time(116_103_000 as u64) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) + } +} diff --git a/runtime/hydradx/src/weights/mod.rs b/runtime/hydradx/src/weights/mod.rs index 8cec8b8b5..c2c07e9c9 100644 --- a/runtime/hydradx/src/weights/mod.rs +++ b/runtime/hydradx/src/weights/mod.rs @@ -1,4 +1,5 @@ pub mod balances; +pub mod bonds; pub mod circuit_breaker; pub mod claims; pub mod collator_selection;