Rust Ethereum Virtual Machine
Revm is an EVM written in Rust that is focused on speed and simplicity.
It has a fast and flexible implementation with a simple interface and embedded Host.
It passes all ethereum/tests
test suites.
Here is a list of guiding principles that Revm follows.
- EVM compatibility and stability - this goes without saying but it is nice to put it here. In the blockchain industry, stability is the most desired attribute of any system.
- Speed - is one of the most important things and most decisions are made to complement this.
- Simplicity - simplification of internals so that it can be easily understood and extended, and interface that can be easily used or integrated into other projects.
- interfacing -
[no_std]
so that it can be used as wasm lib and integrate with JavaScript and cpp binding if needed.
Structure:
- crates
- revm -> main EVM library.
- revm-primitives -> Primitive data types.
- revm-interpreter -> Execution loop with instructions
- revm-precompile -> EVM precompiles
- bins:
- revme: cli binary, used for running state test jsons
This project tends to use the newest rust version, so if you're encountering a build error try running rustup update
first.
There were some big efforts on optimization of revm:
- Optimizing interpreter loop: bluealloy#7
- Introducing Bytecode format (and better bytecode analysis): bluealloy#121
- Unification of instruction signatures: bluealloy#283
git clone https://github.com/bluealloy/revm.git
cd revm
cargo build --release
Note: clang
is required for building revm with c-kzg
or secp256k1
feature flags as they depend on C
libraries. If you don't have it installed, you can install it with apt install clang
.