config

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoL2Chains            = errors.New("at least one L2 chain must be specified")
	ErrMissingL2ChainID      = errors.New("missing l2 chain id")
	ErrMissingL2Genesis      = errors.New("missing l2 genesis")
	ErrNoRollupForGenesis    = errors.New("no rollup config matching l2 genesis")
	ErrNoGenesisForRollup    = errors.New("no l2 genesis for rollup")
	ErrDuplicateRollup       = errors.New("duplicate rollup")
	ErrDuplicateGenesis      = errors.New("duplicate l2 genesis")
	ErrInvalidL1Head         = errors.New("invalid l1 head")
	ErrInvalidL2Head         = errors.New("invalid l2 head")
	ErrInvalidL2OutputRoot   = errors.New("invalid l2 output root")
	ErrInvalidAgreedPrestate = errors.New("invalid l2 agreed prestate")
	ErrL1AndL2Inconsistent   = errors.New("l1 and l2 options must be specified together or both omitted")
	ErrInvalidL2Claim        = errors.New("invalid l2 claim")
	ErrInvalidL2ClaimBlock   = errors.New("invalid l2 claim block number")
	ErrDataDirRequired       = errors.New("datadir must be specified when in non-fetching mode")
	ErrNoExecInServerMode    = errors.New("exec command must not be set when in server mode")
	ErrInvalidDataFormat     = errors.New("invalid data format")
	ErrMissingAgreedPrestate = errors.New("missing agreed prestate")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	L2ChainID eth.ChainID // TODO: Forbid for interop
	Rollups   []*rollup.Config
	// DataDir is the directory to read/write pre-image data from/to.
	// If not set, an in-memory key-value store is used and fetching data must be enabled
	DataDir string

	// DataFormat specifies the format to use for on-disk storage. Only applies when DataDir is set.
	DataFormat types.DataFormat

	// L1Head is the block hash of the L1 chain head block
	L1Head      common.Hash
	L1URL       string
	L1BeaconURL string
	L1TrustRPC  bool
	L1RPCKind   sources.RPCProviderKind

	// L2Head is the l2 block hash contained in the L2 Output referenced by the L2OutputRoot for pre-interop mode
	L2Head common.Hash // TODO: Forbid for interop
	// L2OutputRoot is the agreed L2 output root to start derivation from
	L2OutputRoot common.Hash
	// L2URLs are the URLs of the L2 nodes to fetch L2 data from, these are the canonical URL for L2 data
	// These URLs are used as a fallback for L2ExperimentalURL if the experimental URL fails or cannot retrieve the desired data
	// Must have one L2URL for each chain in Rollups
	L2URLs []string
	// L2ExperimentalURLs are the URLs of the L2 nodes (non hash db archival node, for example, reth archival node) to fetch L2 data from
	// Must have one url for each chain in Rollups
	L2ExperimentalURLs []string
	// L2Claim is the claimed L2 output root to verify
	L2Claim common.Hash
	// L2ClaimBlockNumber is the block number the claimed L2 output root is from
	// Must be above 0 and to be a valid claim needs to be above the L2Head block.
	// For interop this is the superchain root timestamp
	L2ClaimBlockNumber uint64
	// L2ChainConfigs are the op-geth chain config for the L2 execution engines
	// Must have one chain config for each rollup config
	L2ChainConfigs []*params.ChainConfig
	// ExecCmd specifies the client program to execute in a separate process.
	// If unset, the fault proof client is run in the same process.
	ExecCmd string

	// ServerMode indicates that the program should run in pre-image server mode and wait for requests.
	// No client program is run.
	ServerMode bool

	// InteropEnabled enables interop fault proof rules when running the client in-process
	InteropEnabled bool
	// AgreedPrestate is the preimage of the agreed prestate claim. Required for interop.
	AgreedPrestate []byte
	// DependencySet is the dependency set for the interop host. Required for interop.
	DependencySet depset.DependencySet
}

func NewConfig

func NewConfig(
	rollupCfgs []*rollup.Config,
	l2ChainConfigs []*params.ChainConfig,
	l1Head common.Hash,
	l2Head common.Hash,
	l2OutputRoot common.Hash,
	l2Claim common.Hash,
	l2ClaimBlockNum uint64,
) *Config

NewConfig creates a Config with all optional values set to the CLI default value

func NewConfigFromCLI

func NewConfigFromCLI(log log.Logger, ctx *cli.Context) (*Config, error)

func NewSingleChainConfig added in v1.11.0

func NewSingleChainConfig(
	rollupCfg *rollup.Config,
	l2ChainConfig *params.ChainConfig,
	l1Head common.Hash,
	l2Head common.Hash,
	l2OutputRoot common.Hash,
	l2Claim common.Hash,
	l2ClaimBlockNum uint64,
) *Config

func (*Config) Check

func (c *Config) Check() error

func (*Config) FetchingEnabled

func (c *Config) FetchingEnabled() bool

Jump to

Keyboard shortcuts

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