Skip to content

Commit

Permalink
Trigger pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman committed Jun 12, 2024
1 parent 0e5a9d3 commit e75cae2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dataavailability/dataavailability.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func (d *DataAvailability) GetBatchL2Data(batchNums []uint64, batchHashes []comm
if len(batchNums) != len(batchHashes) {
return nil, fmt.Errorf(invalidBatchRetrievalArgs, len(batchNums), len(batchHashes))
}

fmt.Println("d.dataSourcePriority:", d.dataSourcePriority)

for _, p := range d.dataSourcePriority {
switch p {
case Local:
Expand Down Expand Up @@ -117,6 +120,7 @@ func (d *DataAvailability) GetBatchL2Data(batchNums []uint64, batchHashes []comm
log.Warnf("invalid data retrieval priority: %s", p)
}
}

return nil, errors.New("failed to retrieve l2 batch data")
}

Expand Down
3 changes: 3 additions & 0 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -1484,14 +1484,17 @@ func getBatchL2Data(da dataavailability.BatchDataProvider, batchInfos []batchInf
if err != nil {
return nil, err
}

if len(batchL2Data) != len(batchNums) {
return nil,
fmt.Errorf("failed to retrieve all batch data. Expected %d, got %d", len(batchNums), len(batchL2Data))
}

data := make(map[uint64][]byte)
for i, bn := range batchNums {
data[bn] = batchL2Data[i]
}

return data, nil
}

Expand Down

0 comments on commit e75cae2

Please sign in to comment.