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

fix and simplify some bootstrapping logic #405

Merged
merged 10 commits into from
Nov 6, 2019

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Nov 5, 2019

  • Don't bootstrap more than 16 buckets: We can't generate target IDs in buckets beyond bucket 15 so there's no point.
  • Bootstrap sequentially: The default timeout is 10s so this won't take that long anyways. On the other hand, if we do this all at once, we max the swarms dial queue.
  • Rename triggerAutoBootstrap to autoBootstrap. This variable used to control triggering only but now completely disables automatic bootstrapping.
  • Remove the BootstrapConfig. We introduced this before we switched to functional options. Now that we're breaking the interfaces anyways, we might as well use functional options all the way (easier to extend).
  • Always query self when bootstrapping. This really isn't that expensive and ensures that we know how many buckets we should bootstrap.
  • Don't abort the bootstrap process if we timeout finding ourselves.
  • Rename bootstrap to refresh everywhere as these aren't really the same thing (pointed out by @raulk).

* Rename triggerAutoBootstrap to autoBootstrap. This variable used to control
_triggering_ only but now completely disables automatic bootstrapping.
* Remove the BootstrapConfig. We introduced this before we switched to
functional options. Now that we're breaking the interfaces anyways, we might as
well use functional options all the way (easier to extend).
* Always query self (feedback from @raulk).
* Important: don't abort the bootstrap process if we timeout finding ourselves.
The default timeout is 10s so this won't take that long anyways. On the
other hand, if we do this all at once, we max the swarms dial queue.
We can't generate target IDs in buckets beyond bucket 15 so there's no point.
@aarshkshah1992
Copy link
Contributor

@Stebalien Great stuff. Do you need help with this ?

@Stebalien
Copy link
Member Author

Nah, I'm just trying to handle some last minute review from raul so we can cut a release.

@Stebalien
Copy link
Member Author

Actually, if you have some time, a review would be great!

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

LGTM, except for what seems like a concurrency bug and a few nits.

dht_bootstrap.go Show resolved Hide resolved
dht_bootstrap.go Outdated Show resolved Hide resolved
dht_bootstrap.go Outdated Show resolved Hide resolved
dht_bootstrap.go Outdated Show resolved Hide resolved
dht_bootstrap.go Outdated Show resolved Hide resolved
notif.go Outdated Show resolved Hide resolved
notif.go Outdated Show resolved Hide resolved
As pointed out by raul, bootstrapping and refreshing are not the same thing.
Bootstrapping is the initial setup (i.e., connect to some initial nodes to get
started). Refreshing is the process of refreshing the routing table.
@Stebalien Stebalien merged commit 8ecf938 into master Nov 6, 2019
@Stebalien Stebalien deleted the feat/simplify-bootstrapping branch November 6, 2019 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants