swarm/network: Make MinProxBinSize constant across simulation#1074
swarm/network: Make MinProxBinSize constant across simulation#1074
Conversation
730181f to
2627104
Compare
Pending add test for saturation And add test for as many as possible up to saturation
2627104 to
f1b143b
Compare
| log.Trace(k.string()) | ||
| // calculate if depth of saturation changed | ||
| depth := uint8(k.saturation(k.MinBinSize)) | ||
| depth := uint8(k.saturation()) |
There was a problem hiding this comment.
return uint8 from saturation?
There was a problem hiding this comment.
I don't think so, because bins are int everywhere else. @nonsense raised the question whether bin should be its own type. We could consider this, but then let's do it in one PR and change it everywhere.
| // It is used in Healthy function for testing only | ||
| func (k *Kademlia) saturation(n int) int { | ||
| // saturation iterates through all peers and | ||
| // returns the smallest po value in which the node has less than n peers |
There was a problem hiding this comment.
"n peers" is no longer in the signature
| // iterate through nearest neighbors in the peerpot map | ||
| // if we can't find the neighbor in the map we created above | ||
| // then we don't know all our neighbors | ||
| // (which sadly is all too common in modern society) |
zelig
left a comment
There was a problem hiding this comment.
pss changes should be removed. how did they creep into this pr?
| gots++ | ||
| } else { | ||
| log.Trace(fmt.Sprintf("%08x: ExpNN: %s not found", k.BaseAddr()[:4], pk[:8])) | ||
| log.Trace(fmt.Sprintf("%08x: ExpNN: %s not found", k.base, pk)) |
| shutdownWG sync.WaitGroup | ||
| done chan struct{} | ||
| mu sync.RWMutex | ||
| minProxBinSize int |
There was a problem hiding this comment.
i said my piece about renaming, now we are introducing a new field thats gonna be renamed. please
There was a problem hiding this comment.
Can you say your peace again, please? I can't recall what name we have agreed on using.
There was a problem hiding this comment.
the discussion was in the depth PR
| done: make(chan struct{}), | ||
| buckets: make(map[enode.ID]*sync.Map), | ||
| done: make(chan struct{}), | ||
| minProxBinSize: network.NewKadParams().MinProxBinSize, |
| @@ -0,0 +1,356 @@ | |||
| package pss | |||
There was a problem hiding this comment.
how did this get here?? totally out of scope
|
Obsoleted by ethereum/go-ethereum#18408 |
In reference to #1051 (comment)
Merge depencency: