exec3

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomTraceMapReduce

func CustomTraceMapReduce(fromBlock, toBlock uint64, consumer TraceConsumer, ctx context.Context, tx kv.TemporalTx, cfg *ExecArgs, logger log.Logger) (err error)

func NewWorkersPool

func NewWorkersPool(lock sync.Locker, accumulator *shards.Accumulator, logger log.Logger, ctx context.Context, background bool, chainDb kv.RoDB, rs *state.StateV3, in *state.QueueWithRetry, blockReader services.FullBlockReader, chainConfig *chain.Config, genesis *types.Genesis, engine consensus.Engine, workerCount int, dirs datadir.Dirs, isMining bool) (reconWorkers []*Worker, applyWorker *Worker, rws *state.ResultsQueue, clear func(), wait func())

Types

type CallTracer

type CallTracer struct {
	// contains filtered or unexported fields
}

func NewCallTracer

func NewCallTracer() *CallTracer

func (*CallTracer) CaptureEnd

func (ct *CallTracer) CaptureEnd(output []byte, usedGas uint64, err error)

func (*CallTracer) CaptureEnter

func (ct *CallTracer) CaptureEnter(typ vm.OpCode, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte)

func (*CallTracer) CaptureExit

func (ct *CallTracer) CaptureExit(output []byte, usedGas uint64, err error)

func (*CallTracer) CaptureFault

func (ct *CallTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error)

func (*CallTracer) CaptureStart

func (ct *CallTracer) CaptureStart(env *vm.EVM, from libcommon.Address, to libcommon.Address, precompile bool, create bool, input []byte, gas uint64, value *uint256.Int, code []byte)

func (*CallTracer) CaptureState

func (ct *CallTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error)

func (*CallTracer) CaptureTxEnd

func (ct *CallTracer) CaptureTxEnd(restGas uint64)

func (*CallTracer) CaptureTxStart

func (ct *CallTracer) CaptureTxStart(gasLimit uint64)

func (*CallTracer) Froms

func (ct *CallTracer) Froms() map[libcommon.Address]struct{}

func (*CallTracer) Reset

func (ct *CallTracer) Reset()

func (*CallTracer) Tos

func (ct *CallTracer) Tos() map[libcommon.Address]struct{}

type ExecArgs

type ExecArgs struct {
	ChainDB     kv.RoDB
	Genesis     *types.Genesis
	BlockReader services.FullBlockReader
	Prune       prune.Mode
	Engine      consensus.Engine
	Dirs        datadir.Dirs
	ChainConfig *chain.Config
	Workers     int
}

immutable (aka. global) params required for block execution. can instantiate once at app-start

type GenericTracer

type GenericTracer interface {
	vm.EVMLogger
	SetTransaction(tx types.Transaction)
	Found() bool
}

type HistoricalTraceWorker

type HistoricalTraceWorker struct {
	// contains filtered or unexported fields
}

func NewHistoricalTraceWorker

func NewHistoricalTraceWorker(
	consumer TraceConsumer,
	in *state.QueueWithRetry,
	out *state.ResultsQueue,
	background bool,

	ctx context.Context,
	execArgs *ExecArgs,
	logger log.Logger,
) *HistoricalTraceWorker

func NewHistoricalTraceWorkers

func NewHistoricalTraceWorkers(consumer TraceConsumer, cfg *ExecArgs, ctx context.Context, toTxNum uint64, in *state.QueueWithRetry, workerCount int, outputTxNum *atomic.Uint64, logger log.Logger) (g *errgroup.Group, applyWorker *HistoricalTraceWorker, clearFunc func())

func (*HistoricalTraceWorker) ResetTx

func (rw *HistoricalTraceWorker) ResetTx(chainTx kv.Tx)

func (*HistoricalTraceWorker) Run

func (rw *HistoricalTraceWorker) Run() error

func (*HistoricalTraceWorker) RunTxTask

func (rw *HistoricalTraceWorker) RunTxTask(txTask *state.TxTask)

type Resetable

type Resetable interface {
	Reset()
}

type TraceConsumer

type TraceConsumer struct {
	NewTracer func() GenericTracer
	//Reduce receiving results of execution. They are sorted and have no gaps.
	Reduce func(task *state.TxTask, tx kv.Tx) error
}

type TraceWorker

type TraceWorker struct {
	// contains filtered or unexported fields
}

func (*TraceWorker) ChangeBlock

func (e *TraceWorker) ChangeBlock(header *types.Header)

func (*TraceWorker) Close

func (e *TraceWorker) Close()

func (*TraceWorker) ExecTxn

func (e *TraceWorker) ExecTxn(txNum uint64, txIndex int, txn types.Transaction, gasBailout bool) (*evmtypes.ExecutionResult, error)

func (*TraceWorker) GetLogs

func (e *TraceWorker) GetLogs(txIndex int, txnHash common.Hash, blockNumber uint64, blockHash common.Hash) []*types.Log

func (*TraceWorker) GetRawLogs

func (e *TraceWorker) GetRawLogs(txIdx int) types.Logs

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(lock sync.Locker, logger log.Logger, ctx context.Context, background bool, chainDb kv.RoDB, in *state.QueueWithRetry, blockReader services.FullBlockReader, chainConfig *chain.Config, genesis *types.Genesis, results *state.ResultsQueue, engine consensus.Engine, dirs datadir.Dirs, isMining bool) *Worker

func (*Worker) DiscardReadList

func (rw *Worker) DiscardReadList()

func (*Worker) LogLRUStats

func (rw *Worker) LogLRUStats()

func (*Worker) ResetState

func (rw *Worker) ResetState(rs *state.StateV3, accumulator *shards.Accumulator)

func (*Worker) ResetTx

func (rw *Worker) ResetTx(chainTx kv.Tx)

func (*Worker) Run

func (rw *Worker) Run() error

func (*Worker) RunTxTask

func (rw *Worker) RunTxTask(txTask *state.TxTask, isMining bool)

func (*Worker) RunTxTaskNoLock

func (rw *Worker) RunTxTaskNoLock(txTask *state.TxTask, isMining bool)

func (*Worker) SetReader

func (rw *Worker) SetReader(reader state.ResettableStateReader)

Needed to set history reader when need to offset few txs from block beginning and does not break processing, like compute gas used for block and then to set state reader to continue processing on latest data.

func (*Worker) Tx

func (rw *Worker) Tx() kv.Tx

Jump to

Keyboard shortcuts

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