cells and proofs fix

This commit is contained in:
Agnish Ghosh 2024-10-11 02:22:02 +05:30
parent e50470e94c
commit 05b1de93bd

View File

@ -191,29 +191,29 @@ proc recover_cells_and_proofs*(
return err ("DataColumns do not have the same length") return err ("DataColumns do not have the same length")
var var
recovered_cps = newSeq[CellsAndProofs](blobCount) recovered_cps = newSeqOfCap[CellsAndProofs](blobCount)
for blobIdx in 0 ..< blobCount: for blobIdx in 0 ..< blobCount:
var var
bIdx = blobIdx bIdx = blobIdx
cell_ids = newSeq[CellID](columnCount) cell_ids = newSeqOfCap[CellID](columnCount)
ckzgCells = newSeq[KzgCell](columnCount) ckzgCells = newSeqOfCap[KzgCell](columnCount)
for i in 0..<data_columns.len: for i in 0..<data_columns.len:
cell_ids[i] = data_columns[i].index cell_ids.add data_columns[i].index
let let
column = data_columns[i].column column = data_columns[i].column
cell = column[bIdx] cell = column[bIdx]
ckzgCells[i] = cell ckzgCells.add cell
# Recovering the cells and proofs # Recovering the cells and proofs
let recovered_cells_and_proofs = recoverCellsAndKzgProofs(cell_ids, ckzgCells) let recovered_cells_and_proofs = recoverCellsAndKzgProofs(cell_ids, ckzgCells)
if not recovered_cells_and_proofs.isOk: if not recovered_cells_and_proofs.isOk:
return err("Issue with computing cells and proofs!") return err("Issue with computing cells and proofs!")
recovered_cps[blobIdx] = recovered_cells_and_proofs.get recovered_cps.add recovered_cells_and_proofs.get
ok(recovered_cps) ok(recovered_cps)