Skip to content

Commit

Permalink
Fix misleading LogPoller logging
Browse files Browse the repository at this point in the history
This was logging a critical error when any error other than an rpc
error happened (eg networking issue, or context timeout) when batch_size
was = 1. Should have only been logging at that level for rpc error
"Limit Exceeded"
  • Loading branch information
reductionista committed Dec 19, 2023
1 parent fe8ec89 commit 9d315cb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/chains/evm/logpoller/log_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,9 @@ func (lp *logPoller) backfill(ctx context.Context, start, end int64) error {
gethLogs, err := lp.ec.FilterLogs(ctx, lp.Filter(big.NewInt(from), big.NewInt(to), nil))
if err != nil {
var rpcErr client.JsonError
if errors.As(err, &rpcErr) {
if rpcErr.Code != jsonRpcLimitExceeded {
lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to)
return err
}
if !errors.As(err, &rpcErr) || rpcErr.Code != jsonRpcLimitExceeded {
lp.lggr.Errorw("Unable to query for logs", "err", err, "from", from, "to", to)
return err
}
if batchSize == 1 {
lp.lggr.Criticalw("Too many log results in a single block, failed to retrieve logs! Node may be running in a degraded state.", "err", err, "from", from, "to", to, "LogBackfillBatchSize", lp.backfillBatchSize)
Expand Down

0 comments on commit 9d315cb

Please sign in to comment.