Skip to content

Commit

Permalink
Fix checkIfSynced
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed Jul 14, 2023
1 parent caa9a3a commit 0bf9adc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ func (s *ClientSynchronizer) Sync() error {

// Sync trusted state
if latestSyncedBatch >= latestSequencedBatchNumber {
log.Info("L1 state fully synchronized")
startTrusted := time.Now()
log.Info("Syncing trusted state")
err = s.syncTrustedState(latestSyncedBatch)
metrics.FullTrustedSyncTime(time.Since(startTrusted))
if err != nil {
Expand All @@ -246,6 +246,7 @@ func (s *ClientSynchronizer) Sync() error {
}
}
metrics.FullSyncIterationTime(time.Since(start))
log.Info("L1 state fully synchronized")
}
}
}
Expand Down Expand Up @@ -1244,6 +1245,9 @@ func (s *ClientSynchronizer) processTrustedBatch(trustedBatch *types.Batch, dbTx
log.Errorf("error closing batch %d", trustedBatch.Number)
return nil, nil, err
}
batches[0].AccInputHash = trustedBatch.AccInputHash
batches[0].StateRoot = trustedBatch.StateRoot
batches[0].LocalExitRoot = trustedBatch.LocalExitRoot
}
return batches, &trustedBatch.StateRoot, nil
}
Expand Down Expand Up @@ -1400,6 +1404,13 @@ func checkIfSynced(batches []*state.Batch, trustedBatch *types.Batch) bool {
matchCoinbase && matchTimestamp && matchL2Data {
return true
}
log.Info("matchNumber", matchNumber)
log.Info("matchGER", matchGER)
log.Info("matchLER", matchLER)
log.Info("matchSR", matchSR)
log.Info("matchCoinbase", matchCoinbase)
log.Info("matchTimestamp", matchTimestamp)
log.Info("matchL2Data", matchL2Data)
return false
}

Expand Down

0 comments on commit 0bf9adc

Please sign in to comment.