config

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultPollInterval         = time.Second * 12
	DefaultCannonSnapshotFreq   = uint(1_000_000_000)
	DefaultCannonInfoFreq       = uint(10_000_000)
	DefaultAsteriscSnapshotFreq = uint(1_000_000_000)
	DefaultAsteriscInfoFreq     = uint(10_000_000)
	// DefaultGameWindow is the default maximum time duration in the past
	// that the challenger will look for games to progress.
	// The default value is 15 days, which is an 8 day resolution buffer
	// and bond claiming buffer plus the 7 day game finalization window.
	DefaultGameWindow   = time.Duration(15 * 24 * time.Hour)
	DefaultMaxPendingTx = 10
)

Variables

View Source
var (
	ErrMissingTraceType                 = errors.New("no supported trace types specified")
	ErrMissingDatadir                   = errors.New("missing datadir")
	ErrMaxConcurrencyZero               = errors.New("max concurrency must not be 0")
	ErrMissingL2Rpc                     = errors.New("missing L2 rpc url")
	ErrMissingCannonBin                 = errors.New("missing cannon bin")
	ErrMissingCannonServer              = errors.New("missing cannon server")
	ErrMissingCannonAbsolutePreState    = errors.New("missing cannon absolute pre-state")
	ErrCannonAbsolutePreStateAndBaseURL = errors.New("only specify one of cannon absolute pre-state and cannon absolute pre-state base URL")
	ErrMissingL1EthRPC                  = errors.New("missing l1 eth rpc url")
	ErrMissingL1Beacon                  = errors.New("missing l1 beacon url")
	ErrMissingGameFactoryAddress        = errors.New("missing game factory address")
	ErrMissingCannonSnapshotFreq        = errors.New("missing cannon snapshot freq")
	ErrMissingCannonInfoFreq            = errors.New("missing cannon info freq")
	ErrMissingCannonRollupConfig        = errors.New("missing cannon network or rollup config path")
	ErrMissingCannonL2Genesis           = errors.New("missing cannon network or l2 genesis path")
	ErrCannonNetworkAndRollupConfig     = errors.New("only specify one of network or rollup config path")
	ErrCannonNetworkAndL2Genesis        = errors.New("only specify one of network or l2 genesis path")
	ErrCannonNetworkUnknown             = errors.New("unknown cannon network")
	ErrMissingRollupRpc                 = errors.New("missing rollup rpc url")

	ErrMissingAsteriscBin                 = errors.New("missing asterisc bin")
	ErrMissingAsteriscServer              = errors.New("missing asterisc server")
	ErrMissingAsteriscAbsolutePreState    = errors.New("missing asterisc absolute pre-state")
	ErrAsteriscAbsolutePreStateAndBaseURL = errors.New("only specify one of asterisc absolute pre-state and asterisc absolute pre-state base URL")
	ErrMissingAsteriscSnapshotFreq        = errors.New("missing asterisc snapshot freq")
	ErrMissingAsteriscInfoFreq            = errors.New("missing asterisc info freq")
	ErrMissingAsteriscRollupConfig        = errors.New("missing asterisc network or rollup config path")
	ErrMissingAsteriscL2Genesis           = errors.New("missing asterisc network or l2 genesis path")
	ErrAsteriscNetworkAndRollupConfig     = errors.New("only specify one of network or rollup config path")
	ErrAsteriscNetworkAndL2Genesis        = errors.New("only specify one of network or l2 genesis path")
	ErrAsteriscNetworkUnknown             = errors.New("unknown asterisc network")
)

Functions

func ValidTraceType added in v1.1.2

func ValidTraceType(value TraceType) bool

Types

type Config

type Config struct {
	L1EthRpc             string           // L1 RPC Url
	L1Beacon             string           // L1 Beacon API Url
	GameFactoryAddress   common.Address   // Address of the dispute game factory
	GameAllowlist        []common.Address // Allowlist of fault game addresses
	GameWindow           time.Duration    // Maximum time duration to look for games to progress
	Datadir              string           // Data Directory
	MaxConcurrency       uint             // Maximum number of threads to use when progressing games
	PollInterval         time.Duration    // Polling interval for latest-block subscription when using an HTTP RPC provider
	AllowInvalidPrestate bool             // Whether to allow responding to games where the prestate does not match

	AdditionalBondClaimants []common.Address // List of addresses to claim bonds for in addition to the tx manager sender

	SelectiveClaimResolution bool // Whether to only resolve claims for the claimants in AdditionalBondClaimants union [TxSender.From()]

	TraceTypes []TraceType // Type of traces supported

	RollupRpc string // L2 Rollup RPC Url

	L2Rpc string // L2 RPC Url

	// Specific to the cannon trace provider
	CannonBin                     string   // Path to the cannon executable to run when generating trace data
	CannonServer                  string   // Path to the op-program executable that provides the pre-image oracle server
	CannonAbsolutePreState        string   // File to load the absolute pre-state for Cannon traces from
	CannonAbsolutePreStateBaseURL *url.URL // Base URL to retrieve absolute pre-states for Cannon traces from
	CannonNetwork                 string
	CannonRollupConfigPath        string
	CannonL2GenesisPath           string
	CannonSnapshotFreq            uint // Frequency of snapshots to create when executing cannon (in VM instructions)
	CannonInfoFreq                uint // Frequency of cannon progress log messages (in VM instructions)

	// Specific to the asterisc trace provider
	AsteriscBin                     string   // Path to the asterisc executable to run when generating trace data
	AsteriscServer                  string   // Path to the op-program executable that provides the pre-image oracle server
	AsteriscAbsolutePreState        string   // File to load the absolute pre-state for Asterisc traces from
	AsteriscAbsolutePreStateBaseURL *url.URL // Base URL to retrieve absolute pre-states for Asterisc traces from
	AsteriscNetwork                 string
	AsteriscRollupConfigPath        string
	AsteriscL2GenesisPath           string
	AsteriscSnapshotFreq            uint // Frequency of snapshots to create when executing asterisc (in VM instructions)
	AsteriscInfoFreq                uint // Frequency of asterisc progress log messages (in VM instructions)

	MaxPendingTx uint64 // Maximum number of pending transactions (0 == no limit)

	TxMgrConfig   txmgr.CLIConfig
	MetricsConfig opmetrics.CLIConfig
	PprofConfig   oppprof.CLIConfig
}

Config is a well typed config that is parsed from the CLI params. This also contains config options for auxiliary services. It is used to initialize the challenger.

func NewConfig

func NewConfig(
	gameFactoryAddress common.Address,
	l1EthRpc string,
	l1BeaconApi string,
	l2RollupRpc string,
	l2EthRpc string,
	datadir string,
	supportedTraceTypes ...TraceType,
) Config

func (Config) Check

func (c Config) Check() error

func (Config) TraceTypeEnabled added in v1.4.2

func (c Config) TraceTypeEnabled(t TraceType) bool

type TraceType added in v1.1.2

type TraceType string
const (
	TraceTypeAlphabet     TraceType = "alphabet"
	TraceTypeCannon       TraceType = "cannon"
	TraceTypeAsterisc     TraceType = "asterisc"
	TraceTypePermissioned TraceType = "permissioned"
)

func (*TraceType) Clone added in v1.2.0

func (t *TraceType) Clone() any

func (*TraceType) Set added in v1.1.2

func (t *TraceType) Set(value string) error

Set implements the Set method required by the [cli.Generic] interface.

func (TraceType) String added in v1.1.2

func (t TraceType) String() string

Jump to

Keyboard shortcuts

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