Skip to content

Commit

Permalink
fix injected batch sanity check (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Aug 21, 2024
1 parent 6655a2d commit 0390e60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (a *Aggregator) handleReceivedDataStream(entry *datastreamer.FileEntry, cli
}

// Encode batch
if a.currentStreamBatch.Type != datastream.BatchType_BATCH_TYPE_INVALID {
if a.currentStreamBatch.Type != datastream.BatchType_BATCH_TYPE_INVALID && a.currentStreamBatch.Type != datastream.BatchType_BATCH_TYPE_INJECTED {
batchl2Data, err = state.EncodeBatchV2(&a.currentStreamBatchRaw)
if err != nil {
log.Errorf("Error encoding batch: %v", err)
Expand All @@ -319,7 +319,7 @@ func (a *Aggregator) handleReceivedDataStream(entry *datastreamer.FileEntry, cli
}

// If the batch is marked as Invalid in the DS we enforce retrieve the data from L1
if a.cfg.UseL1BatchData || a.currentStreamBatch.Type == datastream.BatchType_BATCH_TYPE_INVALID {
if a.cfg.UseL1BatchData || a.currentStreamBatch.Type == datastream.BatchType_BATCH_TYPE_INVALID || a.currentStreamBatch.Type == datastream.BatchType_BATCH_TYPE_INJECTED {
a.currentStreamBatch.BatchL2Data = virtualBatch.BatchL2Data
} else {
a.currentStreamBatch.BatchL2Data = batchl2Data
Expand Down

0 comments on commit 0390e60

Please sign in to comment.