1
// Copyright 2024 Moonbeam foundation
2
// This file is part of Moonbeam.
3

            
4
// Moonbeam 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
// Moonbeam 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 Moonbeam.  If not, see <http://www.gnu.org/licenses/>.
16

            
17
//! Autogenerated weights for `pallet_randomness`
18
//!
19
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
20
//! DATE: 2025-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21
//! WORST CASE MAP SIZE: `1000000`
22
//! HOSTNAME: `ip-10-0-0-176`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
23
//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
24

            
25
// Executed Command:
26
// ./target/production/moonbeam
27
// benchmark
28
// pallet
29
// --runtime=./target/production/wbuild/moonbeam-runtime/moonbeam_runtime.wasm
30
// --genesis-builder=runtime
31
// --genesis-builder-preset=development
32
// --steps=50
33
// --repeat=20
34
// --pallet=pallet_randomness
35
// --extrinsic=*
36
// --wasm-execution=compiled
37
// --header=./file_header.txt
38
// --template=./benchmarking/frame-weight-template.hbs
39
// --output=./runtime/moonbeam/src/weights/
40

            
41
#![cfg_attr(rustfmt, rustfmt_skip)]
42
#![allow(unused_parens)]
43
#![allow(unused_imports)]
44

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

            
48
/// Weights for `pallet_randomness`.
49
pub struct WeightInfo<T>(PhantomData<T>);
50
impl<T: frame_system::Config> pallet_randomness::WeightInfo for WeightInfo<T> {
51
	/// Storage: `Randomness::RelayEpoch` (r:1 w:1)
52
	/// Proof: `Randomness::RelayEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
53
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
54
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
55
	/// Storage: `ParachainSystem::RelayStateProof` (r:1 w:0)
56
	/// Proof: `ParachainSystem::RelayStateProof` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
57
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
58
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
59
	/// Storage: `Randomness::InherentIncluded` (r:0 w:1)
60
	/// Proof: `Randomness::InherentIncluded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
61
	fn set_babe_randomness_results() -> Weight {
62
		// Proof Size summary in bytes:
63
		//  Measured:  `297`
64
		//  Estimated: `3762`
65
		// Minimum execution time: 15_583_000 picoseconds.
66
		Weight::from_parts(15_950_000, 3762)
67
			.saturating_add(T::DbWeight::get().reads(4_u64))
68
			.saturating_add(T::DbWeight::get().writes(3_u64))
69
	}
70
	/// Storage: `Randomness::NotFirstBlock` (r:1 w:0)
71
	/// Proof: `Randomness::NotFirstBlock` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
72
	/// Storage: `System::Digest` (r:1 w:0)
73
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
74
	/// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:0)
75
	/// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
76
	/// Storage: `Randomness::LocalVrfOutput` (r:1 w:1)
77
	/// Proof: `Randomness::LocalVrfOutput` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
78
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
79
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
80
	fn on_initialize() -> Weight {
81
		// Proof Size summary in bytes:
82
		//  Measured:  `686`
83
		//  Estimated: `4151`
84
		// Minimum execution time: 529_455_000 picoseconds.
85
		Weight::from_parts(531_387_000, 4151)
86
			.saturating_add(T::DbWeight::get().reads(5_u64))
87
			.saturating_add(T::DbWeight::get().writes(2_u64))
88
	}
89
	/// Storage: `Parameters::Parameters` (r:1 w:0)
90
	/// Proof: `Parameters::Parameters` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
91
	/// Storage: `Randomness::RequestCount` (r:1 w:1)
92
	/// Proof: `Randomness::RequestCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
93
	/// Storage: `System::Account` (r:2 w:2)
94
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
95
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
96
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
97
	/// Storage: `Randomness::Requests` (r:0 w:1)
98
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
99
	fn request_randomness() -> Weight {
100
		// Proof Size summary in bytes:
101
		//  Measured:  `516`
102
		//  Estimated: `6172`
103
		// Minimum execution time: 61_840_000 picoseconds.
104
		Weight::from_parts(63_321_000, 6172)
105
			.saturating_add(T::DbWeight::get().reads(5_u64))
106
			.saturating_add(T::DbWeight::get().writes(5_u64))
107
	}
108
	/// Storage: `Randomness::Requests` (r:1 w:0)
109
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
110
	/// Storage: `Randomness::RandomnessResults` (r:1 w:0)
111
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
112
	/// The range of component `x` is `[1, 100]`.
113
	fn prepare_fulfillment(x: u32, ) -> Weight {
114
		// Proof Size summary in bytes:
115
		//  Measured:  `412`
116
		//  Estimated: `3877`
117
		// Minimum execution time: 11_096_000 picoseconds.
118
		Weight::from_parts(11_591_218, 3877)
119
			// Standard Error: 315
120
			.saturating_add(Weight::from_parts(251_915, 0).saturating_mul(x.into()))
121
			.saturating_add(T::DbWeight::get().reads(2_u64))
122
	}
123
	/// Storage: `System::Account` (r:2 w:2)
124
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
125
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
126
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
127
	/// Storage: `Randomness::Requests` (r:0 w:1)
128
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
129
	fn finish_fulfillment() -> Weight {
130
		// Proof Size summary in bytes:
131
		//  Measured:  `706`
132
		//  Estimated: `6172`
133
		// Minimum execution time: 56_389_000 picoseconds.
134
		Weight::from_parts(57_206_000, 6172)
135
			.saturating_add(T::DbWeight::get().reads(3_u64))
136
			.saturating_add(T::DbWeight::get().writes(4_u64))
137
	}
138
	/// Storage: `Randomness::Requests` (r:1 w:1)
139
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
140
	/// Storage: `System::Account` (r:2 w:2)
141
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
142
	fn increase_fee() -> Weight {
143
		// Proof Size summary in bytes:
144
		//  Measured:  `792`
145
		//  Estimated: `6172`
146
		// Minimum execution time: 52_962_000 picoseconds.
147
		Weight::from_parts(53_852_000, 6172)
148
			.saturating_add(T::DbWeight::get().reads(3_u64))
149
			.saturating_add(T::DbWeight::get().writes(3_u64))
150
	}
151
	/// Storage: `Randomness::Requests` (r:1 w:1)
152
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
153
	/// Storage: `System::Account` (r:2 w:2)
154
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
155
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
156
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
157
	fn execute_request_expiration() -> Weight {
158
		// Proof Size summary in bytes:
159
		//  Measured:  `835`
160
		//  Estimated: `6172`
161
		// Minimum execution time: 57_008_000 picoseconds.
162
		Weight::from_parts(58_326_000, 6172)
163
			.saturating_add(T::DbWeight::get().reads(4_u64))
164
			.saturating_add(T::DbWeight::get().writes(4_u64))
165
	}
166
}