From bfe91f3e7a422cd25e26ca89ecee9d5e7fa5637c Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 23 Jul 2020 18:00:03 -0600 Subject: [PATCH] libp2p changes --- beacon_chain/eth2_network.nim | 13 +++++-------- scripts/launch_local_testnet.sh | 2 ++ vendor/nim-libp2p | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 4ae838bb4f..362dc86667 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -198,8 +198,8 @@ const # https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/p2p-interface.md#eth2-network-interaction-domains MAX_CHUNK_SIZE* = 1 * 1024 * 1024 # bytes GOSSIP_MAX_SIZE* = 1 * 1024 * 1024 # bytes - TTFB_TIMEOUT* = 5.seconds - RESP_TIMEOUT* = 10.seconds + TTFB_TIMEOUT* = 5.minutes + RESP_TIMEOUT* = 10.minutes NewPeerScore* = 200 ## Score which will be assigned to new connected Peer @@ -222,9 +222,6 @@ const SeemTableTimeFaultOrError* = 10.minutes ## Period of time for `FaultOnError` error reason. - MaxPubsubReconnectAttempts* = 10 - ## Number of times pubsub is retried for a peer - var successfullyDialledAPeer = false # used to show a warning template neterr(kindParam: Eth2NetworkingErrorKind): auto = @@ -859,8 +856,8 @@ proc init*(T: type Eth2Node, conf: BeaconNodeConf, enrForkId: ENRForkID, result.switch = switch result.wantedPeers = conf.maxPeers result.peerPool = newPeerPool[Peer, PeerID](maxPeers = conf.maxPeers) - result.connectTimeout = 3.minutes - result.seenThreshold = 6.minutes + result.connectTimeout = 1.minutes + result.seenThreshold = 1.minutes result.seenTable = initTable[PeerID, SeenItem]() result.connTable = initTable[PeerID, PeerInfo]() result.connQueue = newAsyncQueue[PeerInfo](ConcurrentConnections) @@ -1272,7 +1269,7 @@ proc broadcast*(node: Eth2Node, topic: string, msg: auto) = inc nbc_gossip_messages_sent let data = snappy.encode(SSZ.encode(msg)) - var futSnappy = node.switch.publish(topic & "_snappy", data) + var futSnappy = node.switch.publish(topic & "_snappy", data, 1.minutes) traceMessage(futSnappy, gossipId(data)) # TODO: diff --git a/scripts/launch_local_testnet.sh b/scripts/launch_local_testnet.sh index d2a40a1946..1561b16ff2 100755 --- a/scripts/launch_local_testnet.sh +++ b/scripts/launch_local_testnet.sh @@ -301,6 +301,8 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do ${EXTRA_ARGS} \ > "${DATA_DIR}/log${NUM_NODE}.txt" 2>&1 & + sleep 5 + if [[ "${PIDS}" == "" ]]; then PIDS="$!" else diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index 3aeb7ab19b..9ece1e5b7e 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 3aeb7ab19b562d0fa6c0a81654271d4e5a878f43 +Subproject commit 9ece1e5b7ec4f6eb3feac52aab0743bb263a8b95