mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-17 00:47:03 +00:00
always enable topic and aggreate metric topics (#2229)
This commit is contained in:
parent
6653ce3fc5
commit
a3a651b565
@ -1591,11 +1591,17 @@ proc announcedENR*(node: Eth2Node): enr.Record =
|
||||
proc shortForm*(id: KeyPair): string =
|
||||
$PeerID.init(id.pubkey)
|
||||
|
||||
proc subscribe*(node: Eth2Node, topic: string) =
|
||||
proc subscribe*(node: Eth2Node, topic: string, enableTopicMetrics: bool = false) =
|
||||
proc dummyMsgHandler(topic: string, data: seq[byte]) {.async.} =
|
||||
discard
|
||||
|
||||
node.pubsub.subscribe(topic & "_snappy", dummyMsgHandler)
|
||||
let
|
||||
topicName = topic & "_snappy"
|
||||
|
||||
if enableTopicMetrics:
|
||||
node.pubsub.knownTopics.incl(topicName)
|
||||
|
||||
node.pubsub.subscribe(topicName, dummyMsgHandler)
|
||||
|
||||
proc addValidator*[MsgType](node: Eth2Node,
|
||||
topic: string,
|
||||
|
@ -475,11 +475,11 @@ proc getAttestationSubnetHandlers(node: BeaconNode) =
|
||||
|
||||
proc addMessageHandlers(node: BeaconNode) =
|
||||
# As a side-effect, this gets the attestation subnets too.
|
||||
node.network.subscribe(node.topicBeaconBlocks)
|
||||
node.network.subscribe(node.topicBeaconBlocks, enableTopicMetrics = true)
|
||||
node.network.subscribe(getAttesterSlashingsTopic(node.forkDigest))
|
||||
node.network.subscribe(getProposerSlashingsTopic(node.forkDigest))
|
||||
node.network.subscribe(getVoluntaryExitsTopic(node.forkDigest))
|
||||
node.network.subscribe(getAggregateAndProofsTopic(node.forkDigest))
|
||||
node.network.subscribe(getAggregateAndProofsTopic(node.forkDigest), enableTopicMetrics = true)
|
||||
node.getAttestationSubnetHandlers()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user