Skip to content

Commit

Permalink
remove costly select
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Oct 6, 2023
1 parent dc900b6 commit 91f0401
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions go/enclave/components/batch_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,7 @@ func (br *batchRegistry) OnBatchExecuted(batch *core.Batch, receipts types.Recei
}

func (br *batchRegistry) HasGenesisBatch() (bool, error) {
genesisBatchStored := true
_, err := br.storage.FetchHeadBatch()
if err != nil {
if !errors.Is(err, errutil.ErrNotFound) {
return false, fmt.Errorf("could not retrieve current head batch. Cause: %w", err)
}
genesisBatchStored = false
}

return genesisBatchStored, nil
return br.headBatchSeq.Uint64() > common.L2GenesisSeqNo, nil
}

func (br *batchRegistry) BatchesAfter(batchSeqNo uint64, upToL1Height uint64, rollupLimiter limiters.RollupLimiter) ([]*core.Batch, []*types.Block, error) {
Expand Down

0 comments on commit 91f0401

Please sign in to comment.