Type Definition ssvm_evmc_sys::evmc_trace_callback[][src]

pub type evmc_trace_callback = Option<unsafe extern "C" fn(context: *mut evmc_tracer_context, code_offset: usize, status_code: evmc_status_code, gas_left: i64, stack_num_items: usize, pushed_stack_item: *const evmc_uint256be, memory_size: usize, changed_memory_offset: usize, changed_memory_size: usize, changed_memory: *const u8)>;
Expand description

The callback to trace instructions execution in an EVM.

This function informs the Client what instruction has been executed in the EVM implementation and what are the results of executing this particular instruction. The message level information (like call depth, destination address, etc.) are not provided here. This piece of information can be acquired by inspecting messages being sent to the EVM in ::evmc_execute_fn and the results of the messages execution.

@deprecated Deprecated since EVMC 6.3, see evmc_instance::set_tracer().

@param context The pointer to the Client-side tracing context. This allows to implement the tracer in OOP manner. @param code_offset The current instruction position in the code. @param status_code The status code of the instruction execution. @param gas_left The amount of the gas left after the instruction execution. @param stack_num_items The current EVM stack height after the instruction execution. @param pushed_stack_item The top EVM stack item pushed as the result of the instruction execution. This value is null when the instruction does not push anything to the stack. @param memory_size The size of the EVM memory after the instruction execution. @param changed_memory_offset The offset in number of bytes of the beginning of the memory area modified as the result of the instruction execution. The Client MAY use this information together with @p changed_memory_size and @p changed_memory to incrementally update the copy of the full VM’s memory. @param changed_memory_size The size of the memory area modified as the result of the instruction execution. @param changed_memory The pointer to the memory area modified as the result of the instruction execution. The Client MAY access the pointed memory area (limited by the @p changed_memory_size) only during the current execution of the evmc_trace_callback(). The pointer MUST NOT be stored by the Client. The Client MUST NOT assume that changed_memory - changed_memory_offset is a valid base pointer of the VM memory.