diff --git a/test/bench/bench.cpp b/test/bench/bench.cpp index 1d6aabd2ff..6ef382da8f 100644 --- a/test/bench/bench.cpp +++ b/test/bench/bench.cpp @@ -50,7 +50,14 @@ std::vector load_inputs(const StateTransitionTest& state_t std::vector inputs; inputs.reserve(state_test.multi_tx.inputs.size()); for (size_t i = 0; i < state_test.multi_tx.inputs.size(); ++i) - inputs.emplace_back(state_test.input_labels.at(i), state_test.multi_tx.inputs[i]); + { + const auto it = state_test.input_labels.find(i); + if (it != state_test.input_labels.end()) + inputs.emplace_back(it->second, state_test.multi_tx.inputs[i]); + else + inputs.emplace_back(std::to_string(i), state_test.multi_tx.inputs[i]); + } + return inputs; } diff --git a/test/bench/helpers.hpp b/test/bench/helpers.hpp index a9083afd75..22775250d1 100644 --- a/test/bench/helpers.hpp +++ b/test/bench/helpers.hpp @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 #pragma once +#include "test/state/host.hpp" #include "test/utils/utils.hpp" #include #include @@ -17,7 +18,7 @@ namespace evmone::test { extern std::map registered_vms; -constexpr auto default_revision = EVMC_ISTANBUL; +constexpr auto default_revision = EVMC_PRAGUE; constexpr auto default_gas_limit = std::numeric_limits::max(); @@ -102,7 +103,10 @@ inline void bench_execute(benchmark::State& state, evmc::VM& vm, bytes_view code constexpr auto gas_limit = default_gas_limit; const auto analysis = analyse_fn(rev, code); - evmc::MockedHost host; + state::State ss; + state::BlockInfo blockInfo = {.gas_limit = gas_limit}; + state::Transaction tx = {.gas_limit = gas_limit}; + state::Host host{rev, vm, ss, blockInfo, tx}; ExecutionStateT exec_state; evmc_message msg{}; msg.kind = EVMC_CALL;