Skip to content

Releases: libp2p/go-libp2p-kad-dht

v0.42.1

Choose a tag to compare

@github-actions github-actions released this 20 Jul 20:20
7b897dc

Note

This release was brought to you by the Shipyard team.

What's Changed

Full Changelog: v0.42.0...v0.42.1

v0.42.0

Choose a tag to compare

@github-actions github-actions released this 20 Jul 07:17
b419cd9

Note

This release was brought to you by the Shipyard team.

Highlights

⚠️ Breaking changes

Constructors no longer take a context.Context (#1282)

The lifecycle context was removed from all constructors. The DHT now runs until Close() is called; cancelling a context no longer tears it down.

Before After
dht.New(ctx, h, opts...) dht.New(h, opts...)
dht.NewDHT(ctx, h, dstore) dht.NewDHT(h, dstore)
dht.NewDHTClient(ctx, h, dstore) dht.NewDHTClient(h, dstore)
dual.New(ctx, h, opts...) dual.New(h, opts...)
records.NewProviderManager(ctx, ...) records.NewProviderManager(...)
rtrefresh.NewRtRefreshManager(ctx, ...) rtrefresh.NewRtRefreshManager(...)

Migration: drop the context argument. If you relied on cancelling the constructor context to shut the DHT down, call Close() instead. Close() blocks until all long-lived components have stopped. Note that in-flight RPC handlers are owned by the libp2p host, so close the host before closing any datastore handed to the DHT.

ProviderStore option removed (#1277 by @guillaumemichel)

Custom ProviderStore implementations can no longer be injected; the DHT always runs the built-in provider manager. The dht.ProviderStore(...) option is replaced by datastore-level configuration:

// Before: inject a custom provider store
d, err := dht.New(ctx, h, dht.ProviderStore(customStore))

// After: configure the built-in provider manager
d, err := dht.New(h,
	dht.ProviderDatastore(dstore),          // dedicated datastore for provider records
	dht.ProviderManagerOpts(                // tune the built-in manager
		records.ProvideValidity(48*time.Hour),
		records.Cache(myLRU),
	),
)

New options: ValueDatastore and ProviderDatastore give value and provider records their own physical datastores (both default to the datastore set with Datastore). The dht.ProviderStore() getter on IpfsDHT remains available.

Value records are stored under namespaced datastore keys (#1277)

Value records used to be stored at the datastore root as /<base32(key)>; they are now namespaced by record type: /<namespace>/<base32(key)> (e.g. /pk/..., /ipns/...). This keeps a shared datastore collision-free and enables per-namespace garbage collection.

Migration: there is no automatic key migration. On upgrade, value records persisted by earlier versions are simply not found under the new layout — nodes will re-store them as the network republishes (records expire after MaxRecordAge, 48h by default, anyway). If you persist the DHT datastore and want to reclaim space, you can delete leftover root-level base32 keys. Provider records are unaffected (already namespaced under /providers/).

What's Changed

Full Changelog: v0.41.0...v0.42.0

v0.41.0

Choose a tag to compare

@github-actions github-actions released this 01 Jul 08:24
7c89e0c

Note

This release was brought to you by the Shipyard team.

What's Changed

Full Changelog: v0.40.0...v0.41.0

v0.40.0

Choose a tag to compare

@github-actions github-actions released this 20 May 08:34
d40b14b

Note

This release was brought to you by the Shipyard team.

Highlights

⚠️ Breaking change

  • SweepingProvider.Stats() now takes a context.Context and returns (stats.Stats, error). Callers must pass a ctx with a deadline — the key count is fetched through the keystore worker and can stall behind a slow datastore op. (#1251 by @guillaumemichel)

Fixes

  • Per-peer timeout on ADD_PROVIDER sends so a single slow peer can't stall a reprovide cycle. (#1252 by @guillaumemichel)
  • batchReprovide now holds cycleStatsLk for the full defer, fixing a stats race. (#1255 by @guillaumemichel)
  • ResettableKeystore reset is faster and no longer blocks the worker. (#1256 by @guillaumemichel)

Other

Full Changelog: v0.39.2...v0.40.0

v0.39.2

Choose a tag to compare

@github-actions github-actions released this 07 May 11:43
c728951

Note

This release was brought to you by the Shipyard team.

What's Changed

Full Changelog: v0.39.1...v0.39.2

v0.39.1

Choose a tag to compare

@github-actions github-actions released this 20 Apr 15:59
bef178c

Note

This release was brought to you by the Shipyard team.

What's Changed

Full Changelog: v0.39.0...v0.39.1

v0.39.0

Choose a tag to compare

@github-actions github-actions released this 19 Mar 10:28
5bbc746

Note

This release was brought to you by the Shipyard team.

Breaking changes

What's Changed

New Contributors

Full Changelog: v0.38.0...v0.39.0

v0.38.0

Choose a tag to compare

@github-actions github-actions released this 16 Feb 08:49
0d9f9f6

What's Changed

Full Changelog: v0.37.1...v0.38.0

v0.37.1

Choose a tag to compare

@github-actions github-actions released this 27 Jan 20:58
b73c2d0

What's Changed

Full Changelog: v0.37.0...v0.37.1

v0.37.0

Choose a tag to compare

@github-actions github-actions released this 14 Jan 08:51
23423e3

Note

This release was brought to you by the Shipyard team.

Overview

This is a minor release focused on dependency updates and bug fixes. The most significant changes are:

  • Breaking change: The deprecated providers/ package has been removed. Users still importing from providers/ must migrate to records/.
  • Dependency update: Upgraded to go-libp2p v0.46.
  • Provider bug fixes: Several fixes to improve provider system stability, including proper handling of peers during keyspace exploration.

This release contains no major feature additions but improves overall reliability of the DHT implementation.

What's Changed

Full Changelog: v0.36.0...v0.37.0