Skip to content

Commit

Permalink
err wait only sequencer
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Aug 12, 2024
1 parent 06231db commit 6c522b4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func (m *Manager) Start(ctx context.Context) error {
}
}

eg, ctx := errgroup.WithContext(ctx)

if isSequencer {
eg, ctx := errgroup.WithContext(ctx)

// Sequencer must wait till DA is synced to start submitting blobs
<-m.DAClient.Synced()
nBytes := m.GetUnsubmittedBytes()
Expand All @@ -164,6 +164,10 @@ func (m *Manager) Start(ctx context.Context) error {
bytesProducedC <- nBytes
return m.ProduceBlockLoop(ctx, bytesProducedC)
})
go func() {
_ = eg.Wait() // errors are already logged
m.logger.Info("Block manager err group finished.")
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism

} else {
// Full-nodes can sync from DA but it is not necessary to wait for it, since it can sync from P2P as well in parallel.
Expand All @@ -181,11 +185,6 @@ func (m *Manager) Start(ctx context.Context) error {
go uevent.MustSubscribe(ctx, m.Pubsub, "applyBlockSyncBlocksLoop", p2p.EventQueryNewBlockSyncBlock, m.onReceivedBlock, m.logger)
}

go func() {
_ = eg.Wait() // errors are already logged
m.logger.Info("Block manager err group finished.")
}()

return nil
}

Expand Down

0 comments on commit 6c522b4

Please sign in to comment.