Commit cd0e9417 authored by Michael de Hoog's avatar Michael de Hoog

Check for start > end too

parent fe7f5b49
...@@ -191,7 +191,7 @@ func (l *BatchSubmitter) loadBlocksIntoState(ctx context.Context) { ...@@ -191,7 +191,7 @@ func (l *BatchSubmitter) loadBlocksIntoState(ctx context.Context) {
if err != nil { if err != nil {
l.log.Warn("Error calculating L2 block range", "err", err) l.log.Warn("Error calculating L2 block range", "err", err)
return return
} else if start.Number == end.Number { } else if start.Number >= end.Number {
return return
} }
...@@ -212,15 +212,13 @@ func (l *BatchSubmitter) loadBlocksIntoState(ctx context.Context) { ...@@ -212,15 +212,13 @@ func (l *BatchSubmitter) loadBlocksIntoState(ctx context.Context) {
latestBlock = block latestBlock = block
} }
if latestBlock != nil { l2ref, err := derive.L2BlockToBlockRef(latestBlock, &l.Rollup.Genesis)
l2ref, err := derive.L2BlockToBlockRef(latestBlock, &l.Rollup.Genesis) if err != nil {
if err != nil { l.log.Warn("Invalid L2 block loaded into state", "err", err)
l.log.Warn("Invalid L2 block loaded into state", "err", err) return
return
}
l.metr.RecordL2BlocksLoaded(l2ref)
} }
l.metr.RecordL2BlocksLoaded(l2ref)
} }
// loadBlockIntoState fetches & stores a single block into `state`. It returns the block it loaded. // loadBlockIntoState fetches & stores a single block into `state`. It returns the block it loaded.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment