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(p2p): fix possible connectivity issue #1996

Merged
merged 2 commits into from
Sep 8, 2023
Merged

Conversation

alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Sep 6, 2023

Description:

  • Temporally comment inbound relay peer prunning, since it may be causing connectivity issues. Note that prunning by IP is kept, this just affects the general prunning.
  • Increase default peer store size. If the max amount of peers is x the peerstore size should be way bigger than that. If no, we wont benefit much from the exponential backoff, since after prunning, this state is "forgotten".
  • Increase peerstore prunning interval to 10 minutes.

Test:

  • Simulated in an environment with waku-simulator

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:1996

@alrevuelta alrevuelta changed the title bug(p2p): fix possible connectivity issue fix(p2p): fix possible connectivity issue Sep 6, 2023
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

You can find the experimental image built from this PR at

quay.io/wakuorg/nwaku-pr:1996-experimental

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!

Comment on lines +587 to +588
# TODO: Temporally disabled. Might be causing connection issues
#if inRelayPeers.len > pm.inRelayPeersTarget:
# await pm.pruneInRelayConns(inRelayPeers.len - pm.inRelayPeersTarget)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I vote to remove that directly. If we need it in the future we can review this commit and easily restore it back. The TODO is likely to be there forever :)

Suggested change
# TODO: Temporally disabled. Might be causing connection issues
#if inRelayPeers.len > pm.inRelayPeersTarget:
# await pm.pruneInRelayConns(inRelayPeers.len - pm.inRelayPeersTarget)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would like to leave it there, since its something I would like to revisit. Some peer prunning in inbound connections is needed, the open question is how.

@@ -101,7 +101,7 @@ proc newWakuSwitch*(
if peerStoreCapacity.isSome():
b = b.withPeerStore(peerStoreCapacity.get())
else:
let defaultPeerStoreCapacity = int(round(float64(maxConnections)*1.25))
let defaultPeerStoreCapacity = int(maxConnections)*5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we have a comment indicating why we set the max PeerStoreCapacity to that?
From the PR's comment is clear, but I'd mention that in the code as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will address it in the future. maybe this shouldn't even be configurable and always harcoded depending on the amount of maxConnections.

@@ -10,6 +10,7 @@ import
chronicles,
metrics,
libp2p/multistream,
libp2p/connmanager,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, fixed
47e3a49

@alrevuelta alrevuelta merged commit 7d9d8a3 into master Sep 8, 2023
14 checks passed
@alrevuelta alrevuelta deleted the fix-con-issues branch September 8, 2023 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants