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 checkStateInconsistency when starting sequencer #3294

Merged
merged 1 commit into from
Feb 17, 2024
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
8 changes: 7 additions & 1 deletion sequencer/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ func (s *Sequencer) Start(ctx context.Context) {

// checkStateInconsistency checks if state inconsistency happened
func (s *Sequencer) checkStateInconsistency(ctx context.Context) {
var err error
s.numberOfStateInconsistencies, err = s.stateIntf.CountReorgs(ctx, nil)
if err != nil {
log.Error("failed to get initial number of reorgs, error: %v", err)
}
for {
time.Sleep(s.cfg.StateConsistencyCheckInterval.Duration)
stateInconsistenciesDetected, err := s.stateIntf.CountReorgs(ctx, nil)
if err != nil {
log.Error("failed to get number of reorgs, error: %v", err)
Expand All @@ -125,6 +129,8 @@ func (s *Sequencer) checkStateInconsistency(ctx context.Context) {
if stateInconsistenciesDetected != s.numberOfStateInconsistencies {
s.finalizer.Halt(ctx, fmt.Errorf("state inconsistency detected, halting finalizer"), false)
}

time.Sleep(s.cfg.StateConsistencyCheckInterval.Duration)
}
}

Expand Down
Loading