File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const GAS_PER_SECOND: u64 = 10_000_000_000;
1313/// like 10 gas for ~1ns allows us to be granular in instructions which are aggregated into metered
1414/// blocks via https://docs.rs/pwasm-utils/0.16.0/pwasm_utils/fn.inject_gas_counter.html But we can
1515/// still charge very high numbers for other things.
16- const CONST_MAX_GAS_PER_HANDLER : u64 = 1000 * GAS_PER_SECOND ;
16+ pub const CONST_MAX_GAS_PER_HANDLER : u64 = 1000 * GAS_PER_SECOND ;
1717
1818lazy_static ! {
1919 /// This is configurable only for debugging purposes. This value is set by the protocol,
Original file line number Diff line number Diff line change 11use std:: { convert:: TryInto , num:: NonZeroU32 } ;
22
3- use graph:: runtime:: gas:: MAX_GAS_PER_HANDLER ;
3+ use graph:: runtime:: gas:: CONST_MAX_GAS_PER_HANDLER ;
44use parity_wasm:: elements:: Instruction ;
55use pwasm_utils:: rules:: { MemoryGrowCost , Rules } ;
66
@@ -158,7 +158,7 @@ impl Rules for GasRules {
158158 // free pages because this is 32bit WASM.
159159 const MAX_PAGES : u64 = 12 * GIB / PAGE ;
160160 let gas_per_page =
161- NonZeroU32 :: new ( ( * MAX_GAS_PER_HANDLER / MAX_PAGES ) . try_into ( ) . unwrap ( ) ) . unwrap ( ) ;
161+ NonZeroU32 :: new ( ( CONST_MAX_GAS_PER_HANDLER / MAX_PAGES ) . try_into ( ) . unwrap ( ) ) . unwrap ( ) ;
162162
163163 Some ( MemoryGrowCost :: Linear ( gas_per_page) )
164164 }
You can’t perform that action at this time.
0 commit comments