Crate interpreter
Expand description
§revm-interpreter
Interpreter is part of the project that executes EVM instructions.
Modules§
- gas
- EVM gas calculation utilities.
- host
- instructions
- EVM opcode implementations.
- interpreter
- interpreter_action 
- interpreter_types 
Macros§
- as_isize_ saturated 
- Converts a U256value to aisize, saturating toisize::MAXif the value is too large.
- as_u64_ saturated 
- Converts a U256value to au64, saturating toMAXif the value is too large.
- as_usize_ or_ fail 
- Converts a U256value to ausize, failing the instruction if the value is too large.
- as_usize_ or_ fail_ ret 
- Converts a U256value to ausizeand returnsret, failing the instruction if the value is too large.
- as_usize_ saturated 
- Converts a U256value to ausize, saturating toMAXif the value is too large.
- assume
- check
- Check if the SPECis enabled, and fail the instruction if it is not.
- debug_unreachable 
- gas
- Records a gascost and fails the instruction if it would exceed the available gas.
- gas_or_ fail 
- Same as gas!, but withgasas an option.
- otry
- popn
- Pops n values from the stack. Fails the instruction if n values can’t be popped.
- popn_top 
- Pops n values from the stack and returns the top value. Fails the instruction if n values can’t be popped.
- push
- Pushes a B256value onto the stack. Fails the instruction if the stack is full.
- require_eof 
- Error if the current call is executing EOF.
- require_non_ staticcall 
- Fails the instruction if the current call is static.
- resize_memory 
- Resizes the interpreterreter memory if necessary. Fails the instruction if the memory or gas limit is exceeded.
- return_error 
- return_ok 
- return_revert 
- tri
- constOption- ?.
Structs§
- CallInputs 
- Inputs for a call.
- CallOutcome 
- Represents the outcome of a call operation in a virtual machine.
- CreateInputs 
- Inputs for a create call
- CreateOutcome 
- Represents the outcome of a create operation in an interpreter.
- EOFCreateInputs 
- Inputs for EOF Create call
- Gas
- Represents the state of gas during execution.
- InitialAndFloor Gas 
- Init and floor gas from transaction
- InputsImpl 
- Inputs for the interpreter that are used for execution of the call.
- Interpreter
- Main interpreter structure that contains all components defines in InterpreterTypes.s
- InterpreterResult 
- The result of an interpreter operation.
- SStoreResult 
- Represents the result of an sstoreoperation.
- SelfDestruct Result 
- Result of a selfdestruct action
- SharedMemory 
- A sequential memory shared between calls, which uses
a Vecfor internal representation. A SharedMemory instance should always be obtained using thenewstatic 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§
- CallInput 
- Input enum for a call.
- CallScheme 
- Call scheme.
- CallValue 
- Call value.
- CreateScheme 
- Create scheme
- EOFCreateKind 
- EOF create can be called from two places:
- FrameInput 
- InstructionResult 
- InternalResult 
- Internal results that are not exposed externally
- InterpreterAction 
- SuccessOrHalt 
Constants§
- MAX_CODE_ SIZE 
- EIP-170: Contract code size limit
- MAX_INITCODE_ SIZE 
- EIP-3860: Limit and meter initcode
- STACK_LIMIT 
- EVM interpreter stack limit.
Traits§
- Host
- Host trait with all methods that are needed by the Interpreter.
- InterpreterTypes 
Functions§
- instruction_table 
- Returns the instruction table for the given spec.
- 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.
- InstructionTable 
- Instruction table is list of instruction function pointers mapped to 256 EVM opcodes.