Skip to content

Commit

Permalink
op-node,op-service: Add Fjord override flag (ethereum-optimism#10648)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst authored May 24, 2024
1 parent 2a805a9 commit 4c3f63d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion op-node/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ func applyOverrides(ctx *cli.Context, rollupConfig *rollup.Config) {
ecotone := ctx.Uint64(opflags.EcotoneOverrideFlagName)
rollupConfig.EcotoneTime = &ecotone
}
if ctx.IsSet(opflags.FjordOverrideFlagName) {
fjord := ctx.Uint64(opflags.FjordOverrideFlagName)
rollupConfig.FjordTime = &fjord
}
}

func NewSnapshotLogger(ctx *cli.Context) (log.Logger, error) {
Expand All @@ -271,7 +275,7 @@ func NewSnapshotLogger(ctx *cli.Context) (log.Logger, error) {

func NewSyncConfig(ctx *cli.Context, log log.Logger) (*sync.Config, error) {
if ctx.IsSet(flags.L2EngineSyncEnabled.Name) && ctx.IsSet(flags.SyncModeFlag.Name) {
return nil, errors.New("cannot set both --l2.engine-sync and --syncmode at the same time.")
return nil, errors.New("cannot set both --l2.engine-sync and --syncmode at the same time")
} else if ctx.IsSet(flags.L2EngineSyncEnabled.Name) {
log.Error("l2.engine-sync is deprecated and will be removed in a future release. Use --syncmode=execution-layer instead.")
}
Expand Down
8 changes: 8 additions & 0 deletions op-service/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
CanyonOverrideFlagName = "override.canyon"
DeltaOverrideFlagName = "override.delta"
EcotoneOverrideFlagName = "override.ecotone"
FjordOverrideFlagName = "override.fjord"
)

func CLIFlags(envPrefix string, category string) []cli.Flag {
Expand All @@ -41,6 +42,13 @@ func CLIFlags(envPrefix string, category string) []cli.Flag {
Hidden: false,
Category: category,
},
&cli.Uint64Flag{
Name: FjordOverrideFlagName,
Usage: "Manually specify the Fjord fork timestamp, overriding the bundled setting",
EnvVars: opservice.PrefixEnvVar(envPrefix, "OVERRIDE_FJORD"),
Hidden: false,
Category: category,
},
CLINetworkFlag(envPrefix, category),
CLIRollupConfigFlag(envPrefix, category),
}
Expand Down

0 comments on commit 4c3f63d

Please sign in to comment.