-
Notifications
You must be signed in to change notification settings - Fork 111
swarm/network: Refactor peer suggestion engine #1073
Conversation
26a1521
to
7835637
Compare
8a0d503
to
2f83537
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.
just took a look. Risky PR
changes a LOT of code around without adding a fix or algorithmic improvement
} | ||
|
||
// | ||
lastPotentialBin++ |
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.
put this in the for
loop line
@@ -265,9 +172,8 @@ func (k *Kademlia) On(p *Peer) (uint8, bool) { | |||
}) | |||
if ins && !p.BzzPeer.LightNode { | |||
a := newEntry(p.BzzAddr) | |||
a.conn = p |
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.
why remove this line?
} | ||
|
||
// knowNearestNeighbours tests if all known nearest neighbours given as arguments | ||
// are found in the addressbook | ||
// knowNeighbours tests if all neighbours in the peerpot |
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.
should this not be knownNeighbours
similar to connectedNeighbours
?
return connects == len(peers), connects, culprits | ||
} | ||
|
||
// connectedPotential checks whether the peer is connected to a health minimum of peers it knows about in bins that are shallower than depth |
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.
what is wrong with saturation?
On hold pending success of (along the lines of) ethereum/go-ethereum#18404 |
Discontinued due to ethereum/go-ethereum#18404 |
This PR aims to simplify and cleanly encapsulate the component that informs which peers to attempt connections to, and which peers to request.
The implicit aim is to attain a clear and logical separation of responsbility and functionality between the files
hive.go
,kademlia.go
anddiscovery.go
.merge dependencies (in order of merge to master):
swarm/network: Make MinProxBinSize constant across simulation #1074