Skip to content

Commit

Permalink
node/evm: Fix shadowed variable in Optimism case (#3390)
Browse files Browse the repository at this point in the history
* EVM Watcher: Fix shadowed variable in Optimism case

* move metric setter into special case
  • Loading branch information
barnjamin authored Sep 22, 2023
1 parent 5e8cb3e commit 3ecc620
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/pkg/watchers/evm/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
Expand All @@ -646,6 +645,7 @@ func (w *Watcher) Run(parentCtx context.Context) error {
} else {
atomic.StoreUint64(&currentBlockNumber, blockNumberU)
atomic.StoreUint64(&w.latestFinalizedBlockNumber, blockNumberU)
currentEthHeight.WithLabelValues(w.networkName).Set(float64(ev.Number.Int64()))
}

for key, pLock := range w.pending {
Expand Down

0 comments on commit 3ecc620

Please sign in to comment.