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 42.0.0
20
//! DATE: 2024-10-10, 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: Some("moonbase-dev"), DB CACHE: 1024
24

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

            
39
#![cfg_attr(rustfmt, rustfmt_skip)]
40
#![allow(unused_parens)]
41
#![allow(unused_imports)]
42

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

            
46
/// Weights for `pallet_randomness`.
47
pub struct WeightInfo<T>(PhantomData<T>);
48
impl<T: frame_system::Config> pallet_randomness::WeightInfo for WeightInfo<T> {
49
	/// Storage: `Randomness::RelayEpoch` (r:1 w:1)
50
	/// Proof: `Randomness::RelayEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
51
	/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
52
	/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
53
	/// Storage: `ParachainSystem::RelayStateProof` (r:1 w:0)
54
	/// Proof: `ParachainSystem::RelayStateProof` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
55
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
56
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
57
	/// Storage: `Randomness::InherentIncluded` (r:0 w:1)
58
	/// Proof: `Randomness::InherentIncluded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
59
	fn set_babe_randomness_results() -> Weight {
60
		// Proof Size summary in bytes:
61
		//  Measured:  `297`
62
		//  Estimated: `3762`
63
		// Minimum execution time: 12_198_000 picoseconds.
64
		Weight::from_parts(12_517_000, 3762)
65
			.saturating_add(T::DbWeight::get().reads(4_u64))
66
			.saturating_add(T::DbWeight::get().writes(3_u64))
67
	}
68
	/// Storage: `Randomness::NotFirstBlock` (r:1 w:0)
69
	/// Proof: `Randomness::NotFirstBlock` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
70
	/// Storage: `System::Digest` (r:1 w:0)
71
	/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
72
	/// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:0)
73
	/// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`)
74
	/// Storage: `Randomness::LocalVrfOutput` (r:1 w:1)
75
	/// Proof: `Randomness::LocalVrfOutput` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
76
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
77
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
78
	fn on_initialize() -> Weight {
79
		// Proof Size summary in bytes:
80
		//  Measured:  `719`
81
		//  Estimated: `4184`
82
		// Minimum execution time: 519_559_000 picoseconds.
83
		Weight::from_parts(523_170_000, 4184)
84
			.saturating_add(T::DbWeight::get().reads(5_u64))
85
			.saturating_add(T::DbWeight::get().writes(2_u64))
86
	}
87
	/// Storage: `Parameters::Parameters` (r:1 w:0)
88
	/// Proof: `Parameters::Parameters` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
89
	/// Storage: `Randomness::RequestCount` (r:1 w:1)
90
	/// Proof: `Randomness::RequestCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
91
	/// Storage: `System::Account` (r:2 w:2)
92
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
93
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
94
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
95
	/// Storage: `Randomness::Requests` (r:0 w:1)
96
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
97
	fn request_randomness() -> Weight {
98
		// Proof Size summary in bytes:
99
		//  Measured:  `549`
100
		//  Estimated: `6172`
101
		// Minimum execution time: 52_393_000 picoseconds.
102
		Weight::from_parts(54_545_000, 6172)
103
			.saturating_add(T::DbWeight::get().reads(5_u64))
104
			.saturating_add(T::DbWeight::get().writes(5_u64))
105
	}
106
	/// Storage: `Randomness::Requests` (r:1 w:0)
107
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
108
	/// Storage: `Randomness::RandomnessResults` (r:1 w:0)
109
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
110
	/// The range of component `x` is `[1, 100]`.
111
	fn prepare_fulfillment(x: u32, ) -> Weight {
112
		// Proof Size summary in bytes:
113
		//  Measured:  `412`
114
		//  Estimated: `3877`
115
		// Minimum execution time: 9_399_000 picoseconds.
116
		Weight::from_parts(9_673_040, 3877)
117
			// Standard Error: 362
118
			.saturating_add(Weight::from_parts(263_578, 0).saturating_mul(x.into()))
119
			.saturating_add(T::DbWeight::get().reads(2_u64))
120
	}
121
	/// Storage: `System::Account` (r:2 w:2)
122
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
123
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
124
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
125
	/// Storage: `Randomness::Requests` (r:0 w:1)
126
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
127
	fn finish_fulfillment() -> Weight {
128
		// Proof Size summary in bytes:
129
		//  Measured:  `739`
130
		//  Estimated: `6172`
131
		// Minimum execution time: 49_219_000 picoseconds.
132
		Weight::from_parts(51_561_000, 6172)
133
			.saturating_add(T::DbWeight::get().reads(3_u64))
134
			.saturating_add(T::DbWeight::get().writes(4_u64))
135
	}
136
	/// Storage: `Randomness::Requests` (r:1 w:1)
137
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
138
	/// Storage: `System::Account` (r:2 w:2)
139
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
140
	fn increase_fee() -> Weight {
141
		// Proof Size summary in bytes:
142
		//  Measured:  `825`
143
		//  Estimated: `6172`
144
		// Minimum execution time: 46_217_000 picoseconds.
145
		Weight::from_parts(48_364_000, 6172)
146
			.saturating_add(T::DbWeight::get().reads(3_u64))
147
			.saturating_add(T::DbWeight::get().writes(3_u64))
148
	}
149
	/// Storage: `Randomness::Requests` (r:1 w:1)
150
	/// Proof: `Randomness::Requests` (`max_values`: None, `max_size`: None, mode: `Measured`)
151
	/// Storage: `System::Account` (r:2 w:2)
152
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
153
	/// Storage: `Randomness::RandomnessResults` (r:1 w:1)
154
	/// Proof: `Randomness::RandomnessResults` (`max_values`: None, `max_size`: None, mode: `Measured`)
155
	fn execute_request_expiration() -> Weight {
156
		// Proof Size summary in bytes:
157
		//  Measured:  `868`
158
		//  Estimated: `6172`
159
		// Minimum execution time: 50_501_000 picoseconds.
160
		Weight::from_parts(52_681_000, 6172)
161
			.saturating_add(T::DbWeight::get().reads(4_u64))
162
			.saturating_add(T::DbWeight::get().writes(4_u64))
163
	}
164
}