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_collator_assignment
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2025-05-28, 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_collator_assignment
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_collator_assignment.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_collator_assignment.
55
pub trait WeightInfo {
56
	fn new_session(x: u32, y: u32, ) -> Weight;
57
}
58

            
59
/// Weights for pallet_collator_assignment using the Substrate node and recommended hardware.
60
pub struct SubstrateWeight<T>(PhantomData<T>);
61
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
62
	/// Storage: `CollatorAssignment::Randomness` (r:1 w:1)
63
	/// Proof: `CollatorAssignment::Randomness` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
64
	/// Storage: `Configuration::PendingConfigs` (r:1 w:0)
65
	/// Proof: `Configuration::PendingConfigs` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
66
	/// Storage: `Configuration::ActiveConfig` (r:1 w:0)
67
	/// Proof: `Configuration::ActiveConfig` (`max_values`: Some(1), `max_size`: Some(52), added: 547, mode: `MaxEncodedLen`)
68
	/// Storage: `Registrar::PendingParaIds` (r:1 w:0)
69
	/// Proof: `Registrar::PendingParaIds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
70
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
71
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
72
	/// Storage: `Registrar::ParathreadParams` (r:20 w:0)
73
	/// Proof: `Registrar::ParathreadParams` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
74
	/// Storage: `CollatorAssignment::PendingCollatorContainerChain` (r:1 w:1)
75
	/// Proof: `CollatorAssignment::PendingCollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
76
	/// Storage: `ServicesPayment::MaxTip` (r:20 w:0)
77
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
78
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:20 w:20)
79
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
80
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:20 w:0)
81
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
82
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
83
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
84
	/// Storage: `System::BlockWeight` (r:1 w:1)
85
	/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
86
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:0 w:1)
87
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
88
	/// Storage: `CollatorAssignment::CollatorFullnessRatio` (r:0 w:1)
89
	/// Proof: `CollatorAssignment::CollatorFullnessRatio` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
90
	/// The range of component `x` is `[1, 200]`.
91
	/// The range of component `y` is `[1, 20]`.
92
	fn new_session(x: u32, y: u32, ) -> Weight {
93
		// Proof Size summary in bytes:
94
		//  Measured:  `728 + y * (59 ±0)`
95
		//  Estimated: `4687 + y * (2511 ±0)`
96
		// Minimum execution time: 256_969_000 picoseconds.
97
		Weight::from_parts(68_463_860, 4687)
98
			// Standard Error: 121_658
99
			.saturating_add(Weight::from_parts(650_927, 0).saturating_mul(x.into()))
100
			// Standard Error: 1_247_148
101
			.saturating_add(Weight::from_parts(38_340_765, 0).saturating_mul(y.into()))
102
			.saturating_add(T::DbWeight::get().reads(8_u64))
103
			.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(y.into())))
104
			.saturating_add(T::DbWeight::get().writes(5_u64))
105
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into())))
106
			.saturating_add(Weight::from_parts(0, 2511).saturating_mul(y.into()))
107
	}
108
}
109

            
110
// For backwards compatibility and tests
111
impl WeightInfo for () {
112
	/// Storage: `CollatorAssignment::Randomness` (r:1 w:1)
113
	/// Proof: `CollatorAssignment::Randomness` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
114
	/// Storage: `Configuration::PendingConfigs` (r:1 w:0)
115
	/// Proof: `Configuration::PendingConfigs` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
116
	/// Storage: `Configuration::ActiveConfig` (r:1 w:0)
117
	/// Proof: `Configuration::ActiveConfig` (`max_values`: Some(1), `max_size`: Some(52), added: 547, mode: `MaxEncodedLen`)
118
	/// Storage: `Registrar::PendingParaIds` (r:1 w:0)
119
	/// Proof: `Registrar::PendingParaIds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
120
	/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
121
	/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
122
	/// Storage: `Registrar::ParathreadParams` (r:20 w:0)
123
	/// Proof: `Registrar::ParathreadParams` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
124
	/// Storage: `CollatorAssignment::PendingCollatorContainerChain` (r:1 w:1)
125
	/// Proof: `CollatorAssignment::PendingCollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
126
	/// Storage: `ServicesPayment::MaxTip` (r:20 w:0)
127
	/// Proof: `ServicesPayment::MaxTip` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
128
	/// Storage: `ServicesPayment::CollatorAssignmentCredits` (r:20 w:20)
129
	/// Proof: `ServicesPayment::CollatorAssignmentCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
130
	/// Storage: `ServicesPayment::BlockProductionCredits` (r:20 w:0)
131
	/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
132
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
133
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
134
	/// Storage: `System::BlockWeight` (r:1 w:1)
135
	/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
136
	/// Storage: `CollatorAssignment::CollatorContainerChain` (r:0 w:1)
137
	/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
138
	/// Storage: `CollatorAssignment::CollatorFullnessRatio` (r:0 w:1)
139
	/// Proof: `CollatorAssignment::CollatorFullnessRatio` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
140
	/// The range of component `x` is `[1, 200]`.
141
	/// The range of component `y` is `[1, 20]`.
142
148
	fn new_session(x: u32, y: u32, ) -> Weight {
143
148
		// Proof Size summary in bytes:
144
148
		//  Measured:  `728 + y * (59 ±0)`
145
148
		//  Estimated: `4687 + y * (2511 ±0)`
146
148
		// Minimum execution time: 256_969_000 picoseconds.
147
148
		Weight::from_parts(68_463_860, 4687)
148
148
			// Standard Error: 121_658
149
148
			.saturating_add(Weight::from_parts(650_927, 0).saturating_mul(x.into()))
150
148
			// Standard Error: 1_247_148
151
148
			.saturating_add(Weight::from_parts(38_340_765, 0).saturating_mul(y.into()))
152
148
			.saturating_add(RocksDbWeight::get().reads(8_u64))
153
148
			.saturating_add(RocksDbWeight::get().reads((4_u64).saturating_mul(y.into())))
154
148
			.saturating_add(RocksDbWeight::get().writes(5_u64))
155
148
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(y.into())))
156
148
			.saturating_add(Weight::from_parts(0, 2511).saturating_mul(y.into()))
157
148
	}
158
}