Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion core/node/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions docs/changelogs/v0.40.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [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)
Expand All @@ -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)
```
Expand All @@ -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.

#### Accelerated DHT Client and Provide Sweep now work together

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

- update `go-libp2p` to [v0.46.0](https://github.com/libp2p/go-libp2p/releases/tag/v0.46.0)
Expand Down
Loading