engine

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

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 16 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 client.RPC, log log.Logger, shutdown <-chan struct{}, settings *BlockBuildingSettings) error

func BuildBlock

func BuildBlock(ctx context.Context, client client.RPC, status *StatusData, settings *BlockBuildingSettings) (*beacon.ExecutableDataV1, error)

func Copy

func Copy(ctx context.Context, copyFrom client.RPC, copyTo client.RPC) 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 DialClient

func DialClient(ctx context.Context, endpoint string, jwtSecret [32]byte) (client.RPC, error)

Types

type BlockBuildingSettings

type BlockBuildingSettings struct {
	BlockTime    uint64
	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 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