2

Below statement is from this documentation.

The network component continues to perform a peer search if its number of peers is less than the minimum connectivity. The network component rejects peering attempts if its number of peers is equal to or greater than the maximum connectivity.

Question:

As the documentation says,

number of peers is equal to or greater than the maximum connectivity,

If a node is allowed to have a 'maximum number of peers', say N, how can the 'number of peers' be GREATER than N ?

NOTE:

You may want to refer to another question from me, which was related to 'maximum connection between nodes' which happens before 'attempting peering'. The main difference between these 2 questions is about 'maximum connections' and 'maximum (bi-directional) peers'.

RafiAlhamd
  • 341
  • 2
  • 13

1 Answers1

1

No, it cannot be greater than N (ideally). Looking at this code, a connection is registered as peer, if current peers is less than the maximum peers allowed. The documentation is saying it in terms of condition for rejection. ie ("less than" vs "greater than or equal to")

The documentation is correct

shonjs
  • 256
  • 1
  • 6
  • Still, I've second thoughts on 'how the documentation has been phrased'. Please help provide pointer to the code. I would accept the answer. – RafiAlhamd Jul 13 '19 at 14:13
  • I have updated the link to the code which I think is the process that documentation is talking about, in the answer. Hope that helps. – shonjs Jul 13 '19 at 14:21
  • As per the code: `if len(self._peers) < self._maximum_peer_connectivity`. Applying negation to the above condition should result in: `if self._maximum_peer_connectivity >= len(self._peers)`. But, the documentation is still: `number of peers is equal to or greater than the maximum connectivity`. Whic would mean: `if len(self._peers) >= self._maximum_peer_connectivity` Hence, the DOCUMENTATION is WRONG! Will ACCEPT THE ANSWER, ONCE the below opinion is removed from the answer: `I think the statement seems correct, if thinking...defensive... perspective as well.` – RafiAlhamd Jul 13 '19 at 14:46
  • I meant negation in description, which is the else part of the condition. Else part of the condition is the condition when a node is not registered as peer ie it is rejected. The documentation seems precise. – shonjs Jul 13 '19 at 14:50
  • Have removed from my question: `Is the documentation wrong? Or is there something else I'm missing here?`, so that, we stick to the concept instead of talking about the validity of the document. – RafiAlhamd Jul 13 '19 at 17:40
  • Understood the 'negation part'. Technical negation under the else part provides implied all possible technical choices, but, documentation should talk about only the PRACTICALLY possible choices. You've helped me with a correct answer, `No, it cannot be greater than N (ideally)` along with pointer to the code. So, I REALLY WANT TO ACCEPT this answer, except the ambiguous statement: `The documentation seems precise`. – RafiAlhamd Jul 13 '19 at 17:40