processor

package
v0.0.0-...-3ee0057 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTransaction

func ApplyTransaction(msg *core.Message, gp *core.GasPool, worldState worldstate.WorldState, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (receipt *types.Receipt, err error)

ApplyTransaction applies a transaction to state.

func NewChainContext

func NewChainContext(ctx context.Context, chain blockchain.Blockchain, engine consensus.Engine, config *params.ChainConfig) core.ChainContext

NewChainContext creates a new chain context

Types

type BlockProcessor

type BlockProcessor struct {

	// Consensus engine for block rewards
	Engine consensus.Engine
	// contains filtered or unexported fields
}

func NewBlockProcessor

func NewBlockProcessor(config *params.ChainConfig, chain blockchain.Blockchain) (*BlockProcessor, error)

NewBlockProcessor creates a new block processor.

func NewBlockProcessorWithEngine

func NewBlockProcessorWithEngine(config *params.ChainConfig, chain blockchain.Blockchain, engine consensus.Engine) *BlockProcessor

NewBlockProcessorWithEngine creates a new block processor.

func (*BlockProcessor) Config

func (p *BlockProcessor) Config() *params.ChainConfig

Config retrieves the blockchain's chain configuration.

func (*BlockProcessor) CurrentHeader

func (p *BlockProcessor) CurrentHeader() *types.Header

CurrentHeader retrieves the current header from the local chain.

func (*BlockProcessor) GetHeader

func (p *BlockProcessor) GetHeader(hash common.Hash, number uint64) *types.Header

GetHeader retrieves a block header from the database by hash and number.

func (*BlockProcessor) GetHeaderByHash

func (p *BlockProcessor) GetHeaderByHash(hash common.Hash) *types.Header

GetHeaderByHash retrieves a block header from the database by its hash.

func (*BlockProcessor) GetHeaderByNumber

func (p *BlockProcessor) GetHeaderByNumber(number uint64) *types.Header

GetHeaderByNumber retrieves a block header from the database by number.

func (*BlockProcessor) Process

func (p *BlockProcessor) Process(ctx context.Context, block *types.Block, worldState worldstate.WorldState, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error)

Process processes the state changes according to the Ethereum rules by running the transaction messages using the statedb and applying any rewards to both the processor (coinbase) and any included uncles.

Process returns the receipts and logs accumulated during the process and returns the amount of gas that was used in the process. If any of the transactions failed to execute due to insufficient gas it will return an error.

Jump to

Keyboard shortcuts

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