Crate interpreter

Expand description

§revm-interpreter

REVM Interpreter.

Modules§

gas
EVM gas calculation utilities.
instructions
EVM opcode implementations.
interpreter
interpreter_action
opcode
EVM opcode definitions and utilities.
primitives
revm-primitives

Macros§

as_isize_saturated
Converts a U256 value to a isize, saturating to isize::MAX if the value is too large.
as_u64_saturated
Converts a U256 value to a u64, saturating to MAX if the value is too large.
as_usize_or_fail
Converts a U256 value to a usize, failing the instruction if the value is too large.
as_usize_or_fail_ret
Converts a U256 value to a usize and returns ret, failing the instruction if the value is too large.
as_usize_saturated
Converts a U256 value to a usize, saturating to MAX if the value is too large.
check
Check if the SPEC is enabled, and fail the instruction if it is not.
gas
Records a gas cost and fails the instruction if it would exceed the available gas.
gas_or_fail
Same as gas!, but with gas as an option.
pop
Pops U256 values from the stack. Fails the instruction if the stack is too small.
pop_address
Pops Address values from the stack. Fails the instruction if the stack is too small.
pop_address_ret
Pop Address values from the stack, returns ret on stack underflow.
pop_ret
Pops U256 values from the stack, and returns ret. Fails the instruction if the stack is too small.
pop_top
Pops U256 values from the stack, and returns a reference to the top of the stack. Fails the instruction if the stack is too small.
push
Pushes a B256 value onto the stack. Fails the instruction if the stack is full.
push_b256
Pushes B256 values onto the stack. Fails the instruction if the stack is full.
refund
Records a gas refund.
require_eof
Error if the current call is executing EOF.
require_init_eof
Error if not init eof call.
require_non_staticcall
Fails the instruction if the current call is static.
resize_memory
Resizes the interpreter memory if necessary. Fails the instruction if the memory or gas limit is exceeded.
return_error
return_ok
return_revert

Structs§

AccountLoad
Result of the account load from Journal state.
CallInputs
Inputs for a call.
CallOutcome
Represents the outcome of a call operation in a virtual machine.
Contract
EVM contract information.
CreateInputs
Inputs for a create call.
CreateOutcome
Represents the outcome of a create operation in an interpreter.
DummyHost
A dummy Host implementation.
EOFCreateInputs
Inputs for EOF create call.
Eip7702CodeLoad
EIP-7702 code load result that contains optional delegation is_cold information.
FunctionReturnFrame
Function return frame. Needed information for returning from a function.
FunctionStack
Function Stack
Gas
Represents the state of gas during execution.
Interpreter
EVM bytecode interpreter.
InterpreterResult
The result of an interpreter operation.
OpCode
An EVM opcode.
SStoreResult
Represents the result of an sstore operation.
SelfDestructResult
Result of a selfdestruct action.
SharedMemory
A sequential memory shared between calls, which uses a Vec for internal representation. A SharedMemory instance should always be obtained using the new static method to ensure memory safety.
Stack
EVM stack with STACK_LIMIT capacity of words.
StateLoad
State load information that contains the data and if the account or storage is cold loaded.

Enums§

CallScheme
Call scheme.
CallValue
Call value.
CreateScheme
Create scheme.
EOFCreateKind
EOF create can be called from two places:
InstructionResult
InternalResult
Internal result that are not ex
InterpreterAction
SuccessOrHalt

Constants§

EMPTY_SHARED_MEMORY
Empty shared memory.
MAX_CODE_SIZE
EIP-170: Contract code size limit
MAX_INITCODE_SIZE
EIP-3860: Limit and meter initcode
OPCODE_INFO_JUMPTABLE
Maps each opcode to its info.
STACK_LIMIT
EVM interpreter stack limit.

Traits§

Host
EVM context host.

Functions§

num_words
Returns number of words what would fit to provided number of bytes, i.e. it rounds up the number bytes to number of words.

Type Aliases§

Instruction
EVM opcode function signature.