save iterations for popDataColumns

This commit is contained in:
Agnish Ghosh 2024-10-13 01:36:07 +05:30
parent 4a5995797f
commit 3b4e72c9e4
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 11 additions and 1 deletions

View File

@ -103,7 +103,17 @@ func popDataColumns*(
blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock): blck: deneb.SignedBeaconBlock | electra.SignedBeaconBlock):
seq[ref DataColumnSidecar] = seq[ref DataColumnSidecar] =
var r: seq[ref DataColumnSidecar] var r: seq[ref DataColumnSidecar]
for idx in 0..<NUMBER_OF_COLUMNS: let
localSubnetCount =
if quarantine.supernode:
DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64
else:
CUSTODY_REQUIREMENT.uint64
localCustodyColumns =
get_custody_columns(quarantine.nodeid,
max(SAMPLES_PER_SLOT.uint64,
localSubnetCount))
for idx in localCustodyColumns:
var c: ref DataColumnSidecar var c: ref DataColumnSidecar
if quarantine.data_columns.pop((digest, ColumnIndex idx), c): if quarantine.data_columns.pop((digest, ColumnIndex idx), c):
r.add(c) r.add(c)