diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index 0797336de..64728e571 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -971,8 +971,14 @@ proc makeEth2Request(peer: Peer, protocolId: string, requestBytes: seq[byte], deadline = sleepAsync timeout streamRes = awaitWithTimeout(peer.network.openStream(peer, protocolId), deadline): + peer.updateScore(PeerScorePoorRequest) return neterr StreamOpenTimeout - stream = ?streamRes + stream = streamRes.valueOr: + if streamRes.error().kind in ProtocolViolations: + peer.updateScore(PeerScoreInvalidRequest) + else: + peer.updateScore(PeerScorePoorRequest) + return err streamRes.error() try: # Send the request