Type Alias EvmHandler

Source
pub type EvmHandler<'a, EXT, DB> = Handler<'a, Context<EXT, DB>, EXT, DB>;
Expand description

EVM Handler

Aliased Type§

struct EvmHandler<'a, EXT, DB> {
    pub cfg: HandlerCfg,
    pub instruction_table: InstructionTables<'a, Context<EXT, DB>>,
    pub registers: Vec<HandleRegisters<'a, EXT, DB>>,
    pub validation: ValidationHandler<'a, EXT, DB>,
    pub pre_execution: PreExecutionHandler<'a, EXT, DB>,
    pub post_execution: PostExecutionHandler<'a, EXT, DB>,
    pub execution: ExecutionHandler<'a, EXT, DB>,
}

Fields§

§cfg: HandlerCfg

Handler configuration.

§instruction_table: InstructionTables<'a, Context<EXT, DB>>

Instruction table type.

§registers: Vec<HandleRegisters<'a, EXT, DB>>

Registers that will be called on initialization.

§validation: ValidationHandler<'a, EXT, DB>

Validity handles.

§pre_execution: PreExecutionHandler<'a, EXT, DB>

Pre execution handle.

§post_execution: PostExecutionHandler<'a, EXT, DB>

Post Execution handle.

§execution: ExecutionHandler<'a, EXT, DB>

Execution loop that handles frames.

Implementations§

Source§

impl<'a, EXT, DB: Database> EvmHandler<'a, EXT, DB>

Source

pub fn new(cfg: HandlerCfg) -> Self

Created new Handler with given configuration.

Internally it calls mainnet_with_spec with the given spec id. Or optimism_with_spec if the optimism feature is enabled and cfg.is_optimism is set.

Source

pub fn mainnet<SPEC: Spec>() -> Self

Default handler for Ethereum mainnet.

Source

pub fn is_optimism(&self) -> bool

Returns true if the optimism feature is enabled and flag is set to true.

Source

pub fn mainnet_with_spec(spec_id: SpecId) -> Self

Creates handler with variable spec id, inside it will call mainnet::<SPEC> for appropriate spec.

Source

pub fn cfg(&self) -> HandlerCfg

Specification ID.

Source

pub fn spec_id(&self) -> SpecId

Returns specification ID.

Source

pub fn execute_frame( &self, frame: &mut Frame, shared_memory: &mut SharedMemory, context: &mut Context<EXT, DB>, ) -> Result<InterpreterAction, EVMError<DB::Error>>

Executes call frame.

Source

pub fn take_instruction_table( &mut self, ) -> InstructionTables<'a, Context<EXT, DB>>

Take instruction table.

Source

pub fn set_instruction_table( &mut self, table: InstructionTables<'a, Context<EXT, DB>>, )

Set instruction table.

Source

pub fn pre_execution(&self) -> &PreExecutionHandler<'a, EXT, DB>

Returns reference to pre execution handler.

Source

pub fn post_execution(&self) -> &PostExecutionHandler<'a, EXT, DB>

Returns reference to pre execution handler.

Source

pub fn execution(&self) -> &ExecutionHandler<'a, EXT, DB>

Returns reference to frame handler.

Source

pub fn validation(&self) -> &ValidationHandler<'a, EXT, DB>

Returns reference to validation handler.

Source

pub fn append_handler_register( &mut self, register: HandleRegisters<'a, EXT, DB>, )

Append handle register.

Source

pub fn append_handler_register_plain( &mut self, register: HandleRegister<EXT, DB>, )

Append plain handle register.

Source

pub fn append_handler_register_box( &mut self, register: HandleRegisterBox<'a, EXT, DB>, )

Append boxed handle register.

Source

pub fn pop_handle_register(&mut self) -> Option<HandleRegisters<'a, EXT, DB>>

Pop last handle register and reapply all registers that are left.

Source

pub fn create_handle_generic<SPEC: Spec>(&mut self) -> EvmHandler<'a, EXT, DB>

Creates the Handler with Generic Spec.

Source

pub fn modify_spec_id(&mut self, spec_id: SpecId)

Creates the Handler with variable SpecId, inside it will call function with Generic Spec.