engineapi

package
v0.0.0-...-70e280b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExceedsGasLimit = errors.New("tx gas exceeds block gas limit")
	ErrUsesTooMuchGas  = errors.New("action takes too much gas")
)
View Source
var (
	STATUS_INVALID = &eth.ForkchoiceUpdatedResult{PayloadStatus: eth.PayloadStatusV1{Status: eth.ExecutionInvalid}, PayloadID: nil}
	STATUS_SYNCING = &eth.ForkchoiceUpdatedResult{PayloadStatus: eth.PayloadStatusV1{Status: eth.ExecutionSyncing}, PayloadID: nil}
)
View Source
var ErrNotBuildingBlock = errors.New("not currently building a block, cannot include tx from queue")

Functions

func CreatePrecompileOverrides

func CreatePrecompileOverrides(precompileOracle PrecompileOracle) vm.PrecompileOverrides

Types

type BlockDataProvider

type BlockDataProvider interface {
	StateAt(root common.Hash) (*state.StateDB, error)
	GetHeader(common.Hash, uint64) *types.Header
	Engine() consensus.Engine
	GetVMConfig() *vm.Config
	Config() *params.ChainConfig
	consensus.ChainHeaderReader
}

type BlockProcessor

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

func NewBlockProcessorFromHeader

func NewBlockProcessorFromHeader(provider BlockDataProvider, h *types.Header) (*BlockProcessor, error)

func NewBlockProcessorFromPayloadAttributes

func NewBlockProcessorFromPayloadAttributes(provider BlockDataProvider, parent common.Hash, attrs *eth.PayloadAttributes) (*BlockProcessor, error)

func (*BlockProcessor) AddTx

func (b *BlockProcessor) AddTx(tx *types.Transaction) error

func (*BlockProcessor) Assemble

func (b *BlockProcessor) Assemble() (*types.Block, error)

func (*BlockProcessor) CheckTxWithinGasLimit

func (b *BlockProcessor) CheckTxWithinGasLimit(tx *types.Transaction) error

func (*BlockProcessor) Commit

func (b *BlockProcessor) Commit() error

type EngineBackend

type EngineBackend interface {
	CurrentSafeBlock() *types.Header
	CurrentFinalBlock() *types.Header
	GetBlockByHash(hash common.Hash) *types.Block
	GetBlock(hash common.Hash, number uint64) *types.Block
	HasBlockAndState(hash common.Hash, number uint64) bool
	GetCanonicalHash(n uint64) common.Hash

	GetVMConfig() *vm.Config
	Config() *params.ChainConfig
	// Engine retrieves the chain's consensus engine.
	Engine() consensus.Engine

	StateAt(root common.Hash) (*state.StateDB, error)

	InsertBlockWithoutSetHead(block *types.Block) error
	SetCanonical(head *types.Block) (common.Hash, error)
	SetFinalized(header *types.Header)
	SetSafe(header *types.Header)

	consensus.ChainHeaderReader
}

type L2EngineAPI

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

L2EngineAPI wraps an engine actor, and implements the RPC backend required to serve the engine API. This re-implements some of the Geth API work, but changes the API backend so we can deterministically build and control the L2 block contents to reach very specific edge cases as desired for testing.

func NewL2EngineAPI

func NewL2EngineAPI(log log.Logger, backend EngineBackend, downloader *downloader.Downloader) *L2EngineAPI

func (*L2EngineAPI) ForcedEmpty

func (ea *L2EngineAPI) ForcedEmpty() bool

func (*L2EngineAPI) ForkchoiceUpdatedV1

func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)

func (*L2EngineAPI) ForkchoiceUpdatedV2

func (ea *L2EngineAPI) ForkchoiceUpdatedV2(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)

func (*L2EngineAPI) GetPayloadV1

func (ea *L2EngineAPI) GetPayloadV1(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)

func (*L2EngineAPI) GetPayloadV2

func (ea *L2EngineAPI) GetPayloadV2(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)

func (*L2EngineAPI) GetPayloadV3

func (ea *L2EngineAPI) GetPayloadV3(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)

func (*L2EngineAPI) IncludeTx

func (ea *L2EngineAPI) IncludeTx(tx *types.Transaction, from common.Address) error

func (*L2EngineAPI) NewPayloadV1

func (ea *L2EngineAPI) NewPayloadV1(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)

func (*L2EngineAPI) NewPayloadV2

func (ea *L2EngineAPI) NewPayloadV2(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)

func (*L2EngineAPI) PendingIndices

func (ea *L2EngineAPI) PendingIndices(from common.Address) uint64

func (*L2EngineAPI) RemainingBlockGas

func (ea *L2EngineAPI) RemainingBlockGas() uint64

type PrecompileOracle

type PrecompileOracle interface {
	Precompile(address common.Address, input []byte) ([]byte, bool)
}

PrecompileOracle defines the high-level API used to retrieve the result of a precompile call The caller is expected to validate the input to the precompile call

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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