-
Notifications
You must be signed in to change notification settings - Fork 456
Implement new/tried peer list and peer bucket management Closes #3334 #4030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First batch of comments. I will go deep into the peer directory folder now. But before, what do you think about changing the folder name to directory
only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishantiw just made few comments, otherwise, the PR looks good
258df5a
to
bd4f5b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another batch of comments. I will give you a third review after you solve them. It only remains me to have a deep look to new_peers
and tried_peers
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor comments regarding function naming. Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishantiw remember to add test integration scenarios to prove the eviction process, upgrades and downgrades are working as expected.
@diego-G There are unit tests related to downgrade and upgrade a peer. we need extra effort and time to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest again to add a scenario to check if peers get downgraded as expected. For the eviction process I agree we should tackle it in another PR.
…and triedPeersList
cc9c10f
to
acc8dbc
Compare
@diego-G I have added few more scenarios on PeerBook for upgrade/downgrade of a peer and its movement between the two lists. |
Description
Implementation of peer management according to the LIP0004.
Changes:
peer_directory
that will encapsulate new/triedPeers list and the bucket management within it.peer_directory/new_peers
includes management of newPeers list and newPeers related eviction logicpeer_directory/tried_peers
includes management of triedPeers list and triedPeers related eviction logicpeer_directory/peer_book
exposes the interface for peer management at a higher level, it exposes,p2p
to use peer_book instead of dealing with new/triedPeers list separatelyReview checklist