Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion modules/evm/src/bench/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion modules/evm/src/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn whitelist_keys(b: &mut Bencher, from: H160, code: Vec<u8>) -> H160 {
let config = <Runtime as Config>::config();
let metadata = StackSubstateMetadata::new(21_000_000, 1_000_000, config);
let state = SubstrateStackState::<Runtime>::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);
Expand Down Expand Up @@ -154,6 +154,7 @@ macro_rules! evm_create {
0,
21_000_000,
1_000_000,
vec![],
<Runtime as Config>::config(),
)
})
Expand Down Expand Up @@ -183,6 +184,7 @@ macro_rules! evm_call {
0,
21_000_000,
1_000_000,
vec![],
<Runtime as Config>::config(),
)
.unwrap();
Expand All @@ -208,6 +210,7 @@ macro_rules! evm_call {
0,
21_000_000,
1_000_000,
vec![],
<Runtime as Config>::config(),
)
})
Expand Down