Skip to content

Commit

Permalink
Fix migration (#232)
Browse files Browse the repository at this point in the history
This ensures the transition block has the empty withdrawals hash.
  • Loading branch information
piersy authored Sep 20, 2024
1 parent 816eaf0 commit cb878ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion op-chain-ops/cmd/celo-migrate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ func applyStateMigrationChanges(config *genesis.DeployConfig, l2Allocs types.Gen
}
log.Info("Build Cel2 migration header", "header", cel2Header)

// We need to set empty withdrawals in the body, otherwise types.NewBlock will nullify the withdrawals hash in the given header.
b := &types.Body{
Withdrawals: []*types.Withdrawal{},
}
// Create the Cel2 transition block from the header. Note that there are no transactions,
// uncle blocks, or receipts in the Cel2 transition block.
cel2Block := types.NewBlock(cel2Header, nil, nil, trie.NewStackTrie(nil))
cel2Block := types.NewBlock(cel2Header, b, nil, trie.NewStackTrie(nil))

// We did it!
log.Info(
Expand Down

0 comments on commit cb878ed

Please sign in to comment.