Change defaultDialRatio
from 3 to 2
#29737
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes
defaultDialRatio
which limits incoming peer connections to a maximum ratio of total connections. When this ratio is 3 there are a few downstream consequences:MaxPeers
limit. Imagine a testnet with 10 geth nodes and each node being configured toMaxPeers == 9
to peer all peers. Each node will only be able to accept 3 incoming peers total. This would mean that some amount of peering would not be able to happen and not all nodes would be able to connect. You can imagine how this would cause issue with a small network of 3 peers ifMaxPeers == 5
and there was no minimum peer setting set. Each geth node would only be able to find one outgoing peer because of the incoming peer limit that would result. In a perfect situtation all peers would have a connection with eachother since the total number of participants is less thanMaxPeers
. This low-peer scenario is easier to think about but the same issue holds true forMaxPeers == 50
.defaultDialRatio == 3
and the network will be skewed to less nodes accepting geth's outgoing peer requests. While these peers would happily connect to a geth node that has open ports and the geth node could be under its peer limit, the geth node will decline incoming connections due to thedefaultDialRatio
. I believe that this is what was making it more difficult to for other clients to find geth peers on Goerli and Holesky.This PR also fixes a small type in a fuzzing function. I did modify the RLP fuzzers and fuzz quite a bit but did not find any new issues so I have left those changes out.