arbos/util/
tracing_info.rs

1use alloy_primitives::Address;
2
3/// The scenario in which tracing is occurring.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum TracingScenario {
6    /// Tracing a top-level transaction.
7    Transaction,
8    /// Tracing a precompile call within a transaction.
9    Precompile,
10    /// Tracing an ArbOS internal operation.
11    ArbOS,
12}
13
14/// Tracing context passed through ArbOS for EVM debugging/tracing support.
15#[derive(Debug, Clone)]
16pub struct TracingInfo {
17    pub scenario: TracingScenario,
18    pub from: Address,
19    pub to: Address,
20    pub depth: usize,
21}
22
23impl TracingInfo {
24    pub fn new(from: Address, to: Address, scenario: TracingScenario) -> Self {
25        Self {
26            scenario,
27            from,
28            to,
29            depth: 0,
30        }
31    }
32}