Skip to content

Commit 1c55749

Browse files
authored
improve column batch addition from getBlobs (#7725)
* improve column batch addition from getBlobs * review * add fulu.DataColumnSidecar, why is it redefined for Gloas anyway? * resolve issues
1 parent 87157e0 commit 1c55749

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

beacon_chain/nimbus_beacon_node.nim

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,9 +2110,20 @@ proc attemptGetBlobs(node: BeaconNode,
21102110
flat_proof)
21112111
# Send notification to event stream
21122112
# and add these columns to column quarantine
2113+
let MaxColsPerPut = (node.dag.cfg.NUMBER_OF_COLUMNS.int div 2) + 1
2114+
2115+
var batch = newSeqOfCap[ref fulu.DataColumnSidecar](MaxColsPerPut)
2116+
21132117
for col in recovered_columns:
2114-
if col.index in node.dataColumnQuarantine[].custodyColumns:
2115-
node.dataColumnQuarantine[].put(forkyBlck.root, newClone(col))
2118+
if col.index notin node.dataColumnQuarantine[].custodyColumns:
2119+
continue
2120+
2121+
batch.add(newClone(col))
2122+
if batch.len == MaxColsPerPut:
2123+
break
2124+
2125+
if batch.len > 0:
2126+
node.dataColumnQuarantine[].put(forkyBlck.root, batch)
21162127

21172128
proc onSlotStart(node: BeaconNode, wallTime: BeaconTime,
21182129
lastSlot: Slot): Future[bool] {.async.} =

0 commit comments

Comments
 (0)