From e65885ae5ec6f09f5b4f1760c2ee1a0a63ce4a69 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 7 Dec 2022 19:22:04 +0100 Subject: [PATCH] docs: Routing.Type=auto timeouts for DHT/IPNI Based on feedback from https://github.com/ipfs/kubo/pull/9475 --- core/node/libp2p/routingopt.go | 8 ++++---- docs/changelogs/v0.18.md | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/node/libp2p/routingopt.go b/core/node/libp2p/routingopt.go index df553ace4f3..e28762ce4ad 100644 --- a/core/node/libp2p/routingopt.go +++ b/core/node/libp2p/routingopt.go @@ -57,8 +57,8 @@ func ConstructDefaultRouting(peerID string, addrs []string, privKey string) func } routers = append(routers, &routinghelpers.ParallelRouter{ Router: dhtRouting, - IgnoreError: false, // TODO: confirm this is what we want - Timeout: 1 * time.Minute, // TODO: what value makes sense here? + IgnoreError: false, + Timeout: 5 * time.Minute, // https://github.com/ipfs/kubo/pull/9475#discussion_r1042501333 ExecuteAfter: 0, }) @@ -70,8 +70,8 @@ func ConstructDefaultRouting(peerID string, addrs []string, privKey string) func } routers = append(routers, &routinghelpers.ParallelRouter{ Router: httpRouter, - IgnoreError: true, // TODO: confirm this is what we want - Timeout: 1 * time.Minute, // TODO: what value makes sense here? + IgnoreError: true, // https://github.com/ipfs/kubo/pull/9475#discussion_r1042507387 + Timeout: 15 * time.Second, // 5x server value from https://github.com/ipfs/kubo/pull/9475#discussion_r1042428529 ExecuteAfter: 0, }) } diff --git a/docs/changelogs/v0.18.md b/docs/changelogs/v0.18.md index 35f1489488f..147a4fb1d60 100644 --- a/docs/changelogs/v0.18.md +++ b/docs/changelogs/v0.18.md @@ -75,11 +75,13 @@ The default `Routing.Type` is changed from `dht` to `auto`. When `Routing.Type` is unset or set to `auto`, your node will accelerate some types of routing by leveraging HTTP endpoints compatible with [IPIP-337](https://github.com/ipfs/specs/pull/337) -in addition to the IPFS DHT. +in addition to the IPFS DHT. DHT response timeout in `auto` mode is 5 minutes, and IPNI is 3 seconds. By default, an instance of IPNI ([InterPlanetary Network Indexer](https://github.com/ipni/specs/blob/main/IPNI.md#readme)) at https://cid.contact is used. + Old behavior can be restored by setting `Routing.Type` to `dht`. + Alternative routing rules, including alternative IPNI endpoints, can be configured in `Routing.Routers` after setting `Routing.Type` to `custom`. Learn more in [`Routing` docs](https://github.com/ipfs/kubo/blob/master/docs/config.md#routing).