1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17

            
18
//! Autogenerated weights for pallet_author_noting
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
21
//! DATE: 2024-12-31, STEPS: `16`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `tomasz-XPS-15-9520`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// ./target/release/tanssi-node
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_author_noting
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 16
39
// --repeat
40
// 1
41
// --template=benchmarking/frame-weight-pallet-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/pallet_author_noting.rs
46

            
47
#![cfg_attr(rustfmt, rustfmt_skip)]
48
#![allow(unused_parens)]
49
#![allow(unused_imports)]
50

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

            
54
/// Weight functions needed for pallet_author_noting.
55
pub trait WeightInfo {
56
	fn set_latest_author_data(x: u32, ) -> Weight;
57
	fn set_author() -> Weight;
58
	fn kill_author_data() -> Weight;
59
	fn on_container_authors_noted(x: u32, ) -> Weight;
60
}
61

            
62
/// Weights for pallet_author_noting using the Substrate node and recommended hardware.
63
pub struct SubstrateWeight<T>(PhantomData<T>);
64
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
65
	/// Storage: `AuthorNoting::DidSetContainerAuthorData` (r:1 w:1)
66
	/// Proof: `AuthorNoting::DidSetContainerAuthorData` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
67
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
68
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
69
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
70
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
71
	/// Storage: `System::Digest` (r:1 w:0)
72
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
73
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:1 w:0)
74
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
75
	/// Storage: `AuthorNoting::LatestAuthor` (r:100 w:100)
76
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
77
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
78
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
79
	/// The range of component `x` is `[1, 100]`.
80
	fn set_latest_author_data(x: u32, ) -> Weight {
81
		// Proof Size summary in bytes:
82
		//  Measured:  `493 + x * (73 ±0)`
83
		//  Estimated: `1978 + x * (2539 ±0)`
84
		// Minimum execution time: 48_373_000 picoseconds.
85
		Weight::from_parts(48_373_000, 1978)
86
			// Standard Error: 633_051
87
			.saturating_add(Weight::from_parts(15_379_156, 0).saturating_mul(x.into()))
88
			.saturating_add(T::DbWeight::get().reads(6_u64))
89
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into())))
90
			.saturating_add(T::DbWeight::get().writes(2_u64))
91
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into())))
92
			.saturating_add(Weight::from_parts(0, 2539).saturating_mul(x.into()))
93
	}
94
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
95
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
96
	fn set_author() -> Weight {
97
		// Proof Size summary in bytes:
98
		//  Measured:  `0`
99
		//  Estimated: `0`
100
		// Minimum execution time: 9_241_000 picoseconds.
101
		Weight::from_parts(9_241_000, 0)
102
			.saturating_add(T::DbWeight::get().writes(1_u64))
103
	}
104
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
105
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
106
	fn kill_author_data() -> Weight {
107
		// Proof Size summary in bytes:
108
		//  Measured:  `0`
109
		//  Estimated: `0`
110
		// Minimum execution time: 11_313_000 picoseconds.
111
		Weight::from_parts(11_313_000, 0)
112
			.saturating_add(T::DbWeight::get().writes(1_u64))
113
	}
114
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
115
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
116
	/// Storage: `System::Account` (r:4 w:3)
117
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
118
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
119
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
120
	/// Storage: `PooledStaking::Pools` (r:2 w:0)
121
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
122
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
123
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
124
	/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:1)
125
	/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
126
	/// The range of component `x` is `[1, 50]`.
127
	fn on_container_authors_noted(x: u32, ) -> Weight {
128
		// Proof Size summary in bytes:
129
		//  Measured:  `881`
130
		//  Estimated: `11402`
131
		// Minimum execution time: 92_161_000 picoseconds.
132
		Weight::from_parts(76_221_073, 11402)
133
			// Standard Error: 239_851
134
			.saturating_add(Weight::from_parts(10_452_583, 0).saturating_mul(x.into()))
135
			.saturating_add(T::DbWeight::get().reads(9_u64))
136
			.saturating_add(T::DbWeight::get().writes(5_u64))
137
	}
138
}
139

            
140
// For backwards compatibility and tests
141
impl WeightInfo for () {
142
	/// Storage: `AuthorNoting::DidSetContainerAuthorData` (r:1 w:1)
143
	/// Proof: `AuthorNoting::DidSetContainerAuthorData` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
144
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
145
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
146
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
147
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
148
	/// Storage: `System::Digest` (r:1 w:0)
149
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
150
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:1 w:0)
151
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
152
	/// Storage: `AuthorNoting::LatestAuthor` (r:100 w:100)
153
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
154
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
155
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
156
	/// The range of component `x` is `[1, 100]`.
157
16
	fn set_latest_author_data(x: u32, ) -> Weight {
158
16
		// Proof Size summary in bytes:
159
16
		//  Measured:  `493 + x * (73 ±0)`
160
16
		//  Estimated: `1978 + x * (2539 ±0)`
161
16
		// Minimum execution time: 48_373_000 picoseconds.
162
16
		Weight::from_parts(48_373_000, 1978)
163
16
			// Standard Error: 633_051
164
16
			.saturating_add(Weight::from_parts(15_379_156, 0).saturating_mul(x.into()))
165
16
			.saturating_add(RocksDbWeight::get().reads(6_u64))
166
16
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(x.into())))
167
16
			.saturating_add(RocksDbWeight::get().writes(2_u64))
168
16
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(x.into())))
169
16
			.saturating_add(Weight::from_parts(0, 2539).saturating_mul(x.into()))
170
16
	}
171
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
172
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
173
2
	fn set_author() -> Weight {
174
2
		// Proof Size summary in bytes:
175
2
		//  Measured:  `0`
176
2
		//  Estimated: `0`
177
2
		// Minimum execution time: 9_241_000 picoseconds.
178
2
		Weight::from_parts(9_241_000, 0)
179
2
			.saturating_add(RocksDbWeight::get().writes(1_u64))
180
2
	}
181
	/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
182
	/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
183
	fn kill_author_data() -> Weight {
184
		// Proof Size summary in bytes:
185
		//  Measured:  `0`
186
		//  Estimated: `0`
187
		// Minimum execution time: 11_313_000 picoseconds.
188
		Weight::from_parts(11_313_000, 0)
189
			.saturating_add(RocksDbWeight::get().writes(1_u64))
190
	}
191
	/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
192
	/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(418), added: 913, mode: `MaxEncodedLen`)
193
	/// Storage: `System::Account` (r:4 w:3)
194
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
195
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
196
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
197
	/// Storage: `PooledStaking::Pools` (r:2 w:0)
198
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
199
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
200
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
201
	/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:1)
202
	/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
203
	/// The range of component `x` is `[1, 50]`.
204
	fn on_container_authors_noted(x: u32, ) -> Weight {
205
		// Proof Size summary in bytes:
206
		//  Measured:  `881`
207
		//  Estimated: `11402`
208
		// Minimum execution time: 92_161_000 picoseconds.
209
		Weight::from_parts(76_221_073, 11402)
210
			// Standard Error: 239_851
211
			.saturating_add(Weight::from_parts(10_452_583, 0).saturating_mul(x.into()))
212
			.saturating_add(RocksDbWeight::get().reads(9_u64))
213
			.saturating_add(RocksDbWeight::get().writes(5_u64))
214
	}
215
}