mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-01 01:08:27 +00:00
cells and proofs fix
This commit is contained in:
parent
e50470e94c
commit
05b1de93bd
@ -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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user