Skip to content
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

Merged
merged 4 commits into from
Aug 12, 2018

Conversation

devos50
Copy link
Contributor

@devos50 devos50 commented Aug 9, 2018

This PR implements direct payouts between Tribler instances (zero-hop downloads).

TODO:

Fixes #3718

@devos50 devos50 force-pushed the zero_hop_payout branch 4 times, most recently from 59bb192 to dfda88e Compare August 9, 2018 11:54
@devos50 devos50 force-pushed the zero_hop_payout branch 3 times, most recently from e81c2e3 to eb0fa0f Compare August 9, 2018 14:00
@devos50
Copy link
Contributor Author

devos50 commented Aug 9, 2018

While I haven't finished the big experiment yet, I think this PR is ready for review 👍

@devos50 devos50 requested review from qstokkink and xoriole August 9, 2018 14:09
# 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"]:
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright 👍

Copy link
Contributor

@qstokkink qstokkink left a 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.

qstokkink
qstokkink previously approved these changes Aug 9, 2018
qstokkink
qstokkink previously approved these changes Aug 10, 2018
@devos50
Copy link
Contributor Author

devos50 commented Aug 12, 2018

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):
trustchain_interactions

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.

@devos50 devos50 changed the title WIP: Performing direct payouts to other Tribler clients READY: Performing direct payouts to other Tribler clients Aug 12, 2018
@devos50 devos50 requested a review from qstokkink August 12, 2018 10:35
@devos50 devos50 changed the title READY: Performing direct payouts to other Tribler clients Performing direct payouts to other Tribler clients Aug 12, 2018
@devos50 devos50 merged commit d2611b5 into Tribler:next Aug 12, 2018
@devos50 devos50 deleted the zero_hop_payout branch August 12, 2018 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants