pub trait VMTracer: Send {
    type Output;
    fn drain(self) -> Option<Self::Output>;

    fn trace_next_instruction(
        &mut self,
        _pc: usize,
        _instruction: u8,
        _current_gas: U256
    ) -> bool { ... }
fn trace_prepare_execute(
        &mut self,
        _pc: usize,
        _instruction: u8,
        _gas_cost: U256,
        _mem_written: Option<(usize, usize)>,
        _store_written: Option<(U256, U256)>
    ) { ... }
fn trace_failed(&mut self) { ... }
fn trace_executed(
        &mut self,
        _gas_used: U256,
        _stack_push: &[U256],
        _mem: &[u8]
    ) { ... }
fn prepare_subtrace(&mut self, _code: &[u8]) { ... }
fn done_subtrace(&mut self) { ... } }
Expand description

Used by executive to build VM traces.

Associated Types

Data returned when draining the VMTracer.

Required methods

Consumes self and returns the VM trace.

Provided methods

Trace the progression of interpreter to next instruction. If tracer returns false it won’t be called again. @returns true if trace_prepare_execute and trace_executed should be called.

Trace the preparation to execute a single valid instruction.

Trace the execution failure of a single instruction.

Trace the finalised execution of a single valid instruction.

Spawn subtracer which will be used to trace deeper levels of execution.

Finalize subtracer.

Implementors