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.
- Exposes the IVMC API.
- Requires C++17 standard.
- 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: Advanced (default) and Baseline (experimental).
- The indirect call threading is the dispatch method used - a loaded IVM 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.
- Provides relatively straight-forward IVM implementation.
- Performs only minimalistic
JUMPDEST
analysis. - Experimental. Can be enabled with
O=0
option.
The option O
controls the "optimization level":
O=2
uses Advanced interpreter (default),O=0
uses Baseline interpreter.
ivmone implements the IVMC API for ILCOIN Virtual Machines.
Next, download ivmone from Releases.
To build the ivmone IVMC module (shared library), test, and benchmark:
-
Fetch the source code:
git clone --recursive https://github.com/ILCOINDevelopmentTeam/ivmone cd ivmone
-
Configure the project build and dependencies:
cmake -S . -B build -DIVMONE_TESTING=ON
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
-
Build:
cmake --build build --parallel
-
Run the unit tests or benchmarking tool:
build/bin/ivmone-unittests build/bin/ivmone-bench test/benchmarks
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
- IVM is gas free.
ILCOIN Development Team
Licensed under the Apache License, Version 2.0.