Skip to content

Commit

Permalink
fix(filter2): add requestID to pings and remove unneeded log (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored and Vitaliy Vlasov committed Sep 27, 2023
1 parent 0928116 commit a04b074
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion waku/v2/protocol/filter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (wf *WakuFilterLightNode) Ping(ctx context.Context, peerID peer.ID) error {

return wf.request(
ctx,
&FilterSubscribeParameters{selectedPeer: peerID},
&FilterSubscribeParameters{selectedPeer: peerID, requestID: protocol.GenerateRequestID()},
pb.FilterSubscribeRequest_SUBSCRIBER_PING,
ContentFilter{})
}
Expand Down
2 changes: 0 additions & 2 deletions waku/v2/utils/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
"github.com/multiformats/go-multiaddr"
"github.com/waku-org/go-waku/logging"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -61,7 +60,6 @@ func SelectRandomPeer(peers peer.IDSlice, log *zap.Logger) (peer.ID, error) {
if len(peers) >= 1 {
peerID := peers[rand.Intn(len(peers))]
// TODO: proper heuristic here that compares peer scores and selects "best" one. For now a random peer for the given protocol is returned
log.Info("Got random peer from peerstore", logging.HostID("peer", peerID))
return peerID, nil // nolint: gosec
}

Expand Down

0 comments on commit a04b074

Please sign in to comment.