processor

package
v0.0.0-...-d7cfa30 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTransaction

func ApplyTransaction(msg *core.Message, config *params.ChainConfig, 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) core.ChainContext

NewChainContext creates a new chain context

func ProcessBeaconBlockRoot

func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, worldState worldstate.WorldState)

ProcessBeaconBlockRoot applies the EIP-4788 system call to the beacon block root contract. This method is exported to be used in tests.

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) 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