update enr and metadata during boot

This commit is contained in:
Agnish Ghosh 2024-10-17 15:13:38 +05:30
parent 9fe68bf906
commit a479c7bdf4
2 changed files with 9 additions and 11 deletions

View File

@ -2634,8 +2634,6 @@ proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) =
debug "Stability subnets changed; updated ENR attnets", attnets
proc loadCscnetsMetadata*(node: Eth2Node, cscnets: CscCount) =
if node.metadata.custody_subnet_count == cscnets.uint64:
return
node.metadata.custody_subnet_count = cscnets.uint64

View File

@ -508,6 +508,15 @@ proc initFullNode(
quarantine, blobQuarantine, dataColumnQuarantine, rmanBlockVerifier,
rmanBlockLoader, rmanBlobLoader, rmanDataColumnLoader)
if node.config.subscribeAllSubnets:
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.uint8)
else:
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint8)
if node.config.lightClientDataServe:
proc scheduleSendingLightClientUpdates(slot: Slot) =
if node.lightClientPool[].broadcastGossipFut != nil:
@ -1182,15 +1191,6 @@ proc addDenebMessageHandlers(
debugEcho topic
node.network.subscribe(topic, basicParams)
if node.config.subscribeAllSubnets:
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.uint8)
else:
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint8)
proc addElectraMessageHandlers(
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
node.addDenebMessageHandlers(forkDigest, slot)