Skip to content

Commit

Permalink
Trigger pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman committed Jun 12, 2024
1 parent a3a97d0 commit 11f9d68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sequencer/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,23 @@ func (s *Sequencer) isSynced(ctx context.Context) bool {
log.Errorf("failed to get last isSynced batch, error: %v", err)
return false
}

lastTrustedBatchNum, err := s.stateIntf.GetLastBatchNumber(ctx, nil)
if err != nil && err != state.ErrNotFound {
log.Errorf("failed to get last batch num, error: %v", err)
return false
}

if lastTrustedBatchNum > lastVirtualBatchNum {
return true
}

lastEthBatchNum, err := s.etherman.GetLatestBatchNumber()
if err != nil {
log.Errorf("failed to get last eth batch, error: %v", err)
return false
}

if lastVirtualBatchNum < lastEthBatchNum {
log.Infof("waiting for the state to be synced, lastVirtualBatchNum: %d, lastEthBatchNum: %d", lastVirtualBatchNum, lastEthBatchNum)
return false
Expand Down

0 comments on commit 11f9d68

Please sign in to comment.