-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discv5 #19
Conversation
So @oskarth, I was working a bit with @kdeme and we both had the same thought. I actually started googling and on most devices there is no practical way to get your external IP. This to me means that mobile devices cannot sign an ENR and participate in the DHT in 2 ways. They can only run lookups. So the only real experiment that has any form of practical effect is figuring out how many lookups a "light" node needs to execute to find interesting nodes, this is totally dependent on the ordering of the DHT and if we were to take into account what @arnetheduck said yesterday may not even be relevant. IMO topics is what is needed here, has the lowest overhead and always guarantees that we ideally get what we are looking for when doing 1 lookup. |
So also talking to @kdeme, a node can reply with the external IP in a |
Yes, the important part is to know how expensive (how many lookups) it will be to get n interesting nodes in a bunch of nodes (randomly filled DHT). The fact of short connection windows + frequently updated ip-address will probably cause a mobile device not to be discoverable from other nodes in the DHT (chance of others finding a correct ENR in the DHT). At least, not when the mobile device is moving ( guess this also depends somewhat per mobile operator, ipv6, etc.). |
We've known for a long time that mobile phones wouldn't be publicly connectable. The purpose of the DHT isn't to find mobile phone, it is to find nodes that provide a useful service. The questions that should be answered are still the same, are they not? I don't see how this changes anything related to dependencies of topics etc. I'm curious about the ENR signing of IP requirement. Do we have more info on this? |
@oskarth connection info in the ENR should be signed https://github.com/ethereum/devp2p/blob/master/enr.md. This includes IP etc, even though these fields are optional an ENR without them would be usefless. |
So I ran the code and did a little investigation First I noticed a lot of revalidation failures, and many of them are with the bootstrap node (makes sense, all are spamming this one initially). I also noticed a lot messages arriving after the timeouts (and thus being dropped). I added some logging to see how many entries each node has in its DHT, it turned out to be very low for the nodes started later, see first file here: So I increased the timeouts ( So, it looks like there is some bug in the findNode call, I will further investigate this. Even with the increased timeouts, there are still a lot of messages that get lost. We could probably improve this by doing the lookups (that now happen in the loops) in a more controlled way. Or by adding them "manually" (yet randomly) with |
@kdeme @oskarth just posting this here for persistence, when I now start a network by pairing nodes randomly using the Also important to note, when I call Important to note: The pairing currently adds |
Questions on baseline test results: https://gist.github.com/decanus/dea759e3471b0a5dcebba1218eb070c7
This is the setting, but is this the reality? That's what I would assert in log statements
IIRC you saw behavior where a node return 0 nodes several times in a raw, but then it returned more. Is that issue fixed and do we know the origin of that?
The important property to me is that each node should have kademlia connectivity. This may or may not happen by adding random nodes. I'd make sure the nodes in the network have connectivity by logging/asserting that they should have a node in each k-bucket. |
So I've investigated the code for FindNode in nim-eth better and found a crucial bug. I've ran (an older version, sorry didn't update) of your code and results are much better. |
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.
Since this is research throwaway code I'm not going to review it ;) Feel free to merge tho
closes #15