refine missing data columns logic

This commit is contained in:
Agnish Ghosh 2024-10-12 17:27:35 +05:30
parent dfcc89138f
commit 71914ac8a7
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 9 additions and 2 deletions

View File

@ -119,6 +119,7 @@ func checkForInitialDcSidecars*(quarantine: DataColumnQuarantine,
func hasMissingDataColumns*(quarantine: DataColumnQuarantine, func hasMissingDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool = blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool =
var counter = 0
let let
localSubnetCount = localSubnetCount =
if quarantine.supernode: if quarantine.supernode:
@ -132,8 +133,14 @@ func hasMissingDataColumns*(quarantine: DataColumnQuarantine,
for i in localCustodyColumns: for i in localCustodyColumns:
if (blck.root, ColumnIndex i) notin quarantine.data_columns and if (blck.root, ColumnIndex i) notin quarantine.data_columns and
len(blck.message.body.blob_kzg_commitments) != 0: len(blck.message.body.blob_kzg_commitments) != 0:
inc counter
if quarantine.supernode and coutner == 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, func hasEnoughDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool = blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): bool =