Skip to content

Commit

Permalink
fix sanity genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Feb 23, 2024
1 parent 235522a commit cacf154
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,15 @@ func (s *ClientSynchronizer) RequestAndProcessRollupGenesisBlock(dbTx pgx.Tx, la
}

func sanityCheckForGenesisBlockRollupInfo(blocks []etherman.Block, order map[common.Hash][]etherman.Order) error {
if len(blocks) != 1 || len(order) != 1 || len(order[blocks[0].BlockHash]) != 2 {
if len(blocks) != 1 || len(order) < 1 || len(order[blocks[0].BlockHash]) < 1 {
log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected 1 block with 2 orders")
return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected 1 block with 2 orders")
}
if order[blocks[0].BlockHash][0].Name != etherman.ForkIDsOrder {
log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected ForkIDsOrder, got %s", order[blocks[0].BlockHash][0].Name)
return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected ForkIDsOrder")
}
if order[blocks[0].BlockHash][1].Name != etherman.InitialSequenceBatchesOrder {
log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected InitialSequenceBatchesOrder, got %s", order[blocks[0].BlockHash][0].Name)
return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected InitialSequenceBatchesOrder")
}

return nil
}

Expand Down

0 comments on commit cacf154

Please sign in to comment.