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: increase providers validity to 48 hours #2801

Merged
merged 6 commits into from
Nov 16, 2024
Merged

Conversation

2color
Copy link
Contributor

@2color 2color commented Nov 4, 2024

Description

Notes & open questions

The kad-dht specs says:

Provider Record Republish Interval: The content provider needs to make sure that the nodes chosen to store the provider record are still online when clients ask for the record. In order to guarantee this, while taking into account the peer churn, content providers republish the records they want to provide. Choosing the particular value for the Republish interval is network-specific and depends on several parameters, such as peer reliability and churn.
For the IPFS network it is currently set to 22 hours.

However in our implementation we take a different approach, whereby we run the cleanUp method every 2 hours and only if the record expires in 2 hours do we queue it for a reprovide. This effectively results in a 44 hour Provider Record Republish Interval

if (this.peerId.equals(peerId) && (now - expires) < this.reprovideThreshold) {
this.queueReprovide(cid)
.catch(err => {
this.log.error('could not reprovide %c - %e', cid, err)
})

Should we increase the REPROVIDE_THRESHOLD from 2 hours to 24 hours?

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@2color 2color requested a review from a team as a code owner November 4, 2024 09:19
@SgtPooki SgtPooki changed the title fix: increase providers vality to 48 hours fix: increase providers validity to 48 hours Nov 7, 2024
@achingbrain achingbrain merged commit 4329553 into main Nov 16, 2024
34 checks passed
@achingbrain achingbrain deleted the provider-validty branch November 16, 2024 10:25
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.

2 participants