The getUniqueOutboundConnectedPeers method doesn't fit well with the rest of the P2P library API. Instead, there should be a method to expose all outbound PeerInfo and another method for all inbound PeerInfo.
It's important for the Network module to expose methods that allow other modules to analyse the network in flexible ways. For this to happen, the Network module API should be as simple as possible while also exposing as much information as possible.
We don't want the API to end up with hundreds of related methods with complex names and have hundreds of different ways to get the same data.
Motivation
The implementation of the getUniqueOutboundConnectedPeersCount method currently uses the height property which is specific to lisk-core.
The Network module API should be as simple and as obvious as possible.
Acceptance Criteria
The getUniqueOutboundConnectedPeersCount action is removed from the network module.
The getUniqueOutboundConnectedPeers method is removed from the P2P library.
The network module and P2P API expose a method and an action for getting all outbound PeerInfo.
The network module and P2P API exposes a method and an action for getting all inbound PeerInfo.
The calculateConsensus function performs the consensus in a single operation. The current one makes multiple asynchronous calls which may skew the calculation in certain scenarios where the node is busy.
Description
The
getUniqueOutboundConnectedPeers
method doesn't fit well with the rest of the P2P library API. Instead, there should be a method to expose all outbound PeerInfo and another method for all inbound PeerInfo.It's important for the Network module to expose methods that allow other modules to analyse the network in flexible ways. For this to happen, the Network module API should be as simple as possible while also exposing as much information as possible.
We don't want the API to end up with hundreds of related methods with complex names and have hundreds of different ways to get the same data.
Motivation
getUniqueOutboundConnectedPeersCount
method currently uses theheight
property which is specific to lisk-core.Acceptance Criteria
getUniqueOutboundConnectedPeersCount
action is removed from the network module.getUniqueOutboundConnectedPeers
method is removed from the P2P library.