Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkIfSynced #2289

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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