Libp2p connection limits (#2272)

* max peers gets set as connection limits

* pass max connections
This commit is contained in:
Dmitriy Ryajov 2021-01-28 00:31:29 -06:00 committed by GitHub
parent 6528707e44
commit 1117993a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -1526,7 +1526,13 @@ proc newBeaconSwitch*(conf: BeaconNodeConf, seckey: PrivateKey,
let identify = newIdentify(peerInfo)
newSwitch(peerInfo, transports, identify, muxers, secureManagers)
newSwitch(
peerInfo,
transports,
identify,
muxers,
secureManagers,
maxConnections = conf.maxPeers)
proc createEth2Node*(rng: ref BrHmacDrbgContext,
conf: BeaconNodeConf,

View File

@ -373,7 +373,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
--log-level="${LOG_LEVEL}" \
--tcp-port=$(( BASE_PORT + NUM_NODE )) \
--udp-port=$(( BASE_PORT + NUM_NODE )) \
--max-peers=$(( NUM_NODES - 1 )) \
--max-peers=$(( NUM_NODES * 2 - 1 )) \
--data-dir="${NODE_DATA_DIR}" \
${BOOTSTRAP_ARG} \
${STATE_SNAPSHOT_ARG} \

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit 0959877b29be802b857cb10ab194f5cf29e3649f
Subproject commit 1d77d37f17a8d4b9bbafb83eae69790dad48b4c5