Skip to content

Commit

Permalink
migration: Use deterministic default for migration block timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Oct 1, 2024
1 parent 78d41a3 commit 6137080
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions op-chain-ops/cmd/celo-migrate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/jsonutil"
Expand Down Expand Up @@ -157,7 +156,9 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, l2Allocs types.Gen
}

if migrationBlockTime == 0 {
migrationBlockTime = uint64(time.Now().Unix())
// If the migration block time is not set, use the time of the last block incremented by one.
// This makes sure the migration is deterministic.
migrationBlockTime = header.Time + config.L2BlockTime
}

// Set the standard options.
Expand Down

0 comments on commit 6137080

Please sign in to comment.