-
Notifications
You must be signed in to change notification settings - Fork 47
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
Consider merging service.rs
and peers.rs
together
#478
Comments
I think that the best course of action is to "soft-rewrite"
Of course, these different copies would share a lot of code. What we need from the networking service is:
One problem that When it comes to peers and addresses to decide who to connect to, it should be a separate mechanism from Kademlia, just like in Substrate. Peers and addresses discovered through Kademlia are untrusted. In other words, if Alice sends to Bob the list of addresses of Charlie, Alice might lie and give fake addresses. Charlie should not suffer if that is the case. It's still unclear to me how to manage these addresses. As a reminder, the algorithm used in Substrate is leaky. |
So there's actually no need to differentiate active from pending connections. |
When thinking about how to update
peers.rs
in the context of #111 and #44, it seems to me that the logicpeers.rs
would be quite intertwined with the one inservice.rs
.In other words, the way the logic of the networking is split between
peers.rs
andservice.rs
isn't really appropriate anymore.It would make sense to me to remove
peers.rs
entirely, and move what it is doing withinservice.rs
.Of course, we can't just move all the fields of
peers.rs
within the service, as it would become way too complex, but we can add more state machines that help the service do what it has do to.The text was updated successfully, but these errors were encountered: