FABRKNT
Reth Fundamentals — Your First Steps with Alloy
Inside the EVM
Lesson 9 of 11·CONTENT12 min25 XP

Treat this page as a workbench, not a blog post. The goal is to extract a reusable mental model from the source and carry it into the rest of the Fabrknt stack.

Course
Reth Fundamentals — Your First Steps with Alloy
Lesson role
CONTENT
Sequence
9 / 11

Lesson 9 — Revm — the execution engine

Question

Revm = the Rust EVM execution engine. Reth, Foundry, Hyperliquid, Tempo, Berachain — anywhere in the Rust ecosystem you need to execute EVM, you find Revm. Why Revm, and what does it provide as a library?

Principle (minimum model)

  • Revm is a library. Not a chain, not a node — just an EVM execution engine. Reth adds state + consensus; Foundry adds a test harness.
  • Modular design. Interpreter / instruction table / Database trait / Inspector are all independent and swappable. Hyperliquid adds custom precompiles; MEV bots observe via Inspector.
  • Database trait. The abstraction over state. HashMap (testing) / JSON-RPC (mainnet fork) / MDBX (production) all conform to the same trait.
  • Adopted by Foundry / Reth / OP-Reth / zkVMs / MEV bots. Anywhere Rust meets EVM, Revm is the shared substrate.
  • Inside Revm course (Intermediate). Walks add / instruction table / Database trait line by line. This lesson is the entry point.

Worked example + steps

Revm — the execution engine

You've seen Alloy (the outer RPC layer) and now know the EVM is a stack machine. The next character is Revm — the engine that actually runs opcodes.

Where Revm fits

+----------------+
|     Reth       |  ← Full node (sync, storage, consensus)
+----------------+
|     Revm       |  ← Execution engine (this layer)
+----------------+
| Database / DB  |  ← State (Trie, KV)
+----------------+

Revm's actual top-level API

Revm exports these high-level types (crates/revm/src/lib.rs):

TypeRole
MainnetEvmthe prebuilt Ethereum mainnet EVM
ExecuteEvm, ExecuteCommitEvmrun a transaction (commit = also write state changes back)
SystemCallEvmsystem-level calls (e.g., post-Cancun BEACONROOT)
InspectEvm, InspectCommitEvmtracing variants — same execution, with hooks
Contextthe execution environment (block, tx, cfg)
Journal, JournalEntrystate-change tracking (used for revert)
Database, DatabaseRef, DatabaseCommitthe storage interfaces (covered in Intermediate)
Inspectortrait you implement to hook into execution

The key insight: Revm is modular by design. ExecuteEvm, InspectEvm, ExecuteCommitEvm aren't different EVMs — they're the same engine composed with different layers. You pick what you need.

What Revm provides

  • Opcode interpretation (the Interpreter)
  • State access trait (Database)
  • Gas accounting and exception handling
  • Logs and tracing via Inspectors

Why Revm became the standard

AdopterUse
FoundrySolidity test runner, mainnet fork simulation
RethThe execution engine of the full node
OP-Reth, TempoL2s and App-chains
zkEVMs (Risc0, etc.)Provable EVM execution
MEV / simulationAnywhere you need to re-execute fast

The combination of "library-first design," "Rust embeddability," and "easy customization" is what locked in adoption.

Next

You now know enough to start reading Revm code. The next lesson introduces Foundry — the Rust EVM toolchain you'll actually use day-to-day. Then the Intermediate tier opens the interpreter folder.

📺 Further watching

xRuDWTWuxKA | Dragan Rakita — Revm Endgame (Devcon SEA 2024)

Summary (3 lines)

  • Revm = Rust EVM execution engine (library). Adopted by Reth / Foundry / Hyperliquid / Tempo / Berachain as a shared substrate.
  • Modular: interpreter + instruction table + Database + Inspector are independent. Database trait abstracts HashMap / JSON-RPC / MDBX behind one type.
  • Inside Revm Intermediate course deep-dives the internals. Next: Foundry toolchain.