Skip to content

Commit

Permalink
Merge pull request #2025 from OffchainLabs/ensure-backlog-populated
Browse files Browse the repository at this point in the history
Ensure sequencer backlog is populated before any clients connect
  • Loading branch information
PlasmaPower authored Dec 16, 2023
2 parents df7b287 + c12e5c2 commit 9b19f6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,9 @@ func (n *Node) Start(ctx context.Context) error {
return fmt.Errorf("error initializing feed broadcast server: %w", err)
}
}
if n.InboxTracker != nil && n.BroadcastServer != nil && config.Sequencer && !config.SeqCoordinator.Enable {
// Normally, the sequencer would populate the feed backlog when it acquires the lockout.
// However, if the sequencer coordinator is not enabled, we must populate the backlog on startup.
if n.InboxTracker != nil && n.BroadcastServer != nil && config.Sequencer {
// Even if the sequencer coordinator will populate this backlog,
// we want to make sure it's populated before any clients connect.
err = n.InboxTracker.PopulateFeedBacklog(n.BroadcastServer)
if err != nil {
return fmt.Errorf("error populating feed backlog on startup: %w", err)
Expand Down
1 change: 1 addition & 0 deletions broadcaster/backlog/backlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (b *backlog) Append(bm *m.BroadcastMessage) error {
segment = newBacklogSegment()
b.head.Store(segment)
b.tail.Store(segment)
confirmedSequenceNumberGauge.Update(int64(msg.SequenceNumber))
}

prevMsgIdx := segment.End()
Expand Down

0 comments on commit 9b19f6c

Please sign in to comment.