Skip to content

Commit daa1ff8

Browse files
authored
fix lsupernode logic (#7763)
* fix lsupernode logic * fix
1 parent 8b2923a commit daa1ff8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

beacon_chain/nimbus_beacon_node.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,14 @@ proc initFullNode(
422422
if supernode:
423423
dag.cfg.NUMBER_OF_CUSTODY_GROUPS
424424
elif lightSupernode:
425-
dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2
425+
(dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2) + 1
426426
else:
427427
dag.cfg.CUSTODY_REQUIREMENT
428428
custodyColumns =
429429
if node.config.lightSupernode:
430430
# Just the first half of custody columns
431431
var res: HashSet[ColumnIndex]
432-
for i in 0..<dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2:
432+
for i in 0..<(dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2) + 1:
433433
res.incl ColumnIndex(i)
434434
res
435435
else:
@@ -1310,7 +1310,7 @@ func readCustodyGroupSubnets(node: BeaconNode): uint64 =
13101310
if node.config.peerdasSupernode or node.config.debugPeerdasSupernode:
13111311
custodyGroups
13121312
elif node.config.lightSupernode:
1313-
custodyGroups div 2
1313+
(custodyGroups div 2) + 1
13141314
elif vcus_count > node.dag.cfg.CUSTODY_REQUIREMENT:
13151315
vcus_count
13161316
else:
@@ -1324,8 +1324,8 @@ proc updateDataColumnSidecarHandlers(node: BeaconNode, gossipEpoch: Epoch) =
13241324
custody =
13251325
if node.config.lightSupernode:
13261326
# Light supernode serves only half of the custody groups
1327-
var res = newSeqOfCap[CustodyIndex](custody_groups div 2)
1328-
for i in 0..<custody_groups div 2:
1327+
var res = newSeqOfCap[CustodyIndex]((custody_groups div 2) + 1)
1328+
for i in 0..<(custody_groups div 2) + 1:
13291329
res.add CustodyIndex(i)
13301330
res
13311331
else:

0 commit comments

Comments
 (0)