From 5b042a852d222e94d9e0affbdd7d0dad6834fcf4 Mon Sep 17 00:00:00 2001 From: Nils-Erik Frantzell Date: Tue, 16 Jul 2019 21:43:50 -0700 Subject: [PATCH 1/2] Cap max incoming hashes at c_maxIncomingNewHashes --- libethereum/EthereumCapability.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libethereum/EthereumCapability.cpp b/libethereum/EthereumCapability.cpp index 8d8e6587528..13ebf51702a 100644 --- a/libethereum/EthereumCapability.cpp +++ b/libethereum/EthereumCapability.cpp @@ -760,8 +760,9 @@ bool EthereumCapability::interpretCapabilityPacket( if (itemCount > c_maxIncomingNewHashes) { - disablePeer(_peerID, "Too many new hashes"); - break; + LOG(m_logger) << "Received too many hashes (" << itemCount << ") from " << _peerID + << ", only processing first " << c_maxIncomingNewHashes << " hashes"; + itemCount = c_maxIncomingNewHashes; } vector> hashes(itemCount); From 333fa99a694b0544bdd363347b0f40acb43c96b5 Mon Sep 17 00:00:00 2001 From: Nils-Erik Frantzell Date: Tue, 16 Jul 2019 21:52:37 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0846d52777c..c17f84488f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Changed: [#5648](https://github.com/ethereum/aleth/pull/5648) `BlockChainTests` suite is split into `BlockChainTests/ValidBlocks` and `BlockChainTests/InvalidBlocks`. - Changed: [#5678](https://github.com/ethereum/aleth/pull/5678) Enable optimizer in aleth-interpreter by default. - Changed: [#5675](https://github.com/ethereum/aleth/pull/5675) Disconnect from peer when syncing is disabled for peer. +- Changed: [#5676](https://github.com/ethereum/aleth/pull/5676) When receiving large batches of new block hashes, process up to 1024 hashes instead of disabling the peer. - Removed: [#5631](https://github.com/ethereum/aleth/pull/5631) Removed PARANOID build option. - Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet. - Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery.