Skip to content

Commit

Permalink
Update forkIdIntervals
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed Mar 15, 2023
1 parent 2a12876 commit f4e926c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,19 @@ func (s *ClientSynchronizer) processForkID(forkID etherman.ForkID, blockNumber u
return err
}
if latestBatchNumber < forkID.BatchNumber { //If the forkID will start in a future batch
// Read Fork ID FROM POE SC
forkIDIntervals, err := s.etherMan.GetForks(s.ctx)
if err != nil || len(forkIDIntervals) == 0 {
log.Error("error getting all forkIDs: ", err)
rollbackErr := dbTx.Rollback(s.ctx)
if rollbackErr != nil {
log.Errorf("error rolling back state. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err)
return rollbackErr
}
return err
}
// Update forkID intervals in the state
s.state.UpdateForkIDIntervals(forkIDIntervals)
return nil
}

Expand Down

0 comments on commit f4e926c

Please sign in to comment.