Trait InspectorHandler
pub trait InspectorHandler: Handlerwhere
Self::Evm: InspectorEvmTr,
<Self::Evm as InspectorEvmTr>::Inspector: Inspector<<Self::Evm as EvmTr>::Context, Self::IT>,{
type IT: InterpreterTypes;
// Provided methods
fn inspect_run(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error> { ... }
fn inspect_run_without_catch_error(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error> { ... }
fn inspect_execution(
&mut self,
evm: &mut Self::Evm,
init_and_floor_gas: &InitialAndFloorGas,
) -> Result<FrameResult, Self::Error> { ... }
fn inspect_run_exec_loop(
&mut self,
evm: &mut Self::Evm,
first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit,
) -> Result<FrameResult, Self::Error> { ... }
fn inspect_run_system_call(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error> { ... }
}Expand description
Trait that extends Handler with inspection functionality.
Similar how Handler::run method serves as the entry point,
InspectorHandler::inspect_run method serves as the entry point for inspection.
For system calls, InspectorHandler::inspect_run_system_call provides inspection
support similar to Handler::run_system_call.
Notice that when inspection is run it skips few functions from handler, this can be
a problem if custom EVM is implemented and some of skipped functions have changed logic.
For custom EVM, those changed functions would need to be also changed in InspectorHandler.
List of functions that are skipped in InspectorHandler:
Handler::runreplaced withInspectorHandler::inspect_runHandler::run_without_catch_errorreplaced withInspectorHandler::inspect_run_without_catch_errorHandler::executionreplaced withInspectorHandler::inspect_executionHandler::run_exec_loopreplaced withInspectorHandler::inspect_run_exec_looprun_exec_loopcallsinspect_frame_initandinspect_frame_runthat call inspector inside.
Handler::run_system_callreplaced withInspectorHandler::inspect_run_system_call
Required Associated Types§
type IT: InterpreterTypes
type IT: InterpreterTypes
The interpreter types used by this handler.
Provided Methods§
fn inspect_run(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
fn inspect_run( &mut self, evm: &mut Self::Evm, ) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
Entry point for inspection.
This method is acts as Handler::run method for inspection.
fn inspect_run_without_catch_error(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
fn inspect_run_without_catch_error( &mut self, evm: &mut Self::Evm, ) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
Run inspection without catching error.
This method is acts as Handler::run_without_catch_error method for inspection.
fn inspect_execution(
&mut self,
evm: &mut Self::Evm,
init_and_floor_gas: &InitialAndFloorGas,
) -> Result<FrameResult, Self::Error>
fn inspect_execution( &mut self, evm: &mut Self::Evm, init_and_floor_gas: &InitialAndFloorGas, ) -> Result<FrameResult, Self::Error>
Run execution loop with inspection support
This method acts as Handler::execution method for inspection.
fn inspect_run_exec_loop(
&mut self,
evm: &mut Self::Evm,
first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit,
) -> Result<FrameResult, Self::Error>
fn inspect_run_exec_loop( &mut self, evm: &mut Self::Evm, first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit, ) -> Result<FrameResult, Self::Error>
Run inspection on execution loop.
This method acts as Handler::run_exec_loop method for inspection.
It will call:
Inspector::call,Inspector::createto inspect call, create and eofcreate.Inspector::call_end,Inspector::create_endto inspect call, create and eofcreate end.Inspector::initialize_interpto inspect initialized interpreter.
fn inspect_run_system_call(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
fn inspect_run_system_call( &mut self, evm: &mut Self::Evm, ) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
Run system call with inspection support.
This method acts as Handler::run_system_call method for inspection.
Similar to InspectorHandler::inspect_run but skips validation and pre-execution phases,
going directly to execution with inspection support.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.