Skip to content

Commit

Permalink
Improve error message for missing Celo1 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Kourin1996 committed Jan 29, 2025
1 parent 5c3e2be commit 1dd6d97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
// Make sure Cel2 full sync node has migrated data from Celo1
currentBlock := eth.blockchain.CurrentBlock()
if config.SyncMode == downloader.FullSync && chainConfig.Cel2Time != nil && !chainConfig.IsCel2(currentBlock.Number.Uint64()) {
log.Error("Migrated data for Cel2 is missing, please ensure the migrated data from Celo1 can be properly loaded before starting the blockchain",
"current number", currentBlock.Number.Uint64(), "current hash", currentBlock.Hash())
log.Error(fmt.Sprintf(
"Chaindata is missing blocks, Cel2 fork is at block %d, but the head block is %d. Pre Cel2 blocks must be migrated from"+
" Celo L1 chaindata, Celo L2 cannot generate pre Cel2 blocks. See migration instructions here - https://docs.celo.org/cel2/l2-operator-guide",
*chainConfig.Cel2Time, currentBlock.Number.Uint64()))
return nil, fmt.Errorf("missing migrated data")
}
if chainConfig := eth.blockchain.Config(); chainConfig.Optimism != nil { // config.Genesis.Config.ChainID cannot be used because it's based on CLI flags only, thus default to mainnet L1
Expand Down

0 comments on commit 1dd6d97

Please sign in to comment.