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

Improvements and bug fixes for iterative find #3559

Merged
merged 25 commits into from
Mar 2, 2022
Merged

Improvements and bug fixes for iterative find #3559

merged 25 commits into from
Mar 2, 2022

Conversation

shyba
Copy link
Member

@shyba shyba commented Feb 4, 2022

backwards-incompatible: removed unused search_bottom_out_limit from peer list API (it was ignored before and got removed entirely from internals)

  • closest peer is only considered when already contacted and not known to be bad
  • don't add bad peers to active
  • reset closest and previous closest if they go bad during search
  • fix sorting on search round
  • improved and unified some of value/node find debug logging into a common one

@coveralls
Copy link

coveralls commented Feb 7, 2022

Coverage Status

Coverage remained the same at 70.101% when pulling ccacb5e on dht_bug into 1aa4d9d on master.

@shyba shyba force-pushed the dht_bug branch 5 times, most recently from 61bfb39 to 64ef302 Compare February 8, 2022 20:08
@shyba shyba added area: DHT type: improvement Existing (or partially existing) functionality needs to be changed labels Feb 16, 2022
@shyba shyba force-pushed the dht_bug branch 2 times, most recently from d8c3964 to d00b5be Compare February 21, 2022 13:52
self.prev_closest_peer = self.closest_peer
self.closest_peer = peer
self.active[peer] = self.distance(peer.node_id)
self.active = OrderedDict(sorted(self.active.items(), key=lambda item: item[1]))
Copy link
Member

Choose a reason for hiding this comment

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

instead of remaking the ordered dict you could use an always-sorted list that you insort into

@shyba shyba merged commit f05943f into master Mar 2, 2022
@shyba shyba deleted the dht_bug branch March 2, 2022 16:00
@jackrobison jackrobison changed the title DHT: iterative find bugfixes and better logging Improvements and bug fixes for iterative find Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DHT 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