check edge cases

This commit is contained in:
Agnish Ghosh 2024-10-13 05:15:57 +05:30
parent 198ac66e2c
commit 11508c41c2
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 3 additions and 10 deletions

View File

@ -129,7 +129,6 @@ func checkForInitialDcSidecars*(quarantine: DataColumnQuarantine,
func hasMissingDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool =
var counter = 0
let
localSubnetCount =
if quarantine.supernode:
@ -141,16 +140,10 @@ func hasMissingDataColumns*(quarantine: DataColumnQuarantine,
max(SAMPLES_PER_SLOT.uint64,
localSubnetCount))
for i in localCustodyColumns:
if (blck.root, ColumnIndex i) in quarantine.data_columns and
if (blck.root, ColumnIndex i) notin quarantine.data_columns and
len(blck.message.body.blob_kzg_commitments) != 0:
inc counter
if quarantine.supernode and counter == NUMBER_OF_COLUMNS:
return true
elif quarantine.supernode == false and
counter == max(SAMPLES_PER_SLOT, CUSTODY_REQUIREMENT):
return true
else:
return false
return false
true
func hasEnoughDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool =