Skip to content

Commit bc3d57a

Browse files
committed
synchronous again
1 parent 4cec38e commit bc3d57a

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

block/internal/syncing/syncer.go

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -240,37 +240,16 @@ func (s *Syncer) syncLoop() {
240240
// Backoff control when DA replies with errors
241241
nextDARequestAt := &time.Time{}
242242

243-
blockTicker := time.NewTicker(s.config.Node.BlockTime.Duration)
244-
defer blockTicker.Stop()
245-
246243
for {
247-
wg := sync.WaitGroup{}
248-
249244
select {
250245
case <-s.ctx.Done():
251246
return
252247
default:
253248
}
254-
wg.Add(1)
255-
go func() {
256-
defer wg.Done()
257-
s.processPendingEvents()
258-
}()
259-
260-
wg.Add(1)
261-
go func() {
262-
defer wg.Done()
263-
s.tryFetchFromP2P()
264-
}()
265-
266-
wg.Add(1)
267-
go func() {
268-
defer wg.Done()
269-
s.tryFetchFromDA(nextDARequestAt)
270-
}()
271-
272-
// wait for pending events processing, p2p and da fetching
273-
wg.Wait()
249+
250+
s.processPendingEvents()
251+
s.tryFetchFromP2P()
252+
s.tryFetchFromDA(nextDARequestAt)
274253

275254
// Prevent busy-waiting when no events are processed
276255
select {

0 commit comments

Comments
 (0)