PIVX-Project / PIVX

Protected Instant Verified Transactions - Core wallet.
https://www.pivx.org
MIT License
528 stars 716 forks source link

[bug] Masternodes running on IPv6 will not allow more than 16 connections #2696

Open DeanSparrow opened 2 years ago

DeanSparrow commented 2 years ago

Masternodes running on IPv6 will not allow more than 16 connections

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

  1. Added maxconnections=256 to pivx.conf
  2. Tested on Multiple masternodes on Ubuntu 18

Expected behavior

Masternodes on IPv6 should allow more connections

Actual behavior

Masternodes running on IPv6 will not allow more than 16 connections

Screenshots.

If the issue is related to the GUI, screenshots can be added to this issue via drag & drop.

What version of PIVX Core are you using?

"version": 5040000, "protocolversion": 70924, "services": "NETWORK/BLOOM/", "walletversion": 170000,

Machine specs:

Any extra information that might be useful in the debugging process.

This is normally the contents of a debug.log, db.log or config.log file. Raw text or a link to a pastebin type site are preferred.

PeterL73 commented 2 years ago

maxconnections sets the most connections to peers (in + outbound)

the most automatic outbound connections are limited to 16 https://github.com/PIVX-Project/PIVX/blob/5a7b5141a7fcf765729ce31b6a7c0ce9b6d21969/src/net.h#L60-L61

DeanSparrow commented 2 years ago

Hi Peter Thanks for taking a look. With IPv4 we can 'override this' by adding maxconnections=XX to pivx.conf for IPv6 it does not "override".

skironDotNet commented 1 year ago

Limiting connection is a good thing, the server CPU suffers when there is too many threads. usually up to 16 connections is ok to support the network but I checked my nodes on IPv6 and I have some with 37 connections, so not sure what the problem is

skironDotNet commented 11 months ago

As I dive deeper into the subject I realized there are 2 aspects and now this https://github.com/PIVX-Project/PIVX/issues/2696#issuecomment-1100135649 answer makes sense.

There are incoming connection and outgoing connections. Incoming connections are what matters the most because this is that other clients and nodes can connect to you, and this is your maxconnections the outgoing connections are the ones your node makes to sync with others, and it doesn't need that much connections, 16 is plenty to make you connect to at least 3 valid nodes at the same time.

like I said "on IPv6 and I have some with 37 connections" this means 16 is like outgoing, and 21 is incoming, my limit is set to 128

I vote to close this ticket as not an issue, all works OK by design