From 237dc3adfbce7cbe8e507687bd9ea3c8ae952cb2 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Sat, 24 Aug 2024 16:41:38 +0530 Subject: [PATCH] subscribe to only those gossips that return via get_custody_column_subnet --- beacon_chain/nimbus_beacon_node.nim | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index f64cfe4b1..c749ee5bd 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -2047,16 +2047,20 @@ proc installMessageValidators(node: BeaconNode) = else: CUSTODY_REQUIREMENT.uint64 - for it in 0'u64 ..< subnetCount: + let dc_subnets = get_custody_column_subnet(node.network.nodeId, subnetCount) + for it in 0'u64 ..< DATA_COLUMN_SIDECAR_SUBNET_COUNT: closureScope: # Needed for inner `proc`; don't lift it out of loop. let subnet_id = it - node.network.addValidator( - getDataColumnSidecarTopic(digest, subnet_id), proc ( - dataColumnSidecar: DataColumnSidecar - ): ValidationResult = - toValidationResult( - node.processor[].processDataColumnSidecar( - MsgSource.gossip, dataColumnSidecar, subnet_id))) + if subnet_id notin dc_subnets.get: + discard + else: + node.network.addValidator( + getDataColumnSidecarTopic(digest, subnet_id), proc ( + dataColumnSidecar: DataColumnSidecar + ): ValidationResult = + toValidationResult( + node.processor[].processDataColumnSidecar( + MsgSource.gossip, dataColumnSidecar, subnet_id))) node.installLightClientMessageValidators()