From 3ecc620eed3ed70bac11b006afcb72983f69f138 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Fri, 22 Sep 2023 13:08:16 -0400 Subject: [PATCH] node/evm: Fix shadowed variable in Optimism case (#3390) * EVM Watcher: Fix shadowed variable in Optimism case * move metric setter into special case --- node/pkg/watchers/evm/watcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/pkg/watchers/evm/watcher.go b/node/pkg/watchers/evm/watcher.go index 978662920..a98eae1ce 100644 --- a/node/pkg/watchers/evm/watcher.go +++ b/node/pkg/watchers/evm/watcher.go @@ -289,7 +289,7 @@ func (w *Watcher) Run(parentCtx context.Context) error { } else if w.chainID == vaa.ChainIDOptimism && !w.unsafeDevMode { // This only supports Bedrock mode useFinalizedBlocks = true - safeBlocksSupported := true + safeBlocksSupported = true logger.Info("using finalized blocks, will publish safe blocks") baseConnector, err := connectors.NewEthereumConnector(timeout, w.networkName, w.url, w.contract, logger) if err != nil { @@ -631,7 +631,6 @@ func (w *Watcher) Run(parentCtx context.Context) error { zap.Stringer("current_blockhash", currentHash), zap.Bool("is_safe_block", ev.Safe), zap.String("eth_network", w.networkName)) - currentEthHeight.WithLabelValues(w.networkName).Set(float64(ev.Number.Int64())) readiness.SetReady(w.readinessSync) p2p.DefaultRegistry.SetNetworkStats(w.chainID, &gossipv1.Heartbeat_Network{ Height: ev.Number.Int64(), @@ -646,6 +645,7 @@ func (w *Watcher) Run(parentCtx context.Context) error { } else { atomic.StoreUint64(¤tBlockNumber, blockNumberU) atomic.StoreUint64(&w.latestFinalizedBlockNumber, blockNumberU) + currentEthHeight.WithLabelValues(w.networkName).Set(float64(ev.Number.Int64())) } for key, pLock := range w.pending {