Skip to content

Commit

Permalink
op-deployer: Remove irrelevant flags (#12525)
Browse files Browse the repository at this point in the history
We only need a `--artifacts-locator` flag now.
  • Loading branch information
mslipper authored Oct 18, 2024
1 parent f99424d commit 5f7f44c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
20 changes: 10 additions & 10 deletions op-deployer/pkg/deployer/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type OPCMConfig struct {
PrivateKey string
Logger log.Logger
ArtifactsLocator *opcm.ArtifactsLocator
ContractsRelease string

privateKeyECDSA *ecdsa.PrivateKey
}
Expand Down Expand Up @@ -59,10 +58,6 @@ func (c *OPCMConfig) Check() error {
return fmt.Errorf("artifacts locator must be specified")
}

if c.ContractsRelease == "" {
return fmt.Errorf("contracts release must be specified")
}

return nil
}

Expand All @@ -73,12 +68,11 @@ func OPCMCLI(cliCtx *cli.Context) error {

l1RPCUrl := cliCtx.String(deployer.L1RPCURLFlagName)
privateKey := cliCtx.String(deployer.PrivateKeyFlagName)
artifactsURLStr := cliCtx.String(ArtifactsURLFlagName)
artifactsURLStr := cliCtx.String(ArtifactsLocatorFlagName)
artifactsLocator := new(opcm.ArtifactsLocator)
if err := artifactsLocator.UnmarshalText([]byte(artifactsURLStr)); err != nil {
return fmt.Errorf("failed to parse artifacts URL: %w", err)
}
contractsRelease := cliCtx.String(ContractsReleaseFlagName)

ctx := ctxinterrupt.WithCancelOnInterrupt(cliCtx.Context)

Expand All @@ -87,7 +81,6 @@ func OPCMCLI(cliCtx *cli.Context) error {
PrivateKey: privateKey,
Logger: l,
ArtifactsLocator: artifactsLocator,
ContractsRelease: contractsRelease,
})
}

Expand Down Expand Up @@ -138,7 +131,14 @@ func OPCM(ctx context.Context, cfg OPCMConfig) error {
signer := opcrypto.SignerFnFromBind(opcrypto.PrivateKeySignerFn(cfg.privateKeyECDSA, chainID))
chainDeployer := crypto.PubkeyToAddress(cfg.privateKeyECDSA.PublicKey)

lgr.Info("deploying OPCM", "release", cfg.ContractsRelease)
var release string
if cfg.ArtifactsLocator.IsTag() {
release = cfg.ArtifactsLocator.Tag
} else {
release = "dev"
}

lgr.Info("deploying OPCM", "release", release)

var dio opcm.DeployImplementationsOutput
err = pipeline.CallScriptBroadcast(
Expand Down Expand Up @@ -181,7 +181,7 @@ func OPCM(ctx context.Context, cfg OPCMConfig) error {
ChallengePeriodSeconds: big.NewInt(86400),
ProofMaturityDelaySeconds: big.NewInt(604800),
DisputeGameFinalityDelaySeconds: big.NewInt(302400),
Release: cfg.ContractsRelease,
Release: release,
SuperchainConfigProxy: superchainConfigAddr,
ProtocolVersionsProxy: protocolVersionsAddr,
OpcmProxyOwner: opcmProxyOwnerAddr,
Expand Down
19 changes: 6 additions & 13 deletions op-deployer/pkg/deployer/bootstrap/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,21 @@ import (
)

const (
ArtifactsURLFlagName = "artifacts-url"
ContractsReleaseFlagName = "contracts-release"
ArtifactsLocatorFlagName = "artifacts-locator"
)

var (
ArtifactsURLFlag = &cli.StringFlag{
Name: ArtifactsURLFlagName,
Usage: "URL to the artifacts directory.",
EnvVars: deployer.PrefixEnvVar("ARTIFACTS_URL"),
}
ContractsReleaseFlag = &cli.StringFlag{
Name: ContractsReleaseFlagName,
Usage: "Release of the contracts to deploy.",
EnvVars: deployer.PrefixEnvVar("CONTRACTS_RELEASE"),
ArtifactsLocatorFlag = &cli.StringFlag{
Name: ArtifactsLocatorFlagName,
Usage: "Locator for artifacts.",
EnvVars: deployer.PrefixEnvVar("ARTIFACTS_LOCATOR"),
}
)

var OPCMFlags = []cli.Flag{
deployer.L1RPCURLFlag,
deployer.PrivateKeyFlag,
ArtifactsURLFlag,
ContractsReleaseFlag,
ArtifactsLocatorFlag,
}

var Commands = []*cli.Command{
Expand Down

0 comments on commit 5f7f44c

Please sign in to comment.