other fixes

This commit is contained in:
Agnish Ghosh 2024-10-14 01:20:51 +05:30
parent 3f14f6b4ba
commit 1c1ff21bf9
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
2 changed files with 8 additions and 9 deletions

View File

@ -86,8 +86,7 @@ func accumulateDataColumns*(quarantine: DataColumnQuarantine,
indices
func gatherDataColumns*(quarantine: DataColumnQuarantine,
blck: deneb.SignedBeaconBlock |
electra.SignedBeaconBlock):
digest: Eth2Digest):
seq[ref DataColumnSidecar] =
var columns: seq[ref DataColumnSidecar]
let
@ -103,8 +102,8 @@ func gatherDataColumns*(quarantine: DataColumnQuarantine,
for i in localCustodyColumns:
let idx = ColumnIndex(i)
if quarantine.data_columns.hasKey(
(blck.root, idx)):
let value = quarantine.data_columns.getOrDefault((blck.root, idx), default(ref DataColumnSidecar))
(digest, idx)):
let value = quarantine.data_columns.getOrDefault((digest, idx), default(ref DataColumnSidecar))
columns.add(value)
columns
@ -176,7 +175,7 @@ func hasEnoughDataColumns*(quarantine: DataColumnQuarantine,
localSubnetCount))
if quarantine.supernode:
let
collectedColumns = quarantine.gatherDataColumns(blck)
collectedColumns = quarantine.gatherDataColumns(blck.root)
if collectedColumns.len >= (localCustodyColumns.len div 2):
return true
else:

View File

@ -398,12 +398,12 @@ proc processDataColumnSidecar*(
let columnless = o.unsafeGet()
withBlck(columnless):
when consensusFork >= ConsensusFork.Deneb:
if self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).len ==
if self.dataColumnQuarantine[].gatherDataColumns(block_root).len ==
max(SAMPLES_PER_SLOT, CUSTODY_REQUIREMENT) and
self.dataColumnQuarantine[].hasMissingDataColumns(forkyBlck):
if self.dataColumnQuarantine[].supernode == false:
let columns =
self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).mapIt(it[])
self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[])
for gdc in columns:
self.dataColumnQuarantine[].put(newClone(gdc))
self.blockProcessor[].enqueueBlock(
@ -412,14 +412,14 @@ proc processDataColumnSidecar*(
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
let
columns = self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)
columns = self.dataColumnQuarantine[].gatherDataColumns(block_root)
if columns.len >= (NUMBER_OF_COLUMNS div 2) and
self.dataColumnQuarantine[].supernode:
let
reconstructed_columns =
self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[]))
for rc in reconstructed_columns.get:
if rc notin self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).mapIt(it[]):
if rc notin self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[]):
self.dataColumnQuarantine[].put(newClone(rc))
self.blockProcessor[].enqueueBlock(
MsgSource.gossip, columnless,