All Projects → ewasm → Hera

ewasm / Hera

Licence: apache-2.0
Hera: Ewasm virtual machine conforming to the EVMC API

Projects that are alternatives of or similar to Hera

Lam
🚀 a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly
Stars: ✭ 176 (+33.33%)
Mutual labels:  webassembly, vm
Awesome Wasm Runtimes
A list of webassemby runtimes
Stars: ✭ 490 (+271.21%)
Mutual labels:  webassembly, vm
Customasm
💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Stars: ✭ 211 (+59.85%)
Mutual labels:  webassembly, vm
Alchemyvm
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 176 (+33.33%)
Mutual labels:  webassembly, vm
Ethereumjs Monorepo
Monorepo for the Ethereum VM TypeScript Implementation
Stars: ✭ 813 (+515.91%)
Mutual labels:  ethereum, vm
0x Mesh
A peer-to-peer network for sharing 0x orders
Stars: ✭ 149 (+12.88%)
Mutual labels:  ethereum, webassembly
Octopus
Security Analysis tool for WebAssembly module (wasm) and Blockchain Smart Contracts (BTC/ETH/NEO/EOS)
Stars: ✭ 261 (+97.73%)
Mutual labels:  ethereum, webassembly
Capstone
Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.
Stars: ✭ 5,374 (+3971.21%)
Mutual labels:  ethereum, webassembly
Ssvm
SSVM is a high performance, extensible, and hardware optimized WebAssembly Virtual Machine for cloud, AI, and blockchain applications.
Stars: ✭ 751 (+468.94%)
Mutual labels:  ethereum, webassembly
Securityworker
The best javascript code protection solution ever.
Stars: ✭ 626 (+374.24%)
Mutual labels:  webassembly, vm
Evm2wasm
[ORPHANED] Transcompiles EVM code to eWASM
Stars: ✭ 96 (-27.27%)
Mutual labels:  ethereum, webassembly
Design
Ewasm Design Overview and Specification
Stars: ✭ 827 (+526.52%)
Mutual labels:  ethereum, webassembly
Lunatic
Lunatic is an Erlang-inspired runtime for WebAssembly
Stars: ✭ 2,074 (+1471.21%)
Mutual labels:  webassembly, vm
Augur.js
Augur JavaScript API
Stars: ✭ 129 (-2.27%)
Mutual labels:  ethereum
Deno Wasi
A (WIP) WebAssembly System Interface implementation for Deno
Stars: ✭ 132 (+0%)
Mutual labels:  webassembly
Elm Ethereum
dApps in Elm
Stars: ✭ 129 (-2.27%)
Mutual labels:  ethereum
Hashed Timelock Contract Ethereum
Hashed Timelock Contracts for ETH, ERC20 and ERC721 on Ethereum
Stars: ✭ 128 (-3.03%)
Mutual labels:  ethereum
Contracts
Smart contracts comprising the business logic of the Matic Network
Stars: ✭ 130 (-1.52%)
Mutual labels:  ethereum
Phptrader
A simple php powered Bitcoin and Ethereum trading bot
Stars: ✭ 131 (-0.76%)
Mutual labels:  ethereum
Typescript Solidity Dev Starter Kit
Starter kit for smart contract development using Typescript
Stars: ✭ 127 (-3.79%)
Mutual labels:  ethereum

Hera Status

Hera is an ewasm (revision 4) virtual machine implemented in C++ conforming to EVMC ABIv7.

It is designed to leverage various Wasm backends, both interpreters and AOT/JITs.

Client support

Hera has been tested with aleth and geth. It should however work with any client with compliant EVMC support.

Building Hera

First clone this repository and make sure the submodules are checked out:

$ git clone https://github.com/ewasm/hera
$ cd hera
$ git submodule update --init

The preferred way is building Hera as a shared library:

$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=ON ..
$ cmake --build .

In this case the built library will be placed at build/src/libhera/libhera.so on Linux or build/src/libhera/libhera.dylib on MacOS.

Please also check the build options listed in the following section.

Build options

  • -DHERA_DEBUGGING=ON will turn on debugging features and messages. This is off by default.
  • -DBUILD_SHARED_LIBS=ON is a standard CMake option to build libraries as shared. This will build Hera shared library that can be then dynamically loaded by EVMC compatible Clients (e.g. aleth from aleth). This is the preferred way of compilation.

wabt support

Complete support.

wabt is built by default and needs no build options. It can be disabled with:

  • -DHERA_WABT=OFF

Binaryen support

Complete support.

Binaryen support needs to be enabled via the following build option and requested at runtime with engine=binaryen:

  • -DHERA_BINARYEN=ON will request the compilation of Binaryen support

WAVM support

Complete support.

WAVM support needs to be enabled via the following build option and requested at runtime with engine=wavm:

  • -DHERA_WAVM=ON will request the compilation of WAVM support
  • -DLLVM_DIR=... one will need to specify the path to LLVM's CMake file. In most installations this has to be within the lib/cmake/llvm directory, such as /usr/local/Cellar/llvm/6.0.1/lib/cmake/llvm on Homebrew.

Runtime options

These are to be used via EVMC set_option:

  • engine=<engine> will select the underlying WebAssembly engine, where the only accepted values currently are binaryen, wabt, and wavm
  • metering=true will enable metering of bytecode at deployment using the Sentinel system contract (set to false by default)
  • benchmark=true will produce execution timings and output it to both standard error output and hera_benchmarks.log file.
  • evm1mode=<evm1mode> will select how EVM1 bytecode is handled
  • sys:<alias/address>=file.wasm will override the code executing at the specified address with code loaded from a filepath at runtime. This option supports aliases for system contracts as well, such that sys:sentinel=file.wasm and sys:evm2wasm=file.wasm are both valid. This option is intended for debugging purposes.

evm1mode

  • reject will reject any EVM1 bytecode with an error (the default setting)
  • fallback will allow EVM1 bytecode to be passed through to the client for execution
  • evm2wasm will enable transformation of bytecode using the EVM Transcompiler
  • runevm will transform EVM1 bytecode using runevm

Interfaces

Hera implements two interfaces: EEI and a debugging module.

Debugging module

  • debug::print32(value: i32) - print value
  • debug::print64(value: i64) - print value
  • debug::printMem(offset: i32, len: i32) - print memory segment as printable characters
  • debug::printMemHex(offset: i32, len: i32) - print memory segment as hex
  • debug::printStorage(pathOffset: i32) - print storage value as printable characters
  • debug::printStorageHex(pathOffset: i32) - print storage value as hex

These are only enabled if Hera is compiled with debugging on.

EVM Tracing

  • debug::evmTrace(pc: i32, opcode: i32, cost: i32, sp: i32)

This is useful to trace the translated code by EVM Transcompiler. This is only enabled if Hera is compiled with debugging on.

Note: it is valid to invoke evmTrace with a negative value for sp. In this case, no stack values will be printed.

Fuzzing

To enable fuzzing you need clang compiler and provide -DHERA_FUZZING=ON option to CMake. You should also enable both Binaryen and WABT engines. This will build additional executable hera-fuzzer. Check out its help and libFuzzer documentation.

test/fuzzing/hera-fuzzer -help=1

Author(s)

  • Alex Beregszaszi
  • Jake Lang

License

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].