Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Sep 14, 2023
1 parent be35d4b commit ce92d32
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions go/enclave/components/batch_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ func (br *batchRegistry) BatchesAfter(batchSeqNo uint64, upToL1Height uint64, ro
currentBatchSeq++
}

// Sanity check that the rollup includes consecutive batches (according to the seqNo)
current := resultBatches[0].SeqNo().Uint64()
for i, b := range resultBatches {
if current+uint64(i) != b.SeqNo().Uint64() {
return nil, fmt.Errorf("created invalid rollup with batches out of sequence")
if len(resultBatches) > 0 {
// Sanity check that the rollup includes consecutive batches (according to the seqNo)
current := resultBatches[0].SeqNo().Uint64()
for i, b := range resultBatches {
if current+uint64(i) != b.SeqNo().Uint64() {
return nil, fmt.Errorf("created invalid rollup with batches out of sequence")
}
}
}

Expand Down

0 comments on commit ce92d32

Please sign in to comment.