subscribe to only those gossips that return via get_custody_column_subnet

This commit is contained in:
Agnish Ghosh 2024-08-24 16:41:38 +05:30
parent c2962b65c9
commit 237dc3adfb
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
1 changed files with 12 additions and 8 deletions

View File

@ -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()