Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pallet weights #470

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 180 additions & 102 deletions pallets/automation-price/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
// This file is part of Substrate.
// This file is part of OAK-blockchain.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) OAK Network Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-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.
// 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 <https://www.gnu.org/licenses/>.

//! Autogenerated weights for pallet_automation_price
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `copvan.local`, CPU: `<UNKNOWN>`
//! DATE: 2023-11-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `actions-runner-1`, CPU: `Intel(R) Xeon(R) E-2388G CPU @ 3.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("turing-dev"), DB CACHE: 1024

// Executed Command:
// target/release/oak-collator
// ./oak-collator
// benchmark
// pallet
// --header
// ./.maintain/HEADER-GPL3
// --chain
// turing-dev
// --execution
Expand All @@ -41,24 +45,26 @@
// --steps
// 50
// --output
// ./pallets/automation-price/src/raw-weights.rs
// ./automation_price-raw-weights.rs
// --template
// ./.maintain/frame-weight-template.hbs

// Summary:
//:initialize_asset_extrinsic 14_098_714
//:asset_price_update_extrinsic 9_980_215
//:schedule_xcmp_task_extrinsic 12_000_000
//:cancel_task_extrinsic 20_000_000
//:run_xcmp_task 30_000_000
//:emit_event 4_000_000
//:initialize_asset_extrinsic 20_135_952,3541
//:asset_price_update_extrinsic 7_743_581,1493
//:schedule_xcmp_task_extrinsic 12_226_000,1493
//:cancel_task_extrinsic 9_131_000,3579
//:run_xcmp_task 38_582_000,3946
//:remove_task 21_659_000,3579
//:emit_event 5_287_000,0

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;
use core::marker::PhantomData;

/// Weight functions needed for pallet_automation_price.
pub trait WeightInfo {
Expand All @@ -67,117 +73,189 @@ pub trait WeightInfo {
fn schedule_xcmp_task_extrinsic() -> Weight;
fn cancel_task_extrinsic() -> Weight;
fn run_xcmp_task() -> Weight;
fn remove_task() -> Weight;
fn emit_event() -> Weight;
fn remove_task() -> Weight;
}

/// Weights for pallet_automation_price using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: AutomationPrice AssetRegistry (r:1 w:1)
// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice AssetRegistry (r:1 w:1)
/// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// The range of component `v` is `[1, 5]`.
fn initialize_asset_extrinsic(_v: u32, ) -> Weight {
Weight::from_ref_time(14_098_714 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
fn initialize_asset_extrinsic(v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `3541`
// Minimum execution time: 19_700_000 picoseconds.
Weight::from_parts(20_135_952, 3541)
// Standard Error: 3_223
.saturating_add(Weight::from_parts(14_093, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
// Storage: AutomationPrice AssetRegistry (r:1 w:0)
// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// The range of component `v` is `[1, 100]`.
fn asset_price_update_extrinsic(v: u32, ) -> Weight {
Weight::from_ref_time(9_980_215 as u64)
// Standard Error: 617
.saturating_add(Weight::from_ref_time(141_778 as u64).saturating_mul(v as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1493`
// Minimum execution time: 7_548_000 picoseconds.
Weight::from_parts(7_743_581, 1493)
// Standard Error: 160
.saturating_add(Weight::from_parts(159_207, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
fn schedule_xcmp_task_extrinsic() -> Weight {
Weight::from_ref_time(12_000_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1493`
// Minimum execution time: 11_992_000 picoseconds.
Weight::from_parts(12_226_000, 1493)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
// Storage: AutomationPrice Tasks (r:1 w:1)
// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
// Storage: AutomationPrice AccountTasks (r:0 w:1)
// Proof Skipped: AutomationPrice AccountTasks (max_values: None, max_size: None, mode: Measured)
// Storage: AutomationPrice SortedTasksIndex (r:0 w:1)
// Proof Skipped: AutomationPrice SortedTasksIndex (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice Tasks (r:1 w:0)
/// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
fn cancel_task_extrinsic() -> Weight {
Weight::from_ref_time(20_000_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
// Proof Size summary in bytes:
// Measured: `114`
// Estimated: `3579`
// Minimum execution time: 8_917_000 picoseconds.
Weight::from_parts(9_131_000, 3579)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured)
// Storage: AssetRegistry LocationToAssetId (r:1 w:0)
// Proof Skipped: AssetRegistry LocationToAssetId (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
/// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetRegistry LocationToAssetId (r:1 w:0)
/// Proof Skipped: AssetRegistry LocationToAssetId (max_values: None, max_size: None, mode: Measured)
fn run_xcmp_task() -> Weight {
Weight::from_ref_time(30_000_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
}
fn emit_event() -> Weight {
Weight::from_ref_time(4_000_000 as u64)
// Proof Size summary in bytes:
// Measured: `481`
// Estimated: `3946`
// Minimum execution time: 38_126_000 picoseconds.
Weight::from_parts(38_582_000, 3946)
.saturating_add(T::DbWeight::get().reads(3_u64))
}

/// Storage: AutomationPrice SortedTasksIndex (r:1 w:0)
/// Proof Skipped: AutomationPrice SortedTasksIndex (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice SortedTasksByExpiration (r:1 w:1)
/// Proof Skipped: AutomationPrice SortedTasksByExpiration (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: AutomationPrice TaskStats (r:1 w:0)
/// Proof Skipped: AutomationPrice TaskStats (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice AccountStats (r:1 w:0)
/// Proof Skipped: AutomationPrice AccountStats (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice Tasks (r:0 w:1)
/// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
fn remove_task() -> Weight {
Weight::from_ref_time(4_000_000 as u64)
// Proof Size summary in bytes:
// Measured: `114`
// Estimated: `3579`
// Minimum execution time: 21_206_000 picoseconds.
Weight::from_parts(21_659_000, 3579)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
fn emit_event() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_027_000 picoseconds.
Weight::from_parts(5_287_000, 0)
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
// Storage: AutomationPrice AssetRegistry (r:1 w:1)
// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice AssetRegistry (r:1 w:1)
/// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// The range of component `v` is `[1, 5]`.
fn initialize_asset_extrinsic(_v: u32, ) -> Weight {
Weight::from_ref_time(14_098_714 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
fn initialize_asset_extrinsic(v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `3541`
// Minimum execution time: 19_700_000 picoseconds.
Weight::from_parts(20_135_952, 3541)
// Standard Error: 3_223
.saturating_add(Weight::from_parts(14_093, 0).saturating_mul(v.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
// Storage: AutomationPrice AssetRegistry (r:1 w:0)
// Proof Skipped: AutomationPrice AssetRegistry (max_values: None, max_size: None, mode: Measured)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
/// The range of component `v` is `[1, 100]`.
fn asset_price_update_extrinsic(v: u32, ) -> Weight {
Weight::from_ref_time(9_980_215 as u64)
// Standard Error: 617
.saturating_add(Weight::from_ref_time(141_778 as u64).saturating_mul(v as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1493`
// Minimum execution time: 7_548_000 picoseconds.
Weight::from_parts(7_743_581, 1493)
// Standard Error: 160
.saturating_add(Weight::from_parts(159_207, 0).saturating_mul(v.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Timestamp Now (r:1 w:0)
/// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen)
fn schedule_xcmp_task_extrinsic() -> Weight {
Weight::from_ref_time(12_000_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1493`
// Minimum execution time: 11_992_000 picoseconds.
Weight::from_parts(12_226_000, 1493)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
// Storage: AutomationPrice Tasks (r:1 w:1)
// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
// Storage: AutomationPrice AccountTasks (r:0 w:1)
// Proof Skipped: AutomationPrice AccountTasks (max_values: None, max_size: None, mode: Measured)
// Storage: AutomationPrice SortedTasksIndex (r:0 w:1)
// Proof Skipped: AutomationPrice SortedTasksIndex (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice Tasks (r:1 w:0)
/// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
fn cancel_task_extrinsic() -> Weight {
Weight::from_ref_time(20_000_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
// Proof Size summary in bytes:
// Measured: `114`
// Estimated: `3579`
// Minimum execution time: 8_917_000 picoseconds.
Weight::from_parts(9_131_000, 3579)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured)
// Storage: AssetRegistry LocationToAssetId (r:1 w:0)
// Proof Skipped: AssetRegistry LocationToAssetId (max_values: None, max_size: None, mode: Measured)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: UnknownTokens ConcreteFungibleBalances (r:1 w:0)
/// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetRegistry LocationToAssetId (r:1 w:0)
/// Proof Skipped: AssetRegistry LocationToAssetId (max_values: None, max_size: None, mode: Measured)
fn run_xcmp_task() -> Weight {
Weight::from_ref_time(30_000_000 as u64)
.saturating_add(RocksDbWeight::get().reads(3 as u64))
}
fn emit_event() -> Weight {
Weight::from_ref_time(4_000_000 as u64)
// Proof Size summary in bytes:
// Measured: `481`
// Estimated: `3946`
// Minimum execution time: 38_126_000 picoseconds.
Weight::from_parts(38_582_000, 3946)
.saturating_add(RocksDbWeight::get().reads(3_u64))
}

/// Storage: AutomationPrice SortedTasksIndex (r:1 w:0)
/// Proof Skipped: AutomationPrice SortedTasksIndex (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice SortedTasksByExpiration (r:1 w:1)
/// Proof Skipped: AutomationPrice SortedTasksByExpiration (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: AutomationPrice TaskStats (r:1 w:0)
/// Proof Skipped: AutomationPrice TaskStats (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice AccountStats (r:1 w:0)
/// Proof Skipped: AutomationPrice AccountStats (max_values: None, max_size: None, mode: Measured)
/// Storage: AutomationPrice Tasks (r:0 w:1)
/// Proof Skipped: AutomationPrice Tasks (max_values: None, max_size: None, mode: Measured)
fn remove_task() -> Weight {
Weight::from_ref_time(4_000_000 as u64)
// Proof Size summary in bytes:
// Measured: `114`
// Estimated: `3579`
// Minimum execution time: 21_206_000 picoseconds.
Weight::from_parts(21_659_000, 3579)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
fn emit_event() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_027_000 picoseconds.
Weight::from_parts(5_287_000, 0)
}
}
Loading
Loading