Documentation
¶
Index ¶
- Constants
- Variables
- func CheckCannonBaseFlags(ctx *cli.Context) error
- func CheckCannonFlags(ctx *cli.Context) error
- func CheckCannonKonaBaseFlags(ctx *cli.Context, gameType gameTypes.GameType) error
- func CheckCannonKonaFlags(ctx *cli.Context) error
- func CheckRequired(ctx *cli.Context, types []gameTypes.GameType) error
- func CheckSuperCannonFlags(ctx *cli.Context) error
- func CheckSuperCannonKonaFlags(ctx *cli.Context) error
- func FactoryAddress(ctx *cli.Context) (common.Address, error)
- func FactoryAddressForNetworks(networks []string, addressSource ChainAddressesSource) (common.Address, error)
- func NewConfigFromCLI(ctx *cli.Context, logger log.Logger) (*config.Config, error)
- type ChainAddressesSource
- type FlagCreator
- type VMFlag
- func (f *VMFlag) DefaultName() string
- func (f *VMFlag) EitherFlagName(vm gameTypes.GameType) string
- func (f *VMFlag) Flags() []cli.Flag
- func (f *VMFlag) IsSet(ctx *cli.Context, vm gameTypes.GameType) bool
- func (f *VMFlag) SourceFlagName(ctx *cli.Context, vm gameTypes.GameType) string
- func (f *VMFlag) String(ctx *cli.Context, vm gameTypes.GameType) string
- func (f *VMFlag) StringSlice(ctx *cli.Context, vm gameTypes.GameType) []string
- func (f *VMFlag) TraceSpecificFlagName(vm gameTypes.GameType) string
Constants ¶
View Source
const EnvVarPrefix = "OP_CHALLENGER"
Variables ¶
View Source
var ( // Required Flags L1EthRpcFlag = &cli.StringFlag{ Name: "l1-eth-rpc", Usage: "HTTP provider URL for L1.", EnvVars: prefixEnvVars("L1_ETH_RPC"), } L1RPCProviderKind = &cli.GenericFlag{ Name: "l1-rpc-kind", Usage: "The kind of RPC provider, used to inform optimal transactions receipts fetching, and thus reduce costs. Valid options: " + openum.EnumString(sources.RPCProviderKinds), EnvVars: prefixEnvVars("L1_RPC_KIND"), Value: func() *sources.RPCProviderKind { out := sources.RPCKindStandard return &out }(), } L1BeaconFlag = &cli.StringFlag{ Name: "l1-beacon", Usage: "Address of L1 Beacon API endpoint to use", EnvVars: prefixEnvVars("L1_BEACON"), } SuperNodeRpcFlag = &cli.StringFlag{ Name: "supernode-rpc", Usage: "Provider URL for supernode roots", EnvVars: prefixEnvVars("SUPERNODE_RPC"), } RollupRpcFlag = &cli.StringFlag{ Name: "rollup-rpc", Usage: "HTTP provider URL for the rollup node", EnvVars: prefixEnvVars("ROLLUP_RPC"), } NetworkFlag = &cli.StringSliceFlag{ Name: flags.NetworkFlagName, Usage: fmt.Sprintf("Predefined network selection. Available networks: %s", strings.Join(chaincfg.AvailableNetworks(), ", ")), EnvVars: prefixEnvVars("NETWORK"), } FactoryAddressFlag = &cli.StringFlag{ Name: "game-factory-address", Usage: "Address of the fault game factory contract.", EnvVars: prefixEnvVars("GAME_FACTORY_ADDRESS"), } GameAllowlistFlag = &cli.StringSliceFlag{ Name: "game-allowlist", Usage: "List of Fault Game contract addresses the challenger is allowed to play. " + "If empty, the challenger will play all games.", EnvVars: prefixEnvVars("GAME_ALLOWLIST"), } GameTypesFlag = &cli.StringSliceFlag{ Name: "game-types", Aliases: []string{"trace-type"}, Usage: "The game types to support. Valid options: " + openum.EnumStringer(gameTypes.SupportedGameTypes), EnvVars: prefixEnvVars("GAME_TYPES", "TRACE_TYPE"), Value: cli.NewStringSlice(gameTypes.CannonGameType.String(), gameTypes.CannonKonaGameType.String()), } DatadirFlag = &cli.StringFlag{ Name: "datadir", Usage: "Directory to store data generated as part of responding to games", EnvVars: prefixEnvVars("DATADIR"), } // Optional Flags MaxConcurrencyFlag = &cli.UintFlag{ Name: "max-concurrency", Usage: "Maximum number of threads to use when progressing games", EnvVars: prefixEnvVars("MAX_CONCURRENCY"), Value: uint(runtime.NumCPU()), } L2EthRpcFlag = &cli.StringSliceFlag{ Name: "l2-eth-rpc", Usage: "URLs of L2 JSON-RPC endpoints to use (eth and debug namespace required)", EnvVars: prefixEnvVars("L2_ETH_RPC"), } L2ExperimentalEthRpcFlag = &cli.StringFlag{ Name: "l2-experimental-eth-rpc", Usage: "L2 Address of L2 JSON-RPC endpoint to use (eth and debug namespace required with execution witness support) (cannon game type only)", EnvVars: prefixEnvVars("L2_EXPERIMENTAL_ETH_RPC"), } MaxPendingTransactionsFlag = &cli.Uint64Flag{ Name: "max-pending-tx", Usage: "The maximum number of pending transactions. 0 for no limit.", Value: config.DefaultMaxPendingTx, EnvVars: prefixEnvVars("MAX_PENDING_TX"), } HTTPPollInterval = &cli.DurationFlag{ Name: "http-poll-interval", Usage: "Polling interval for latest-block subscription when using an HTTP RPC provider.", EnvVars: prefixEnvVars("HTTP_POLL_INTERVAL"), Value: config.DefaultPollInterval, } MinUpdateInterval = &cli.DurationFlag{ Name: "min-update-interval", Usage: "Minimum time between scheduling update cycles based on the L1 block time.", EnvVars: prefixEnvVars("MIN_UPDATE_INTERVAL"), } AdditionalBondClaimants = &cli.StringSliceFlag{ Name: "additional-bond-claimants", Usage: "List of addresses to claim bonds for, in addition to the configured transaction sender", EnvVars: prefixEnvVars("ADDITIONAL_BOND_CLAIMANTS"), } PreStatesURLFlag = NewVMFlag("prestates-url", EnvVarPrefix, faultDisputeVMs, func(name string, envVars []string, gameTypeInfo string) cli.Flag { return &cli.StringFlag{ Name: name, Usage: "Base URL to absolute prestates to use when generating trace data. " + "Prestates in this directory should be name as <commitment>.bin.gz <commitment>.json.gz or <commitment>.json " + gameTypeInfo, EnvVars: envVars, } }) RollupConfigFlag = NewVMFlag("rollup-config", EnvVarPrefix, faultDisputeVMs, func(name string, envVars []string, gameTypeInfo string) cli.Flag { return &cli.StringSliceFlag{ Name: name, Usage: "Rollup chain parameters " + gameTypeInfo, EnvVars: envVars, } }) L2GenesisFlag = NewVMFlag("l2-genesis", EnvVarPrefix, faultDisputeVMs, func(name string, envVars []string, gameTypeInfo string) cli.Flag { return &cli.StringSliceFlag{ Name: name, Usage: "Paths to the op-geth genesis file " + gameTypeInfo, EnvVars: envVars, } }) L1GenesisFlag = NewVMFlag("l1-genesis", EnvVarPrefix, faultDisputeVMs, func(name string, envVars []string, gameTypeInfo string) cli.Flag { return &cli.StringFlag{ Name: name, Usage: "Path to the L1 genesis file. Only required if the L1 is not mainnet, sepolia, holesky, or hoodi.", EnvVars: envVars, } }) DepsetConfigFlag = NewVMFlag("depset-config", EnvVarPrefix, faultDisputeVMs, func(name string, envVars []string, gameTypeInfo string) cli.Flag { return &cli.StringFlag{ Name: name, Usage: "Interop dependency set config file " + gameTypeInfo, EnvVars: envVars, } }) CannonL2CustomFlag = &cli.BoolFlag{ Name: "cannon-l2-custom", Usage: "Notify the op-program host that the L2 chain uses custom config to be loaded via the preimage oracle. " + "WARNING: This is incompatible with on-chain testing and must only be used for testing purposes.", EnvVars: prefixEnvVars("CANNON_L2_CUSTOM"), Value: false, Hidden: true, } CannonBinFlag = &cli.StringFlag{ Name: "cannon-bin", Usage: "Path to cannon executable to use when generating trace data (cannon game type only)", EnvVars: prefixEnvVars("CANNON_BIN"), } CannonServerFlag = &cli.StringFlag{ Name: "cannon-server", Usage: "Path to executable to use as pre-image oracle server when generating trace data (cannon game type only)", EnvVars: prefixEnvVars("CANNON_SERVER"), } CannonPreStateFlag = &cli.StringFlag{ Name: "cannon-prestate", Usage: "Path to absolute prestate to use when generating trace data (cannon game type only)", EnvVars: prefixEnvVars("CANNON_PRESTATE"), } CannonSnapshotFreqFlag = &cli.UintFlag{ Name: "cannon-snapshot-freq", Usage: "Frequency of cannon snapshots to generate in VM steps (cannon game type only)", EnvVars: prefixEnvVars("CANNON_SNAPSHOT_FREQ"), Value: config.DefaultCannonSnapshotFreq, } CannonInfoFreqFlag = &cli.UintFlag{ Name: "cannon-info-freq", Usage: "Frequency of cannon info log messages to generate in VM steps (cannon game type only)", EnvVars: prefixEnvVars("CANNON_INFO_FREQ"), Value: config.DefaultCannonInfoFreq, } CannonKonaServerFlag = &cli.StringFlag{ Name: "cannon-kona-server", Usage: "Path to kona executable to use as pre-image oracle server when generating trace data (cannon-kona game type only)", EnvVars: prefixEnvVars("CANNON_KONA_SERVER"), } CannonKonaPreStateFlag = &cli.StringFlag{ Name: "cannon-kona-prestate", Usage: "Path to absolute prestate to use when generating trace data (cannon-kona game type only)", EnvVars: prefixEnvVars("CANNON_KONA_PRESTATE"), } CannonKonaL2CustomFlag = &cli.BoolFlag{ Name: "cannon-kona-l2-custom", Usage: "Notify the kona-host that the L2 chain uses custom config to be loaded via the preimage oracle. " + "WARNING: This is incompatible with on-chain testing and must only be used for testing purposes.", EnvVars: prefixEnvVars("CANNON_KONA_L2_CUSTOM"), Value: false, Hidden: true, } CannonKonaExperimentalWitnessEndpointFlag = &cli.BoolFlag{ Name: "cannon-kona-experimental-witness-endpoint", Usage: "Enable experimental witness endpoint for Kona interop. " + "Uses debug_executePayload RPC to collect execution witnesses, " + "reducing proof generation time by avoiding re-execution. " + "Requires op-reth or execution client started with " + "--proofs-history enabled to provide debug_executePayload support.", EnvVars: prefixEnvVars("CANNON_KONA_EXPERIMENTAL_WITNESS_ENDPOINT"), } GameWindowFlag = &cli.DurationFlag{ Name: "game-window", Usage: "The time window which the challenger will look for games to progress and claim bonds. " + "This should include a buffer for the challenger to claim bonds for games outside the maximum game duration.", EnvVars: prefixEnvVars("GAME_WINDOW"), Value: config.DefaultGameWindow, } SelectiveClaimResolutionFlag = &cli.BoolFlag{ Name: "selective-claim-resolution", Usage: "Only resolve claims for the configured claimants", EnvVars: prefixEnvVars("SELECTIVE_CLAIM_RESOLUTION"), } UnsafeAllowInvalidPrestate = &cli.BoolFlag{ Name: "unsafe-allow-invalid-prestate", Usage: "Allow responding to games where the absolute prestate is configured incorrectly. THIS IS UNSAFE!", EnvVars: prefixEnvVars("UNSAFE_ALLOW_INVALID_PRESTATE"), Hidden: true, } ResponseDelayFlag = &cli.DurationFlag{ Name: "response-delay", Usage: "Delay before responding to game actions to slow down game progression.", EnvVars: prefixEnvVars("RESPONSE_DELAY"), Value: config.DefaultResponseDelay, } ResponseDelayAfterFlag = &cli.Uint64Flag{ Name: "response-delay-after", Usage: "Number of responses after which to start applying the delay (0 = from first response).", EnvVars: prefixEnvVars("RESPONSE_DELAY_AFTER"), Value: config.DefaultResponseDelayAfter, } )
View Source
var Flags []cli.Flag
Flags contains the list of configuration options available to the binary.
Functions ¶
func CheckCannonBaseFlags ¶
func CheckCannonFlags ¶
func CheckCannonKonaFlags ¶
func CheckSuperCannonFlags ¶
func FactoryAddressForNetworks ¶
func FactoryAddressForNetworks(networks []string, addressSource ChainAddressesSource) (common.Address, error)
Types ¶
type ChainAddressesSource ¶
type ChainAddressesSource func(network string) (superchain.AddressesConfig, error)
type FlagCreator ¶
type VMFlag ¶
type VMFlag struct {
// contains filtered or unexported fields
}
VMFlag defines a set of flags to set a VM specific option. Provides a flag to set the default plus flags to override the default on a per VM basis.
func (*VMFlag) DefaultName ¶
func (*VMFlag) SourceFlagName ¶
func (*VMFlag) StringSlice ¶
Click to show internal directories.
Click to hide internal directories.