config

package
v1.16.5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingPectraBlobSchedule = errors.New("probably missing Pectra blob schedule")

Functions

This section is empty.

Types

type ActiveConfigPersistence

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

func NewConfigPersistence

func NewConfigPersistence(file string) *ActiveConfigPersistence

func (*ActiveConfigPersistence) SequencerStarted

func (p *ActiveConfigPersistence) SequencerStarted() error

func (*ActiveConfigPersistence) SequencerState

func (p *ActiveConfigPersistence) SequencerState() (RunningState, error)

func (*ActiveConfigPersistence) SequencerStopped

func (p *ActiveConfigPersistence) SequencerStopped() error

type ConductorRPCFunc

type ConductorRPCFunc func(ctx context.Context) (string, error)

ConductorRPCFunc retrieves the endpoint. The RPC may not immediately be available.

type Config

type Config struct {
	L1 L1EndpointSetup
	L2 L2EndpointSetup

	Beacon L1BeaconEndpointSetup

	InteropConfig interop.Setup

	Driver driver.Config

	Rollup rollup.Config

	L1ChainConfig *params.ChainConfig

	DependencySet depset.DependencySet

	// P2PSigner will be used for signing off on published content
	// if the node is sequencing and if the p2p stack is enabled
	P2PSigner p2p.SignerSetup

	RPC oprpc.CLIConfig

	P2P p2p.SetupP2P

	Metrics opmetrics.CLIConfig

	Pprof oppprof.CLIConfig

	// Used to poll the L1 for new finalized or safe blocks
	L1EpochPollInterval time.Duration

	ConfigPersistence ConfigPersistence

	// Path to store safe head database. Disabled when set to empty string
	SafeDBPath string

	// RuntimeConfigReloadInterval defines the interval between runtime config reloads.
	// Disabled if <= 0.
	// Runtime config changes should be picked up from log-events,
	// but if log-events are not coming in (e.g. not syncing blocks) then the reload ensures the config stays accurate.
	RuntimeConfigReloadInterval time.Duration

	// Optional
	Tracer tracer.Tracer

	// Optional
	L2FollowSource L2FollowSourceEndpointSetup

	Sync sync.Config

	// To halt when detecting the node does not support a signaled protocol version
	// change of the given severity (major/minor/patch). Disabled if empty.
	RollupHalt string

	// Cancel to request a premature shutdown of the node itself, e.g. when halting. This may be nil.
	Cancel context.CancelCauseFunc

	// Conductor is used to determine this node is the leader sequencer.
	ConductorEnabled    bool
	ConductorRpc        ConductorRPCFunc
	ConductorRpcTimeout time.Duration

	// AltDA config
	AltDA altda.CLIConfig

	IgnoreMissingPectraBlobSchedule bool
	FetchWithdrawalRootFromState    bool

	// Experimental. Enables new opstack RPC namespace. Used by op-test-sequencer.
	ExperimentalOPStackAPI bool
}

func (*Config) Check

func (cfg *Config) Check() error

Check verifies that the given configuration makes sense

func (*Config) LoadPersisted

func (cfg *Config) LoadPersisted(log log.Logger) error

func (*Config) P2PEnabled

func (cfg *Config) P2PEnabled() bool

type ConfigPersistence

type ConfigPersistence interface {
	SequencerStarted() error
	SequencerStopped() error
	SequencerState() (RunningState, error)
}

type DisabledConfigPersistence

type DisabledConfigPersistence struct {
}

DisabledConfigPersistence provides an implementation of config persistence that does not persist anything and reports unset for all values

func (DisabledConfigPersistence) SequencerStarted

func (d DisabledConfigPersistence) SequencerStarted() error

func (DisabledConfigPersistence) SequencerState

func (d DisabledConfigPersistence) SequencerState() (RunningState, error)

func (DisabledConfigPersistence) SequencerStopped

func (d DisabledConfigPersistence) SequencerStopped() error

type L1BeaconEndpointConfig

type L1BeaconEndpointConfig struct {
	BeaconAddr             string   // Address of L1 User Beacon-API endpoint to use (beacon namespace required)
	BeaconHeader           string   // Optional HTTP header for all requests to L1 Beacon
	BeaconFallbackAddrs    []string // Addresses of L1 Beacon-API fallback endpoints (only for blob sidecars retrieval)
	BeaconCheckIgnore      bool     // When false, halt startup if the beacon version endpoint fails
	BeaconFetchAllSidecars bool     // Whether to fetch all blob sidecars and filter locally
}

func (*L1BeaconEndpointConfig) Check

func (cfg *L1BeaconEndpointConfig) Check() error

func (*L1BeaconEndpointConfig) Setup

func (*L1BeaconEndpointConfig) ShouldFetchAllSidecars

func (cfg *L1BeaconEndpointConfig) ShouldFetchAllSidecars() bool

func (*L1BeaconEndpointConfig) ShouldIgnoreBeaconCheck

func (cfg *L1BeaconEndpointConfig) ShouldIgnoreBeaconCheck() bool

type L1BeaconEndpointSetup

type L1BeaconEndpointSetup interface {
	Setup(ctx context.Context, log log.Logger) (cl apis.BeaconClient, fb []apis.BlobSideCarsClient, err error)
	// ShouldIgnoreBeaconCheck returns true if the Beacon-node version check should not halt startup.
	ShouldIgnoreBeaconCheck() bool
	ShouldFetchAllSidecars() bool
	Check() error
}

type L1EndpointConfig

type L1EndpointConfig struct {
	L1NodeAddr string // Address of L1 User JSON-RPC endpoint to use (eth namespace required)

	// L1TrustRPC: if we trust the L1 RPC we do not have to validate L1 response contents like headers
	// against block hashes, or cached transaction sender addresses.
	// Thus we can sync faster at the risk of the source RPC being wrong.
	L1TrustRPC bool

	// L1RPCKind identifies the RPC provider kind that serves the RPC,
	// to inform the optimal usage of the RPC for transaction receipts fetching.
	L1RPCKind sources.RPCProviderKind

	// RateLimit specifies a self-imposed rate-limit on L1 requests. 0 is no rate-limit.
	RateLimit float64

	// BatchSize specifies the maximum batch-size, which also applies as L1 rate-limit burst amount (if set).
	BatchSize int

	// MaxConcurrency specifies the maximum number of concurrent requests to the L1 RPC.
	MaxConcurrency int

	// HttpPollInterval specifies the interval between polling for the latest L1 block,
	// when the RPC is detected to be an HTTP type.
	// It is recommended to use websockets or IPC for efficient following of the changing block.
	// Setting this to 0 disables polling.
	HttpPollInterval time.Duration

	// CacheSize specifies the cache size for blocks, receipts and transactions. It's optional and a
	// sane default of 3/2 the sequencing window size is used during Setup if this field is set to 0.
	// Note that receipts and transactions are cached per block, which is why there's only one cache
	// size to configure.
	CacheSize uint
}

func (*L1EndpointConfig) Check

func (cfg *L1EndpointConfig) Check() error

func (*L1EndpointConfig) Setup

func (cfg *L1EndpointConfig) Setup(ctx context.Context, log log.Logger, defaultCacheSize int, metrics opmetrics.RPCMetricer) (client.RPC, *sources.L1ClientConfig, error)

type L1EndpointSetup

type L1EndpointSetup interface {
	// Setup a RPC client to a L1 node to pull rollup input-data from.
	// The results of the RPC client may be trusted for faster processing, or strictly validated.
	// The kind of the RPC may be non-basic, to optimize RPC usage.
	Setup(ctx context.Context, log log.Logger, defaultCacheSize int, metrics opmetrics.RPCMetricer) (cl client.RPC, rpcCfg *sources.L1ClientConfig, err error)
	Check() error
}

type L2EndpointConfig

type L2EndpointConfig struct {
	// L2EngineAddr is the address of the L2 Engine JSON-RPC endpoint to use. The engine and eth
	// namespaces must be enabled by the endpoint.
	L2EngineAddr string

	// JWT secrets for L2 Engine API authentication during HTTP or initial Websocket communication.
	// Any value for an IPC connection.
	L2EngineJWTSecret [32]byte

	// L2EngineCallTimeout is the default timeout duration for L2 calls.
	// Defines the maximum time a call to the L2 engine is allowed to take before timing out.
	L2EngineCallTimeout time.Duration
}

func (*L2EndpointConfig) Check

func (cfg *L2EndpointConfig) Check() error

func (*L2EndpointConfig) Setup

type L2EndpointSetup

type L2EndpointSetup interface {
	// Setup a RPC client to a L2 execution engine to process rollup blocks with.
	Setup(ctx context.Context, log log.Logger, rollupCfg *rollup.Config, metrics opmetrics.RPCMetricer) (cl client.RPC, rpcCfg *sources.EngineClientConfig, err error)
	Check() error
}

type L2FollowSourceConfig added in v1.16.4

type L2FollowSourceConfig struct {
	L2RPCAddr        string
	L2RPCCallTimeout time.Duration
}

func (*L2FollowSourceConfig) Check added in v1.16.4

func (cfg *L2FollowSourceConfig) Check() error

func (*L2FollowSourceConfig) Setup added in v1.16.4

type L2FollowSourceEndpointSetup added in v1.16.4

type L2FollowSourceEndpointSetup interface {
	// Setup a RPC client to a L2 execution engine to follow.
	Setup(ctx context.Context, log log.Logger, rollupCfg *rollup.Config, metrics opmetrics.RPCMetricer) (client.RPC, *sources.L2ClientConfig, error)
	Check() error
}

type PreparedL1Endpoint

type PreparedL1Endpoint struct {
	Client          client.RPC
	TrustRPC        bool
	RPCProviderKind sources.RPCProviderKind
}

PreparedL1Endpoint enables testing with an in-process pre-setup RPC connection to L1

func (*PreparedL1Endpoint) Check

func (cfg *PreparedL1Endpoint) Check() error

func (*PreparedL1Endpoint) Setup

func (p *PreparedL1Endpoint) Setup(ctx context.Context, log log.Logger, defaultCacheSize int, metrics opmetrics.RPCMetricer) (client.RPC, *sources.L1ClientConfig, error)

type PreparedL2Endpoints

type PreparedL2Endpoints struct {
	Client client.RPC
}

PreparedL2Endpoints enables testing with in-process pre-setup RPC connections to L2 engines

func (*PreparedL2Endpoints) Check

func (p *PreparedL2Endpoints) Check() error

func (*PreparedL2Endpoints) Setup

type RunningState

type RunningState int
const (
	StateUnset RunningState = iota
	StateStarted
	StateStopped
)

Jump to

Keyboard shortcuts

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