Revm is a highly efficient and stable implementation of the Ethereum Virtual Machine (EVM) written in Rust.
Known for its robustness, it stands as one of the most popular libraries and critical component of the Ethereum ecosystem. Revm plays a crucial role across various projects, being widely utilized by almost all tooling and block builders. It is integrated into Reth, multiple Layer 2 variants and other clients and serving as a standard for zkVMs.
Revm offers two primary applications: firstly, it functions as an executor where users can set up block info and process mainnet transactions; secondly, it acts as a framework that facilitates the extension and support of different EVM variants such as revm-optimism.
Here is a straightforward example of using the Execution API: It allows us to create an Ethereum Virtual Machine (EVM) and execute transactions. Additionally, it can be utilized to generate traces with the inspector or more complex example of foundry cheatcodes.
let mut evm = Context::mainnet().with_block(block).build_mainnet();
let out = evm.transact(tx);
// or you can use powerful inspection tool to trace it
let mut evm = evm.with_inspector(tracer);
let out = evm.inspect_with_tx(tx);
The Evm Framework API is somewhat complex to use, but this document provides a detailed explanation. It enables users to extend logic, incorporate various context types, and offers built-in support for inspection. For a practical example, you can refer to the revm-optimism crate.
As previously noted, there are several groups of projects that utilize this technology:
- Major block builders.
- Clients: Reth, Helios, Trin,..
- Tooling: Foundry, Hardhat,..
- L2s: Optimism, Coinbase, Scroll,..
- zkVM: Risc0, Succinct,..
The full list of projects that use Revm is available in the awesome-revm section of the book.
Note that book and code docs are still in WIP stage and they are being updated!
Part of the links point to the code documentation or the book. code docs are there to explain usage of particular part of the code where book is to get more of the overview on architecture or how components/projects fit toggether.
- How to build and use revm can be found here. (code)
- Architecture overview can be seen here. (book)
- Structure of the project (list of crates) can be seen here. (book)
- How to use Revm Framework can be found here. (book)
- Release procedure and changelogs explanation. (book)
- How to use revme (Revm binary with few commands) can be found here. (code)
- How to run Ethereum test can be found here: (book)
- How to run examples and benchmark with
samply
to check performance. (book) - If there is more explanations please open PR request for it.
For questions please open an github issue or join public telegram group: https://t.me/+Ig4WDWOzikA3MzA0
Revm is licensed under MIT Licence.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, shall be licensed as above, without any additional terms or conditions.
For any security questions or findings, please reach out to me directly via email at [email protected] or contact me on Keybase under the username draganrakita.