other fixes
This commit is contained in:
parent
3f14f6b4ba
commit
1c1ff21bf9
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue