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,
|
||||
blck: deneb.SignedBeaconBlock |
|
||||
electra.SignedBeaconBlock):
|
||||
seq[DataColumnSidecar] =
|
||||
var columns: seq[DataColumnSidecar]
|
||||
seq[ref DataColumnSidecar] =
|
||||
var columns: seq[ref DataColumnSidecar]
|
||||
for i in 0..<NUMBER_OF_COLUMNS:
|
||||
let idx = ColumnIndex(i)
|
||||
if quarantine.data_columns.hasKey(
|
||||
(blck.root, idx)):
|
||||
let value = quarantine.data_columns.getOrDefault((blck.root, idx), default(ref DataColumnSidecar))
|
||||
columns.add(value[])
|
||||
columns.add(value)
|
||||
columns
|
||||
|
||||
func popDataColumns*(
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{.push raises: [].}
|
||||
|
||||
import
|
||||
std/tables,
|
||||
std/[tables, sequtils],
|
||||
stew/results,
|
||||
chronicles, chronos, metrics, taskpools,
|
||||
../networking/eth2_network,
|
||||
|
@ -404,7 +404,7 @@ proc processDataColumnSidecar*(
|
|||
self.blockProcessor[].enqueueBlock(
|
||||
MsgSource.gossip, columnless,
|
||||
Opt.none(BlobSidecars),
|
||||
Opt.some(self.dataColumnQuarantine[].popDataColumns(block_root, forkyBlck)))
|
||||
Opt.some(self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)))
|
||||
elif self.dataColumnQuarantine[].hasEnoughDataColumns(forkyBlck):
|
||||
let
|
||||
columns = self.dataColumnQuarantine[].gatherDataColumns(forkyBlck)
|
||||
|
@ -412,9 +412,9 @@ proc processDataColumnSidecar*(
|
|||
self.dataColumnQuarantine[].supernode:
|
||||
let
|
||||
reconstructed_columns =
|
||||
self.processReconstructionFromGossip(forkyBlck, columns)
|
||||
self.processReconstructionFromGossip(forkyBlck, columns.mapIt(it[]))
|
||||
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.blockProcessor[].enqueueBlock(
|
||||
MsgSource.gossip, columnless,
|
||||
|
|
Loading…
Reference in New Issue