From 7ea71cfa0ddc16d5d2c4af2f4b06f1862d2d114b Mon Sep 17 00:00:00 2001 From: guillaumemichel Date: Fri, 9 Jan 2026 14:39:07 +0100 Subject: [PATCH 1/3] fix(provider): wait for fullrt crawl completion before providing --- core/node/provider.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/core/node/provider.go b/core/node/provider.go index a780da3d704..22eef7b995d 100644 --- a/core/node/provider.go +++ b/core/node/provider.go @@ -322,6 +322,25 @@ type dhtImpl interface { Host() host.Host MessageSender() dht_pb.MessageSender } + +type fullrtRouter struct { + *fullrt.FullRT +} + +// GetClosestPeers overrides fullrt.FullRT's GetClosestPeers and returns an +// error if the fullrt's initial network crawl isn't complete yet. +func (fr *fullrtRouter) GetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) { + if !fr.Ready() { + return nil, errors.New("fullrt: initial network crawl still running") + } + return fr.FullRT.GetClosestPeers(ctx, key) +} + +var ( + _ dhtImpl = &dht.IpfsDHT{} + _ dhtImpl = &fullrtRouter{} +) + type addrsFilter interface { FilteredAddrs() []ma.Multiaddr } @@ -400,7 +419,7 @@ func SweepingProviderOpt(cfg *config.Config) fx.Option { } case *fullrt.FullRT: if inDht != nil { - impl = inDht + impl = &fullrtRouter{inDht} } } if impl == nil { From 73636956897c19c84dec79772eba3d34d7887a32 Mon Sep 17 00:00:00 2001 From: guillaumemichel Date: Fri, 9 Jan 2026 14:58:08 +0100 Subject: [PATCH 2/3] changelog --- docs/changelogs/v0.40.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/changelogs/v0.40.md b/docs/changelogs/v0.40.md index 19f785de899..d492541e16b 100644 --- a/docs/changelogs/v0.40.md +++ b/docs/changelogs/v0.40.md @@ -13,6 +13,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team. - [Routing V1 HTTP API now exposed by default](#routing-v1-http-api-now-exposed-by-default) - [Track total size when adding pins](#track-total-size-when-adding-pins) - [Skip bad keys when listing](#skip_bad_keys_when_listing) + - [Fix accelerated DHT provider bootstrap](#fix-accelerated-dht-provider-bootstrap) - [๐Ÿ“ฆ๏ธ Dependency updates](#-dependency-updates) - [๐Ÿ“ Changelog](#-changelog) - [๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors](#-contributors) @@ -30,6 +31,7 @@ The [Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) is n Adds total size progress tracking of pinned nodes during `ipfs pin add --progress`. The output now shows the total size of the pinned dag. Example output: + ``` Fetched/Processed 336 nodes (83 MB) ``` @@ -38,6 +40,10 @@ Fetched/Processed 336 nodes (83 MB) Change the `ipfs key list` behavior to log an error and continue listing keys when a key cannot be read from the keystore or decoded. +#### Fix accelerated DHT provider bootstrap + +When both Accelerated DHT Client and Provide Sweep are enabled, the provider now waits for the initial accelerated DHT client initial network crawl to complete (around 10 minutes) before running any provide operation. + #### ๐Ÿ“ฆ๏ธ Dependency updates - update `go-libp2p` to [v0.46.0](https://github.com/libp2p/go-libp2p/releases/tag/v0.46.0) From 3535caa244f8750ef052ab52f251e6ecf46d439b Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 9 Jan 2026 21:15:50 +0100 Subject: [PATCH 3/3] docs: improve changelog wording --- docs/changelogs/v0.40.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/changelogs/v0.40.md b/docs/changelogs/v0.40.md index d492541e16b..8b73bc4b2f0 100644 --- a/docs/changelogs/v0.40.md +++ b/docs/changelogs/v0.40.md @@ -13,7 +13,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team. - [Routing V1 HTTP API now exposed by default](#routing-v1-http-api-now-exposed-by-default) - [Track total size when adding pins](#track-total-size-when-adding-pins) - [Skip bad keys when listing](#skip_bad_keys_when_listing) - - [Fix accelerated DHT provider bootstrap](#fix-accelerated-dht-provider-bootstrap) + - [Accelerated DHT Client and Provide Sweep now work together](#accelerated-dht-client-and-provide-sweep-now-work-together) - [๐Ÿ“ฆ๏ธ Dependency updates](#-dependency-updates) - [๐Ÿ“ Changelog](#-changelog) - [๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors](#-contributors) @@ -40,9 +40,9 @@ Fetched/Processed 336 nodes (83 MB) Change the `ipfs key list` behavior to log an error and continue listing keys when a key cannot be read from the keystore or decoded. -#### Fix accelerated DHT provider bootstrap +#### Accelerated DHT Client and Provide Sweep now work together -When both Accelerated DHT Client and Provide Sweep are enabled, the provider now waits for the initial accelerated DHT client initial network crawl to complete (around 10 minutes) before running any provide operation. +Previously, provide operations could start before the Accelerated DHT Client discovered enough peers, causing sweep mode to lose its efficiency benefits. Now, providing waits for the initial network crawl (about 10 minutes). Your content will be properly distributed across DHT regions after initial DHT map is created. Check `ipfs provide stat` to see when providing begins. #### ๐Ÿ“ฆ๏ธ Dependency updates