gear_core/gas_metering/
schedule.rs

1// This file is part of Gear.
2//
3// Copyright (C) 2021-2025 Gear Technologies Inc.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19#![allow(rustdoc::broken_intra_doc_links, missing_docs)]
20#![doc = r" This is auto-generated module that contains cost schedule from"]
21#![doc = r" `pallets/gear/src/schedule.rs`."]
22#![doc = r""]
23#![doc = r" See `./scripts/weight-dump.sh` if you want to update it."]
24
25use crate::costs::*;
26
27#[derive(Debug, Clone)]
28#[doc = " Definition of the cost schedule and other parameterization for the wasm vm."]
29pub struct Schedule {
30    #[doc = " Describes the upper limits on various metrics."]
31    pub limits: Limits,
32    #[doc = " The weights for individual wasm instructions."]
33    pub instruction_weights: InstructionWeights,
34    #[doc = " The weights for each imported function a program is allowed to call."]
35    pub syscall_weights: SyscallWeights,
36    #[doc = " The weights for memory interaction."]
37    pub memory_weights: MemoryWeights,
38    #[doc = " The weights for renting."]
39    pub rent_weights: RentWeights,
40    #[doc = " The weights for database access."]
41    pub db_weights: DbWeights,
42    #[doc = " The weights for executing tasks."]
43    pub task_weights: TaskWeights,
44    #[doc = " The weights for instantiation of the module."]
45    pub instantiation_weights: InstantiationWeights,
46    #[doc = " The weights for WASM code instrumentation."]
47    pub instrumentation_weights: InstrumentationWeights,
48    #[doc = " Load allocations weight."]
49    pub load_allocations_weight: Weight,
50}
51
52impl Default for Schedule {
53    fn default() -> Self {
54        Self {
55            limits: Limits::default(),
56            instruction_weights: InstructionWeights::default(),
57            syscall_weights: SyscallWeights::default(),
58            memory_weights: MemoryWeights::default(),
59            rent_weights: RentWeights::default(),
60            db_weights: DbWeights::default(),
61            task_weights: TaskWeights::default(),
62            instantiation_weights: InstantiationWeights::default(),
63            instrumentation_weights: InstrumentationWeights::default(),
64            load_allocations_weight: Weight {
65                ref_time: 23856,
66                proof_size: 0,
67            },
68        }
69    }
70}
71
72#[derive(Debug, Clone)]
73#[doc = " Describes the upper limits on various metrics."]
74#[doc = ""]
75#[doc = " # Note"]
76#[doc = ""]
77#[doc = " The values in this struct should never be decreased. The reason is that decreasing those"]
78#[doc = " values will break existing programs which are above the new limits when a"]
79#[doc = " re-instrumentation is triggered."]
80pub struct Limits {
81    #[doc = " Maximum allowed stack height in number of elements."]
82    #[doc = ""]
83    #[doc = " See <https://wiki.parity.io/WebAssembly-StackHeight> to find out"]
84    #[doc = " how the stack frame cost is calculated. Each element can be of one of the"]
85    #[doc = " wasm value types. This means the maximum size per element is 64bit."]
86    #[doc = ""]
87    #[doc = " # Note"]
88    #[doc = ""]
89    #[doc = " It is safe to disable (pass `None`) the `stack_height` when the execution engine"]
90    #[doc = " is part of the runtime and hence there can be no indeterminism between different"]
91    #[doc = " client resident execution engines."]
92    pub stack_height: Option<u32>,
93    #[doc = " Maximum number of globals a module is allowed to declare."]
94    #[doc = ""]
95    #[doc = " Globals are not limited through the linear memory limit `memory_pages`."]
96    pub globals: u32,
97    #[doc = " Maximum number of locals a function can have."]
98    #[doc = ""]
99    #[doc = " As wasm engine initializes each of the local, we need to limit their number to confine"]
100    #[doc = " execution costs."]
101    pub locals: u32,
102    #[doc = " Maximum numbers of parameters a function can have."]
103    #[doc = ""]
104    #[doc = " Those need to be limited to prevent a potentially exploitable interaction with"]
105    #[doc = " the stack height instrumentation: The costs of executing the stack height"]
106    #[doc = " instrumentation for an indirectly called function scales linearly with the amount"]
107    #[doc = " of parameters of this function. Because the stack height instrumentation itself is"]
108    #[doc = " is not weight metered its costs must be static (via this limit) and included in"]
109    #[doc = " the costs of the instructions that cause them (call, call_indirect)."]
110    pub parameters: u32,
111    #[doc = " Maximum number of memory pages allowed for a program."]
112    pub memory_pages: u16,
113    #[doc = " Maximum number of elements allowed in a table."]
114    #[doc = ""]
115    #[doc = " Currently, the only type of element that is allowed in a table is funcref."]
116    pub table_size: u32,
117    #[doc = " Maximum number of elements that can appear as immediate value to the br_table instruction."]
118    pub br_table_size: u32,
119    #[doc = " The maximum length of a subject in bytes used for PRNG generation."]
120    pub subject_len: u32,
121    #[doc = " The maximum nesting level of the call stack."]
122    pub call_depth: u32,
123    #[doc = " The maximum size of a message payload in bytes."]
124    pub payload_len: u32,
125    #[doc = " The maximum length of a program code in bytes. This limit applies to the instrumented"]
126    #[doc = " version of the code. Therefore `instantiate_with_code` can fail even when supplying"]
127    #[doc = " a wasm binary below this maximum size."]
128    pub code_len: u32,
129    #[doc = " The maximum number of wasm data segments allowed for a program."]
130    pub data_segments_amount: u32,
131}
132
133impl Default for Limits {
134    fn default() -> Self {
135        Self {
136            stack_height: Some(36743),
137            globals: 256,
138            locals: 1024,
139            parameters: 128,
140            memory_pages: 32768,
141            table_size: 4096,
142            br_table_size: 256,
143            subject_len: 32,
144            call_depth: 32,
145            payload_len: 8388608,
146            code_len: 524288,
147            data_segments_amount: 1024,
148        }
149    }
150}
151
152#[derive(Debug, Clone)]
153#[doc = " Describes the weight for all categories of supported wasm instructions."]
154#[doc = ""]
155#[doc = " There there is one field for each wasm instruction that describes the weight to"]
156#[doc = " execute one instruction of that name. There are a few exceptions:"]
157#[doc = ""]
158#[doc = " 1. If there is a i64 and a i32 variant of an instruction we use the weight"]
159#[doc = "    of the former for both."]
160#[doc = " 2. The following instructions are free of charge because they merely structure the"]
161#[doc = "    wasm module and cannot be spammed without making the module invalid (and rejected):"]
162#[doc = "    End, Unreachable, Return, Else"]
163#[doc = " 3. The following instructions cannot be benchmarked because they are removed by any"]
164#[doc = "    real world execution engine as a preprocessing step and therefore don't yield a"]
165#[doc = "    meaningful benchmark result. However, in contrast to the instructions mentioned"]
166#[doc = "    in 2. they can be spammed. We price them with the same weight as the \"default\""]
167#[doc = "    instruction (i64.const): Block, Loop, Nop"]
168#[doc = " 4. We price both i64.const and drop as InstructionWeights.i64const / 2. The reason"]
169#[doc = "    for that is that we cannot benchmark either of them on its own but we need their"]
170#[doc = "    individual values to derive (by subtraction) the weight of all other instructions"]
171#[doc = "    that use them as supporting instructions. Supporting means mainly pushing arguments"]
172#[doc = "    and dropping return values in order to maintain a valid module."]
173pub struct InstructionWeights {
174    #[doc = " Version of the instruction weights."]
175    #[doc = ""]
176    #[doc = " # Note"]
177    #[doc = ""]
178    #[doc = " Should be incremented whenever any instruction weight is changed. The"]
179    #[doc = " reason is that changes to instruction weights require a re-instrumentation"]
180    #[doc = " in order to apply the changes to an already deployed code. The re-instrumentation"]
181    #[doc = " is triggered by comparing the version of the current schedule with the version the code was"]
182    #[doc = " instrumented with. Changes usually happen when pallet_gear is re-benchmarked."]
183    #[doc = ""]
184    #[doc = " Changes to other parts of the schedule should not increment the version in"]
185    #[doc = " order to avoid unnecessary re-instrumentations."]
186    pub version: u32,
187    pub i64const: u32,
188    pub i64load: u32,
189    pub i32load: u32,
190    pub i64store: u32,
191    pub i32store: u32,
192    pub select: u32,
193    pub r#if: u32,
194    pub br: u32,
195    pub br_if: u32,
196    pub br_table: u32,
197    pub br_table_per_entry: u32,
198    pub call: u32,
199    pub call_indirect: u32,
200    pub call_indirect_per_param: u32,
201    pub call_per_local: u32,
202    pub local_get: u32,
203    pub local_set: u32,
204    pub local_tee: u32,
205    pub global_get: u32,
206    pub global_set: u32,
207    pub memory_current: u32,
208    pub i64clz: u32,
209    pub i32clz: u32,
210    pub i64ctz: u32,
211    pub i32ctz: u32,
212    pub i64popcnt: u32,
213    pub i32popcnt: u32,
214    pub i64eqz: u32,
215    pub i32eqz: u32,
216    pub i32extend8s: u32,
217    pub i32extend16s: u32,
218    pub i64extend8s: u32,
219    pub i64extend16s: u32,
220    pub i64extend32s: u32,
221    pub i64extendsi32: u32,
222    pub i64extendui32: u32,
223    pub i32wrapi64: u32,
224    pub i64eq: u32,
225    pub i32eq: u32,
226    pub i64ne: u32,
227    pub i32ne: u32,
228    pub i64lts: u32,
229    pub i32lts: u32,
230    pub i64ltu: u32,
231    pub i32ltu: u32,
232    pub i64gts: u32,
233    pub i32gts: u32,
234    pub i64gtu: u32,
235    pub i32gtu: u32,
236    pub i64les: u32,
237    pub i32les: u32,
238    pub i64leu: u32,
239    pub i32leu: u32,
240    pub i64ges: u32,
241    pub i32ges: u32,
242    pub i64geu: u32,
243    pub i32geu: u32,
244    pub i64add: u32,
245    pub i32add: u32,
246    pub i64sub: u32,
247    pub i32sub: u32,
248    pub i64mul: u32,
249    pub i32mul: u32,
250    pub i64divs: u32,
251    pub i32divs: u32,
252    pub i64divu: u32,
253    pub i32divu: u32,
254    pub i64rems: u32,
255    pub i32rems: u32,
256    pub i64remu: u32,
257    pub i32remu: u32,
258    pub i64and: u32,
259    pub i32and: u32,
260    pub i64or: u32,
261    pub i32or: u32,
262    pub i64xor: u32,
263    pub i32xor: u32,
264    pub i64shl: u32,
265    pub i32shl: u32,
266    pub i64shrs: u32,
267    pub i32shrs: u32,
268    pub i64shru: u32,
269    pub i32shru: u32,
270    pub i64rotl: u32,
271    pub i32rotl: u32,
272    pub i64rotr: u32,
273    pub i32rotr: u32,
274}
275
276impl Default for InstructionWeights {
277    fn default() -> Self {
278        Self {
279            version: 1900,
280            i64const: 196,
281            i64load: 5532,
282            i32load: 5276,
283            i64store: 10604,
284            i32store: 10439,
285            select: 7079,
286            r#if: 5441,
287            br: 3845,
288            br_if: 6295,
289            br_table: 11520,
290            br_table_per_entry: 150,
291            call: 5461,
292            call_indirect: 25216,
293            call_indirect_per_param: 1307,
294            call_per_local: 0,
295            local_get: 679,
296            local_set: 1460,
297            local_tee: 1443,
298            global_get: 714,
299            global_set: 1073,
300            memory_current: 14243,
301            i64clz: 550,
302            i32clz: 238,
303            i64ctz: 550,
304            i32ctz: 238,
305            i64popcnt: 439,
306            i32popcnt: 263,
307            i64eqz: 1827,
308            i32eqz: 941,
309            i32extend8s: 233,
310            i32extend16s: 235,
311            i64extend8s: 388,
312            i64extend16s: 396,
313            i64extend32s: 340,
314            i64extendsi32: 190,
315            i64extendui32: 219,
316            i32wrapi64: 217,
317            i64eq: 1616,
318            i32eq: 969,
319            i64ne: 1588,
320            i32ne: 1033,
321            i64lts: 1659,
322            i32lts: 953,
323            i64ltu: 1620,
324            i32ltu: 1013,
325            i64gts: 1597,
326            i32gts: 1018,
327            i64gtu: 1631,
328            i32gtu: 963,
329            i64les: 1673,
330            i32les: 981,
331            i64leu: 1599,
332            i32leu: 927,
333            i64ges: 1617,
334            i32ges: 939,
335            i64geu: 1586,
336            i32geu: 941,
337            i64add: 897,
338            i32add: 488,
339            i64sub: 895,
340            i32sub: 486,
341            i64mul: 1599,
342            i32mul: 818,
343            i64divs: 3795,
344            i32divs: 2574,
345            i64divu: 3851,
346            i32divu: 2629,
347            i64rems: 21105,
348            i32rems: 17654,
349            i64remu: 3941,
350            i32remu: 2688,
351            i64and: 1078,
352            i32and: 550,
353            i64or: 1051,
354            i32or: 606,
355            i64xor: 1021,
356            i32xor: 543,
357            i64shl: 779,
358            i32shl: 287,
359            i64shrs: 772,
360            i32shrs: 285,
361            i64shru: 811,
362            i32shru: 285,
363            i64rotl: 765,
364            i32rotl: 291,
365            i64rotr: 799,
366            i32rotr: 302,
367        }
368    }
369}
370
371#[derive(Debug, Clone)]
372#[doc = " Describes the weight for each imported function that a program is allowed to call."]
373pub struct SyscallWeights {
374    #[doc = " Weight of calling `alloc`."]
375    pub alloc: Weight,
376    #[doc = " Weight of calling `free`."]
377    pub free: Weight,
378    #[doc = " Weight of calling `free_range`."]
379    pub free_range: Weight,
380    #[doc = " Weight of calling `free_range` per page."]
381    pub free_range_per_page: Weight,
382    #[doc = " Weight of calling `gr_reserve_gas`."]
383    pub gr_reserve_gas: Weight,
384    #[doc = " Weight of calling `gr_unreserve_gas`"]
385    pub gr_unreserve_gas: Weight,
386    #[doc = " Weight of calling `gr_system_reserve_gas`"]
387    pub gr_system_reserve_gas: Weight,
388    #[doc = " Weight of calling `gr_gas_available`."]
389    pub gr_gas_available: Weight,
390    #[doc = " Weight of calling `gr_message_id`."]
391    pub gr_message_id: Weight,
392    #[doc = " Weight of calling `gr_program_id`."]
393    pub gr_program_id: Weight,
394    #[doc = " Weight of calling `gr_source`."]
395    pub gr_source: Weight,
396    #[doc = " Weight of calling `gr_value`."]
397    pub gr_value: Weight,
398    #[doc = " Weight of calling `gr_value_available`."]
399    pub gr_value_available: Weight,
400    #[doc = " Weight of calling `gr_size`."]
401    pub gr_size: Weight,
402    #[doc = " Weight of calling `gr_read`."]
403    pub gr_read: Weight,
404    #[doc = " Weight per payload byte by `gr_read`."]
405    pub gr_read_per_byte: Weight,
406    #[doc = " Weight of calling `gr_env_vars`."]
407    pub gr_env_vars: Weight,
408    #[doc = " Weight of calling `gr_block_height`."]
409    pub gr_block_height: Weight,
410    #[doc = " Weight of calling `gr_block_timestamp`."]
411    pub gr_block_timestamp: Weight,
412    #[doc = " Weight of calling `gr_random`."]
413    pub gr_random: Weight,
414    #[doc = " Weight of calling `gr_reply_deposit`."]
415    pub gr_reply_deposit: Weight,
416    #[doc = " Weight of calling `gr_send`."]
417    pub gr_send: Weight,
418    #[doc = " Weight per payload byte in `gr_send`."]
419    pub gr_send_per_byte: Weight,
420    #[doc = " Weight of calling `gr_send_wgas`."]
421    pub gr_send_wgas: Weight,
422    #[doc = " Weight per payload byte in `gr_send_wgas`."]
423    pub gr_send_wgas_per_byte: Weight,
424    #[doc = " Weight of calling `gr_value_available`."]
425    pub gr_send_init: Weight,
426    #[doc = " Weight of calling `gr_send_push`."]
427    pub gr_send_push: Weight,
428    #[doc = " Weight per payload byte by `gr_send_push`."]
429    pub gr_send_push_per_byte: Weight,
430    #[doc = " Weight of calling `gr_send_commit`."]
431    pub gr_send_commit: Weight,
432    #[doc = " Weight of calling `gr_send_commit_wgas`."]
433    pub gr_send_commit_wgas: Weight,
434    #[doc = " Weight of calling `gr_reservation_send`."]
435    pub gr_reservation_send: Weight,
436    #[doc = " Weight per payload byte in `gr_reservation_send`."]
437    pub gr_reservation_send_per_byte: Weight,
438    #[doc = " Weight of calling `gr_reservation_send_commit`."]
439    pub gr_reservation_send_commit: Weight,
440    #[doc = " Weight of calling `gr_reply_commit`."]
441    pub gr_reply_commit: Weight,
442    #[doc = " Weight of calling `gr_reply_commit_wgas`."]
443    pub gr_reply_commit_wgas: Weight,
444    #[doc = " Weight of calling `gr_reservation_reply`."]
445    pub gr_reservation_reply: Weight,
446    #[doc = " Weight of calling `gr_reservation_reply` per one payload byte."]
447    pub gr_reservation_reply_per_byte: Weight,
448    #[doc = " Weight of calling `gr_reservation_reply_commit`."]
449    pub gr_reservation_reply_commit: Weight,
450    #[doc = " Weight of calling `gr_reply_push`."]
451    pub gr_reply_push: Weight,
452    #[doc = " Weight of calling `gr_reply`."]
453    pub gr_reply: Weight,
454    #[doc = " Weight of calling `gr_reply` per one payload byte."]
455    pub gr_reply_per_byte: Weight,
456    #[doc = " Weight of calling `gr_reply_wgas`."]
457    pub gr_reply_wgas: Weight,
458    #[doc = " Weight of calling `gr_reply_wgas` per one payload byte."]
459    pub gr_reply_wgas_per_byte: Weight,
460    #[doc = " Weight per payload byte by `gr_reply_push`."]
461    pub gr_reply_push_per_byte: Weight,
462    #[doc = " Weight of calling `gr_reply_to`."]
463    pub gr_reply_to: Weight,
464    #[doc = " Weight of calling `gr_signal_code`."]
465    pub gr_signal_code: Weight,
466    #[doc = " Weight of calling `gr_signal_from`."]
467    pub gr_signal_from: Weight,
468    #[doc = " Weight of calling `gr_reply_input`."]
469    pub gr_reply_input: Weight,
470    #[doc = " Weight of calling `gr_reply_input_wgas`."]
471    pub gr_reply_input_wgas: Weight,
472    #[doc = " Weight of calling `gr_reply_push_input`."]
473    pub gr_reply_push_input: Weight,
474    #[doc = " Weight per payload byte by `gr_reply_push_input`."]
475    pub gr_reply_push_input_per_byte: Weight,
476    #[doc = " Weight of calling `gr_send_input`."]
477    pub gr_send_input: Weight,
478    #[doc = " Weight of calling `gr_send_input_wgas`."]
479    pub gr_send_input_wgas: Weight,
480    #[doc = " Weight of calling `gr_send_push_input`."]
481    pub gr_send_push_input: Weight,
482    #[doc = " Weight per payload byte by `gr_send_push_input`."]
483    pub gr_send_push_input_per_byte: Weight,
484    #[doc = " Weight of calling `gr_debug`."]
485    pub gr_debug: Weight,
486    #[doc = " Weight per payload byte by `gr_debug_per_byte`."]
487    pub gr_debug_per_byte: Weight,
488    #[doc = " Weight of calling `gr_reply_code`."]
489    pub gr_reply_code: Weight,
490    #[doc = " Weight of calling `gr_exit`."]
491    pub gr_exit: Weight,
492    #[doc = " Weight of calling `gr_leave`."]
493    pub gr_leave: Weight,
494    #[doc = " Weight of calling `gr_wait`."]
495    pub gr_wait: Weight,
496    #[doc = " Weight of calling `gr_wait_for`."]
497    pub gr_wait_for: Weight,
498    #[doc = " Weight of calling `gr_wait_up_to`."]
499    pub gr_wait_up_to: Weight,
500    #[doc = " Weight of calling `gr_wake`."]
501    pub gr_wake: Weight,
502    #[doc = " Weight of calling `gr_create_program`."]
503    pub gr_create_program: Weight,
504    #[doc = " Weight per payload byte in `gr_create_program`."]
505    pub gr_create_program_payload_per_byte: Weight,
506    #[doc = " Weight per salt byte in `gr_create_program`"]
507    pub gr_create_program_salt_per_byte: Weight,
508    #[doc = " Weight of calling `create_program_wgas`."]
509    pub gr_create_program_wgas: Weight,
510    #[doc = " Weight per payload byte by `create_program_wgas`."]
511    pub gr_create_program_wgas_payload_per_byte: Weight,
512    #[doc = " Weight per salt byte by `create_program_wgas`."]
513    pub gr_create_program_wgas_salt_per_byte: Weight,
514}
515
516impl Default for SyscallWeights {
517    fn default() -> Self {
518        Self {
519            alloc: Weight {
520                ref_time: 1797260,
521                proof_size: 0,
522            },
523            free: Weight {
524                ref_time: 996898,
525                proof_size: 0,
526            },
527            free_range: Weight {
528                ref_time: 1037181,
529                proof_size: 0,
530            },
531            free_range_per_page: Weight {
532                ref_time: 53531,
533                proof_size: 0,
534            },
535            gr_reserve_gas: Weight {
536                ref_time: 2557671,
537                proof_size: 0,
538            },
539            gr_unreserve_gas: Weight {
540                ref_time: 2532794,
541                proof_size: 0,
542            },
543            gr_system_reserve_gas: Weight {
544                ref_time: 1291112,
545                proof_size: 0,
546            },
547            gr_gas_available: Weight {
548                ref_time: 1211034,
549                proof_size: 0,
550            },
551            gr_message_id: Weight {
552                ref_time: 1218247,
553                proof_size: 0,
554            },
555            gr_program_id: Weight {
556                ref_time: 1216917,
557                proof_size: 0,
558            },
559            gr_source: Weight {
560                ref_time: 1260383,
561                proof_size: 0,
562            },
563            gr_value: Weight {
564                ref_time: 1222331,
565                proof_size: 0,
566            },
567            gr_value_available: Weight {
568                ref_time: 1246999,
569                proof_size: 0,
570            },
571            gr_size: Weight {
572                ref_time: 1228382,
573                proof_size: 0,
574            },
575            gr_read: Weight {
576                ref_time: 1838813,
577                proof_size: 0,
578            },
579            gr_read_per_byte: Weight {
580                ref_time: 216,
581                proof_size: 0,
582            },
583            gr_env_vars: Weight {
584                ref_time: 1238509,
585                proof_size: 0,
586            },
587            gr_block_height: Weight {
588                ref_time: 1212941,
589                proof_size: 0,
590            },
591            gr_block_timestamp: Weight {
592                ref_time: 1228059,
593                proof_size: 0,
594            },
595            gr_random: Weight {
596                ref_time: 2193434,
597                proof_size: 0,
598            },
599            gr_reply_deposit: Weight {
600                ref_time: 5795243,
601                proof_size: 0,
602            },
603            gr_send: Weight {
604                ref_time: 3175487,
605                proof_size: 0,
606            },
607            gr_send_per_byte: Weight {
608                ref_time: 525,
609                proof_size: 0,
610            },
611            gr_send_wgas: Weight {
612                ref_time: 3199326,
613                proof_size: 0,
614            },
615            gr_send_wgas_per_byte: Weight {
616                ref_time: 520,
617                proof_size: 0,
618            },
619            gr_send_init: Weight {
620                ref_time: 1371942,
621                proof_size: 0,
622            },
623            gr_send_push: Weight {
624                ref_time: 2125612,
625                proof_size: 0,
626            },
627            gr_send_push_per_byte: Weight {
628                ref_time: 532,
629                proof_size: 0,
630            },
631            gr_send_commit: Weight {
632                ref_time: 2582215,
633                proof_size: 0,
634            },
635            gr_send_commit_wgas: Weight {
636                ref_time: 2628603,
637                proof_size: 0,
638            },
639            gr_reservation_send: Weight {
640                ref_time: 3797428,
641                proof_size: 0,
642            },
643            gr_reservation_send_per_byte: Weight {
644                ref_time: 537,
645                proof_size: 0,
646            },
647            gr_reservation_send_commit: Weight {
648                ref_time: 3352305,
649                proof_size: 0,
650            },
651            gr_reply_commit: Weight {
652                ref_time: 14190304,
653                proof_size: 0,
654            },
655            gr_reply_commit_wgas: Weight {
656                ref_time: 12438052,
657                proof_size: 0,
658            },
659            gr_reservation_reply: Weight {
660                ref_time: 9916828,
661                proof_size: 0,
662            },
663            gr_reservation_reply_per_byte: Weight {
664                ref_time: 767,
665                proof_size: 0,
666            },
667            gr_reservation_reply_commit: Weight {
668                ref_time: 9905924,
669                proof_size: 0,
670            },
671            gr_reply_push: Weight {
672                ref_time: 1994688,
673                proof_size: 0,
674            },
675            gr_reply: Weight {
676                ref_time: 13932546,
677                proof_size: 0,
678            },
679            gr_reply_per_byte: Weight {
680                ref_time: 780,
681                proof_size: 0,
682            },
683            gr_reply_wgas: Weight {
684                ref_time: 13545610,
685                proof_size: 0,
686            },
687            gr_reply_wgas_per_byte: Weight {
688                ref_time: 782,
689                proof_size: 0,
690            },
691            gr_reply_push_per_byte: Weight {
692                ref_time: 710,
693                proof_size: 0,
694            },
695            gr_reply_to: Weight {
696                ref_time: 1241752,
697                proof_size: 0,
698            },
699            gr_signal_code: Weight {
700                ref_time: 1243433,
701                proof_size: 0,
702            },
703            gr_signal_from: Weight {
704                ref_time: 1253340,
705                proof_size: 0,
706            },
707            gr_reply_input: Weight {
708                ref_time: 14554248,
709                proof_size: 0,
710            },
711            gr_reply_input_wgas: Weight {
712                ref_time: 12861480,
713                proof_size: 0,
714            },
715            gr_reply_push_input: Weight {
716                ref_time: 1394053,
717                proof_size: 0,
718            },
719            gr_reply_push_input_per_byte: Weight {
720                ref_time: 129,
721                proof_size: 0,
722            },
723            gr_send_input: Weight {
724                ref_time: 3050720,
725                proof_size: 0,
726            },
727            gr_send_input_wgas: Weight {
728                ref_time: 3107762,
729                proof_size: 0,
730            },
731            gr_send_push_input: Weight {
732                ref_time: 1587543,
733                proof_size: 0,
734            },
735            gr_send_push_input_per_byte: Weight {
736                ref_time: 157,
737                proof_size: 0,
738            },
739            gr_debug: Weight {
740                ref_time: 1423616,
741                proof_size: 0,
742            },
743            gr_debug_per_byte: Weight {
744                ref_time: 494,
745                proof_size: 0,
746            },
747            gr_reply_code: Weight {
748                ref_time: 1250732,
749                proof_size: 0,
750            },
751            gr_exit: Weight {
752                ref_time: 21540542,
753                proof_size: 0,
754            },
755            gr_leave: Weight {
756                ref_time: 16282680,
757                proof_size: 0,
758            },
759            gr_wait: Weight {
760                ref_time: 15669854,
761                proof_size: 0,
762            },
763            gr_wait_for: Weight {
764                ref_time: 16128408,
765                proof_size: 0,
766            },
767            gr_wait_up_to: Weight {
768                ref_time: 16617294,
769                proof_size: 0,
770            },
771            gr_wake: Weight {
772                ref_time: 3286292,
773                proof_size: 0,
774            },
775            gr_create_program: Weight {
776                ref_time: 4017070,
777                proof_size: 0,
778            },
779            gr_create_program_payload_per_byte: Weight {
780                ref_time: 129,
781                proof_size: 0,
782            },
783            gr_create_program_salt_per_byte: Weight {
784                ref_time: 1626,
785                proof_size: 0,
786            },
787            gr_create_program_wgas: Weight {
788                ref_time: 4118509,
789                proof_size: 0,
790            },
791            gr_create_program_wgas_payload_per_byte: Weight {
792                ref_time: 130,
793                proof_size: 0,
794            },
795            gr_create_program_wgas_salt_per_byte: Weight {
796                ref_time: 1626,
797                proof_size: 0,
798            },
799        }
800    }
801}
802
803#[derive(Debug, Clone)]
804#[doc = " Describes the weight for memory interaction."]
805#[doc = ""]
806#[doc = " Each weight with `lazy_pages_` prefix includes weight for storage read,"]
807#[doc = " because for each first page access we need to at least check whether page exists in storage."]
808#[doc = " But they do not include cost for loading page data from storage into program memory."]
809#[doc = " This weight is taken in account separately, when loading occurs."]
810#[doc = ""]
811#[doc = " Lazy-pages write accesses does not include cost for uploading page data to storage,"]
812#[doc = " because uploading happens after execution, so benchmarks do not include this cost."]
813#[doc = " But they include cost for processing changed page data in runtime."]
814pub struct MemoryWeights {
815    #[doc = " Cost per one [GearPage] signal `read` processing in lazy-pages,"]
816    pub lazy_pages_signal_read: Weight,
817    #[doc = " Cost per one [GearPage] signal `write` processing in lazy-pages,"]
818    pub lazy_pages_signal_write: Weight,
819    #[doc = " Cost per one [GearPage] signal `write after read` processing in lazy-pages,"]
820    pub lazy_pages_signal_write_after_read: Weight,
821    #[doc = " Cost per one [GearPage] host func `read` access processing in lazy-pages,"]
822    pub lazy_pages_host_func_read: Weight,
823    #[doc = " Cost per one [GearPage] host func `write` access processing in lazy-pages,"]
824    pub lazy_pages_host_func_write: Weight,
825    #[doc = " Cost per one [GearPage] host func `write after read` access processing in lazy-pages,"]
826    pub lazy_pages_host_func_write_after_read: Weight,
827    #[doc = " Cost per one [GearPage] data loading from storage and moving it in program memory."]
828    #[doc = " Does not include cost for storage read, because it is taken in account separately."]
829    pub load_page_data: Weight,
830    #[doc = " Cost per one [GearPage] uploading data to storage."]
831    #[doc = " Does not include cost for processing changed page data in runtime,"]
832    #[doc = " cause it is taken in account separately."]
833    pub upload_page_data: Weight,
834    #[doc = " Cost per one [WasmPage] for memory growing."]
835    pub mem_grow: Weight,
836    #[doc = " Cost per one [WasmPage] for memory growing."]
837    pub mem_grow_per_page: Weight,
838    #[doc = " Cost per one [GearPage]."]
839    #[doc = " When we read page data from storage in para-chain, then it should be sent to relay-chain,"]
840    #[doc = " in order to use it for process queue execution. So, reading from storage cause"]
841    #[doc = " additional resources consumption after block(s) production on para-chain."]
842    pub parachain_read_heuristic: Weight,
843}
844
845impl Default for MemoryWeights {
846    fn default() -> Self {
847        Self {
848            lazy_pages_signal_read: Weight {
849                ref_time: 29135567,
850                proof_size: 0,
851            },
852            lazy_pages_signal_write: Weight {
853                ref_time: 35934679,
854                proof_size: 0,
855            },
856            lazy_pages_signal_write_after_read: Weight {
857                ref_time: 10662222,
858                proof_size: 0,
859            },
860            lazy_pages_host_func_read: Weight {
861                ref_time: 30395108,
862                proof_size: 0,
863            },
864            lazy_pages_host_func_write: Weight {
865                ref_time: 36285199,
866                proof_size: 0,
867            },
868            lazy_pages_host_func_write_after_read: Weight {
869                ref_time: 12491615,
870                proof_size: 0,
871            },
872            load_page_data: Weight {
873                ref_time: 10762675,
874                proof_size: 0,
875            },
876            upload_page_data: Weight {
877                ref_time: 103893936,
878                proof_size: 0,
879            },
880            mem_grow: Weight {
881                ref_time: 728456,
882                proof_size: 0,
883            },
884            mem_grow_per_page: Weight {
885                ref_time: 5,
886                proof_size: 0,
887            },
888            parachain_read_heuristic: Weight {
889                ref_time: 0,
890                proof_size: 0,
891            },
892        }
893    }
894}
895
896#[derive(Debug, Clone)]
897#[doc = " Describes the weight for instantiation of the module."]
898pub struct InstantiationWeights {
899    #[doc = " WASM module code section instantiation per byte cost."]
900    pub code_section_per_byte: Weight,
901    #[doc = " WASM module data section instantiation per byte cost."]
902    pub data_section_per_byte: Weight,
903    #[doc = " WASM module global section instantiation per byte cost."]
904    pub global_section_per_byte: Weight,
905    #[doc = " WASM module table section instantiation per byte cost."]
906    pub table_section_per_byte: Weight,
907    #[doc = " WASM module element section instantiation per byte cost."]
908    pub element_section_per_byte: Weight,
909    #[doc = " WASM module type section instantiation per byte cost."]
910    pub type_section_per_byte: Weight,
911}
912
913impl Default for InstantiationWeights {
914    fn default() -> Self {
915        Self {
916            code_section_per_byte: Weight {
917                ref_time: 2772,
918                proof_size: 0,
919            },
920            data_section_per_byte: Weight {
921                ref_time: 647,
922                proof_size: 0,
923            },
924            global_section_per_byte: Weight {
925                ref_time: 3034,
926                proof_size: 0,
927            },
928            table_section_per_byte: Weight {
929                ref_time: 628,
930                proof_size: 0,
931            },
932            element_section_per_byte: Weight {
933                ref_time: 2688,
934                proof_size: 0,
935            },
936            type_section_per_byte: Weight {
937                ref_time: 18285,
938                proof_size: 0,
939            },
940        }
941    }
942}
943
944#[derive(Debug, Clone)]
945#[doc = " Describes the weight for renting."]
946pub struct RentWeights {
947    #[doc = " Holding message in waitlist weight."]
948    pub waitlist: Weight,
949    #[doc = " Holding message in dispatch stash weight."]
950    pub dispatch_stash: Weight,
951    #[doc = " Holding reservation weight."]
952    pub reservation: Weight,
953    #[doc = " Holding message in mailbox weight."]
954    pub mailbox: Weight,
955    #[doc = " The minimal gas amount for message to be inserted in mailbox."]
956    pub mailbox_threshold: Weight,
957}
958
959impl Default for RentWeights {
960    fn default() -> Self {
961        Self {
962            waitlist: Weight {
963                ref_time: 100,
964                proof_size: 0,
965            },
966            dispatch_stash: Weight {
967                ref_time: 100,
968                proof_size: 0,
969            },
970            reservation: Weight {
971                ref_time: 100,
972                proof_size: 0,
973            },
974            mailbox: Weight {
975                ref_time: 100,
976                proof_size: 0,
977            },
978            mailbox_threshold: Weight {
979                ref_time: 3000,
980                proof_size: 0,
981            },
982        }
983    }
984}
985
986#[derive(Debug, Clone)]
987#[doc = " Describes DB access weights."]
988pub struct DbWeights {
989    pub read: Weight,
990    pub read_per_byte: Weight,
991    pub write: Weight,
992    pub write_per_byte: Weight,
993}
994
995impl Default for DbWeights {
996    fn default() -> Self {
997        Self {
998            read: Weight {
999                ref_time: 25000000,
1000                proof_size: 0,
1001            },
1002            read_per_byte: Weight {
1003                ref_time: 830,
1004                proof_size: 0,
1005            },
1006            write: Weight {
1007                ref_time: 100000000,
1008                proof_size: 0,
1009            },
1010            write_per_byte: Weight {
1011                ref_time: 237,
1012                proof_size: 0,
1013            },
1014        }
1015    }
1016}
1017
1018#[derive(Debug, Clone)]
1019#[doc = " Describes weights for running tasks."]
1020pub struct TaskWeights {
1021    pub remove_gas_reservation: Weight,
1022    pub send_user_message_to_mailbox: Weight,
1023    pub send_user_message: Weight,
1024    pub send_dispatch: Weight,
1025    pub wake_message: Weight,
1026    pub wake_message_no_wake: Weight,
1027    pub remove_from_waitlist: Weight,
1028    pub remove_from_mailbox: Weight,
1029}
1030
1031impl Default for TaskWeights {
1032    fn default() -> Self {
1033        Self {
1034            remove_gas_reservation: Weight {
1035                ref_time: 956280000,
1036                proof_size: 6196,
1037            },
1038            send_user_message_to_mailbox: Weight {
1039                ref_time: 709875000,
1040                proof_size: 4290,
1041            },
1042            send_user_message: Weight {
1043                ref_time: 1471408000,
1044                proof_size: 6196,
1045            },
1046            send_dispatch: Weight {
1047                ref_time: 815761000,
1048                proof_size: 4126,
1049            },
1050            wake_message: Weight {
1051                ref_time: 857831000,
1052                proof_size: 4371,
1053            },
1054            wake_message_no_wake: Weight {
1055                ref_time: 31912000,
1056                proof_size: 3545,
1057            },
1058            remove_from_waitlist: Weight {
1059                ref_time: 1911031000,
1060                proof_size: 7598,
1061            },
1062            remove_from_mailbox: Weight {
1063                ref_time: 1865393000,
1064                proof_size: 7321,
1065            },
1066        }
1067    }
1068}
1069
1070#[derive(Debug, Clone)]
1071#[doc = " Describes WASM code instrumentation weights."]
1072pub struct InstrumentationWeights {
1073    #[doc = " WASM code instrumentation base cost."]
1074    pub base: Weight,
1075    #[doc = " WASM code instrumentation per-byte cost."]
1076    pub per_byte: Weight,
1077}
1078
1079impl Default for InstrumentationWeights {
1080    fn default() -> Self {
1081        Self {
1082            base: Weight {
1083                ref_time: 308799000,
1084                proof_size: 3760,
1085            },
1086            per_byte: Weight {
1087                ref_time: 726837,
1088                proof_size: 0,
1089            },
1090        }
1091    }
1092}
1093
1094#[doc = r" Represents the computational time and storage space required for an operation."]
1095#[derive(Debug, Clone, Copy)]
1096pub struct Weight {
1097    #[doc = r" The weight of computational time used based on some reference hardware."]
1098    pub ref_time: u64,
1099    #[doc = r" The weight of storage space used by proof of validity."]
1100    pub proof_size: u64,
1101}
1102
1103impl Weight {
1104    #[doc = r" Return the reference time part of the weight."]
1105    #[doc(hidden)]
1106    pub const fn ref_time(&self) -> u64 {
1107        self.ref_time
1108    }
1109    #[doc = r" Saturating [`Weight`] addition. Computes `self + rhs`, saturating at the numeric bounds of"]
1110    #[doc = r" all fields instead of overflowing."]
1111    #[doc(hidden)]
1112    pub const fn saturating_add(&self, other: Self) -> Self {
1113        Self {
1114            ref_time: self.ref_time.saturating_add(other.ref_time),
1115            proof_size: self.proof_size.saturating_add(other.proof_size),
1116        }
1117    }
1118}
1119
1120impl From<InstrumentationWeights> for InstrumentationCosts {
1121    fn from(val: InstrumentationWeights) -> Self {
1122        Self {
1123            base: val.base.ref_time().into(),
1124            per_byte: val.per_byte.ref_time().into(),
1125        }
1126    }
1127}
1128
1129impl From<SyscallWeights> for SyscallCosts {
1130    fn from(val: SyscallWeights) -> Self {
1131        Self {
1132            alloc: val.alloc.ref_time().into(),
1133            free: val.free.ref_time().into(),
1134            free_range: val.free_range.ref_time().into(),
1135            free_range_per_page: val.free_range_per_page.ref_time().into(),
1136            gr_reserve_gas: val.gr_reserve_gas.ref_time().into(),
1137            gr_unreserve_gas: val.gr_unreserve_gas.ref_time().into(),
1138            gr_system_reserve_gas: val.gr_system_reserve_gas.ref_time().into(),
1139            gr_gas_available: val.gr_gas_available.ref_time().into(),
1140            gr_message_id: val.gr_message_id.ref_time().into(),
1141            gr_program_id: val.gr_program_id.ref_time().into(),
1142            gr_source: val.gr_source.ref_time().into(),
1143            gr_value: val.gr_value.ref_time().into(),
1144            gr_value_available: val.gr_value_available.ref_time().into(),
1145            gr_size: val.gr_size.ref_time().into(),
1146            gr_read: val.gr_read.ref_time().into(),
1147            gr_read_per_byte: val.gr_read_per_byte.ref_time().into(),
1148            gr_env_vars: val.gr_env_vars.ref_time().into(),
1149            gr_block_height: val.gr_block_height.ref_time().into(),
1150            gr_block_timestamp: val.gr_block_timestamp.ref_time().into(),
1151            gr_random: val.gr_random.ref_time().into(),
1152            gr_reply_deposit: val.gr_reply_deposit.ref_time().into(),
1153            gr_send: val.gr_send.ref_time().into(),
1154            gr_send_per_byte: val.gr_send_per_byte.ref_time().into(),
1155            gr_send_wgas: val.gr_send_wgas.ref_time().into(),
1156            gr_send_wgas_per_byte: val.gr_send_wgas_per_byte.ref_time().into(),
1157            gr_send_init: val.gr_send_init.ref_time().into(),
1158            gr_send_push: val.gr_send_push.ref_time().into(),
1159            gr_send_push_per_byte: val.gr_send_push_per_byte.ref_time().into(),
1160            gr_send_commit: val.gr_send_commit.ref_time().into(),
1161            gr_send_commit_wgas: val.gr_send_commit_wgas.ref_time().into(),
1162            gr_reservation_send: val.gr_reservation_send.ref_time().into(),
1163            gr_reservation_send_per_byte: val.gr_reservation_send_per_byte.ref_time().into(),
1164            gr_reservation_send_commit: val.gr_reservation_send_commit.ref_time().into(),
1165            gr_send_input: val.gr_send_input.ref_time().into(),
1166            gr_send_input_wgas: val.gr_send_input_wgas.ref_time().into(),
1167            gr_send_push_input: val.gr_send_push_input.ref_time().into(),
1168            gr_send_push_input_per_byte: val.gr_send_push_input_per_byte.ref_time().into(),
1169            gr_reply: val.gr_reply.ref_time().into(),
1170            gr_reply_per_byte: val.gr_reply_per_byte.ref_time().into(),
1171            gr_reply_wgas: val.gr_reply_wgas.ref_time().into(),
1172            gr_reply_wgas_per_byte: val.gr_reply_wgas_per_byte.ref_time().into(),
1173            gr_reply_push: val.gr_reply_push.ref_time().into(),
1174            gr_reply_push_per_byte: val.gr_reply_push_per_byte.ref_time().into(),
1175            gr_reply_commit: val.gr_reply_commit.ref_time().into(),
1176            gr_reply_commit_wgas: val.gr_reply_commit_wgas.ref_time().into(),
1177            gr_reservation_reply: val.gr_reservation_reply.ref_time().into(),
1178            gr_reservation_reply_per_byte: val.gr_reservation_reply_per_byte.ref_time().into(),
1179            gr_reservation_reply_commit: val.gr_reservation_reply_commit.ref_time().into(),
1180            gr_reply_input: val.gr_reply_input.ref_time().into(),
1181            gr_reply_input_wgas: val.gr_reply_input_wgas.ref_time().into(),
1182            gr_reply_push_input: val.gr_reply_push_input.ref_time().into(),
1183            gr_reply_push_input_per_byte: val.gr_reply_push_input_per_byte.ref_time().into(),
1184            gr_debug: val.gr_debug.ref_time().into(),
1185            gr_debug_per_byte: val.gr_debug_per_byte.ref_time().into(),
1186            gr_reply_to: val.gr_reply_to.ref_time().into(),
1187            gr_signal_code: val.gr_signal_code.ref_time().into(),
1188            gr_signal_from: val.gr_signal_from.ref_time().into(),
1189            gr_reply_code: val.gr_reply_code.ref_time().into(),
1190            gr_exit: val.gr_exit.ref_time().into(),
1191            gr_leave: val.gr_leave.ref_time().into(),
1192            gr_wait: val.gr_wait.ref_time().into(),
1193            gr_wait_for: val.gr_wait_for.ref_time().into(),
1194            gr_wait_up_to: val.gr_wait_up_to.ref_time().into(),
1195            gr_wake: val.gr_wake.ref_time().into(),
1196            gr_create_program: val.gr_create_program.ref_time().into(),
1197            gr_create_program_payload_per_byte: val
1198                .gr_create_program_payload_per_byte
1199                .ref_time()
1200                .into(),
1201            gr_create_program_salt_per_byte: val.gr_create_program_salt_per_byte.ref_time().into(),
1202            gr_create_program_wgas: val.gr_create_program_wgas.ref_time().into(),
1203            gr_create_program_wgas_payload_per_byte: val
1204                .gr_create_program_wgas_payload_per_byte
1205                .ref_time()
1206                .into(),
1207            gr_create_program_wgas_salt_per_byte: val
1208                .gr_create_program_wgas_salt_per_byte
1209                .ref_time()
1210                .into(),
1211        }
1212    }
1213}
1214
1215impl From<MemoryWeights> for IoCosts {
1216    fn from(val: MemoryWeights) -> Self {
1217        Self {
1218            common: PagesCosts::from(val.clone()),
1219            lazy_pages: LazyPagesCosts::from(val),
1220        }
1221    }
1222}
1223
1224impl From<MemoryWeights> for PagesCosts {
1225    fn from(val: MemoryWeights) -> Self {
1226        Self {
1227            load_page_data: val.load_page_data.ref_time().into(),
1228            upload_page_data: val.upload_page_data.ref_time().into(),
1229            mem_grow: val.mem_grow.ref_time().into(),
1230            mem_grow_per_page: val.mem_grow_per_page.ref_time().into(),
1231            parachain_read_heuristic: val.parachain_read_heuristic.ref_time().into(),
1232        }
1233    }
1234}
1235
1236impl From<MemoryWeights> for LazyPagesCosts {
1237    fn from(val: MemoryWeights) -> Self {
1238        Self {
1239            signal_read: val.lazy_pages_signal_read.ref_time().into(),
1240            signal_write: val
1241                .lazy_pages_signal_write
1242                .saturating_add(val.upload_page_data)
1243                .ref_time()
1244                .into(),
1245            signal_write_after_read: val
1246                .lazy_pages_signal_write_after_read
1247                .saturating_add(val.upload_page_data)
1248                .ref_time()
1249                .into(),
1250            host_func_read: val.lazy_pages_host_func_read.ref_time().into(),
1251            host_func_write: val
1252                .lazy_pages_host_func_write
1253                .saturating_add(val.upload_page_data)
1254                .ref_time()
1255                .into(),
1256            host_func_write_after_read: val
1257                .lazy_pages_host_func_write_after_read
1258                .saturating_add(val.upload_page_data)
1259                .ref_time()
1260                .into(),
1261            load_page_storage_data: val
1262                .load_page_data
1263                .saturating_add(val.parachain_read_heuristic)
1264                .ref_time()
1265                .into(),
1266        }
1267    }
1268}
1269
1270impl From<RentWeights> for RentCosts {
1271    fn from(val: RentWeights) -> Self {
1272        Self {
1273            waitlist: val.waitlist.ref_time().into(),
1274            dispatch_stash: val.dispatch_stash.ref_time().into(),
1275            reservation: val.reservation.ref_time().into(),
1276        }
1277    }
1278}
1279
1280impl From<DbWeights> for DbCosts {
1281    fn from(val: DbWeights) -> Self {
1282        Self {
1283            write: val.write.ref_time().into(),
1284            read: val.read.ref_time().into(),
1285            write_per_byte: val.write_per_byte.ref_time().into(),
1286            read_per_byte: val.read_per_byte.ref_time().into(),
1287        }
1288    }
1289}
1290
1291impl From<InstantiationWeights> for InstantiationCosts {
1292    fn from(val: InstantiationWeights) -> Self {
1293        Self {
1294            code_section_per_byte: val.code_section_per_byte.ref_time().into(),
1295            data_section_per_byte: val.data_section_per_byte.ref_time().into(),
1296            global_section_per_byte: val.global_section_per_byte.ref_time().into(),
1297            table_section_per_byte: val.table_section_per_byte.ref_time().into(),
1298            element_section_per_byte: val.element_section_per_byte.ref_time().into(),
1299            type_section_per_byte: val.type_section_per_byte.ref_time().into(),
1300        }
1301    }
1302}
1303
1304impl Schedule {
1305    pub fn process_costs(&self) -> ProcessCosts {
1306        ProcessCosts {
1307            ext: ExtCosts {
1308                syscalls: self.syscall_weights.clone().into(),
1309                rent: self.rent_weights.clone().into(),
1310                mem_grow: self.memory_weights.mem_grow.ref_time().into(),
1311                mem_grow_per_page: self.memory_weights.mem_grow_per_page.ref_time().into(),
1312            },
1313            db: self.db_weights.clone().into(),
1314            instrumentation: self.instrumentation_weights.clone().into(),
1315            lazy_pages: self.memory_weights.clone().into(),
1316            instantiation: self.instantiation_weights.clone().into(),
1317            load_allocations_per_interval: self.load_allocations_weight.ref_time().into(),
1318        }
1319    }
1320}