Skip to content

Commit

Permalink
Fix spamming errors (#2289)
Browse files Browse the repository at this point in the history
Fix spamming errors when requesting data from Juno that is not present
  • Loading branch information
AnkushinDaniil authored Nov 28, 2024
1 parent 874e86c commit 8afd1a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions p2p/starknet/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package starknet
import (
"bytes"
"context"
"errors"
"fmt"
"iter"
"sync"
Expand All @@ -13,6 +14,7 @@ import (
"github.com/NethermindEth/juno/blockchain"
"github.com/NethermindEth/juno/core"
"github.com/NethermindEth/juno/core/felt"
"github.com/NethermindEth/juno/db"
"github.com/NethermindEth/juno/p2p/starknet/spec"
"github.com/NethermindEth/juno/utils"
"github.com/libp2p/go-libp2p/core/network"
Expand Down Expand Up @@ -410,7 +412,9 @@ func (h *Handler) processIterationRequest(iteration *spec.Iteration, finMsg prot
// pass it to handler function (some might be interested in header, others in entire block)
msg, err := getMsg(it)
if err != nil {
h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err)
if !errors.Is(err, db.ErrKeyNotFound) {
h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err)
}
break
}

Expand Down Expand Up @@ -447,7 +451,9 @@ func (h *Handler) processIterationRequestMulti(iteration *spec.Iteration, finMsg
// pass it to handler function (some might be interested in header, others in entire block)
messages, err := getMsg(it)
if err != nil {
h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err)
if !errors.Is(err, db.ErrKeyNotFound) {
h.log.Errorw("Failed to generate data", "blockNumber", it.BlockNumber(), "err", err)
}
break
}

Expand Down

0 comments on commit 8afd1a2

Please sign in to comment.