virtual_node

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const VIRTUAL_NODE_CHAIN_ID_LABEL = "virtual_node_chain_id"

VIRTUAL_NODE_CHAIN_ID_LABEL is the name of the label used to differentiate metrics registered by virtual nodes.

Variables

View Source
var (
	ErrVirtualNodeConfigNil      = errors.New("virtual node config is nil")
	ErrVirtualNodeAlreadyRunning = errors.New("virtual node already running")
	ErrVirtualNodeNotRunning     = errors.New("virtual node not running")
	ErrVirtualNodeCantStart      = errors.New("virtual node cannot be started in this state")
)
View Source
var (
	ErrL1AtSafeHeadNotFound    = safedb.ErrL1AtSafeHeadNotFound
	ErrL1AtSafeHeadUnavailable = safedb.ErrL1AtSafeHeadUnavailable
)

Re-exported from safedb for callers that still reference these via virtual_node.

Functions

func NewVirtualNode

func NewVirtualNode(cfg *opnodecfg.Config, log gethlog.Logger, initOverload *rollupNode.InitializationOverrides, appVersion string) *simpleVirtualNode

Types

type VNState

type VNState int32
const (
	VNStateNotStarted VNState = iota
	VNStateRunning
	VNStateStopped
)

type VirtualNode

type VirtualNode interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error

	SafeHeadAtL1(ctx context.Context, l1BlockNum uint64) (eth.BlockID, eth.BlockID, error)
	// L1AtSafeHead returns the earliest L1 block at which the given L2 block became safe.
	L1AtSafeHead(ctx context.Context, target eth.BlockID) (eth.BlockID, error)
	// FirstSafeHeadEntry returns the lowest recorded (L1, L2 safe head) pair from SafeDB.
	// Returns safedb.ErrNotFound when SafeDB has no entries yet.
	FirstSafeHeadEntry(ctx context.Context) (eth.BlockID, eth.BlockID, error)
	SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
	State() VNState
}

Jump to

Keyboard shortcuts

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