engine

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Namespace = "op_node"

Functions

func Auto

func Auto(ctx context.Context, metrics Metricer, client *sources.EngineAPIClient, log log.Logger, shutdown <-chan struct{}, settings *BlockBuildingSettings) error

func Copy

func Copy(ctx context.Context, copyFrom client.RPC, copyTo *sources.EngineAPIClient) error

Copy takes the forkchoice state of copyFrom, and applies it to copyTo, and inserts the head-block. The destination engine should then start syncing to this new chain if it has peers to do so.

func CopyPayload added in v1.7.0

func CopyPayload(ctx context.Context, number uint64, copyFrom client.RPC, copyTo *sources.EngineAPIClient) error

CopyPayload takes the execution payload at number & applies it via NewPayload to copyTo

func GetChainConfig added in v1.7.2

func GetChainConfig(ctx context.Context, open client.RPC) (cfg *params.ChainConfig, err error)

func RawJSONInteraction added in v1.1.6

func RawJSONInteraction(ctx context.Context, client client.RPC, method string, args []string, input io.Reader, output io.Writer) error

func Rewind added in v1.7.2

func Rewind(ctx context.Context, lgr log.Logger, client *sources.EngineAPIClient, open client.RPC, to uint64, setHead bool) error

func SetForkchoice added in v1.1.6

func SetForkchoice(ctx context.Context, client *sources.EngineAPIClient, finalizedNum, safeNum, unsafeNum uint64) error

func SetForkchoiceByHash added in v1.7.0

func SetForkchoiceByHash(ctx context.Context, client *sources.EngineAPIClient, finalized, safe, unsafe common.Hash) error

Types

type BlockBuildingSettings

type BlockBuildingSettings struct {
	BlockTime uint64
	// skip a block; timestamps will still increase in multiples of BlockTime like L1, but there may be gaps.
	AllowGaps    bool
	Random       common.Hash
	FeeRecipient common.Address
	BuildTime    time.Duration
}

type Metricer

type Metricer interface {
	RecordBlockFail()
	RecordBlockStats(hash common.Hash, num uint64, time uint64, txs uint64, gas uint64, baseFee float64)
}

type Metrics

type Metrics struct {
	BlockFails prometheus.Counter

	BlockHash    prometheus.Gauge
	BlockNum     prometheus.Gauge
	BlockTime    prometheus.Gauge
	BlockTxs     prometheus.Gauge
	BlockGas     prometheus.Gauge
	BlockBaseFee prometheus.Gauge
}

func NewMetrics

func NewMetrics(procName string, registry *prometheus.Registry) *Metrics

func (*Metrics) RecordBlockFail

func (r *Metrics) RecordBlockFail()

func (*Metrics) RecordBlockStats

func (r *Metrics) RecordBlockStats(hash common.Hash, num uint64, time uint64, txs uint64, gas uint64, baseFee float64)

type RPCBlock

type RPCBlock struct {
	types.Header
	Transactions []*types.Transaction `json:"transactions"`
}

type StaticVersionProvider added in v1.7.2

type StaticVersionProvider int

func (StaticVersionProvider) ForkchoiceUpdatedVersion added in v1.7.2

func (v StaticVersionProvider) ForkchoiceUpdatedVersion(*eth.PayloadAttributes) eth.EngineAPIMethod

func (StaticVersionProvider) GetPayloadVersion added in v1.7.2

func (v StaticVersionProvider) GetPayloadVersion(uint64) eth.EngineAPIMethod

func (StaticVersionProvider) NewPayloadVersion added in v1.7.2

func (v StaticVersionProvider) NewPayloadVersion(uint64) eth.EngineAPIMethod

type StatusData

type StatusData struct {
	Head      eth.L1BlockRef `json:"head"`
	Safe      eth.L1BlockRef `json:"safe"`
	Finalized eth.L1BlockRef `json:"finalized"`
	Txs       uint64         `json:"txs"`
	Gas       uint64         `json:"gas"`
	StateRoot common.Hash    `json:"stateRoot"`
	BaseFee   *big.Int       `json:"baseFee"`
}

func Status

func Status(ctx context.Context, client client.RPC) (*StatusData, error)

Jump to

Keyboard shortcuts

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