Closed harnen closed 4 years ago
According to https://github.com/ethereum/devp2p/blob/master/discv5/discv5-theory.md#lookup-protocol shouldn't this be implemented in the node that sends the query instead of directly in the response? And, shouldn't be distance, distance+1 and distance-1, instead of distance, distance+1 and distance+2? Distance+2 is not the adjacent bucket.
But here it seems that they put all the distances directly in the message. We can probably check with Felix.
And I never use k+2
. Where have you found it?
Good catch! I don't why I've put +2 :o Anyway, it's fixed.
For sending 3 buckets right away, I think it's similar to pinging. It just generates additional messages without bringing much to the table. Let's keep it as it is and we can consult with Felix during our next checkpoint.
Based on the documentation, nodes returns then nodes from requested bucket
k
,k+1
andk-1
, the resulting list is cut to fit the response size limit.If
k=0
ork=MAX
the current implementation will not overflow. (ifk=0
, only buckets0
and1
will be returned). This can be changed if needed.