Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 6e04540

Browse files
authored
Merge pull request #5676 from ethereum/return-maxhashes
When receiving more than c_maxIncomingNewHashes in a NewBlockHashes packet, process the first c_maxIncomingNewHashes instead of disabling the peer.
2 parents 1bbb6cf + 333fa99 commit 6e04540

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- Changed: [#5648](https://github.com/ethereum/aleth/pull/5648) `BlockChainTests` suite is split into `BlockChainTests/ValidBlocks` and `BlockChainTests/InvalidBlocks`.
2828
- Changed: [#5678](https://github.com/ethereum/aleth/pull/5678) Enable optimizer in aleth-interpreter by default.
2929
- Changed: [#5675](https://github.com/ethereum/aleth/pull/5675) Disconnect from peer when syncing is disabled for peer.
30+
- 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.
3031
- Removed: [#5631](https://github.com/ethereum/aleth/pull/5631) Removed PARANOID build option.
3132
- Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet.
3233
- Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery.

libethereum/EthereumCapability.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,9 @@ bool EthereumCapability::interpretCapabilityPacket(
760760

761761
if (itemCount > c_maxIncomingNewHashes)
762762
{
763-
disablePeer(_peerID, "Too many new hashes");
764-
break;
763+
LOG(m_logger) << "Received too many hashes (" << itemCount << ") from " << _peerID
764+
<< ", only processing first " << c_maxIncomingNewHashes << " hashes";
765+
itemCount = c_maxIncomingNewHashes;
765766
}
766767

767768
vector<pair<h256, u256>> hashes(itemCount);

0 commit comments

Comments
 (0)