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

define the ProviderAddrTTL in this repo #797

Merged
merged 1 commit into from
Nov 20, 2022
Merged

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Nov 20, 2022

It was previously defined in the peerstore package, but we removed it from there (see libp2p/go-libp2p@0e1b7df), because kad was the only consumer.

This PR will be necessary to update go-libp2p to v0.24.0, here and in kubo.

// ProviderAddrTTL is the TTL of an address we've received from a provider.
// This is also a temporary address, but lasts longer. After this expires,
// the records we return will require an extra lookup.
const ProviderAddrTTL = time.Minute * 30
Copy link
Contributor

Choose a reason for hiding this comment

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

This was a var in go-libp2p, presumably for customization? Any reason you changed to const? (I don't really feel strongly here just want the rationale written down somewhere.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. It wasn't used, as far as I can see.
  2. Using package-level globals for configuration is an antipattern.

No strong feelings though, happy to change it back if desired.

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.

None yet

2 participants