Skip to content

Commit

Permalink
Ensure that we set gas limit if migrating at pre-gingerbread point
Browse files Browse the repository at this point in the history
  • Loading branch information
piersy committed Jun 26, 2024
1 parent c4c4f0b commit 77fc0a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions op-chain-ops/cmd/celo-migrate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, genesis *core.Gene
if header.BaseFee != nil {
baseFee = header.BaseFee
}

// If gas limit was zero at the transition point use a default of 30M.
gasLimit := header.GasLimit
if gasLimit == 0 {
gasLimit = 30e6
}
// Create the header for the Cel2 transition block.
cel2Header := &types.Header{
ParentHash: header.Hash(),
Expand All @@ -133,7 +137,7 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, genesis *core.Gene
Bloom: types.Bloom{},
Difficulty: new(big.Int).Set(common.Big0),
Number: migrationBlock,
GasLimit: header.GasLimit,
GasLimit: gasLimit,
GasUsed: 0,
Time: header.Time + 5,
Extra: []byte("CeL2 migration"),
Expand Down

0 comments on commit 77fc0a2

Please sign in to comment.