How astraeuszhao/minievm works
MiniEVM is an embeddable Rust EVM bytecode execution engine. Its main workflow accepts a transaction, validates and checkpoints account state, executes target bytecode through a frame and opcode dispatcher, then returns an execution result or restores state on failure. The graph also preserves the documented gas, memory, environment, and tracing capabilities. The sampled source shows the transaction executor and module boundaries; dispatcher internals were not sampled, so their detailed opcode-level wiring is omitted.
Main entry points: engine.rs EVM Executor · instructions.rs Opcode Dispatcher · world.rs World State · frame.rs Execution Frame
Components 19
Execution
- EVM Executor
src/vm/engine.rs - Analyzed Bytecode
src/vm/bytecode.rs - Opcode Dispatcher
src/vm/instructions.rs
Runtime
- Execution Frame
src/vm/frame.rs - Call Data
src/vm/calldata.rs - Linear Memory
src/memory/linear.rs - Gas Meter
src/gas/meter.rs - Opcode Pricing
src/gas/schedule.rs - Tracing Interface
src/trace/tracer.rs - Address and Word
src/primitives/mod.rs
Account State
- World State
src/state/world.rs - Account
src/state/account.rs - Execution Logs
src/state/log.rs
Inputs and Results
- Transaction
src/core/transaction.rs - Block Environment
src/core/environment.rs - Execution Result
src/core/receipt.rs - VM Errors
src/error/mod.rs
Other components
- Embedding Caller
- Result Consumer
Connections 21
- Embedding Caller → Transaction: provides
- Transaction → EVM Executor: submitted to
- EVM Executor → World State: checks and updates
- EVM Executor → Analyzed Bytecode: analyzes code
- EVM Executor → Execution Frame: creates frame
- EVM Executor → Gas Meter: creates meter
- EVM Executor → Opcode Pricing: prices opcodes
- EVM Executor → Opcode Dispatcher: dispatches opcode
- Opcode Dispatcher → Execution Frame: executes against
- Opcode Dispatcher → Linear Memory: uses memory
- Opcode Dispatcher → World State: reads and writes
- Opcode Dispatcher → Block Environment: reads values
- Opcode Dispatcher → Gas Meter: charges gas
- Opcode Dispatcher → Tracing Interface: emits events
- World State → Account: stores accounts
- World State → Execution Logs: stores logs
- EVM Executor → Execution Result: returns outcome
- EVM Executor → VM Errors: handles failures
- EVM Executor → Result Consumer: returns result
- Address and Word → World State: defines state values
- Call Data → Execution Frame: supplies input