have gather data columns in enqueue block
This commit is contained in:
parent
11508c41c2
commit
6fc5fc79ed
|
@ -88,14 +88,14 @@ func accumulateDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
func gatherDataColumns*(quarantine: DataColumnQuarantine,
|
func gatherDataColumns*(quarantine: DataColumnQuarantine,
|
||||||
blck: deneb.SignedBeaconBlock |
|
blck: deneb.SignedBeaconBlock |
|
||||||
electra.SignedBeaconBlock):
|
electra.SignedBeaconBlock):
|
||||||
seq[DataColumnSidecar] =
|
seq[ref DataColumnSidecar] =
|
||||||
var columns: seq[DataColumnSidecar]
|
var columns: seq[ref DataColumnSidecar]
|
||||||
for i in 0..<NUMBER_OF_COLUMNS:
|
for i in 0..<NUMBER_OF_COLUMNS:
|
||||||
let idx = ColumnIndex(i)
|
let idx = ColumnIndex(i)
|
||||||
if quarantine.data_columns.hasKey(
|
if quarantine.data_columns.hasKey(
|
||||||
(blck.root, idx)):
|
(blck.root, idx)):
|
||||||
let value = quarantine.data_columns.getOrDefault((blck.root, idx), default(ref DataColumnSidecar))
|
let value = quarantine.data_columns.getOrDefault((blck.root, idx), default(ref DataColumnSidecar))
|
||||||
columns.add(value[])
|
columns.add(value)
|
||||||
columns
|
columns
|
||||||
|
|
||||||
func popDataColumns*(
|
func popDataColumns*(
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/tables,
|
std/[tables, sequtils],
|
||||||
stew/results,
|
stew/results,
|
||||||
chronicles, chronos, metrics, taskpools,
|
chronicles, chronos, metrics, taskpools,
|
||||||
../networking/eth2_network,
|
../networking/eth2_network,
|
||||||
|
@ -404,7 +404,7 @@ proc processDataColumnSidecar*(
|
||||||
self.blockProcessor[].enqueueBlock(
|
self.blockProcessor[].enqueueBlock(
|
||||||
MsgSource.gossip, columnless,
|
MsgSource.gossip, columnless,
|
||||||
Opt.none(BlobSidecars),
|
Opt.none(BlobSidecars),
|
||||||
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
|
Opt.some(self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)))
|
||||||
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
|
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
|
||||||
let
|
let
|
||||||
columns = self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)
|
columns = self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)
|
||||||
|
@ -412,9 +412,9 @@ proc processDataColumnSidecar*(
|
||||||
self.dataColumnQuarantine[].supernode:
|
self.dataColumnQuarantine[].supernode:
|
||||||
let
|
let
|
||||||
reconstructed_columns =
|
reconstructed_columns =
|
||||||
self.processReconstructionFromGossip(forkyBlck, columns)
|
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):
|
if rc notin self.dataColumnQuarantine[].gatherDataColumns(forkyBlck).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