Skip to content

ipsilon/evmone

 
 

Repository files navigation

evmone

ethereum badge readme style standard badge codecov badge circleci badge appveyor badge license badge

Fast Ethereum Virtual Machine implementation

evmone is a C++ implementation of the Ethereum Virtual Machine (EVM). Created by members of the 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.

Characteristic of evmone

  1. Exposes the EVMC API.
  2. The direct call threading is the dispatch method used - a loaded EVM program is a table with pointers to functions implementing virtual instructions.
  3. The gas cost and stack requirements of block of instructions is precomputed and applied once per block during execution.
  4. The intx library is used to provide 256-bit integer precision.
  5. The ethash library is used to provide Keccak hash function implementation needed for the special SHA3 instruction.
  6. Requires C++17 standard.

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.

Next, download evmone from Releases.

Start the downloaded geth with --vm.evm option pointing to the evmone shared library.

geth --vm.evm=./libevmone.so

Building from source

To build the evmone EVMC module (shared library), test or benchmark.

git clone --recursive https://github.com/ethereum/evmone
cd evmone
mkdir build
cd build

cmake .. -DEVMONE_TESTING=ON
cmake --build . -- -j

bin/evmone-unittests
bin/evmone-bench

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.

evm-test ./evmone.so

Docker

Docker images with evmone and modified geth are available on Docker Hub: https://hub.docker.com/r/ethereum/evmone.

docker run ethereum/evmone --vm.evm=libevmone.so

Maintainer

Paweł Bylica @chfast

License

license badge

Licensed under the Apache License, Version 2.0.