This commit is contained in:
Agnish Ghosh 2024-10-11 03:22:26 +05:30
parent b92d1dcfbc
commit 35f0636101
2 changed files with 13 additions and 9 deletions

View File

@ -130,16 +130,16 @@ func hasDataColumns*(quarantine: DataColumnQuarantine,
max(SAMPLES_PER_SLOT.uint64,
localSubnetCount))
if quarantine.supernode:
for i in localCustodyColumns:
if (blck.root, ColumnIndex i) in quarantine.data_columns:
inc counter
if counter >= (NUMBER_OF_COLUMNS div 2):
let
collectedColumns = quarantine.gatherDataColumns(blck)
if collectedColumns.len >= (localCustodyColumns.len div 2):
return true
else:
for i in localCustodyColumns:
if (blck.root, ColumnIndex i) notin quarantine.data_columns:
return false
true
else:
return true
func dataColumnFetchRecord*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): DataColumnFetchRecord =

View File

@ -191,7 +191,8 @@ proc recover_cells_and_proofs*(
return err ("DataColumns do not have the same length")
var
recovered_cps = newSeqOfCap[CellsAndProofs](blobCount)
recovered_cps = newSeq[CellsAndProofs]
recovered_cps.setLen(blobCount)
for blobIdx in 0 ..< blobCount:
var
@ -199,11 +200,14 @@ proc recover_cells_and_proofs*(
cell_ids = newSeqOfCap[CellID](columnCount)
ckzgCells = newSeqOfCap[KzgCell](columnCount)
for i in 0..<data_columns.len:
cell_ids.add data_columns[i].index
cell_ids.setLen(0)
ckzgCells.setLen(0)
for col in data_columns:
cell_ids.add col.index
let
column = data_columns[i].column
column = col.column
cell = column[bIdx]
ckzgCells.add cell