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, max(SAMPLES_PER_SLOT.uint64,
localSubnetCount)) localSubnetCount))
if quarantine.supernode: if quarantine.supernode:
for i in localCustodyColumns: let
if (blck.root, ColumnIndex i) in quarantine.data_columns: collectedColumns = quarantine.gatherDataColumns(blck)
inc counter if collectedColumns.len >= (localCustodyColumns.len div 2):
if counter >= (NUMBER_OF_COLUMNS div 2):
return true return true
else: else:
for i in localCustodyColumns: for i in localCustodyColumns:
if (blck.root, ColumnIndex i) notin quarantine.data_columns: if (blck.root, ColumnIndex i) notin quarantine.data_columns:
return false return false
true else:
return true
func dataColumnFetchRecord*(quarantine: DataColumnQuarantine, func dataColumnFetchRecord*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): DataColumnFetchRecord = 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") return err ("DataColumns do not have the same length")
var var
recovered_cps = newSeqOfCap[CellsAndProofs](blobCount) recovered_cps = newSeq[CellsAndProofs]
recovered_cps.setLen(blobCount)
for blobIdx in 0 ..< blobCount: for blobIdx in 0 ..< blobCount:
var var
@ -199,11 +200,14 @@ proc recover_cells_and_proofs*(
cell_ids = newSeqOfCap[CellID](columnCount) cell_ids = newSeqOfCap[CellID](columnCount)
ckzgCells = newSeqOfCap[KzgCell](columnCount) ckzgCells = newSeqOfCap[KzgCell](columnCount)
for i in 0..<data_columns.len: cell_ids.setLen(0)
cell_ids.add data_columns[i].index ckzgCells.setLen(0)
for col in data_columns:
cell_ids.add col.index
let let
column = data_columns[i].column column = col.column
cell = column[bIdx] cell = column[bIdx]
ckzgCells.add cell ckzgCells.add cell