From ea8879958512f3008c32ea85954a919bee033a8b Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Sat, 19 Dec 2020 02:33:31 +0800 Subject: [PATCH] Revert Inbound Peer Limit (#8155) Co-authored-by: Raul Jordan Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/p2p/peers/status.go | 4 ++-- beacon-chain/p2p/peers/status_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/p2p/peers/status.go b/beacon-chain/p2p/peers/status.go index 65d5168c5..70f682fb7 100644 --- a/beacon-chain/p2p/peers/status.go +++ b/beacon-chain/p2p/peers/status.go @@ -55,13 +55,13 @@ const ( const ( // ColocationLimit restricts how many peer identities we can see from a single ip or ipv6 subnet. - ColocationLimit = 7 + ColocationLimit = 5 // Additional buffer beyond current peer limit, from which we can store the relevant peer statuses. maxLimitBuffer = 150 // InboundRatio is the proportion of our connected peer limit at which we will allow inbound peers. - InboundRatio = float64(2) / 5 + InboundRatio = float64(1) ) // Status is the structure holding the peer status information. diff --git a/beacon-chain/p2p/peers/status_test.go b/beacon-chain/p2p/peers/status_test.go index 017775243..f893bb07d 100644 --- a/beacon-chain/p2p/peers/status_test.go +++ b/beacon-chain/p2p/peers/status_test.go @@ -650,7 +650,7 @@ func TestAtInboundPeerLimit(t *testing.T) { createPeer(t, p, nil, network.DirOutbound, peerdata.PeerConnectionState(ethpb.ConnectionState_CONNECTED)) } assert.Equal(t, false, p.IsAboveInboundLimit(), "Inbound limit exceeded") - for i := 0; i < 15; i++ { + for i := 0; i < 31; i++ { // Peer added to peer handler. createPeer(t, p, nil, network.DirInbound, peerdata.PeerConnectionState(ethpb.ConnectionState_CONNECTED)) }