From 81b55faee2178a541b4c8fd36b720aba79077818 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Wed, 26 Jun 2024 02:22:03 +0530 Subject: [PATCH] add: fetch subnetCount for super node when subscribeAllSubnets flag passed --- beacon_chain/spec/eip7594_helpers.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/eip7594_helpers.nim b/beacon_chain/spec/eip7594_helpers.nim index 585bc4ad4..94bb37cba 100644 --- a/beacon_chain/spec/eip7594_helpers.nim +++ b/beacon_chain/spec/eip7594_helpers.nim @@ -13,11 +13,12 @@ import stew/results, ssz_serialization/proofs, chronicles, + ../beacon_node, ./[beacon_time, crypto], kzg4844/kzg_ex, eth/p2p/discoveryv5/[node], ./helpers, - + ./datatypes/[eip7594, deneb] proc sortedColumnIndices*(columnsPerSubnet: ColumnIndex, subnetIds: HashSet[uint64]): seq[ColumnIndex] = @@ -29,6 +30,11 @@ proc sortedColumnIndices*(columnsPerSubnet: ColumnIndex, subnetIds: HashSet[uint res.sort() res +proc fetchCustodySubnetCount* (res: var uint64, conf: BeaconNode) = + res = CUSTODY_REQUIREMENT + if node.config.subscribeAllSubnets: + res = DATA_COLUMN_SIDECAR_SUBNET_COUNT + proc get_custody_column_subnet*(node_id: NodeId, custody_subnet_count: uint64): Result[HashSet[uint64], cstring] = # fetches the subnets for custody column for the current node # assert custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT