Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node/Watcher/EVM: Debug logging #3813

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion node/pkg/watchers/evm/connectors/batch_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (b *BatchPollConnector) SubscribeForBlocks(ctx context.Context, errC chan e
sub.unsubDone <- struct{}{}
return nil
case v := <-innerErrSink:
b.logger.Info("batch_poller innerErrSink received an error, forwarding it on", zap.String("v", v))
sub.err <- fmt.Errorf(v)
case ev := <-headSink:
if ev == nil {
Expand Down Expand Up @@ -150,10 +151,12 @@ func (b *BatchPollConnector) run(ctx context.Context, logger *zap.Logger) error
errCount++
logger.Error("batch polling encountered an error", zap.Int("errCount", errCount), zap.Error(err))
if errCount > 3 {
logger.Error("batch poller is posting the error to errFeed", zap.Error(err))
b.errFeed.Send(fmt.Sprint("polling encountered an error: ", err))
errCount = 0
}
} else {
} else if errCount != 0 {
logger.Info("batch polling has resumed processing blocks")
errCount = 0
}

Expand Down
3 changes: 3 additions & 0 deletions node/pkg/watchers/evm/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ func (w *Watcher) Run(parentCtx context.Context) error {
p2p.DefaultRegistry.AddErrorCount(w.chainID, 1)
return fmt.Errorf("failed to subscribe to header events: %w", err)
}
defer headerSubscription.Unsubscribe()

common.RunWithScissors(ctx, errC, "evm_fetch_headers", func(ctx context.Context) error {
stats := gossipv1.Heartbeat_Network{ContractAddress: w.contract.Hex()}
Expand All @@ -477,6 +478,7 @@ func (w *Watcher) Run(parentCtx context.Context) error {
case <-ctx.Done():
return nil
case err := <-headerSubscription.Err():
logger.Error("error while processing header subscription", zap.Error(err))
ethConnectionErrors.WithLabelValues(w.networkName, "header_subscription_error").Inc()
errC <- fmt.Errorf("error while processing header subscription: %w", err)
p2p.DefaultRegistry.AddErrorCount(w.chainID, 1)
Expand Down Expand Up @@ -731,6 +733,7 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) {
if w.unsafeDevMode {
// Devnet supports finalized and safe (although they returns the same value as latest).
finalized = true
safe = true
} else if w.chainID == vaa.ChainIDAcala ||
w.chainID == vaa.ChainIDArbitrum ||
w.chainID == vaa.ChainIDBase ||
Expand Down
Loading