Skip to content

Commit b9e2dd7

Browse files
committed
prom_gossip: display unknown guardians
1 parent e452787 commit b9e2dd7

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

fly/cmd/prom_gossip/main.go

+17-8
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ func main() {
137137
if env == node_common.MainNet {
138138
guardians = common.MainnetGuardians
139139
knownEmitter = sdk.KnownEmitters
140-
rpcUrl = "https://rpc.ankr.com/eth"
140+
rpcUrl = "https://ethereum-rpc.publicnode.com"
141141
coreBridgeAddr = "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B"
142142
} else if env == node_common.TestNet {
143143
guardians = common.TestnetGuardians
144144
knownEmitter = sdk.KnownTestnetEmitters
145-
rpcUrl = "https://rpc.ankr.com/eth_holesky"
145+
rpcUrl = "https://ethereum-holesky-rpc.publicnode.com"
146146
coreBridgeAddr = "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"
147147
} else if env == node_common.UnsafeDevNet {
148148
guardians = common.DevnetGuardians
@@ -259,8 +259,11 @@ func main() {
259259
}
260260
emitter := strings.ToLower(spl[1])
261261
addr := "0x" + string(hex.EncodeToString(o.Msg.Addr))
262-
idx := guardianIndexMap[strings.ToLower(addr)]
263-
name := guardianIndexToNameMap[idx]
262+
name := addr
263+
idx, found := guardianIndexMap[strings.ToLower(addr)]
264+
if found {
265+
name = guardianIndexToNameMap[idx]
266+
}
264267
observationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc()
265268
if knownEmitters[emitter] {
266269
tbObservationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc()
@@ -352,8 +355,11 @@ func main() {
352355
case g := <-govConfigC:
353356
gossipByType.WithLabelValues("gov_config").Inc()
354357
addr := "0x" + string(hex.EncodeToString(g.GuardianAddr))
355-
idx := guardianIndexMap[strings.ToLower(addr)]
356-
name := guardianIndexToNameMap[idx]
358+
name := addr
359+
idx, found := guardianIndexMap[strings.ToLower(addr)]
360+
if found {
361+
name = guardianIndexToNameMap[idx]
362+
}
357363
govConfigByGuardian.WithLabelValues(name).Inc()
358364
}
359365
}
@@ -368,8 +374,11 @@ func main() {
368374
case g := <-govStatusC:
369375
gossipByType.WithLabelValues("gov_status").Inc()
370376
addr := "0x" + string(hex.EncodeToString(g.GuardianAddr))
371-
idx := guardianIndexMap[strings.ToLower(addr)]
372-
name := guardianIndexToNameMap[idx]
377+
name := addr
378+
idx, found := guardianIndexMap[strings.ToLower(addr)]
379+
if found {
380+
name = guardianIndexToNameMap[idx]
381+
}
373382
govStatusByGuardian.WithLabelValues(name).Inc()
374383
}
375384
}

0 commit comments

Comments
 (0)