fixed quarantine issue for full nodes

This commit is contained in:
Agnish Ghosh 2024-10-05 05:19:14 +05:30
parent 0a31b0ddd1
commit 19ed1bd28c
1 changed files with 10 additions and 3 deletions

View File

@ -89,18 +89,25 @@ func checkForInitialDcSidecars*(quarantine: DataColumnQuarantine,
func hasDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool =
var counter = 0
for idx in 0..<NUMBER_OF_COLUMNS:
if (blck.root, ColumnIndex idx) notin quarantine.data_columns:
return false
true
inc counter
if counter == max(SAMPLES_PER_SLOT, CUSTODY_REQUIREMENT) or
counter == NUMBER_OF_COLUMNS:
return true
false
func dataColumnFetchRecord*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): DataColumnFetchRecord =
var indices: seq[ColumnIndex]
for i in 0..<NUMBER_OF_COLUMNS:
let idx = ColumnIndex(i)
if not quarantine.data_columns.hasKey(
if quarantine.data_columns.hasKey(
(blck.root, idx)):
continue
else:
indices.add(idx)
DataColumnFetchRecord(block_root: blck.root, indices: indices)