turned CscCount to uint8 according to the latest EF spec

This commit is contained in:
Agnish Ghosh 2024-08-24 16:23:27 +05:30
parent e87871e2cb
commit c2962b65c9
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
3 changed files with 6 additions and 6 deletions

View File

@ -1550,7 +1550,7 @@ proc getLowSubnets(node: Eth2Node, epoch: Epoch):
findLowSubnets(getSyncCommitteeTopic, SyncSubcommitteeIndex, SYNC_COMMITTEE_SUBNET_COUNT)
else:
default(SyncnetBits),
findLowSubnets(getDataColumnSidecarTopic, uint64, DATA_COLUMN_SIDECAR_SUBNET_COUNT.int).countOnes.uint64
findLowSubnets(getDataColumnSidecarTopic, uint64, DATA_COLUMN_SIDECAR_SUBNET_COUNT.int).countOnes.uint8
)
proc runDiscoveryLoop(node: Eth2Node) {.async.} =
@ -2598,7 +2598,7 @@ proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) =
else:
debug "Stability subnets changed; updated ENR attnets", attnets
proc loadCscnetsMetadata*(node: Eth2Node, cscnets: uint64) =
proc loadCscnetsMetadata*(node: Eth2Node, cscnets: CscCount) =
if node.metadata.custody_subnet_count == cscnets:
return

View File

@ -1154,13 +1154,13 @@ proc addDenebMessageHandlers(
node.network.subscribe(topic, basicParams)
if node.config.subscribeAllSubnets:
node.network.loadCscnetsMetadata(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64)
node.network.loadCscnetsMetadata(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8)
elif not node.config.subscribeAllSubnets:
let csc = node.config.custodySubnetCount
if csc.isSome and csc.get < DATA_COLUMN_SIDECAR_SUBNET_COUNT:
node.network.loadCscnetsMetadata(csc.get.uint64)
node.network.loadCscnetsMetadata(csc.get.uint8)
else:
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint64)
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint8)
proc addElectraMessageHandlers(
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =

View File

@ -77,7 +77,7 @@ type
column_index*: ColumnIndex
row_index*: RowIndex
CscCount* = uint64
CscCount* = uint8
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/_features/eip7594/p2p-interface.md#metadata
MetaData* = object