Skip to content

Commit

Permalink
Check flushID != 0 (#2406)
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 authored Aug 14, 2023
1 parent f041a1b commit 994cb2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sequencer/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (f *finalizer) halt(ctx context.Context, err error) {
}
}

// checkProverIDAndUpdateStoredFlushID checks if the proverID changed and updates the stored flush id
// checkIfProverRestarted checks if the proverID changed
func (f *finalizer) checkIfProverRestarted(proverID string) {
if f.proverID != "" && f.proverID != proverID {
event := &event.Event{
Expand Down
7 changes: 5 additions & 2 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,9 @@ func (s *ClientSynchronizer) getCurrentBatches(batches []*state.Batch, trustedBa

func (s *ClientSynchronizer) pendingFlushID(flushID uint64, proverID string) {
log.Infof("pending flushID: %d", flushID)
if flushID == 0 {
log.Fatal("flushID is 0. Please check that prover/executor config parameter dbReadOnly is false")
}
s.latestFlushID = flushID
s.latestFlushIDIsFulfilled = false
s.updateAndCheckProverID(proverID)
Expand All @@ -1583,7 +1586,7 @@ func (s *ClientSynchronizer) updateAndCheckProverID(proverID string) {
log.Errorf("error storing event payload: %v", err)
}

log.Fatal("restarting synchronizer because executor have restarted (old=%s, new=%s)", s.proverID, proverID)
log.Fatal("restarting synchronizer because executor has been restarted (old=%s, new=%s)", s.proverID, proverID)
}
}

Expand All @@ -1597,7 +1600,7 @@ func (s *ClientSynchronizer) checkFlushID(dbTx pgx.Tx) error {
log.Error("error getting stored flushID. Error: ", err)
return err
}
if (s.previousExecutorFlushID != storedFlushID) || (s.proverID != proverID) {
if s.previousExecutorFlushID != storedFlushID || s.proverID != proverID {
log.Infof("executor vs local: flushid=%d/%d, proverID=%s/%s", storedFlushID,
s.latestFlushID, proverID, s.proverID)
} else {
Expand Down

0 comments on commit 994cb2c

Please sign in to comment.