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

feat: Routing.Type=auto (DHT+IPNI) #9475

Merged
merged 11 commits into from
Dec 8, 2022
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Dec 7, 2022

TLDR

Kubo will now use DHT and IPNI at cid.contact at the same time.

This PR results in faster lookup times from IPNI for most use cases on average, while still maintaining the resiliency of DHT.
I've been running this for a while and end users should see a positive change in the time it takes to load DNSLink websites, or lookup a provider for a CID.

Closes #9454 Closes #9422

Details

  • Removes default Routing.Type from user config (it is not implicit)
  • Changes the implicit default Routing.Type from dht to auto
  • Configures Routing.Type=auto to ask DHT and IPNI at cid.contact in parallel

Full context: #9422 (comment)

TODO before merge

@lidel lidel requested a review from ajnavarro December 7, 2022 16:11
core/node/libp2p/routingopt.go Outdated Show resolved Hide resolved
core/node/libp2p/routingopt.go Outdated Show resolved Hide resolved
@lidel lidel force-pushed the feat/implicit-routing-defaults branch from 682c21e to 57b98fe Compare December 7, 2022 17:55
This changes the default routing to to be implicit DHT+IPNI

Full context:
#9422 (comment)
@lidel lidel force-pushed the feat/implicit-routing-defaults branch from 57b98fe to e65885a Compare December 7, 2022 18:23
@lidel lidel marked this pull request as ready for review December 7, 2022 18:33
core/node/libp2p/routingopt.go Outdated Show resolved Hide resolved
config/profile.go Outdated Show resolved Hide resolved
core/node/libp2p/routingopt.go Outdated Show resolved Hide resolved
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/config.md Outdated Show resolved Hide resolved
docs/config.md Show resolved Hide resolved
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/changelogs/v0.18.md Show resolved Hide resolved
lidel added a commit to ipfs/fs-repo-migrations that referenced this pull request Dec 7, 2022
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/config.md Outdated Show resolved Hide resolved
docs/config.md Outdated Show resolved Hide resolved
@lidel
Copy link
Member Author

lidel commented Dec 8, 2022

Defaulting to cid.contact breaks private networks feature – leaking private CIDs to public HTTP endpoint, and/or learning about providers which are useless due to the lack of shared key.

I will add a check that tries to swithc to dht-only, and if that fails refuses to start with auto and (LIBP2P_FORCE_PNET or swarm.key present).

lidel added a commit that referenced this pull request Dec 8, 2022
@lidel lidel force-pushed the feat/implicit-routing-defaults branch from 15fd9b1 to 753b3da Compare December 8, 2022 19:11
@lidel
Copy link
Member Author

lidel commented Dec 8, 2022

Resolved, ready for final review @BigLep @guseggert

Copy link
Contributor

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

Good stuff - thanks @lidel !

docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
docs/changelogs/v0.18.md Outdated Show resolved Hide resolved
lidel and others added 3 commits December 8, 2022 21:51
IPNI enabled by default made tests fail due to false-negative:
Kubo was able to find provider for "foo" "bar" thanks to IPNI.

This ensures data is unique enough to have no providers.
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.

Add implicit HTTP delegated router for cid.contact network indexer Update Kubo to new HTTP Delegated Routing
5 participants