From f6e8b2cefa22ec20e3cbfdc1c8e31a09153e3947 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 5 Jan 2023 18:16:32 +0100 Subject: [PATCH 1/2] feat: remove Bitswap.ProviderSearchDelay Ref. https://github.com/ipfs/kubo/issues/8807#issuecomment-1371351845 Closes #8807 --- core/node/bitswap.go | 2 +- docs/config.md | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/node/bitswap.go b/core/node/bitswap.go index 42b948f7520..b9fbdbc28db 100644 --- a/core/node/bitswap.go +++ b/core/node/bitswap.go @@ -22,7 +22,7 @@ const ( DefaultTaskWorkerCount = 8 DefaultEngineTaskWorkerCount = 8 DefaultMaxOutstandingBytesPerPeer = 1 << 20 - DefaultProviderSearchDelay = 1000 * time.Millisecond + DefaultProviderSearchDelay = 0 * time.Millisecond ) type bitswapOptionsOut struct { diff --git a/docs/config.md b/docs/config.md index aae2017d0a8..48403753a8b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -972,11 +972,15 @@ Type: `optionalInteger` (byte count, `null` means default which is 1MB) ### `Internal.Bitswap.ProviderSearchDelay` -This parameter determines how long to wait before looking for providers outside of bitswap. -Other routing systems like the DHT are able to provide results in less than a second, so lowering -this number will allow faster peers lookups in some cases. +Optional delay before looking for providers outside of bitswap, +using routers configured in [`Routing`](#routing) (e.g., DHT, IPNI). -Type: `optionalDuration` (`null` means default which is 1s) +Setting to `1s` may decrease the number of DHT and IPNI queries at the cost of +increased latency. It is advised to keep this unset unless you are confident +the most of requested data will be provided by [`Peering.Peers`](#peering) over +bitswap. More details in [kubo#8807](https://github.com/ipfs/kubo/issues/8807). + +Type: `optionalDuration` (`null` means default which is `0s`) ### `Internal.UnixFSShardingSizeThreshold` From 0724d2ac4f4a38b1588dca5247bffeb754ef11f4 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 17 Jan 2023 18:08:16 +0100 Subject: [PATCH 2/2] fix: set ExecuteAfter=1s for IPNI routers https://github.com/ipfs/kubo/pull/9530#issuecomment-1385266880 --- core/node/libp2p/routingopt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/node/libp2p/routingopt.go b/core/node/libp2p/routingopt.go index bfb45971cc9..7abe004faf3 100644 --- a/core/node/libp2p/routingopt.go +++ b/core/node/libp2p/routingopt.go @@ -89,7 +89,7 @@ func ConstructDefaultRouting(peerID string, addrs []string, privKey string) func Router: r, 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, + ExecuteAfter: 1 * time.Second, // https://github.com/ipfs/kubo/pull/9530#issuecomment-1385266880 }) }