referrerpolicy=no-referrer-when-downgrade

Tracing

Trait Tracing 

Source
pub trait Tracing {
Show 15 methods // Provided methods fn watch_address(&mut self, _addr: &H160) { ... } fn enter_child_span( &mut self, _from: H160, _to: H160, _delegate_call: Option<H160>, _is_read_only: bool, _value: U256, _input: &[u8], _gas_limit: u64, ) { ... } fn terminate( &mut self, _contract_address: H160, _beneficiary_address: H160, _gas_left: u64, _value: U256, ) { ... } fn instantiate_code(&mut self, _code: &Code, _salt: Option<&[u8; 32]>) { ... } fn balance_read(&mut self, _addr: &H160, _value: U256) { ... } fn storage_read(&mut self, _key: &Key, _value: Option<&[u8]>) { ... } fn storage_write( &mut self, _key: &Key, _old_value: Option<Vec<u8>>, _new_value: Option<&[u8]>, ) { ... } fn log_event(&mut self, _event: H160, _topics: &[H256], _data: &[u8]) { ... } fn exit_child_span( &mut self, _output: &ExecReturnValue, _gas_used: u64, _weight_consumed: Weight, ) { ... } fn exit_child_span_with_error( &mut self, _error: DispatchError, _gas_used: u64, _weight_consumed: Weight, ) { ... } fn is_execution_tracer(&self) -> bool { ... } fn enter_opcode( &mut self, _pc: u64, _opcode: u8, _trace_info: &dyn EVMFrameTraceInfo, ) { ... } fn enter_ecall( &mut self, _ecall: &'static str, _args: &[u64], _trace_info: &dyn FrameTraceInfo, ) { ... } fn exit_step( &mut self, _trace_info: &dyn FrameTraceInfo, _returned: Option<u64>, ) { ... } fn dispatch_result( &mut self, _base_call_weight: Weight, _weight_consumed: Weight, ) { ... }
}
Expand description

Defines methods to trace contract interactions.

Provided Methods§

Source

fn watch_address(&mut self, _addr: &H160)

Register an address that should be traced.

Source

fn enter_child_span( &mut self, _from: H160, _to: H160, _delegate_call: Option<H160>, _is_read_only: bool, _value: U256, _input: &[u8], _gas_limit: u64, )

Called before a contract call is executed.

For CALL/DELEGATECALL opcodes:

  • gas_limit: gas forwarded to the child call
Source

fn terminate( &mut self, _contract_address: H160, _beneficiary_address: H160, _gas_left: u64, _value: U256, )

Called when a contract calls terminates (selfdestructs)

Source

fn instantiate_code(&mut self, _code: &Code, _salt: Option<&[u8; 32]>)

Record the next code and salt to be instantiated.

Source

fn balance_read(&mut self, _addr: &H160, _value: U256)

Called when a balance is read

Source

fn storage_read(&mut self, _key: &Key, _value: Option<&[u8]>)

Called when storage read is called

Source

fn storage_write( &mut self, _key: &Key, _old_value: Option<Vec<u8>>, _new_value: Option<&[u8]>, )

Called when storage write is called

Source

fn log_event(&mut self, _event: H160, _topics: &[H256], _data: &[u8])

Record a log event

Source

fn exit_child_span( &mut self, _output: &ExecReturnValue, _gas_used: u64, _weight_consumed: Weight, )

Called after a contract call is executed

Source

fn exit_child_span_with_error( &mut self, _error: DispatchError, _gas_used: u64, _weight_consumed: Weight, )

Called when a contract call terminates with an error

Source

fn is_execution_tracer(&self) -> bool

Check if the tracer is an execution tracer.

Source

fn enter_opcode( &mut self, _pc: u64, _opcode: u8, _trace_info: &dyn EVMFrameTraceInfo, )

Called before an EVM opcode is executed.

§Parameters
  • pc: The current program counter.
  • opcode: The opcode being executed.
  • trace_info: Information about the current execution frame.
Source

fn enter_ecall( &mut self, _ecall: &'static str, _args: &[u64], _trace_info: &dyn FrameTraceInfo, )

Called before a PVM syscall is executed.

§Parameters
  • ecall: The name of the syscall being executed.
  • args: The syscall arguments (register values).
  • trace_info: Information about the current execution frame.
Source

fn exit_step( &mut self, _trace_info: &dyn FrameTraceInfo, _returned: Option<u64>, )

Called after an EVM opcode or PVM syscall is executed to record the gas cost.

§Parameters
  • trace_info: Information about the current execution frame.
  • returned: The syscall return value (PVM only, None for EVM opcodes).
Source

fn dispatch_result( &mut self, _base_call_weight: Weight, _weight_consumed: Weight, )

Called once the transaction completes to report the gas consumed by the meter.

§Parameters
  • base_call_weight: Extrinsic base weight that is added on top of weight_consumed when charging.
  • weight_consumed: Weight used by the transaction logic, excluding the extrinsic base weight.

Implementors§