vm

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: GPL-3.0, LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateableEips

func ActivateableEips() []string

ActivateableEips returns the list of EIPs that can be activated

func ConvertChainConfig

func ConvertChainConfig(cfg *luxparams.ChainConfig) *params.ChainConfig

ConvertChainConfig converts luxfi chainConfig to ethereum chainConfig

Types

type BlockContext

type BlockContext = vm.BlockContext

BlockContext provides the EVM with auxiliary information. Once provided it shouldn't be modified.

type Config

type Config = vm.Config

Config are the configuration options for the Interpreter

type EVM

type EVM struct {
	*vm.EVM
}

EVM is the Ethereum Virtual Machine base object and provides the necessary tools to run a contract on the given state with the provided context. It should be noted that any error generated through any of the calls should be considered a revert-state-and-consume-all-gas operation, no checks on specific errors should ever be performed. The interpreter makes sure that any errors generated are to be considered faulty code.

The EVM should never be reused and is not thread safe.

func NewEVM

func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainConfig, config Config) *EVM

NewEVM creates a new EVM instance.

func NewEVMWithStateDB

func NewEVMWithStateDB(blockCtx BlockContext, txCtx TxContext, statedb *state.StateDB, chainConfig *luxparams.ChainConfig, config Config) *EVM

NewEVMWithStateDB creates a new EVM with luxfi chainConfig and statedb

type EVMLogger

type EVMLogger interface {
	// Transaction level
	CaptureTxStart(gasLimit uint64)
	CaptureTxEnd(restGas uint64)
	// Top call frame
	CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int)
	CaptureEnd(output []byte, gasUsed uint64, err error)
	// Rest of call frames
	CaptureEnter(typ OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)
	CaptureExit(output []byte, gasUsed uint64, err error)
	// Opcode level
	CaptureState(pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, depth int, err error)
	CaptureFault(pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, err error)
}

EVMLogger is used to collect execution traces from an EVM transaction execution. CaptureState is called for each step of the VM with the current VM state. Note that reference types are actual VM data structures; make copies if you need to retain them beyond the current call.

type OpCode

type OpCode = vm.OpCode

OpCode is an EVM opcode

type ScopeContext

type ScopeContext = vm.ScopeContext

ScopeContext contains the things that are per-call, such as stack and memory, but not transients like pc and gas

type StateDB

type StateDB interface {
	vm.StateDB
}

StateDB is an EVM database for full state querying.

type TxContext

type TxContext = vm.TxContext

TxContext provides the EVM with information about a transaction. All fields can change between transactions.

Jump to

Keyboard shortcuts

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