-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Beta releases with libtorrent2 and new info-hashes #15040
Comments
My main belief is not to confuse the concepts (even if they are confused in some places of the bittorrent protocol for some compatibility, etc.). |
Shouldn't we also provide so-called "torrent ID" as a separate field (both in UI and for scripts)? |
I agree. We should have two distinct concepts:
API user and script writers should be expected to know this bittorrent v2 terminology. |
There should be a clear indication of whether the torrent is V1, V2, or hybrid, and for each possible case, there should be SHA-1, SHA-256 and "truncated SHA256" fields that show all the relevant hashes. If they don't apply (e.g.
Nope. The only remaining technical limitation IIRC now is getting the port into vcpkg for ez-pz Windows CI and builds (which I am working on). |
Maybe an API field indicating the type of torrent would also be useful? As in |
For ease of use yes. But the |
Infohashes are enough.
What API do you mean? |
WebAPI |
This concept is clear for v1 and v2 torrents, but what about hybrid torrent where both hash are available? For running external program, as opposed to my earlier suggestion I think we can add only one new parameter (torrent ID) and fix |
👍
I think we may even provide no "torrent id" parameter since it is easily calculated from infohash (especially if there is single infohash). |
Treating hybrid torrents as V2 doesn't seem correct. I can already anticipate user reports that they'd like the ability to get all different infohashes from a hybrid torrent, as opposed to only getting its V2 infohash.
I would put my money on "No". It should be possible to query the V1 infohash as well as the full 64 char SHA256 V2 hash of the torrent. |
@FranciscoPombal |
👍
Thanks for clarifying. I am not totally sure what you meant by "It assumes that only one of them can be used on the command line, but what's the point?" though, can you please elaborate? I imagine that a user may have the need to get all infohashes, and providing them as a single parameter puts the additional burden of parsing them out of the string on them, which is not as nice as providing them as separate arguments. If we provide them as all separate parameters, e.g. |
A child's task...
If we provide infohashes in separate parameters user is allowed to construct command line that contains only one of them. What's the point of doing it? Can there be any valid usecases where this is needed? I can't imagine... This means that such a script will be able to handle only torrents of one of the versions, while it will still run for all the torrents. |
Of course it is easy. But if we don't do it, then everyone will have to repeat the same code over and over in their scripts. It's about making the lives of our users easier. If I'm writing a simple bash script, for instance, I'd rather not deal with it. It's not about if users can or cannot deal with it, it's about whether they have to deal with it.
Better leave this to our users' imagination. Of course none of us can possibly imagine all use cases. In general, in such cases where we provide the users the means to execute arbitrary scripts, I think the principle of "I can't imagine why this would be useful so let's not implement it" is a bad one, unless of course the implementation would be too costly, which is not the case here. |
How about the following?
I didn't say that. Even if there is some exotic usecase here, it can still be handled with just one parameter for all infohashes.
This is regardless of the number of parameters. Any script will need to contain code that determines the number of available infohashes. In any case, I don't intend to argue about it. Since this applies to the user interface, then let the users (the one who expresses the point of view of a hypothetical user of this feature) determine how it should be. If they are satisfied with an inconsistent interface for the sake of getting rid of more than trivial parsing of a pair of hashes from a single parameter, then let them use it. |
OK, I have no interest in arguing about this either. But I'd appreciate it if you could elaborate on this:
Why does providing one parameter per infohash (for a total of 3) result in an "inconsistent interface", as opposed to exposing a single parameter that outputs a comma-separated list? Not saying the latter makes it "inconsistent" either, but I'd really like to know why you think the former does. |
There are only 2 possible infohashes in current implementation. |
I meant 3 different "torrent identification values" that the user might care about: V1 hash, the "V2 torrent ID" (which is the 40-byte truncated SHA256 hash), and the full V2 SHA256 hash itself. |
In libtorrent 2.0 you can't control how much RAM you want to dedicate to disk caching. It's managed by the kernal and from my experience the kernal allocates almost all the RAM to qBt disk cache and later frees up if some other apps need it. This is problematic because if qBt uses some insane amount of the RAM, system may become less responsive and the user will have no way to control this behaviour. |
Why is this not desired? This is exactly what you want from a data transfer program. On the networking side, μTP was developed with the same principle in mind: it uses all available network capacity, but backs off if other applications need it. It makes sense that consumption of disk I/O resources follows a similar principle. Most performance issues users face right now can be traced back to either RC_1_2's custom disk cache, or doing multiple fast downloads to an HDD while not knowing that HDDs are bad at random workloads.
I trust modern kernels to manage the cached memory efficiently, much more than some userspace program... don't you?
It's absolutely logical: RC_2_0 has support for highly anticipated features and is very stable as well. Plus I would think RC_1_2 is receiving some of its last "regular" patches. I believe arvidn has mentioned in the past he wants to drop it, he's just waiting for RC_2_0 to gain critical mass.
It will take longer if qBittorrent, one of the most used clients, doesn't adopt it. We can drive adoption by switching to it. Can't wait to drink the tears of μT 2.2.1 boomers when trackers switch to V2. If you do want to stick with RC_1_2, you can keep using whatever qBittorrent version last supported it, it won't magically stop working once the newer V2 versions are released... |
I have provided a 4.4.0beta1 release based on libtorrent RC_2_0. |
#15097 also provides v1/v2 infohashes and torrent ID as parameters for external scripts in "Run external program" feature. |
@glassez then this can be closed? And after a few betas we can release 4.4.0 stable? I mean there isn't any v2-torrent issues pending, right? |
But there are still a few problems with the support of v2 torrents, both in qBittorrent and libtorrent. |
Are those listed somewhere or can you list them here? |
@sledgehammer999 may be no harm to peruse #15109 |
As per #15109, I'd say we are not that close. There are known hangs and crashes still, and builds with 2.x have not received extensive testing of features by any remotely significant number of people. It would be more accurate to classify it as an "alpha", IMO. |
@sledgehammer999 |
My intention is to release the 4.4.x series based on libtorrent2. Because of that I intend to do a few beta releases. They will still be based on Qt 5.15.
I suppose there isn't an objection to switching to libtorrent2, right?
From a discussion with @glassez and @Chocobo1 it was indicated there is a situation on how to handle the new info-hashes.
Background: Libtorrent2 now supports v2 torrents. The v2 torrents have an sha-256 infohash whereas the v1 torrent have an sha1 infohash. The difference is in the length. sha-256 is 64 chars long while sha1 is 40 chars long (when represented in hex).
The bittorrent protocol chooses to ID the v2 torrents by truncating their sha-256 hash to 40 chars (to be represented as fake sha1 hash). Also there can be a hybrid torrent which has both a valid sha1 (not truncated sha-256) and a valid sha-256 hash.
From my understanding there are 2 pending issues to be tackled:
For number 1 I think it is easy. Just add another field in the GUI/WEBUI.
For number 2 @glassez and @Chocobo1 had some proposals. I'll let them present them in the comments.
Mostly devs or script users are expected to weigh in here.
Also I notify @qbittorrent/frequent-contributors @qbittorrent/bug-handlers
The text was updated successfully, but these errors were encountered: