You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The intx library is used to provide 256-bit integer precision.
The ethash library is used to provide Keccak hash function implementation
needed for the special KECCAK256 instruction.
Contains two interpreters:
Baseline (default)
Advanced (select with the advanced option)
Baseline Interpreter
Provides relatively straight-forward but efficient EVM implementation.
Performs only minimalistic JUMPDEST analysis.
Advanced Interpreter
The indirect call threading is the dispatch method used -
a loaded EVM program is a table with pointers to functions implementing virtual instructions.
The gas cost and stack requirements of block of instructions is precomputed
and applied once per block during execution.
Performs extensive and expensive bytecode analysis before execution.
Usage
As geth plugin
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.
Ethereum Precompiled Contracts (precompiles for short) are supported by evmone with some exceptions:
The ecrecover is implemented directly by evmone and has degraded performance.
For 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.
Tools
evm-test
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.
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
EVM Object Format (EOF) support
evmone supports EOFv1. Since EOF validation is done once during deploy-time, evmone does not revalidate during execution of bytecode. To force EOF revalidation, you can use the validate_eof option, example:
evmc run --vm libevmone.so,validate_eof --rev 15 "EF00"