-
Notifications
You must be signed in to change notification settings - Fork 451
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
Tribler code review #3646
Comments
Monitor-bezel-crushing image of Tribler module imports.
(p.s. used |
It seems Guys, could someone comment on this issue? |
It should be used here in the
You should be able to trigger this through searching for a torrent. |
The only place where something tribler/Tribler/community/search/community.py Line 526 in b096b9b
But it is never run! tribler/Tribler/community/search/community.py Line 516 in b096b9b
is always empty. You could literally comment out .download_torrent , and Tribler GUI works as usual. Channels, search, anonymous downloads, mining - everything works.
So, what the |
Basically, tribler/Tribler/community/search/community.py Line 509 in b096b9b
|
@egbertbouman can you say anything about this? |
It should collect 50k of torrents slowly in the background. The TFTP binary transfer of torrents never worked smoothly. You found another skeleton in our collection... We have an open issue for magnet links only Tribler operation. Discussion started 3 years ago #1150 |
I can probably answer your question about the remote torrent handler module. Another purpose of the module, besides what @synctext says, is to speed up the process of fetching torrent metadata. In particular, when clicking on a torrent in Tribler (i.e. a search result or a torrent inside a channel), it would try to fetch the torrent from other candidates. The torrent file itself would be sent using the TFTP protocol and the data was sent over the Dispersy endpoint (since this endpoint was already NAT punctured by Dispersy). I even think there is a separate prefix for this. It used to be this way in the old GUI. When I built the new GUI, I added support for fetching torrent metadata using HTTP/UDP trackers and the DHT. Since (re)adding support for the TFTP transfer of torrent metadata was not very high on my priority list, this feature was never added back to the GUI. The code still exists in the original code base, together with a few tests (which are not really unit tests...). I highly doubt whether we want to re-add this feature again. For now, I would be fine if you remove the TFTP module and code that manages fetching torrents from others. Let's discuss this next week 👍 |
@devos50 The RemoteTorrentHandler used to do a lot more than just TFTP torrent collecting, it's also capable of collecting from magnet/DHT/candidates. All this functionality is still in there, but I guess we stopped using this while creating the new GUI. As far as TFTP goes, I don't think this has ever worked properly. If you look at the code you'll see the that it will only try to collect torrents that we already have 😢 This means that collect-requests are still coming in, but we never actually discover a new torrent. |
I talked to everyone involved, and it seems the consensus is: "we used this stuff in the old days, but now its irrelevant, so it should go". So, its removal is on the list. |
Well, before it is deleted... We need to know the consequences. No full .torrent collecting anymore? Have measurements proven that magnet-based BEP9 collecting is now fast enough? Is there a design for anonymous downloads and getting the .torrent? |
@synctext, I've just ran Tribler with this stuff completely disabled, and it worked fine. Search, channels, downloads - everything ran fine. Torrent collecting is redundant now. |
@synctext I looked into the TFTP torrent collecting, and at the moment it's not working at all. That means that we are only collecting torrents from the DHT/trackers after some user interaction (e.g., downloading a torrent). For testing purposes, I did a 1-line fix, and Tribler magically started collecting TFTP torrents. So, if we are OK with the amount of torrents we are collecting right now, we could remove it. Note that because we are not currently collecting torrents in the background, we are essentially gossiping all our downloads within the SearchCommunity... |
Thank you for finding this out! |
@synctext, we're gonna scrape all of this in favor of AllChannel2.0, the Heir to Dispersy. We definitely want to have some mechanism for background torrent metadata exchange, at least for anonymity purposes. However, there is no point in reclaiming this old code. |
We first need a spam solution, protection against an attack in AllChannels mechanisms with merely $1000 worth of cloud servers. With solid foundation we can focus on fancy features. Please focus on linking Trustchain non-cheap identities to content discovery. Perfect if we can all do that in 1 upgrade, but I prefer to first remove the SyncAll broadcast in AllChannel community, upgrade to IPv8, and discard all channels votes with Trustchain > 2 hops (and a future Max-Edge-Flow > 1 GByte). That is a lot of features to get flawlessly deployed, correct? |
- that is exactly what I meant by "Dispersy v1.9 refactored"! |
Each object in our codebase has its own SQL access methods... It would greatly simplify and unify all SQL-related stuff. |
Yes, ORM is also on my 2019 wish list. Our running old-IPv8 ORM code: Please take the time to read about our operational 2010 work with this code: https://repository.tudelft.nl/islandora/object/uuid:52b586ea-6144-4b4e-a5a1-b05255ce493a Plus IPv8 in 2010 with ORM: |
Impressive how fast you comprehend our code base. |
@synctext, I have to, to be able to keep up with the pace of development... |
IPv8 issues: auth = BinMemberAuthenticationPayload(self.my_peer.public_key.key_to_bin()).to_pack_list()
dist = GlobalTimeDistributionPayload(self.claim_global_time()).to_pack_list()
payload = MyMessage(self.BLABLABLA).to_pack_list() is a classic example of a boilerplate code that is used in every message in every community. |
@ichorid the |
@qstokkink, but it is in your wiki tutorial... |
@ichorid good point, I'll remove that. |
I've done some quick check for duplicates in Triber with Clonedigger.
(p.s. the analysis does not include unit tests.) @devos50 , I guess this kind of analysis could be useful for your efforts with Market. |
Looks like IPv8 has some duplicates too:
|
Bear in mind, though, that Clonedigger's algorithm is language-agnostic and prone to false positives. So, take these stats with a proper grain of salt. |
For the whole Tribler/next, without Dispersy and Test directories, and without submodules:
|
Anyone willing to continue this work - welcome! |
This is the big list of things I found out during the review.
TODO:
run_tribler.py: __main__
runs twice, refactor in 2-3 separate files.LaunchManyCore
should be completely refactored by splitting into the series of smaller objects/methods. Its torrent-handling functionality should be moved to the torrent manager.APIImplementation
dir should be scrapped completely after refactoringLaunchManyCore
.RemoteTorrentHandler.py
contains almost completely dead code. EDIT: it used to collect torrents in the background for anonymity and quality of service, but was broken a long time ago. Not gonna fix, should just redo this in AllChannel2.0.SqliteCacheDBHandler.py
is full of awful old code that should basically be completely gone when we move to AllChannel2.0. For example,PeerDB
is only written, and is never read. We should keep SQL usage to a minimum to be as stateless as possible.Notifier.py
- subjects should not be pre-set in Notifier. Instead, they should be defined dynamically by users of Notifier object, in their respective modules.2k lines of code in 2(two!) objects! And some more high-level stuff is spread out through the rest of the codebase. There is a LOT of valuable experience in this code, so refactoring should be done carefully.
TorrentDef.py
- includes dumb TorrentDefNoMetainfo object that forces everyone to check the object type. Should be refactored to become one with TorrentDef. Which should be moved into TorrentMgr module.TriblerStatistics
object should be used as a parent class for Session, instead of being wrapped around.The text was updated successfully, but these errors were encountered: