tracers

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package tracers is a manager for transaction tracing engines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLookup

func RegisterLookup(wildcard bool, lookup lookupFunc)

RegisterLookup registers a method as a lookup for tracers, meaning that users can invoke a named tracer through that lookup. If 'wildcard' is true, then the lookup will be placed last. This is typically meant for interpreted engines (js) which can evaluate dynamic user-supplied code.

Types

type Context

type Context struct {
	BlockHash libcommon.Hash // Hash of the block the tx is contained within (zero if dangling tx or call)
	TxIndex   int            // Index of the transaction within a block (zero if dangling tx or call)
	TxHash    libcommon.Hash // Hash of the transaction being traced (zero if dangling call)
}

Context contains some contextual infos for a transaction execution that is not available from within the EVM object.

type TraceConfig

type TraceConfig struct {
	*logger.LogConfig
	Tracer         *string
	TracerConfig   *json.RawMessage
	Timeout        *string
	Reexec         *uint64
	NoRefunds      *bool // Turns off gas refunds when tracing
	StateOverrides *ethapi.StateOverrides

	BorTraceEnabled *bool
	BorTx           *bool
	TxIndex         *hexutil.Uint
}

TraceConfig holds extra parameters to trace functions.

type Tracer

type Tracer interface {
	vm.EVMLogger
	GetResult() (json.RawMessage, error)
	// Stop terminates execution of the tracer at the first opportune moment.
	Stop(err error)
}

Tracer interface extends vm.EVMLogger and additionally allows collecting the tracing result.

func New

func New(code string, ctx *Context, cfg json.RawMessage) (Tracer, error)

New returns a new instance of a tracer, by iterating through the registered lookups.

Directories

Path Synopsis
internal
js
internal/tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.
Package native is a collection of tracers written in go.
Package native is a collection of tracers written in go.

Jump to

Keyboard shortcuts

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