flags

package
v0.0.0-...-ae07365 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	L1WSEndpoint = &cli.StringFlag{
		Name:     "l1.ws",
		Usage:    "Websocket RPC endpoint of a L1 ethereum node",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"L1_WS"},
	}
	L1PrivateEndpoint = &cli.StringFlag{
		Name:     "l1.private",
		Usage:    "RPC endpoint of a L1 node with private mempool",
		Category: commonCategory,
		EnvVars:  []string{"L1_PRIVATE"},
	}
	L2WSEndpoint = &cli.StringFlag{
		Name:     "l2.ws",
		Usage:    "Websocket RPC endpoint of a L2 taiko-geth execution engine",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"L2_WS"},
	}
	L1BeaconEndpoint = &cli.StringFlag{
		Name:     "l1.beacon",
		Usage:    "HTTP RPC endpoint of a L1 beacon node",
		Category: commonCategory,
		EnvVars:  []string{"L1_BEACON"},
	}
	L2HTTPEndpoint = &cli.StringFlag{
		Name:     "l2.http",
		Usage:    "HTTP RPC endpoint of a L2 taiko-geth execution engine",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"L2_HTTP"},
	}
	L2AuthEndpoint = &cli.StringFlag{
		Name:     "l2.auth",
		Usage:    "Authenticated HTTP RPC endpoint of a L2 taiko-geth execution engine",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"L2_AUTH"},
	}
	JWTSecret = &cli.StringFlag{
		Name:     "jwtSecret",
		Usage:    "Path to a JWT secret to use for authenticated RPC endpoints",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"JWT_SECRET"},
	}
	TaikoL1Address = &cli.StringFlag{
		Name:     "taikoL1",
		Usage:    "TaikoL1 contract `address`",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"TAIKO_L1"},
	}
	TaikoL2Address = &cli.StringFlag{
		Name:     "taikoL2",
		Usage:    "TaikoL2 contract `address`",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"TAIKO_L2"},
	}
	TaikoTokenAddress = &cli.StringFlag{
		Name:     "taikoToken",
		Usage:    "TaikoToken contract `address`",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"TAIKO_TOKEN"},
	}

	// Optional flags used by all client software.
	// Logging
	Verbosity = &cli.IntFlag{
		Name:     "verbosity",
		Usage:    "Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail",
		Value:    3,
		Category: loggingCategory,
		EnvVars:  []string{"VERBOSITY"},
	}
	LogJSON = &cli.BoolFlag{
		Name:     "log.json",
		Usage:    "Format logs with JSON",
		Category: loggingCategory,
		EnvVars:  []string{"LOG_JSON"},
	}
	// Metrics
	MetricsEnabled = &cli.BoolFlag{
		Name:     "metrics",
		Usage:    "Enable metrics collection and reporting",
		Category: metricsCategory,
		Value:    false,
		EnvVars:  []string{"METRICS"},
	}
	MetricsAddr = &cli.StringFlag{
		Name:     "metrics.addr",
		Usage:    "Metrics reporting server listening address",
		Category: metricsCategory,
		Value:    "0.0.0.0",
		EnvVars:  []string{"METRICS_ADDR"},
	}
	MetricsPort = &cli.IntFlag{
		Name:     "metrics.port",
		Usage:    "Metrics reporting server listening port",
		Category: metricsCategory,
		Value:    6060,
		EnvVars:  []string{"METRICS_PORT"},
	}
	BackOffMaxRetries = &cli.Uint64Flag{
		Name:     "backoff.maxRetries",
		Usage:    "Max retry times when there is an error",
		Category: commonCategory,
		Value:    10,
		EnvVars:  []string{"BACKOFF_MAX_RETRIES"},
	}
	BackOffRetryInterval = &cli.DurationFlag{
		Name:     "backoff.retryInterval",
		Usage:    "Retry interval in seconds when there is an error",
		Category: commonCategory,
		Value:    backoff.DefaultMaxInterval,
		EnvVars:  []string{"BACKOFF_RETRY_INTERVAL"},
	}
	RPCTimeout = &cli.DurationFlag{
		Name:     "rpc.timeout",
		Usage:    "Timeout in seconds for RPC calls",
		Category: commonCategory,
		Value:    12 * time.Second,
		EnvVars:  []string{"RPC_TIMEOUT"},
	}
	ProverSetAddress = &cli.StringFlag{
		Name:     "proverSet",
		Usage:    "ProverSet contract `address`",
		Value:    rpc.ZeroAddress.Hex(),
		Category: commonCategory,
		EnvVars:  []string{"PROVER_SET"},
	}
)

Required flags used by all client software.

View Source
var (
	P2PSync = &cli.BoolFlag{
		Name: "p2p.sync",
		Usage: "Try P2P syncing blocks between L2 execution engines, " +
			"will be helpful to bring a new node online quickly",
		Value:    false,
		Category: driverCategory,
		EnvVars:  []string{"P2P_SYNC"},
	}
	P2PSyncTimeout = &cli.DurationFlag{
		Name: "p2p.syncTimeout",
		Usage: "P2P syncing timeout, if no sync progress is made within this time span, " +
			"driver will stop the P2P sync and insert all remaining L2 blocks one by one",
		Value:    1 * time.Hour,
		Category: driverCategory,
		EnvVars:  []string{"P2P_SYNC_TIMEOUT"},
	}
	CheckPointSyncURL = &cli.StringFlag{
		Name:     "p2p.checkPointSyncUrl",
		Usage:    "HTTP RPC endpoint of another synced L2 execution engine node",
		Category: driverCategory,
		EnvVars:  []string{"P2P_CHECK_POINT_SYNC_URL"},
	}
	// Chain syncer specific flag
	MaxExponent = &cli.Uint64Flag{
		Name: "syncer.maxExponent",
		Usage: "Maximum exponent of retrieving L1 blocks when there is a mismatch between protocol and L2 EE," +
			"0 means that it is reset to the genesis height",
		Value:    0,
		Category: driverCategory,
		EnvVars:  []string{"SYNCER_MAX_EXPONENT"},
	}
	// blob server endpoint
	BlobServerEndpoint = &cli.StringFlag{
		Name:     "blob.server",
		Usage:    "Blob sidecar storage server",
		Category: driverCategory,
		EnvVars:  []string{"BLOB_SERVER"},
	}
	SocialScanEndpoint = &cli.StringFlag{
		Name:     "blob.socialScanEndpoint",
		Usage:    "Social Scan's blob storage server",
		Category: driverCategory,
		EnvVars:  []string{"BLOB_SOCIAL_SCAN_ENDPOINT"},
	}
)

Optional flags used by driver.

View Source
var (
	L1ProposerPrivKey = &cli.StringFlag{
		Name:     "l1.proposerPrivKey",
		Usage:    "Private key of the L1 proposer, who will send TaikoL1.proposeBlock transactions",
		Required: true,
		Category: proposerCategory,
		EnvVars:  []string{"L1_PROPOSER_PRIV_KEY"},
	}
	L2SuggestedFeeRecipient = &cli.StringFlag{
		Name:     "l2.suggestedFeeRecipient",
		Usage:    "Address of the proposed block's suggested L2 fee recipient",
		Required: true,
		Category: proposerCategory,
		EnvVars:  []string{"L2_SUGGESTED_FEE_RECIPIENT"},
	}
)

Required flags used by proposer.

View Source
var (
	// Proposing epoch related.
	ProposeInterval = &cli.DurationFlag{
		Name:     "epoch.interval",
		Usage:    "Time interval to propose L2 pending transactions",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_INTERVAL"},
	}
	MinGasUsed = &cli.Uint64Flag{
		Name:     "epoch.minGasUsed",
		Usage:    "Minimum gas used for a transactions list to propose",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_MIN_GAS_USED"},
	}
	MinTxListBytes = &cli.Uint64Flag{
		Name:     "epoch.minTxListBytes",
		Usage:    "Minimum bytes for a transactions list to propose",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_MIN_TX_LIST_BYTES"},
	}
	MinTip = &cli.Float64Flag{
		Name:     "epoch.minTip",
		Usage:    "Minimum tip (in GWei) for a transaction to propose",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_MIN_TIP"},
	}
	MinProposingInternal = &cli.DurationFlag{
		Name:     "epoch.minProposingInterval",
		Usage:    "Minimum time interval to force proposing a block, even if there are no transaction in mempool",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_MIN_PROPOSING_INTERNAL"},
	}
	AllowZeroInterval = &cli.Uint64Flag{
		Name:     "epoch.allowZeroInterval",
		Usage:    "If set, after this many epochs, proposer will allow propose zero tip transactions once",
		Category: proposerCategory,
		Value:    0,
		EnvVars:  []string{"EPOCH_ALLOW_ZERO_INTERVAL"},
	}
	// Transactions pool related.
	TxPoolLocals = &cli.StringSliceFlag{
		Name:     "txPool.locals",
		Usage:    "Comma separated accounts to treat as locals (priority inclusion)",
		Category: proposerCategory,
		EnvVars:  []string{"TX_POOL_LOCALS"},
	}
	TxPoolLocalsOnly = &cli.BoolFlag{
		Name:     "txPool.localsOnly",
		Usage:    "If set to true, proposer will only propose transactions of local accounts",
		Value:    false,
		Category: proposerCategory,
		EnvVars:  []string{"TX_POOL_LOCALS_ONLY"},
	}
	MaxProposedTxListsPerEpoch = &cli.Uint64Flag{
		Name:     "txPool.maxTxListsPerEpoch",
		Usage:    "Maximum number of transaction lists which will be proposed inside one proposing epoch",
		Value:    1,
		Category: proposerCategory,
		EnvVars:  []string{"TX_POOL_MAX_TX_LISTS_PER_EPOCH"},
	}
	// Transaction related.
	BlobAllowed = &cli.BoolFlag{
		Name:    "l1.blobAllowed",
		Usage:   "Send EIP-4844 blob transactions when proposing blocks",
		Value:   false,
		EnvVars: []string{"L1_BLOB_ALLOWED"},
	}
	FallbackToCalldata = &cli.BoolFlag{
		Name:     "l1.fallbackToCalldata",
		Usage:    "If set to true, proposer will use calldata as DA when blob fee is more expensive than using calldata",
		Value:    false,
		Category: proposerCategory,
		EnvVars:  []string{"L1_FALLBACK_TO_CALLDATA"},
	}
	RevertProtectionEnabled = &cli.BoolFlag{
		Name: "l1.revertProtection",
		Usage: "Enable revert protection within your ProverSet contract, " +
			"this is effective only if your PBS service supports revert protection",
		Value:    false,
		Category: proposerCategory,
		EnvVars:  []string{"L1_REVERT_PROTECTION"},
	}
)

Optional flags used by proposer.

View Source
var (
	RaikoHostEndpoint = &cli.StringFlag{
		Name:     "raiko.host",
		Usage:    "RPC endpoint of a Raiko host service",
		Category: proverCategory,
		EnvVars:  []string{"RAIKO_HOST"},
	}
	RaikoZKVMHostEndpoint = &cli.StringFlag{
		Name:     "raiko.host.zkvm",
		Usage:    "RPC endpoint of a Raiko ZKVM host service",
		Category: proverCategory,
		EnvVars:  []string{"RAIKO_HOST_ZKVM"},
	}
	RaikoJWTPath = &cli.StringFlag{
		Name:     "raiko.jwtPath",
		Usage:    "Path to a JWT secret for the Raiko service",
		Category: proverCategory,
		EnvVars:  []string{"RAIKO_JWT_PATH"},
	}
	RaikoRequestTimeout = &cli.DurationFlag{
		Name:     "raiko.requestTimeout",
		Usage:    "Timeout in minutes for raiko request",
		Category: commonCategory,
		Value:    10 * time.Minute,
		EnvVars:  []string{"RAIKO_REQUEST_TIMEOUT"},
	}
	StartingBlockID = &cli.Uint64Flag{
		Name:     "prover.startingBlockID",
		Usage:    "If set, prover will start proving blocks from the block with this ID",
		Category: proverCategory,
		EnvVars:  []string{"PROVER_STARTING_BLOCK_ID"},
	}
	Graffiti = &cli.StringFlag{
		Name:     "prover.graffiti",
		Usage:    "When string is passed, adds additional graffiti info to proof evidence",
		Category: proverCategory,
		Value:    "",
		EnvVars:  []string{"PROVER_GRAFFITI"},
	}
	// Proving strategy.
	ProveUnassignedBlocks = &cli.BoolFlag{
		Name:     "prover.proveUnassignedBlocks",
		Usage:    "Whether you want to prove unassigned blocks, or only work on assigned proofs",
		Category: proverCategory,
		Value:    false,
		EnvVars:  []string{"PROVER_PROVE_UNASSIGNED_BLOCKS"},
	}
	// Running mode
	ContesterMode = &cli.BoolFlag{
		Name:     "mode.contester",
		Usage:    "Whether you want to contest wrong transitions with higher tier proofs",
		Category: proverCategory,
		Value:    false,
		EnvVars:  []string{"MODE_CONTESTER"},
	}
	// HTTP server related.
	ProverHTTPServerPort = &cli.Uint64Flag{
		Name:     "prover.port",
		Usage:    "Port to expose for http server",
		Category: proverCategory,
		Value:    9876,
		EnvVars:  []string{"PROVER_PORT"},
	}
	MaxExpiry = &cli.DurationFlag{
		Name:     "http.maxExpiry",
		Usage:    "Maximum accepted expiry in seconds for accepting proving a block",
		Value:    1 * time.Hour,
		Category: proverCategory,
		EnvVars:  []string{"HTTP_MAX_EXPIRY"},
	}
	// Special flags for testing.
	Dummy = &cli.BoolFlag{
		Name:     "prover.dummy",
		Usage:    "Produce dummy proofs, testing purposes only",
		Value:    false,
		Category: proverCategory,
		EnvVars:  []string{"PROVER_DUMMY"},
	}
	// Max amount of L1 blocks that can pass before block is invalid
	Allowance = &cli.Float64Flag{
		Name:     "prover.allowance",
		Usage:    "Amount without decimal to approve TaikoL1 contract for TaikoToken usage",
		Category: proverCategory,
		EnvVars:  []string{"PROVER_ALLOWANCE"},
	}
	GuardianProverHealthCheckServerEndpoint = &cli.StringFlag{
		Name:     "prover.guardianProverHealthCheckServerEndpoint",
		Usage:    "HTTP endpoint for main guardian prover health check server",
		Category: proverCategory,
		EnvVars:  []string{"PROVER_GUARDIAN_PROVER_HEALTH_CHECK_SERVER_ENDPOINT"},
	}
	// Guardian prover specific flag
	GuardianProverMinority = &cli.StringFlag{
		Name:     "guardianProverMinority",
		Usage:    "GuardianProverMinority contract `address`",
		Value:    rpc.ZeroAddress.Hex(),
		Category: proverCategory,
		EnvVars:  []string{"GUARDIAN_PROVER_MINORITY"},
	}
	GuardianProverMajority = &cli.StringFlag{
		Name:     "guardianProverMajority",
		Usage:    "GuardianProverMajority contract `address`",
		Category: proverCategory,
		EnvVars:  []string{"GUARDIAN_PROVER_MAJORITY"},
	}
	GuardianProofSubmissionDelay = &cli.DurationFlag{
		Name:     "guardian.submissionDelay",
		Usage:    "Guardian proof submission delay",
		Value:    1 * time.Hour,
		Category: proverCategory,
		EnvVars:  []string{"GUARDIAN_SUBMISSION_DELAY"},
	}
	EnableLivenessBondProof = &cli.BoolFlag{
		Name:     "prover.enableLivenessBondProof",
		Usage:    "Toggles whether the proof is a dummy proof or returns keccak256(RETURN_LIVENESS_BOND) as proof",
		Value:    false,
		Category: proverCategory,
		EnvVars:  []string{"PROVER_ENABLE_LIVENESS_BOND_PROOF"},
	}
	L1NodeVersion = &cli.StringFlag{
		Name:     "prover.l1NodeVersion",
		Usage:    "Version or tag or the L1 Node Version used as an L1 RPC Url by this guardian prover",
		Category: proverCategory,
		EnvVars:  []string{"PROVER_L1_NODE_VERSION"},
	}
	L2NodeVersion = &cli.StringFlag{
		Name:     "prover.l2NodeVersion",
		Usage:    "Version or tag or the L2 Node Version used as an L2 RPC Url by this guardian prover",
		Category: proverCategory,
		EnvVars:  []string{"PROVER_L2_NODE_VERSION"},
	}
	// Confirmations specific flag
	BlockConfirmations = &cli.Uint64Flag{
		Name:     "prover.blockConfirmations",
		Usage:    "Confirmations to the latest L1 block before submitting a proof for a L2 block",
		Value:    6,
		Category: proverCategory,
		EnvVars:  []string{"PROVER_BLOCK_CONFIRMATIONS"},
	}
	// Batch proof related flag
	SGXBatchSize = &cli.Uint64Flag{
		Name: "prover.sgx.batchSize",
		Usage: "The default size of batch sgx proofs, when it arrives, submit a batch of proof immediately, " +
			"this flag only works post Ontake fork",
		Value:    1,
		Category: proverCategory,
		EnvVars:  []string{"PROVER_SGX_BATCH_SIZE"},
	}
	ZKVMBatchSize = &cli.Uint64Flag{
		Name: "prover.zkvm.batchSize",
		Usage: "The size of batch ZKVM proof, when it arrives, submit a batch of proof immediately, " +
			"this flag only works post Ontake fork",
		Value:    1,
		Category: proverCategory,
		EnvVars:  []string{"PROVER_ZKVM_BATCH_SIZE"},
	}
	ForceBatchProvingInterval = &cli.DurationFlag{
		Name: "prover.forceBatchProvingInterval",
		Usage: "Time interval to prove blocks even the number of pending proof do not exceed prover.batchSize, " +
			"this flag only works post Ontake fork",
		Category: proverCategory,
		Value:    30 * time.Minute,
		EnvVars:  []string{"PROVER_FORCE_BATCH_PROVING_INTERVAL"},
	}
)

Optional flags used by prover.

View Source
var (
	NumConfirmations = &cli.Uint64Flag{
		Name:     "tx.numConfirmations",
		Usage:    "Number of confirmations which we will wait after sending a transaction",
		Value:    0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_NUM_CONFIRMATIONS"},
	}
	SafeAbortNonceTooLowCount = &cli.Uint64Flag{
		Name: "tx.safeAbortNonceTooLowCount",
		Usage: "Number of ErrNonceTooLow observations required to give up on " +
			"a tx at a particular nonce without receiving confirmation",
		Value:    3,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_SAFE_ABORT_NONCE_TOO_LOW_COUNT"},
	}
	FeeLimitMultiplier = &cli.Uint64Flag{
		Name:     "tx.feeLimitMultiplier",
		Usage:    "The multiplier applied to fee suggestions to put a hard limit on fee increases",
		Value:    10,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_FEE_LIMIT_MULTIPLIER"},
	}
	FeeLimitThreshold = &cli.Float64Flag{
		Name: "tx.feeLimitThreshold",
		Usage: "The minimum threshold (in GWei) at which fee bumping starts to be capped. " +
			"Allows arbitrary fee bumps below this threshold.",
		Value:    100.0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_FEE_LIMIT_THRESHOLD"},
	}
	MinTipCap = &cli.Float64Flag{
		Name:     "tx.minTipCap",
		Usage:    "Enforces a minimum tip cap (in GWei) to use when determining tx fees. 1 GWei by default.",
		Value:    1.0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_MIN_TIP_CAP"},
	}
	MinBaseFee = &cli.Float64Flag{
		Name:     "tx.minBaseFee",
		Usage:    "Enforces a minimum base fee (in GWei) to assume when determining tx fees. 1 GWei by default.",
		Value:    1.0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_MIN_BASE_FEE"},
	}
	ResubmissionTimeout = &cli.DurationFlag{
		Name:     "tx.resubmissionTimeout",
		Usage:    "Duration we will wait before resubmitting a transaction to L1",
		Value:    48 * time.Second,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_RESUBMISSION_TIMEOUT"},
	}
	TxSendTimeout = &cli.DurationFlag{
		Name:     "tx.sendTimeout",
		Usage:    "Timeout for sending transactions. If 0 it is disabled.",
		Value:    0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_SEND_TIMEOUT"},
	}
	TxNotInMempoolTimeout = &cli.DurationFlag{
		Name:     "tx.notInMempoolTimeout",
		Usage:    "Timeout for aborting a tx send if the tx does not make it to the mempool.",
		Value:    2 * time.Minute,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_NOT_IN_MEMPOOL_TIMEOUT"},
	}
	ReceiptQueryInterval = &cli.DurationFlag{
		Name:     "tx.receiptQueryInterval",
		Usage:    "Frequency to poll for receipts",
		Value:    12 * time.Second,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_RECEIPT_QUERY_INTERVAL"},
	}
	TxGasLimit = &cli.Uint64Flag{
		Name:     "tx.gasLimit",
		Usage:    "Gas limit will be used for transactions (0 means using gas estimation)",
		Value:    0,
		Category: txmgrCategory,
		EnvVars:  []string{"TX_GAS_LIMIT"},
	}
)

CommonFlags All common flags.

DriverFlags All driver flags.

View Source
var (
	L1ProverPrivKey = &cli.StringFlag{
		Name:     "l1.proverPrivKey",
		Usage:    "Private key of L1 prover, who will send TaikoL1.proveBlock transactions",
		Required: true,
		Category: proverCategory,
		EnvVars:  []string{"L1_PROVER_PRIV_KEY"},
	}
)

Required flags used by prover.

ProposerFlags All proposer flags.

ProverFlags All prover flags.

Functions

func MergeFlags

func MergeFlags(groups ...[]cli.Flag) []cli.Flag

MergeFlags merges the given flag slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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