Fast Ethereum Virtual Machine implementation
evmone is a C++ implementation of the Ethereum Virtual Machine (EVM). Created by members of the Ipsilon (ex-Ewasm) team, the project aims for clean, standalone EVM implementation that can be imported as an execution module by Ethereum Client projects. The codebase of evmone is optimized to provide fast and efficient execution of EVM smart contracts.
KECCAK256 instruction.advanced option)JUMPDEST analysis.evmone implements the EVMC API for Ethereum Virtual Machines. It can be used as a plugin replacing geth’s internal EVM. But for that a modified version of geth is needed. The Ewasm’s fork of go-ethereum provides binary releases of geth with EVMC support.
Next, download evmone from Releases.
Start the downloaded geth with --vm.evm option pointing to the evmone shared library.
geth --vm.evm=./libevmone.so
To build the evmone EVMC module (shared library), test, and benchmark:
git clone --recursive https://github.com/ethereum/evmone
cd evmone
cmake -S . -B build -DEVMONE_TESTING=ON
cmake -S . -B build -DEVMONE_TESTING=ON -G "Visual Studio 16 2019" -A x64
cmake --build build --parallel
build/bin/evmone-unittests
build/bin/evmone-bench test/evm-benchmarks/benchmarks
Ethereum Precompiled Contracts (precompiles for short) are supported by evmone with some exceptions:
ecrecover is implemented directly by evmone and has degraded performance.expmod stubs are enabled by default — they will correctly respond to known inputs. The CMake option EVMONE_PRECOMPILES_GMP=1 enables full implementation but this requires GMP (e.g. libgmp-dev) library at build and execution time.The evm-test executes a collection of unit tests on any EVMC-compatible Ethereum Virtual Machine implementation. The collection of tests comes from the evmone project.
evm-test ./evmone.so
Docker images with evmone are available on Docker Hub: https://hub.docker.com/r/ethereum/evmone.
Having the evmone shared library inside a docker is not very useful on its own, but the image can be used as the base of another one or you can run benchmarks with it.
docker run --entrypoint evmone-bench ethereum/evmone /src/test/benchmarks
Paweł Bylica @chfast
Licensed under the Apache License, Version 2.0.