Skip to content

Commit e0deb81

Browse files
authored
Remove break loop condition in batcher (EspressoSystems#733)
1 parent c275273 commit e0deb81

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arbnode/batch_poster.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,6 @@ func (b *BatchPoster) MaybePostSequencerBatch(ctx context.Context) (bool, error)
20812081
}
20822082

20832083
var getNextMessage func() (*arbostypes.MessageWithMetadata, error)
2084-
var breakLoopWhenErrorOccurs bool
20852084

20862085
if b.espressoStreamer == nil {
20872086
getNextMessage = func() (*arbostypes.MessageWithMetadata, error) {
@@ -2091,7 +2090,6 @@ func (b *BatchPoster) MaybePostSequencerBatch(ctx context.Context) (bool, error)
20912090
}
20922091
return msg, nil
20932092
}
2094-
breakLoopWhenErrorOccurs = false
20952093
} else {
20962094
getNextMessage = func() (*arbostypes.MessageWithMetadata, error) {
20972095
espressoMsg := b.espressoStreamer.Next(ctx)
@@ -2100,7 +2098,6 @@ func (b *BatchPoster) MaybePostSequencerBatch(ctx context.Context) (bool, error)
21002098
}
21012099
return &espressoMsg.MessageWithMeta, nil
21022100
}
2103-
breakLoopWhenErrorOccurs = true
21042101
}
21052102

21062103
if b.building.firstDelayedMsg != nil {
@@ -2114,11 +2111,8 @@ func (b *BatchPoster) MaybePostSequencerBatch(ctx context.Context) (bool, error)
21142111
for b.building.msgCount < msgCount {
21152112
msg, err := getNextMessage()
21162113
if err != nil {
2117-
if breakLoopWhenErrorOccurs {
2118-
log.Error("error getting next message", "err", err, "pos", b.building.msgCount)
2119-
break
2120-
}
2121-
return false, err
2114+
log.Error("error getting next message", "err", err, "pos", b.building.msgCount)
2115+
break
21222116
}
21232117

21242118
if msg.Message.Header.BlockNumber < l1BoundMinBlockNumberWithBypass || msg.Message.Header.Timestamp < l1BoundMinTimestampWithBypass {

0 commit comments

Comments
 (0)