Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Implement maximum number of inbound peer connections - Closes #3720 #3779

Conversation

diego-G
Copy link

@diego-G diego-G commented Jun 4, 2019

How to test it?

npm run test:integration

Review checklist

@diego-G diego-G self-assigned this Jun 4, 2019
@diego-G diego-G force-pushed the 3720-implement_incoming_peer_connection_limit branch 3 times, most recently from b258733 to fc87ab3 Compare June 5, 2019 08:41
@diego-G diego-G force-pushed the 3720-implement_incoming_peer_connection_limit branch from fc87ab3 to fbc941d Compare June 5, 2019 08:47
@diego-G diego-G force-pushed the 3720-implement_incoming_peer_connection_limit branch from f38d731 to a57d70e Compare June 5, 2019 09:44
elements/lisk-p2p/src/peer_pool.ts Outdated Show resolved Hide resolved
@diego-G diego-G force-pushed the 3720-implement_incoming_peer_connection_limit branch from faa80c6 to 373faf8 Compare June 5, 2019 15:10
public getAllPeers(): ReadonlyArray<Peer> {
return [...this._peerMap.values()];
public getAllPeers(
kind?: typeof OutboundPeer | typeof InboundPeer,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a string enum 'outbound' or 'inbound' for consistency. Also this is confusing because in JavaScript typeof OutboundPeer would evaluate to 'function'.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What was the conclusion about this one? Although in tyepescript, this seems to be valid

Copy link
Author

Choose a reason for hiding this comment

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

We have no better option and it is valid Typescript-wise.

Copy link
Contributor

@jondubois jondubois Jun 7, 2019

Choose a reason for hiding this comment

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

Because this method is only used internally by the PeerPool and not exposed outside the P2P library, I was convinced that it's OK in this case.

@diego-G diego-G requested a review from jondubois June 6, 2019 14:53
elements/lisk-p2p/src/peer_pool.ts Outdated Show resolved Hide resolved
elements/lisk-p2p/src/peer_pool.ts Show resolved Hide resolved
elements/lisk-p2p/src/peer_pool.ts Outdated Show resolved Hide resolved
@diego-G diego-G requested a review from shuse2 June 7, 2019 08:19
@jondubois jondubois merged commit 7d220da into feature/implement-lip-p2p Jun 7, 2019
@shuse2 shuse2 deleted the 3720-implement_incoming_peer_connection_limit branch June 7, 2019 08:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants