File tree 2 files changed +3
-3
lines changed
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;
13
13
/// like 10 gas for ~1ns allows us to be granular in instructions which are aggregated into metered
14
14
/// blocks via https://docs.rs/pwasm-utils/0.16.0/pwasm_utils/fn.inject_gas_counter.html But we can
15
15
/// 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 ;
17
17
18
18
lazy_static ! {
19
19
/// This is configurable only for debugging purposes. This value is set by the protocol,
Original file line number Diff line number Diff line change 1
1
use std:: { convert:: TryInto , num:: NonZeroU32 } ;
2
2
3
- use graph:: runtime:: gas:: MAX_GAS_PER_HANDLER ;
3
+ use graph:: runtime:: gas:: CONST_MAX_GAS_PER_HANDLER ;
4
4
use parity_wasm:: elements:: Instruction ;
5
5
use pwasm_utils:: rules:: { MemoryGrowCost , Rules } ;
6
6
@@ -158,7 +158,7 @@ impl Rules for GasRules {
158
158
// free pages because this is 32bit WASM.
159
159
const MAX_PAGES : u64 = 12 * GIB / PAGE ;
160
160
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 ( ) ;
162
162
163
163
Some ( MemoryGrowCost :: Linear ( gas_per_page) )
164
164
}
You can’t perform that action at this time.
0 commit comments