Skip to content

Commit

Permalink
fix(manager): full-node syncing fix (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored and omritoptix committed Aug 13, 2024
1 parent 8abe4f9 commit 0dba52d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ 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 +165,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.")
}()

} 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 +186,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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ require (
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/tools v0.18.0 // indirect
pgregory.net/rapid v1.1.0 // indirect
pgregory.net/rapid v1.1.0
)

replace (
Expand Down

0 comments on commit 0dba52d

Please sign in to comment.