Skip to content

Commit

Permalink
readme: Describe Advanced and Baseline interpreters
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jan 7, 2021
1 parent a8cd412 commit 4798fbf
Showing 1 changed file with 25 additions and 7 deletions.
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

0 comments on commit 4798fbf

Please sign in to comment.