Skip to content

Commit 6710109

Browse files
committed
fix: correctly log dropped flashblocks
1 parent 7dc460b commit 6710109

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/l2/block_inspector.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,12 @@ func (bi *BlockInspector) processBlock(ctx context.Context, blockNumber uint64)
736736
attribute.KeyValue{Key: "kind", Value: attribute.StringValue("l2")},
737737
attribute.KeyValue{Key: "network_id", Value: attribute.Int64Value(bi.cfg.chainID.Int64())},
738738
))
739-
for idx := fb.flashblock.Index; idx < len(flashblocks); idx++ {
740-
l.Warn("Flashblock was dropped",
741-
zap.Any("flashblock", fb.flashblock),
742-
)
739+
for idx := fb.flashblock.Index + 1; idx < len(flashblocks); idx++ {
740+
if dfb := flashblocks[idx]; dfb != nil {
741+
l.Warn("Flashblock was dropped",
742+
zap.Any("flashblock", fb.flashblock),
743+
)
744+
}
743745
}
744746
}
745747

0 commit comments

Comments
 (0)