@@ -417,14 +417,24 @@ proc initFullNode(
417417 blobQuarantine = newClone (BlobQuarantine .init (
418418 dag.cfg, dag.db.getQuarantineDB (), 10 , onBlobSidecarAdded))
419419 supernode = node.config.peerdasSupernode or node.config.debugPeerdasSupernode
420+ lightSupernode = node.config.lightSupernode
420421 localCustodyGroups =
421422 if supernode:
422423 dag.cfg.NUMBER_OF_CUSTODY_GROUPS
424+ elif lightSupernode:
425+ dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2
423426 else :
424427 dag.cfg.CUSTODY_REQUIREMENT
425428 custodyColumns =
426- dag.cfg.resolve_columns_from_custody_groups (
427- node.network.nodeId, localCustodyGroups)
429+ if node.config.lightSupernode:
430+ # Just the first half of custody columns
431+ var res: HashSet [ColumnIndex ]
432+ for i in 0 ..< dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2 :
433+ res.incl ColumnIndex (i)
434+ res
435+ else :
436+ dag.cfg.resolve_columns_from_custody_groups (
437+ node.network.nodeId, localCustodyGroups)
428438
429439 var sortedColumns = custodyColumns.toSeq ()
430440 sort (sortedColumns)
@@ -1294,20 +1304,33 @@ func getSyncCommitteeSubnets(node: BeaconNode, epoch: Epoch): SyncnetBits =
12941304 subnets + node.getNextSyncCommitteeSubnets (epoch)
12951305
12961306func readCustodyGroupSubnets (node: BeaconNode ): uint64 =
1297- let vcus_count = node.dataColumnQuarantine.custodyColumns.lenu64
1307+ let
1308+ custodyGroups = node.dag.cfg.NUMBER_OF_CUSTODY_GROUPS
1309+ vcus_count = node.dataColumnQuarantine.custodyColumns.lenu64
12981310 if node.config.peerdasSupernode or node.config.debugPeerdasSupernode:
1299- node.dag.cfg.NUMBER_OF_CUSTODY_GROUPS
1311+ custodyGroups
1312+ elif node.config.lightSupernode:
1313+ custodyGroups div 2
13001314 elif vcus_count > node.dag.cfg.CUSTODY_REQUIREMENT :
13011315 vcus_count
13021316 else :
13031317 node.dag.cfg.CUSTODY_REQUIREMENT
13041318
13051319proc updateDataColumnSidecarHandlers (node: BeaconNode , gossipEpoch: Epoch ) =
13061320 let
1321+ custody_groups = node.dag.cfg.NUMBER_OF_CUSTODY_GROUPS
13071322 forkDigest = node.dag.forkDigests[].atEpoch (gossipEpoch, node.dag.cfg)
13081323 targetSubnets = node.readCustodyGroupSubnets ()
1309- custody = node.dag.cfg.get_custody_groups (
1310- node.network.nodeId, targetSubnets.uint64 )
1324+ custody =
1325+ if node.config.lightSupernode:
1326+ # 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 :
1329+ res.add CustodyIndex (i)
1330+ res
1331+ else :
1332+ node.dag.cfg.get_custody_groups (
1333+ node.network.nodeId, targetSubnets.uint64 )
13111334
13121335 for i in custody:
13131336 let topic = getDataColumnSidecarTopic (forkDigest, i)
@@ -1736,10 +1759,17 @@ proc reconstructDataColumns(node: BeaconNode, slot: Slot) =
17361759 # https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/fulu/das-core.md#reconstruction-and-cross-seeding
17371760 # "If the node obtains 50%+ of all the columns, it SHOULD reconstruct the
17381761 # full data matrix via the recover_matrix helper."
1762+ if node.config.lightSupernode:
1763+ return
1764+
17391765 if node.dataColumnQuarantine.custodyColumns.lenu64 <
17401766 node.dag.cfg.NUMBER_OF_CUSTODY_GROUPS div 2 :
17411767 return
17421768
1769+ # Currently, this logic is broken
1770+ if true :
1771+ return
1772+
17431773 logScope:
17441774 slot = slot
17451775
@@ -2014,6 +2044,7 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
20142044
20152045 if (not node.config.peerdasSupernode) and
20162046 (not node.config.debugPeerdasSupernode) and
2047+ (not node.config.lightSupernode) and
20172048 node.dataColumnQuarantine[].len == 0 and
20182049 node.attachedValidatorBalanceTotal > 0 .Gwei :
20192050 # Detect new validator custody at the last slot of every epoch
0 commit comments