diff --git a/Makefile b/Makefile index 2b6e52de9..76824cb30 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,7 @@ check-runtimes: .PHONY: check-benchmarks check-benchmarks: + SKIP_WASM_BUILD= cargo check --features bench --package module-evm SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p mandala-runtime SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p karura-runtime SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p acala-runtime @@ -139,6 +140,7 @@ test-ts: .PHONY: test-benchmarking test-benchmarking: + cargo test --features bench --package module-evm cargo test --features runtime-benchmarks --features with-all-runtime --features --all benchmarking .PHONY: test-all diff --git a/modules/evm/src/bench/mock.rs b/modules/evm/src/bench/mock.rs index 4ea3c91e6..c67b4c859 100644 --- a/modules/evm/src/bench/mock.rs +++ b/modules/evm/src/bench/mock.rs @@ -193,7 +193,8 @@ impl Config for Runtime { type TxFeePerGas = TxFeePerGas; type Event = Event; - type Precompiles = (); + type PrecompilesType = (); + type PrecompilesValue = (); type ChainId = ChainId; type GasToWeight = GasToWeight; type ChargeTransactionPayment = DefaultTransactionPayment; diff --git a/modules/evm/src/bench/mod.rs b/modules/evm/src/bench/mod.rs index 7f507f3d1..7c6ffe1c0 100644 --- a/modules/evm/src/bench/mod.rs +++ b/modules/evm/src/bench/mod.rs @@ -80,7 +80,7 @@ fn whitelist_keys(b: &mut Bencher, from: H160, code: Vec) -> H160 { let config = ::config(); let metadata = StackSubstateMetadata::new(21_000_000, 1_000_000, config); let state = SubstrateStackState::::new(&vicinity, metadata); - let mut executor = StackExecutor::new(state, config); + let mut executor = StackExecutor::new_with_precompiles(state, config, &()); let mut runtime = EVMRuntime::new(Rc::new(code.clone()), Rc::new(Vec::new()), context, config); let reason = executor.execute(&mut runtime); @@ -154,6 +154,7 @@ macro_rules! evm_create { 0, 21_000_000, 1_000_000, + vec![], ::config(), ) }) @@ -183,6 +184,7 @@ macro_rules! evm_call { 0, 21_000_000, 1_000_000, + vec![], ::config(), ) .unwrap(); @@ -208,6 +210,7 @@ macro_rules! evm_call { 0, 21_000_000, 1_000_000, + vec![], ::config(), ) })