other fixes
This commit is contained in:
parent
3f14f6b4ba
commit
1c1ff21bf9
|
@ -86,8 +86,7 @@ func accumulateDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
indices
|
indices
|
||||||
|
|
||||||
func gatherDataColumns*(quarantine: DataColumnQuarantine,
|
func gatherDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
blck: deneb.SignedBeaconBlock |
|
digest: Eth2Digest):
|
||||||
electra.SignedBeaconBlock):
|
|
||||||
seq[ref DataColumnSidecar] =
|
seq[ref DataColumnSidecar] =
|
||||||
var columns: seq[ref DataColumnSidecar]
|
var columns: seq[ref DataColumnSidecar]
|
||||||
let
|
let
|
||||||
|
@ -103,8 +102,8 @@ func gatherDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
for i in localCustodyColumns:
|
for i in localCustodyColumns:
|
||||||
let idx = ColumnIndex(i)
|
let idx = ColumnIndex(i)
|
||||||
if quarantine.data_columns.hasKey(
|
if quarantine.data_columns.hasKey(
|
||||||
(blck.root, idx)):
|
(digest, idx)):
|
||||||
let value = quarantine.data_columns.getOrDefault((blck.root, idx), default(ref DataColumnSidecar))
|
let value = quarantine.data_columns.getOrDefault((digest, idx), default(ref DataColumnSidecar))
|
||||||
columns.add(value)
|
columns.add(value)
|
||||||
columns
|
columns
|
||||||
|
|
||||||
|
@ -176,7 +175,7 @@ func hasEnoughDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
localSubnetCount))
|
localSubnetCount))
|
||||||
if quarantine.supernode:
|
if quarantine.supernode:
|
||||||
let
|
let
|
||||||
collectedColumns = quarantine.gatherDataColumns(blck)
|
collectedColumns = quarantine.gatherDataColumns(blck.root)
|
||||||
if collectedColumns.len >= (localCustodyColumns.len div 2):
|
if collectedColumns.len >= (localCustodyColumns.len div 2):
|
||||||
return true
|
return true
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -398,12 +398,12 @@ proc processDataColumnSidecar*(
|
||||||
let columnless = o.unsafeGet()
|
let columnless = o.unsafeGet()
|
||||||
withBlck(columnless):
|
withBlck(columnless):
|
||||||
when consensusFork >= ConsensusFork.Deneb:
|
when consensusFork >= ConsensusFork.Deneb:
|
||||||
if self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).len ==
|
if self.dataColumnQuarantine[].gatherDataColumns(block_root).len ==
|
||||||
max(SAMPLES_PER_SLOT, CUSTODY_REQUIREMENT) and
|
max(SAMPLES_PER_SLOT, CUSTODY_REQUIREMENT) and
|
||||||
self.dataColumnQuarantine[].hasMissingDataColumns(forkyBlck):
|
self.dataColumnQuarantine[].hasMissingDataColumns(forkyBlck):
|
||||||
if self.dataColumnQuarantine[].supernode == false:
|
if self.dataColumnQuarantine[].supernode == false:
|
||||||
let columns =
|
let columns =
|
||||||
self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).mapIt(it[])
|
self.dataColumnQuarantine[].gatherDataColumns(block_root).mapIt(it[])
|
||||||
for gdc in columns:
|
for gdc in columns:
|
||||||
self.dataColumnQuarantine[].put(newClone(gdc))
|
self.dataColumnQuarantine[].put(newClone(gdc))
|
||||||
self.blockProcessor[].enqueueBlock(
|
self.blockProcessor[].enqueueBlock(
|
||||||
|
@ -412,14 +412,14 @@ proc processDataColumnSidecar*(
|
||||||
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
|
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
|
||||||
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
|
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
|
||||||
let
|
let
|
||||||
columns = self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)
|
columns = self.dataColumnQuarantine[].gatherDataColumns(block_root)
|
||||||
if columns.len >= (NUMBER_OF_COLUMNS div 2) and
|
if columns.len >= (NUMBER_OF_COLUMNS div 2) and
|
||||||
self.dataColumnQuarantine[].supernode:
|
self.dataColumnQuarantine[].supernode:
|
||||||
let
|
let
|
||||||
reconstructed_columns =
|
reconstructed_columns =
|
||||||
self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[]))
|
self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[]))
|
||||||
for rc in reconstructed_columns.get:
|
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.dataColumnQuarantine[].put(newClone(rc))
|
||||||
self.blockProcessor[].enqueueBlock(
|
self.blockProcessor[].enqueueBlock(
|
||||||
MsgSource.gossip, columnless,
|
MsgSource.gossip, columnless,
|
||||||
|
|
Loading…
Reference in New Issue