From 8e1df24666f5765ceb8615fe3a9914485c0b0f85 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Mon, 7 Oct 2024 13:37:45 +0200 Subject: [PATCH] migration: Make migration-block-time a required flag (#242) Make migration-block-time a required flag --------- Co-authored-by: alecps Co-authored-by: piersy --- op-chain-ops/cmd/celo-migrate/main.go | 5 +++-- op-chain-ops/cmd/celo-migrate/state.go | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/op-chain-ops/cmd/celo-migrate/main.go b/op-chain-ops/cmd/celo-migrate/main.go index c75732a9e9ed9..632ec8dd1587e 100644 --- a/op-chain-ops/cmd/celo-migrate/main.go +++ b/op-chain-ops/cmd/celo-migrate/main.go @@ -67,8 +67,9 @@ var ( Required: true, } migrationBlockTimeFlag = &cli.Uint64Flag{ - Name: "migration-block-time", - Usage: "Specifies a unix timestamp to use for the migration block. If not provided, the current time will be used.", + Name: "migration-block-time", + Usage: "Specifies a unix timestamp to use for the migration block. This should be set to the same timestamp as was used for the sequencer migration. If performing the sequencer migration, this should set to a time in the future around when the migration script is expected to complete.", + Required: true, } oldDBPathFlag = &cli.PathFlag{ Name: "old-db", diff --git a/op-chain-ops/cmd/celo-migrate/state.go b/op-chain-ops/cmd/celo-migrate/state.go index 538486c412382..5c029c8453b03 100644 --- a/op-chain-ops/cmd/celo-migrate/state.go +++ b/op-chain-ops/cmd/celo-migrate/state.go @@ -6,7 +6,6 @@ import ( "fmt" "math/big" "os" - "time" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-service/ioutil" @@ -157,10 +156,6 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, l2Allocs types.Gen return nil, err } - if migrationBlockTime == 0 { - migrationBlockTime = uint64(time.Now().Unix()) - } - // Set the standard options. cfg.LondonBlock = migrationBlockNumber cfg.BerlinBlock = migrationBlockNumber