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

Change map key in eth peers #3383

Closed
wants to merge 3 commits into from

Conversation

pinges
Copy link
Contributor

@pinges pinges commented Feb 7, 2022

Trying to fix multiple connections to the same peer by using the peer id as the key to the map

@helderjnpinto
Copy link
Contributor

@pinges hey all good ? when this PR will be fixed and merged, any time estimation? I have in my network one peer duplicated 1088 times :).

Copy link
Contributor

@jflo jflo left a comment

Choose a reason for hiding this comment

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

Other than the aesthetics mentioned in my comment, this is good.

@@ -118,8 +120,8 @@ private void abortPendingRequestsAssignedToDisconnectedPeers() {
}
}

public EthPeer peer(final PeerConnection peerConnection) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the public interface method to this class needs a type change. It's fine to make the internal map keyed by Bytes, but I think the public interface method into EthPeers gets less readable when we make the parameter more primitive. Can we keep the
parameter as a PeerConnection, and just interact with the Map using its getPeer().getId()?

@macfarla
Copy link
Contributor

@pinges are you closing this PR in favour of your new approach?

@macfarla
Copy link
Contributor

Closing this in favour of a new approach cc @pinges

@macfarla macfarla closed this Apr 28, 2022
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.

Number of peers in logs higher than maxPeers
4 participants