refine missing data columns logic
This commit is contained in:
parent
dfcc89138f
commit
71914ac8a7
|
@ -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 =
|
||||||
|
|
Loading…
Reference in New Issue