-
Notifications
You must be signed in to change notification settings - Fork 253
provider: schedule #1117
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
Merged
Merged
provider: schedule #1117
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3bfb1ff to
a191032
Compare
2 tasks
gammazero
approved these changes
Jul 25, 2025
gammazero
approved these changes
Aug 12, 2025
guillaumemichel
added a commit
that referenced
this pull request
Aug 19, 2025
* provider: adding provide and reprovide queue * provider: network operations * add some tests * schedule prefix len computations * provider schedule * addressed review * use go-test/random * satisfy linter * log errors during initial prefix len measurement * address review * satisfy linter * simplify unscheduleSubsumedPrefixesNoClock * moved maxPrefixSize const to top
guillaumemichel
added a commit
to guillaumemichel/go-libp2p-kad-dht
that referenced
this pull request
Sep 17, 2025
* provider: adding provide and reprovide queue * provider: network operations * add some tests * schedule prefix len computations * provider schedule * addressed review * use go-test/random * satisfy linter * log errors during initial prefix len measurement * address review * satisfy linter * simplify unscheduleSubsumedPrefixesNoClock * moved maxPrefixSize const to top
guillaumemichel
added a commit
that referenced
this pull request
Sep 17, 2025
* provider: adding provide and reprovide queue * provider: network operations * add some tests * schedule prefix len computations * provider schedule * addressed review * use go-test/random * satisfy linter * log errors during initial prefix len measurement * address review * satisfy linter * simplify unscheduleSubsumedPrefixesNoClock * moved maxPrefixSize const to top
guillaumemichel
added a commit
that referenced
this pull request
Sep 18, 2025
* provider: adding provide and reprovide queue * provider: network operations * add some tests * schedule prefix len computations * provider schedule * addressed review * use go-test/random * satisfy linter * log errors during initial prefix len measurement * address review * satisfy linter * simplify unscheduleSubsumedPrefixesNoClock * moved maxPrefixSize const to top
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #1095
Depends on #1116
Schedule
The crux of the Reprovide Sweep is to hold a schedule to know when to reprovide parts of the keyspace to avoid the burst of reproviding everything at once.
The schedule is a datastructure storing the prefixes associated with the explored keyspace regions, and the time for which they should be reprovided next. The schedule contains no overlapping prefix (e.g no prefix included in the schedule is a superstring of another prefix in the schedule).
The schedule only contains the keyspace regions for which the provider is (re)providing keys. E.g if the provider is only reproviding a single key, the schedule will contain a single region, whose identifier is a prefix of this key.
Provide Cycle
ReprovideIntervaldetermine the duration of the provide cycle.00at time offset001at time offsetReprovideInterval / 410at time offsetReprovideInterval / 211at time offset3 * ReprovideInterval / 4The time at which a keys matching a region should be reprovided is not a timestamp, but a time offset compared to the provide cycle. The provide cycle starts when the
SweepingProvideris initialized.providerafter provider: schedule prefix length #1116 is merged