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

When downloading blobs with the BackgroundDownloaderComponent check that the candidate prefix has an overlapping first byte with us #3571

Merged
merged 7 commits into from
Feb 28, 2022

Conversation

shyba
Copy link
Member

@shyba shyba commented Feb 11, 2022

No description provided.

@shyba shyba added area: blobs/files type: improvement Existing (or partially existing) functionality needs to be changed labels Feb 11, 2022
@@ -413,7 +413,8 @@ async def download_blobs_in_background(self):
self.space_available = await self.space_manager.get_free_space_mb(True)
if not self.is_busy and self.space_available > 10:
blob_hash = next((key.hex() for key in self.dht_node.stored_blob_hashes if
key.hex() not in self.blob_manager.completed_blob_hashes), None)
key[0] == self.dht_node.protocol.node_id[0]
Copy link
Member

Choose a reason for hiding this comment

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

I think there should be a constant to determine how many bits are matching

Copy link
Member Author

Choose a reason for hiding this comment

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

extracted to MIN_PREFIX_COLLIDING_BITS

@lbry-bot lbry-bot assigned shyba and unassigned jackrobison Feb 16, 2022
@shyba shyba force-pushed the only_download_close_values branch from 23a78b2 to a6b7817 Compare February 19, 2022 06:09
@lbry-bot lbry-bot assigned shyba and unassigned shyba Feb 19, 2022
@coveralls
Copy link

coveralls commented Feb 19, 2022

Coverage Status

Coverage increased (+0.02%) to 69.653% when pulling f68ea01 on only_download_close_values into dd5b9ca on master.

@shyba shyba force-pushed the only_download_close_values branch from a6b7817 to 5004127 Compare February 21, 2022 01:25
@shyba shyba force-pushed the only_download_close_values branch from 5004127 to d1bc981 Compare February 21, 2022 01:35
@shyba shyba force-pushed the only_download_close_values branch from a9e5a36 to 2a1e1d5 Compare February 22, 2022 17:26
@shyba shyba force-pushed the only_download_close_values branch from 9c095e7 to f68ea01 Compare February 23, 2022 01:38
@shyba shyba merged commit 1aa4d9d into master Feb 28, 2022
@shyba shyba deleted the only_download_close_values branch February 28, 2022 16:06
@jackrobison jackrobison changed the title Seed mode: check that the candidate blob is at least 1 prefix byte close to peer id When downloading blobs with the BackgroundDownloaderComponent check that the candidate prefix has an overlapping first byte with us Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: blobs/files type: improvement Existing (or partially existing) functionality needs to be changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants