tracer

package
v0.6.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tracer provides custom tracing capabilities to comply with EIP-4337 specifications for forbidden opcodes.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Loaded JS tracers for simulating various EntryPoint methods using debug_traceCall.
	Loaded, _ = NewTracers()
)

Functions

This section is empty.

Types

type AccessInfo

type AccessInfo struct {
	Reads  HexMap `json:"reads"`
	Writes Counts `json:"writes"`
}

AccessInfo provides context on read and write counts by storage slots.

type AccessMap added in v0.2.0

type AccessMap = map[common.Address]AccessInfo

type BundlerCollectorReturn

type BundlerCollectorReturn struct {
	CallsFromEntryPoint []CallFromEntryPointInfo `json:"callsFromEntryPoint"`
	Keccak              []string                 `json:"keccak"`
	Calls               []CallInfo               `json:"calls"`
	Logs                []LogInfo                `json:"logs"`
	Debug               []any                    `json:"debug"`
}

BundlerCollectorReturn is the return value from performing an EVM trace with BundlerCollectorTracer.js.

type BundlerExecutionReturn added in v0.6.9

type BundlerExecutionReturn struct {
	Reverts            []string `json:"reverts"`
	ValidationOOG      bool     `json:"validationOOG"`
	ExecutionOOG       bool     `json:"executionOOG"`
	ExecutionGasLimit  float64  `json:"executionGasLimit"`
	UserOperationEvent *LogInfo `json:"userOperationEvent,omitempty"`
	Output             string   `json:"output"`
	Error              string   `json:"error"`
}

BundlerExecutionReturn is the return value from performing an EVM trace with BundlerExecutionTracer.js.

type CallFromEntryPointInfo added in v0.6.33

type CallFromEntryPointInfo struct {
	TopLevelMethodSig     hexutil.Bytes        `json:"topLevelMethodSig"`
	TopLevelTargetAddress common.Address       `json:"topLevelTargetAddress"`
	Opcodes               Counts               `json:"opcodes"`
	Access                AccessMap            `json:"access"`
	ContractSize          ContractSizeMap      `json:"contractSize"`
	ExtCodeAccessInfo     ExtCodeAccessInfoMap `json:"extCodeAccessInfo"`
	OOG                   bool                 `json:"oog"`
}

CallFromEntryPoint provides context on opcodes and storage access made via the EntryPoint to UserOperation entities.

type CallInfo

type CallInfo struct {
	// Common
	Type string `json:"type"`

	// Method info
	From   common.Address `json:"from"`
	To     common.Address `json:"to"`
	Method string         `json:"method"`
	Value  string         `json:"value"`
	Gas    float64        `json:"gas"`

	// Exit info
	GasUsed float64 `json:"gasUsed"`
	Data    any     `json:"data"`
}

CallInfo provides context on internal calls made during tracing.

type ContractSizeInfo added in v0.6.33

type ContractSizeInfo struct {
	ContractSize float64 `json:"contractSize"`
	Opcode       string  `json:"opcode"`
}

ContractSizeInfo provides context on the code size and call type used to access upstream contracts.

type ContractSizeMap added in v0.6.33

type ContractSizeMap map[common.Address]ContractSizeInfo

type Counts

type Counts = map[string]float64

type ExtCodeAccessInfoMap added in v0.6.33

type ExtCodeAccessInfoMap map[common.Address]string

ExtCodeAccessInfoMap provides context on potentially illegal use of EXTCODESIZE.

type HexMap added in v0.6.33

type HexMap = map[string]string

type LogInfo

type LogInfo struct {
	Topics []string `json:"topics"`
	Data   string   `json:"data"`
}

LogInfo provides context from LOG opcodes during each step in the EVM trace.

type Tracers added in v0.6.0

type Tracers struct {
	BundlerCollectorTracer string
	BundlerExecutionTracer string
}

func NewTracers added in v0.6.0

func NewTracers() (*Tracers, error)

NewBundlerTracers reads the *Tracer.js files and returns a collection of strings that can be passed to a debug RPC method as a custom tracer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL