tracer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 2 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuntimeHost

type RuntimeHost interface {
	// GetRefund returns refunded value
	GetRefund() uint64
	// GetStorage access the storage slot at the given address and slot hash
	GetStorage(types.Address, types.Hash) types.Hash
}

RuntimeHost is the interface defining the methods for accessing state by tracer

type Tracer

type Tracer interface {
	// Cancel tells termination of execution and tracing
	Cancel(error)
	// Clear clears the tracked data
	Clear()
	// GetResult returns a result based on tracked data
	GetResult() (interface{}, error)

	// Tx-level
	TxStart(gasLimit uint64)
	TxEnd(gasLeft uint64)

	// Call-level
	CallStart(
		depth int,
		from, to types.Address,
		callType int,
		gas uint64,
		value *big.Int,
		input []byte,
	)
	CallEnd(
		depth int,
		output []byte,
		err error,
	)

	// Op-level
	CaptureState(
		memory []byte,
		stack []*big.Int,
		opCode int,
		contractAddress types.Address,
		sp int,
		host RuntimeHost,
		state VMState,
	)
	ExecuteState(
		contractAddress types.Address,
		ip uint64,
		opcode string,
		availableGas uint64,
		cost uint64,
		lastReturnData []byte,
		depth int,
		err error,
		host RuntimeHost,
	)
}

type VMState

type VMState interface {
	// Halt tells VM to terminate its process
	Halt()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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