https://github.com/flashbots/revm
Revm suited for suave needs
https://github.com/flashbots/revm
Last synced: about 1 year ago
JSON representation
Revm suited for suave needs
- Host: GitHub
- URL: https://github.com/flashbots/revm
- Owner: flashbots
- License: mit
- Created: 2024-01-19T16:36:24.000Z (over 2 years ago)
- Default Branch: extensible-precompiles
- Last Pushed: 2024-07-24T14:16:38.000Z (almost 2 years ago)
- Last Synced: 2025-04-11T20:48:03.137Z (about 1 year ago)
- Language: Rust
- Size: 6.54 MB
- Stars: 2
- Watchers: 9
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# revm
[][gh-ci]
[][mit-license]
[![Chat][tg-badge]][tg-url]
[mit-license]: https://opensource.org/license/mit/
[gh-ci]: https://github.com/bluealloy/revm/actions/workflows/ci.yml
[tg-url]: https://t.me/+Ig4WDWOzikA3MzA0
[tg-badge]: https://img.shields.io/badge/chat-telegram-blue
**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.
# Project
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: https://github.com/bluealloy/revm/issues/7
* Introducing Bytecode format (and better bytecode analysis): https://github.com/bluealloy/revm/issues/121
* Unification of instruction signatures: https://github.com/bluealloy/revm/pull/283
# Building from source
```shell
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`.
# Running eth tests
go to `cd bins/revme/`
Download eth tests from (this will take some time): `git clone https://github.com/ethereum/tests`
run tests with command: `cargo run --release -- statetest tests/GeneralStateTests/ tests/LegacyTests/Constantinople/GeneralStateTests`
`GeneralStateTests` contains all tests related to EVM.
## Running benchmarks
TODO needs to be updated. Benches can now be found inside `crates/revm/benches`
```shell
cargo run --package revm-test --release --bin snailtracer
```
```shell
cargo flamegraph --root --freq 4000 --min-width 0.001 --package revm-test --bin snailtracer
```
## Running example
```shell
cargo run -p revm --features ethersdb --example fork_ref_transact
```
# Used by:
* [Foundry](https://github.com/foundry-rs/foundry) is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
* [Helios](https://github.com/a16z/helios) is a fully trustless, efficient, and portable Ethereum light client written in Rust.
* [Reth](https://github.com/paradigmxyz/reth) Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol
* [Arbiter](https://github.com/primitivefinance/arbiter) is a framework for stateful Ethereum smart-contract simulation
* [Zeth](https://github.com/risc0/zeth) is an open-source ZK block prover for Ethereum built on the RISC Zero zkVM.
* ...
(If you want to add project to the list, ping me or open the PR)
# Documentation
The book can be found at github page here: https://bluealloy.github.io/revm/
The documentation (alas needs some love) can be found here: https://bluealloy.github.io/revm/docs/
To serve the mdbook documentation in a local environment, ensure you have mdbook installed (if not install it with cargo) and then run:
```shell
mdbook serve documentation
```
# Contact
There is public telegram group: https://t.me/+Ig4WDWOzikA3MzA0
Or if you want to hire me or contact me directly, here is my email: dragan0rakita@gmail.com and telegram: https://t.me/draganrakita