Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme: Describe Advanced and Baseline interpreters #280

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,38 @@ Created by members of the [Ewasm] team, the project aims for clean, standalone E
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
### Characteristic of evmone

1. Exposes the [EVMC] API.
2. The _indirect call threading_ is the dispatch method used -
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 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
2. 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.
3. Performs extensive and expensive bytecode analysis before execution.

### Baseline Interpreter

1. Provides relatively straight-forward EVM 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

evmone implements the [EVMC] API for Ethereum Virtual Machines.
Expand Down