-
Notifications
You must be signed in to change notification settings - Fork 110
Conversation
Thanks to Viktor Tron.
@@ -677,20 +677,33 @@ func (k *Kademlia) saturation(n int) int { | |||
func (k *Kademlia) full(emptyBins []int) (full bool) { |
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.
Please add an explanation of the algorithm used here.
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.
So, as we talked about in the call, please add to the comment the definition of a node being healthy when "as healthy as can be," that is that it can have 0 connected peers if no peers are known in the bin. That's what threw me off, at least.
if bytes.Equal(a, addr) { | ||
continue | ||
} | ||
p := &BzzAddr{OAddr: a, UAddr: a} |
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 oaddr and uaddr be the same?
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.
They can be for this test.
} | ||
|
||
/* | ||
The regression test for the following invalid kademlia edge case. |
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 are exactly these cases selected, and where do they come from? Is there any specific logic behind the configurations?
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.
This cases are the ones discovered as the edge cases while working on other tests.
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.
ok, please add a comment saying that.
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 have added the comments. Would more details then this help?
log.Debug(r.delivery.overlay.String()) | ||
log.Debug(fmt.Sprintf("IS HEALTHY: %t", h.GotNN && h.KnowNN && h.Full)) | ||
log.Error(r.delivery.overlay.String()) | ||
log.Error(fmt.Sprintf("IS HEALTHY: %t", h.GotNN && h.KnowNN && h.Full)) |
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 be Debug or Trace?
This PR implements: