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: adding peer exchange peers to the peerStore #2824

Merged

Conversation

gabrielmer
Copy link
Contributor

Description

As soon we receive peers in Peer Exchange, we currently try to connect to all of them directly in a very aggressive way.

This does not take into account our connection targets and limits. Therefore, we should first add the peers to the Peer Store, and the connectivity loop will be in charge to choose and connect to the amount of peers necessary to reach its targets.

Changes

  • adding Peer Exchange peers to the Peer Store instead of trying to directly connect to all of them

Issue

We saw this case happen and potentially cause issues in #2780

Copy link

github-actions bot commented Jun 19, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2824-rln-v1

Built from b4d5906

Copy link

github-actions bot commented Jun 19, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2824-rln-v2

Built from b4d5906

@gabrielmer
Copy link
Contributor Author

I tried to also take care of

# TODO: Only consider peers on pubsub topics we subscribe to

But noticed that in the handler we don't receive the exchanged peers ENRs so we can't filter by the cluster/shards. Maybe I'm missing something.

In any case, I think that the Peer Manager itself should be in charge of the filtering peers by shards so we don't duplicate the logic. This should be taken care of when we activating sharded peer management.

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for it! 💯

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me. Thank you!!!

@gabrielmer gabrielmer merged commit 325e131 into master Jun 20, 2024
14 of 15 checks passed
@gabrielmer gabrielmer deleted the adding-peer-exchange-peers-instead-of-connecting-directly branch June 20, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants