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

Fix spamming errors when requesting data from Juno that is not (yet) … #2289

Merged
merged 2 commits into from
Nov 28, 2024
Merged
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
10 changes: 8 additions & 2 deletions p2p/starknet/handlers.go
AnkushinDaniil marked this conversation as resolved.
Show resolved Hide resolved
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