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

GetProvidersResult should return unique providers #1507

Closed
mikevoronov opened this issue Mar 23, 2020 · 3 comments · Fixed by #1528
Closed

GetProvidersResult should return unique providers #1507

mikevoronov opened this issue Mar 23, 2020 · 3 comments · Fixed by #1528

Comments

@mikevoronov
Copy link
Contributor

mikevoronov commented Mar 23, 2020

It seems that providers from GetProvidersResult could contain non-unique peers. I think that this behaviour could be error-prone for users of rust-libp2p (I've already stumbled with that:)) and providers should be unique.

@mxinden
Copy link
Member

mxinden commented Mar 25, 2020

Given that we don't group the providers by response, we could replace the Vec with a HashSet within GetProviders.

@romanb what do you think?

@romanb
Copy link
Contributor

romanb commented Mar 26, 2020

Sounds ok to me. Furthermore, if we want to introduce a configurable or hard-coded limit on how many providers to look for, terminating the query early if enough providers are found (as I think other libp2p-kad implementations offer), we would need to de-duplicate anyway.

@mxinden
Copy link
Member

mxinden commented Mar 30, 2020

#1528 would fix the duplication.


Furthermore, if we want to introduce a configurable or hard-coded limit on how many providers to look for, terminating the query early if enough providers are found (as I think other libp2p-kad implementations offer), we would need to de-duplicate anyway.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants