Skip to content

ILCOINDevelopmentTeam/ivmone

 
 

Repository files navigation

ivmone

readme style standard badge license badge

Fast ILCOIN Virtual Machine implementation

ivmone is a C++ implementation of the ILCOIN Virtual Machine (IVM). Created by members of the Ewasm team, the project aims for clean, standalone IVM implementation that can be imported as an execution module by ILCOIN Client projects. The codebase of ivmone is optimized to provide fast and efficient execution of IVM smart contracts.

Characteristic of ivmone

  1. Exposes the IVMC API.
  2. Requires C++17 standard.
  3. The intx library is used to provide 256-bit integer precision.
  4. The ethash library is used to provide Keccak hash function implementation needed for the special KECCAK256 instruction.
  5. Contains two interpreters: Advanced (default) and Baseline (experimental).

Advanced Interpreter

  1. The indirect call threading is the dispatch method used - a loaded IVM program is a table with pointers to functions implementing virtual instructions.
  2. The gas cost and stack requirements of block of instructions is precomputed and applied once per block during execution.
  3. Performs extensive and expensive bytecode analysis before execution.

Baseline Interpreter

  1. Provides relatively straight-forward IVM implementation.
  2. Performs only minimalistic JUMPDEST analysis.
  3. Experimental. Can be enabled with O=0 option.

Usage

Optimization levels

The option O controls the "optimization level":

  • O=2 uses Advanced interpreter (default),
  • O=0 uses Baseline interpreter.

As geth plugin

ivmone implements the IVMC API for ILCOIN Virtual Machines.

Next, download ivmone from Releases.

Building from source

To build the ivmone IVMC module (shared library), test, and benchmark:

  1. Fetch the source code:

    git clone --recursive https://github.com/ILCOINDevelopmentTeam/ivmone
    cd ivmone
    
  2. Configure the project build and dependencies:

    Linux / OSX
    cmake -S . -B build -DIVMONE_TESTING=ON
    
    Windows

    Note: >= Visual Studio 2019 is required since ivmone makes heavy use of C++17

    cmake -S . -B build -DIVMONE_TESTING=ON -G "Visual Studio 16 2019" -A x64
    
  3. Build:

    cmake --build build --parallel
    
  4. Run the unit tests or benchmarking tool:

    build/bin/ivmone-unittests
    build/bin/ivmone-bench test/benchmarks
    

Tools

ivm-test

The ivm-test executes a collection of unit tests on any IVMC-compatible ILCOIN Virtual Machine implementation. The collection of tests comes from the ivmone project.

ivm-test ./ivmone.so

References

  1. IVM is gas free.

Maintainer

ILCOIN Development Team

License

license badge

Licensed under the Apache License, Version 2.0.

About

Fast ILCOIN Virtual Machine implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 82.8%
  • CMake 16.2%
  • Other 1.0%