Skip to content

Commit

Permalink
comments fix
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Jun 20, 2024
1 parent cc2b364 commit ea1741f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion synchronizer/batches.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,26 @@ func (bs *BatchSynchronizer) handleReorgs(ctx context.Context) {
select {
case r := <-bs.reorgs:
bs.syncLock.Lock()
defer bs.syncLock.Unlock()

latest, err := getStartBlock(ctx, bs.db)
if err != nil {
log.Errorf("could not determine latest processed block: %v", err)
bs.syncLock.Unlock()

continue
}

if latest < r.Number {
// only reset start block if necessary
bs.syncLock.Unlock()
continue
}

if err = setStartBlock(ctx, bs.db, r.Number); err != nil {
log.Errorf("failed to store new start block to %d: %v", r.Number, err)
}

bs.syncLock.Unlock()
case <-bs.stop:
return
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/datacommittee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func TestDataCommittee(t *testing.T) {

// allow the member to startup and synchronize
log.Infof("waiting for delayed member %d to synchronize...", delayedMember.i)
<-time.After(90 * time.Second)
<-time.After(20 * time.Second)

iter, err := getSequenceBatchesEventIterator(clientL1)
require.NoError(t, err)
Expand Down

0 comments on commit ea1741f

Please sign in to comment.