evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Migrate to benchmarks in JSON format

Open chfast opened this issue 3 years ago • 2 comments

The existing benchmark suite has been converted to JSON State Test format and is available in https://github.com/ipsilon/evm-benchmarks.

  • [ ] Add evm-benchmarks as git submodule replacing test/benchmarks.
  • [ ] Update evmone-bench tool to load benchmarks from JSON files. You can reuse StateTransitionTest and load_state_test() from https://github.com/ethereum/evmone/blob/master/test/statetest/statetest_loader.cpp#L198.

chfast avatar Oct 03 '22 14:10 chfast

Could you mind helping clarify where the name and expected_output are in the evm-benchmarks JSON State Test format?

miles170 avatar Oct 05 '22 07:10 miles170

The names are in the labels section and they should match the elements of transaction.data. https://github.com/ipsilon/evm-benchmarks/blob/main/benchmarks/main/sha1_shifts.json#L8-L14 Our loader does not parse labels yet.

The output is simply not there. We proposed to include it but turned out this is substantial change in many tools. https://github.com/ethereum/tests/issues/998

The good news is we have a tool evmone-statetest (not main branch yet) which can execute and verify these files. Later we can reuse its implementation to verify benchmark files before execution.

For now you should check if a benchmark returns EVMC_SUCCESS. You can also check the status and gas used (if the same) in every benchmark loop iteration.

chfast avatar Oct 05 '22 10:10 chfast