github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/state/runtime/instrumentation/executortrace.go (about)

     1  package instrumentation
     2  
     3  // ExecutorTrace contents executor traces.
     4  type ExecutorTrace struct {
     5  	Context Context `json:"context"`
     6  	Steps   []Step  `json:"steps"`
     7  }
     8  
     9  // Context is the trace context.
    10  type Context struct {
    11  	Type     string `json:"type"`
    12  	From     string `json:"from"`
    13  	To       string `json:"to"`
    14  	Input    string `json:"input"`
    15  	Gas      string `json:"gas"`
    16  	Value    string `json:"value"`
    17  	Output   string `json:"output"`
    18  	Nonce    uint64 `json:"nonce"`
    19  	GasPrice string `json:"gasPrice"`
    20  	// ChainID      uint64 `json:"chainId"`
    21  	OldStateRoot string `json:"oldStateRoot"`
    22  	Time         uint64 `json:"time"`
    23  	GasUsed      string `json:"gasUsed"`
    24  }
    25  
    26  // Step is a trace step.
    27  type Step struct {
    28  	StateRoot  string   `json:"stateRoot"`
    29  	Depth      int      `json:"depth"`
    30  	Pc         uint64   `json:"pc"`
    31  	Gas        string   `json:"gas"`
    32  	OpCode     string   `json:"opcode"`
    33  	Refund     string   `json:"refund"`
    34  	Op         string   `json:"op"`
    35  	Error      string   `json:"error"`
    36  	Contract   Contract `json:"contract"`
    37  	GasCost    string   `json:"gasCost"`
    38  	Stack      []string `json:"stack"`
    39  	Memory     []byte   `json:"memory"`
    40  	ReturnData []byte   `json:"returnData"`
    41  }
    42  
    43  // Contract represents a contract in the trace.
    44  type Contract struct {
    45  	Address string `json:"address"`
    46  	Caller  string `json:"caller"`
    47  	Value   string `json:"value"`
    48  	Input   string `json:"input"`
    49  	Gas     string `json:"gas"`
    50  }
    51  
    52  // Tracer represents the executor tracer.
    53  type Tracer struct {
    54  	Code string `json:"tracer"`
    55  }