Documentation
¶
Index ¶
- Constants
- Variables
- func Apply(ctx context.Context, cfg ApplyConfig) error
- func ApplyCLI() func(cliCtx *cli.Context) error
- func ApplyL1DevGenesis(ctx context.Context, opts ApplyPipelineOpts) error
- func ApplyPipeline(ctx context.Context, opts ApplyPipelineOpts) error
- func ChainIDFromRPC(ctx context.Context, rpcURL string) (*big.Int, error)
- func Continue(ctx context.Context, cfg ContinueConfig) error
- func ContinueCLI() func(cliCtx *cli.Context) error
- func CreateCacheDir(cacheDir string) error
- func Init(cfg InitConfig) error
- func InitCLI() func(ctx *cli.Context) error
- func PrefixEnvVar(name string) []string
- func Prepare(ctx context.Context, cfg PrepareConfig) error
- func PrepareCLI() func(cliCtx *cli.Context) error
- func Prestate(ctx context.Context, cfg PrestateConfig) error
- func PrestateCLI() func(cliCtx *cli.Context) error
- type ApplyConfig
- type ApplyPipelineOpts
- type ContinueConfig
- type DeploymentTarget
- type InitConfig
- type PrepareConfig
- type PrestateConfig
Constants ¶
const ( EnvVarPrefix = flags.EnvVarPrefix L1RPCURLFlagName = flags.L1RPCURLFlagName CacheDirFlagName = flags.CacheDirFlagName L1ChainIDFlagName = flags.L1ChainIDFlagName ArtifactsLocatorFlagName = flags.ArtifactsLocatorFlagName L2ChainIDsFlagName = flags.L2ChainIDsFlagName WorkdirFlagName = flags.WorkdirFlagName OutdirFlagName = flags.OutdirFlagName PrivateKeyFlagName = flags.PrivateKeyFlagName PrestateFlagName = flags.PrestateFlagName IntentTypeFlagName = flags.IntentTypeFlagName VerifierAPIKeyFlagName = flags.VerifierAPIKeyFlagName EtherscanAPIKeyFlagName = flags.EtherscanAPIKeyFlagName // Deprecated: use VerifierAPIKeyFlagName InputFileFlagName = flags.InputFileFlagName ContractNameFlagName = flags.ContractNameFlagName VerifierTypeFlagName = flags.VerifierTypeFlagName VerifierUrlFlagName = flags.VerifierUrlFlagName UseForgeFlagName = flags.UseForgeFlagName GenesisTimeOffsetFlagName = flags.GenesisTimeOffsetFlagName ReceiptQueryIntervalFlagName = flags.ReceiptQueryIntervalFlagName DeployMockSP1VerifierFlagName = flags.DeployMockSP1VerifierFlagName )
Variables ¶
var ( Uint256Type = opcm.MustType("uint256") BytesType = opcm.MustType("bytes") AddressType = opcm.MustType("address") Bytes32Type = opcm.MustType("bytes32") )
Primitive ABI types primarily used with `abi.Arguments` to pack/unpack values when calling contract methods.
var ( SepoliaChainID uint64 = 11155111 DefaultL1ProxyAdminOwnerSepolia common.Address = common.HexToAddress("0x1Eb2fFc903729a0F03966B917003800b145F56E2") )
Constants for Sepolia chain.
var ( L1RPCURLFlag = &cli.StringFlag{ Name: L1RPCURLFlagName, Usage: "RPC URL for the L1 chain. Must be set for live chains. " + "Must be blank for chains deploying to local allocs files.", EnvVars: []string{ "L1_RPC_URL", }, } ArtifactsLocatorFlag = &cli.StringFlag{ Name: ArtifactsLocatorFlagName, Usage: "Locator for artifacts.", EnvVars: PrefixEnvVar("ARTIFACTS_LOCATOR"), Value: artifacts.EmbeddedLocatorString, } CacheDirFlag = &cli.StringFlag{ Name: CacheDirFlagName, Usage: "Cache directory. " + "If set, the deployer will attempt to cache downloaded artifacts in the specified directory.", EnvVars: PrefixEnvVar("CACHE_DIR"), Value: flags.DefaultCacheDir(), } L1ChainIDFlag = &cli.Uint64Flag{ Name: L1ChainIDFlagName, Usage: "Chain ID of the L1 chain.", EnvVars: PrefixEnvVar("L1_CHAIN_ID"), Value: 11155111, } L2ChainIDsFlag = &cli.StringFlag{ Name: L2ChainIDsFlagName, Usage: "Comma-separated list of L2 chain IDs to deploy.", EnvVars: PrefixEnvVar("L2_CHAIN_IDS"), } WorkdirFlag = &cli.StringFlag{ Name: WorkdirFlagName, Usage: "Directory storing intent and stage. Defaults to the current directory.", EnvVars: PrefixEnvVar("WORKDIR"), Value: cwd(), Aliases: []string{ OutdirFlagName, }, } PrivateKeyFlag = &cli.StringFlag{ Name: PrivateKeyFlagName, Usage: "Private key of the deployer account.", EnvVars: PrefixEnvVar("PRIVATE_KEY"), } PrestateFlag = &cli.StringFlag{ Name: PrestateFlagName, Usage: "Selected permissionless-game absolute prestate hash. Fails if a differing intent value is set.", EnvVars: PrefixEnvVar("DISPUTE_ABSOLUTE_PRESTATE"), } DeploymentTargetFlag = &cli.StringFlag{ Name: "deployment-target", Usage: fmt.Sprintf("Where to deploy L1 contracts. Options: %s, %s", DeploymentTargetLive, DeploymentTargetGenesis), EnvVars: PrefixEnvVar("DEPLOYMENT_TARGET"), Value: string(DeploymentTargetLive), } IntentTypeFlag = &cli.StringFlag{ Name: IntentTypeFlagName, Usage: fmt.Sprintf("Intent config type to use. Options: %s (default), %s, %s", state.IntentTypeStandard, state.IntentTypeCustom, state.IntentTypeStandardOverrides), EnvVars: PrefixEnvVar("INTENT_TYPE"), Value: string(state.IntentTypeStandard), Aliases: []string{ "intent-config-type", }, } VerifierAPIKeyFlag = &cli.StringFlag{ Name: VerifierAPIKeyFlagName, Usage: "API key for contract verifier (etherscan, blockscout, etc.)", EnvVars: append(PrefixEnvVar("VERIFIER_API_KEY"), PrefixEnvVar("ETHERSCAN_API_KEY")...), Aliases: []string{EtherscanAPIKeyFlagName}, } InputFileFlag = &cli.StringFlag{ Name: InputFileFlagName, Usage: "filepath of input file for command", EnvVars: PrefixEnvVar("INPUT_FILE"), } ContractNameFlag = &cli.StringFlag{ Name: ContractNameFlagName, Usage: "(optional) contract name matching a field within the input file", EnvVars: PrefixEnvVar("CONTRACT_NAME"), } VerifierFlag = &cli.StringFlag{ Name: VerifierTypeFlagName, Usage: "contract verifier type(s) to use. Comma-separated for multiple verifiers. Options: etherscan, blockscout, custom. Defaults to etherscan and blockscout", EnvVars: PrefixEnvVar("VERIFIER_TYPE"), Value: "etherscan,blockscout", } VerifierUrlFlag = &cli.StringFlag{ Name: VerifierUrlFlagName, Usage: "verifier URL (optional for blockscout, required for custom, ignored for etherscan)", EnvVars: PrefixEnvVar("VERIFIER_URL"), } NoVerifyFlag = &cli.BoolFlag{ Name: "no-verify", Usage: "skip automatic contract verification after deployment", EnvVars: PrefixEnvVar("NO_VERIFY"), Value: false, } UseForgeFlag = &cli.BoolFlag{ Name: UseForgeFlagName, Usage: "run the deployment scripts with forge; false runs them on the Go script host, which a later release removes", EnvVars: PrefixEnvVar("USE_FORGE"), Value: true, } ReceiptQueryIntervalFlag = &cli.DurationFlag{ Name: ReceiptQueryIntervalFlagName, Usage: "for tests: how often to poll for each broadcast's receipt, from 50ms to 1s; 0 uses the default of 1s", EnvVars: PrefixEnvVar("RECEIPT_QUERY_INTERVAL"), Value: broadcaster.DefaultReceiptQueryInterval, Hidden: true, } DeployMockSP1VerifierFlag = &cli.BoolFlag{ Name: DeployMockSP1VerifierFlagName, Usage: "deploy a mock SP1 verifier for the ZK dispute game, on an L1 without a release verifier, " + "in a genesis or live. Development only: the mock accepts every proof.", EnvVars: PrefixEnvVar("DEPLOY_MOCK_SP1_VERIFIER"), Value: false, } GenesisTimeOffsetFlag = &cli.Uint64Flag{ Name: GenesisTimeOffsetFlagName, Usage: "Offset in seconds added to the L1 anchor block's timestamp to produce the committed L2 genesis " + "timestamp. A zero offset starts genesis at the anchor timestamp; nodes produce catch-up blocks for " + "elapsed block times. Use a larger offset to schedule genesis after deployment.", EnvVars: PrefixEnvVar("GENESIS_TIME_OFFSET"), } )
var ApplyFlags = []cli.Flag{ L1RPCURLFlag, WorkdirFlag, PrivateKeyFlag, DeploymentTargetFlag, NoVerifyFlag, VerifierAPIKeyFlag, VerifierFlag, VerifierUrlFlag, UseForgeFlag, ReceiptQueryIntervalFlag, DeployMockSP1VerifierFlag, }
var ContinueFlags = []cli.Flag{ WorkdirFlag, PrivateKeyFlag, L1RPCURLFlag, ReceiptQueryIntervalFlag, }
var GlobalFlags = append([]cli.Flag{CacheDirFlag}, logcli.CLIFlags(EnvVarPrefix)...)
var InitFlags = []cli.Flag{ L1ChainIDFlag, L2ChainIDsFlag, WorkdirFlag, IntentTypeFlag, }
var PrepareFlags = []cli.Flag{ WorkdirFlag, PrivateKeyFlag, L1RPCURLFlag, GenesisTimeOffsetFlag, }
var PrestateFlags = []cli.Flag{ WorkdirFlag, PrestateFlag, }
var VerifyFlags = []cli.Flag{ L1RPCURLFlag, ArtifactsLocatorFlag, VerifierAPIKeyFlag, InputFileFlag, ContractNameFlag, VerifierFlag, VerifierUrlFlag, }
Functions ¶
func ApplyL1DevGenesis ¶ added in v1.20.2
func ApplyL1DevGenesis(ctx context.Context, opts ApplyPipelineOpts) error
ApplyL1DevGenesis deploys the superchain and the implementations into a new L1 dev genesis, with no chains. Unlike a genesis-target ApplyPipeline, it adds the preinstalls before the deployments, so that the deployer keeps its nonce and can deploy chains on the running L1 later.
func ApplyPipeline ¶
func ApplyPipeline( ctx context.Context, opts ApplyPipelineOpts, ) error
func Continue ¶ added in v1.19.5
func Continue(ctx context.Context, cfg ContinueConfig) error
Continue resumes a prepared deployment after simulating and validating every pending chain. This global preflight prevents predictable partial deployments but cannot make independent L1 transactions atomic. Each chain's pinned anchor and the deployer nonce are therefore rechecked immediately before broadcast, and any drift stops the remaining sends.
func ContinueCLI ¶ added in v1.19.5
func CreateCacheDir ¶
func Init ¶
func Init(cfg InitConfig) error
func PrefixEnvVar ¶
func PrepareCLI ¶ added in v1.19.5
func PrestateCLI ¶ added in v1.19.5
Types ¶
type ApplyConfig ¶
type ApplyConfig struct {
L1RPCUrl string
Workdir string
PrivateKey string
DeploymentTarget DeploymentTarget
Logger log.Logger
CacheDir string
// UseScriptHost runs the scripts on the Go script host instead of forge.
UseScriptHost bool
// ReceiptQueryInterval is how often to poll for each broadcast's receipt. Zero uses the broadcaster's default.
ReceiptQueryInterval time.Duration
// DeployMockSP1Verifier deploys an accept-all SP1 verifier on an L1 without a release verifier.
DeployMockSP1Verifier bool
// contains filtered or unexported fields
}
func (*ApplyConfig) Check ¶
func (a *ApplyConfig) Check() error
type ApplyPipelineOpts ¶
type ApplyPipelineOpts struct {
L1RPCUrl string
DeploymentTarget DeploymentTarget
DeployerPrivateKey *ecdsa.PrivateKey
Intent *state.Intent
State *state.State
Logger log.Logger
StateWriter pipeline.StateWriter
CacheDir string
// UseScriptHost runs the scripts on the Go script host instead of forge.
UseScriptHost bool
// DeployMockSP1Verifier is a test-only opt-in for development environments.
DeployMockSP1Verifier bool
// AllowUnoptimizedContracts is a test-only opt-in that lets oversized dev-profile
// artifacts build an L2 genesis. A genesis deployment always allows them.
AllowUnoptimizedContracts bool
Workdir string
ReceiptQueryInterval time.Duration
}
type ContinueConfig ¶ added in v1.19.5
type ContinueConfig struct {
Workdir string
L1RPCUrl string
PrivateKey string
CacheDir string
Logger log.Logger
// ReceiptQueryInterval is how often to poll for each broadcast's receipt. Zero uses the broadcaster's default.
ReceiptQueryInterval time.Duration
// contains filtered or unexported fields
}
func (*ContinueConfig) Check ¶ added in v1.19.5
func (c *ContinueConfig) Check() error
type DeploymentTarget ¶
type DeploymentTarget string
const ( DeploymentTargetLive DeploymentTarget = "live" DeploymentTargetGenesis DeploymentTarget = "genesis" )
func NewDeploymentTarget ¶
func NewDeploymentTarget(s string) (DeploymentTarget, error)
type InitConfig ¶
type InitConfig struct {
IntentType state.IntentType
L1ChainID uint64
Outdir string
L2ChainIDs []common.Hash
}
func (*InitConfig) Check ¶
func (c *InitConfig) Check() error
type PrepareConfig ¶ added in v1.19.5
type PrepareConfig struct {
Workdir string
Logger log.Logger
// PrivateKey of the deployer account. Its address is used as the dry-run
// sender, operator MUST use the same key for the eventual broadcast.
PrivateKey string
// L1RPCUrl is the L1 endpoint that prepare forks to dry-run OPCM.deploy.
L1RPCUrl string
// CacheDir is where downloaded artifacts are cached.
CacheDir string
// GenesisTimeOffset is the number of seconds added to the L1 anchor block's timestamp
// to produce the committed L2 genesis timestamp.
GenesisTimeOffset uint64
// AllowUnoptimizedContracts is a test-only opt-in that lets oversized dev-profile
// artifacts build an L2 genesis.
AllowUnoptimizedContracts bool
// contains filtered or unexported fields
}
func (*PrepareConfig) Check ¶ added in v1.19.5
func (c *PrepareConfig) Check() error