-
Notifications
You must be signed in to change notification settings - Fork 42
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
GET_NODES periodically #402
Comments
@kilrau If the goal is : "All xuds automatically find each other and connect to each other." we should assume that all nodes are already connected to all connectable nodes. So when a new node (X) joins the graph it is doing so by connecting to one of the existing nodes (Y). Y should already be connected to most other nodes and should share their addresses to X. X will connect to these nodes itself so all other nodes become connected with X without the need for anything like a and b being done. |
Manually querying for new nodes is the type of thing that would have to happen quite rarely, and while it can potentially be a big packet it's already something we do every time start up and I don't think it's a problem. My thinking is that, for nodes that stay online for long stretches of time, manually querying for new nodes is a way to simulate that start-up querying for nodes but without actually shutting down the server. But maybe we don't even need either of these options. We already do GET_NODES each time we start up, and if we're online, new nodes will hear about us.
Not exactly, I think this is fine for a network on the order of dozens or hundreds of nodes. Much beyond that I'm not sure, and at some point we just exhaust the number of ports. That would definitely be a phase 2 sort of concern. |
We have a plan to introduce something called super-nodes later on which are allowed to route orders because they can ensure certain things, like a good ping, ensure they don't temper with the order, don't front-run etc. It takes a bit more to figure this out. @offerm
Well a) is how "Y share their addresses to X" is realized. @offerm
This made me think. I have the feeling it won't work that well for nodes being online long-term since they have to rely on new nodes connecting to them. Anyhow, let's keep things |
Any new opinions on 1) or 2) @sangaman @moshababo @michael1011 @offerm ? |
I think we have total 4 different approaches:
I don't think it's relevant. everything should be done automatically.
Sounds like the easiest approach.
Could be spammy, I would rather keep the push messaging limited as possible, and favor the request/response model.
If our node is reachable, I think this could work, it just put the responsibility on newly connected nodes. But I don't think we can assume that our node is reachable. |
I also prefer request/response over pushing newly discovered peers. Periodically querying for new nodes I'd agree is probably the best way to go. |
EDIT: OUTDATED, latest summary below Ok I agree on
Notes:
Agreed? Anything to add? @sangaman @moshababo |
The timestamp idea might conflict with how we handle nodes that have been offline for a while and come back online. Sometimes we want to hear about those nodes again provided they are online, because we may have exhausted reconnection attempts locally and cleared that node's connection addresses. Stiil it might be a nice feature if we can make it work around that concern, and in that case I figure we'd also want it on the GET_NODES call we make after the handshake. So I'd be inclined to handle that issue separately from the scheduled GET_NODES calls. |
Gotcha and makes sense. Just can't come up with anything else apart from timestamps how to easily get the "delta" of nodes, not the whole list every time. But agreed, then we handle it separately from this issue. |
Thinking about this again I don't have any bright ideas. I'm thinking that for now, it'd be ok just to query for everything. It's not a lot of data to transmit or anything, and we're not dealing with very large numbers of nodes yet. So I can implement just the periodic queries, and it can be improved later perhaps. |
Let's do it |
I haven't thought about it too deeply yet. But yes if |
Gotcha thanks, assigning to myself, hopefully will come with a PR asap. |
Question : why do we need to ask the peer for new nodes? Why can't the peer
push it when it discover a new node?
…On Sun, 2 Dec 2018 at 21:35 Sercan Özdemir ***@***.***> wrote:
Gotcha, assigning to myself, hopefully will come with a PR asap.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#402 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQ0cvUxlHIHPH7VzD39xDoKLIZHNcYNks5u1CuagaJpZM4WOQAt>
.
|
This is the option 1) and 2) I put out to debate above. Basically we went with 1) because if I'm connected to 100 nodes I'll hear about a new node 100 times without me being able to control these push messages. And they always come in bulks - potentially very spammy. Whereas when using the |
Latest summary of what is to be implemented in this issue:
|
Hello @kilrau,
|
I also don't see the need for As for your second bullet point, I think that's right. |
My bad, yep
Sounds right.
Do you mean reset the timeout once a peer connects? If so, yes. Once a peer disconnects, the reconnect cycle with increasing timeouts as per #311 starts |
This issue is to discuss 2 opposing approaches in how to share new peers (reminder: peer is a node I'm currently successfully connected to):
1
Manually send
GET_NODES
packet to learn about all peers of my peer (concern: nobody will ever do that, it should be automated). Also it's potentially a huge load every time since it's ALL peers.2
My peer shares newly connected peers dynamically at run time every time it successfully connects to one (concern: spammy?)
I would define our overall goal as: "All xuds automatically find each other and connect to each other."
Just like BitTorrents DHT gets bootstrapped from some hard coded seeds (or a swarm) and the rest happens automatically. Hence, I think we should combine a) and b).
a) happens on startup
b) during run time
The text was updated successfully, but these errors were encountered: