-
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
Refactoring IPv8 class structure #123
Comments
Can you please first create a few performance tests? Processing incoming UDPs, generation them, and CPU usage when overlay has 1000 connected peers? Plus also a 'perfect architecture' design, to discuss, before commensing with coding? |
Ah, the class diagram has gotten so beautiful since the Dispersy days: it brings a tear to my eye. Anyway, sentiment aside, let me respond to your points:
Concluding: we have seen beautiful design before and it turned out to be unusable. I would take practical and ugly over beautiful any day of the week |
Actually, I think the class structure/architecture is pretty spot on right now (other than what I discussed above). Most of the |
@synctext, let's consider the creation of packet throughput / 1000 peers tests the first step of the refactoring process. These result would guide the further development. |
@qstokkink, yeah, |
@ichorid the |
Very true indeed. IPv8 versus |
Half a month of work to refactor video-on-demand? |
@synctext, the problem is, Dispersy deprecation (and other stuff you mentioned) would be much harder to do, if we don't get the base (i.e. IPv8) right first. It would take
We know that we'll have to at least ditch Twisted and make IPv8 a separate service by the end of the year. And when we get new developers for the team we don't want them to have to learn two codebases (For example, I really appreciated what @qstokkink did with IPv8, and that I don't have to learn Dispersy programming). |
BTW, there are almost no calls to Twisted async stuff in IPv8. And those that are still there could be trivially replaced with Python |
productive discussion... For a major refactoring project like Tribler it's vital to do a deep dive and understand the illness of the patient. Parts of our code base are said to Frightening Small Children and Disconcerting Grown-ups. Please dive also into the other major headache parts of the code, now that you have profiled exit nodes and analysed IPv8. @ichorid Do you think it is a good idea to develop the required knowledge for our future micro-architecture and do a health check of all code components? I'm leaning towards standardizing on IPv8 and re-factor all communities into "event-driven Distributed Apps". The community code is the weak soft underbelly of our code base I believe. Agreed, @qstokkink? Research Question: can we devise a "trustworthy gossip" messaging middleware layer on top of the IPv8 one-to-one communication layer. As a scientist it's not about the twisted refactoring, but about the scientific breakthrough of reasoning with a simplistic trust function (trust==Trustchain hop distance) and evolving them further for coming decade. Within a 2 week sprint create a table like this? (then generated from source code annotations within a Jenkins job? :-)
|
@synctext, challenge accepted. Two weeks to produce a detailed report on the state of the code. |
It depends. The community interface is like a chef's knife:
And then there's Dispersy, which forces everyone to grab the knife by the blade instead of the handle. |
I think this issue no longer fully aligns with our future vision and is too broad. We can refactor components when we see fit, supported by an issue of properly focused scope. |
Current IPv8 classes inheritance and composition graph:
(Achtung! The width of the picture could break your monitor's bezel!)
Some problems are immediately apparent. For example:
EccCrypto
class is inherited byTunnelCommunity
twice, fromTunnelCrypto
and directly fromOverlay
, in the member with the same name(!)crypto
;Community -> EZPackOverlay -> Overlay -> EndpointListener
is essentially a single class spread out through 4 levels of abstraction. Even if, at some point, we would want to create new kinds of overlays, with their own families of communities, we should not create redundant umbrella classes for that purpose.master_peer
is used in every community. Maybe push it to Community class?On high-level design, there are some more notes:
In general, the programmer does not want to jump several levels up in inheritance hierarchy just to know how the method he looks at works. The program should be broken into small, isolated fragments that are easy to understand and maintain. Superfluous usage of inheritance mechanism does not help that at all.
Resume:
may I chop that stuff into pieces, and assemble something beautiful out of these?
EDIT:
The text was updated successfully, but these errors were encountered: