LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 456 forks source link

Fix _newPeers and _triedPeers to match the LIP #3330

Closed jondubois closed 5 years ago

jondubois commented 5 years ago

Expected behavior

Scope

The goal of this issue is to make sure that the _newPeers and _triedPeers (address book) does not grow to unlimited size. This should be done according to the LIP.

Description

This is related to https://github.com/LiskHQ/lisk-elements/issues/1072 - The _newPeers and _triedPeers maps (which store P2PDiscoveredPeerInfo) need to have a size limit to prevent DoS. The LIP has a mechanism which limits the size of the _newPeers and _triedPeers maps so it should be implemented.

Actual behavior

_newPeers and _triedPeers are not currently managed according to the LIP.

jondubois commented 5 years ago

This issue is there to address any remaining details which may be left over in order to fully comply with the LIP regarding the management of the the address book (_newPeers and _triedPeers).