-
Notifications
You must be signed in to change notification settings - Fork 452
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
Performing direct payouts to other Tribler clients #3776
Conversation
59bb192
to
dfda88e
Compare
e81c2e3
to
eb0fa0f
Compare
While I haven't finished the big experiment yet, I think this PR is ready for review 👍 |
# this peer runs a Tribler instance | ||
if self.state_cb_count % 5 == 0 and download.get_hops() == 0 and self.payout_manager: | ||
for peer in download.get_peerlist(): | ||
if 'Tribler' in peer["extended_version"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do a .startswith()
here? It is more efficient.
if self.state_cb_count % 5 == 0 and download.get_hops() == 0 and self.payout_manager: | ||
for peer in download.get_peerlist(): | ||
if 'Tribler' in peer["extended_version"]: | ||
self.payout_manager.update_peer(peer["id"].decode('hex'), infohash, peer["dtotal"]) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The peer ID is already encoded in hex format: https://github.com/Tribler/tribler/blob/next/Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py#L852
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor stuff, rest seems good.
eb0fa0f
to
877f832
Compare
6bf9f11
to
be926f8
Compare
c78f069
to
396ab47
Compare
Status update: it seems that the direct payouts is working correctly, however, I think there is a bug in the DHTDiscoveryCommunity since peers are removed after around one minute, even though they are pinged. Functional experiment (where I removed the (buggy?) code that deletes peers from the DHT storage): https://jenkins-ci.tribler.org/job/pers/job/direct_download_devos50/96/ Final interaction graph (not all peers are downloading something): Since this is not a bug specific to this PR, I consider this PR ready for merge and another review. I will discuss my observations with @egbertbouman tomorrow. |
396ab47
to
be926f8
Compare
This PR implements direct payouts between Tribler instances (zero-hop downloads).
TODO:
Fixes #3718