1
// Copyright 2025 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

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

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

            
43
#![cfg_attr(rustfmt, rustfmt_skip)]
44
#![allow(unused_parens)]
45
#![allow(unused_imports)]
46

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

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