tracer

package
v0.0.0-...-11d95e7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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