Repository navigation
Releases
v0.43.1
Highlights
go-libp2p v0.52.0 (#1311)
go-libp2p is upgraded from v0.50.0 to v0.52.0. That brings quic-go v0.64.1, and the connection upgrader now releases connections that close before they are accepted. The DHT's exported API is unchanged, and Go 1.26 remains the minimum version.
Value lookups and optimistic provides return when they are done (#1309)
GetValueandSearchValuewith a quorum: once the quorum was reached, queries still in flight stayed blocked until the caller's context ended, and kept the lookup's goroutines alive with them. With a context that has no deadline, they never exited. They now end as soon as the lookup stops.ProvidewithEnableOptimisticProvide: when the lookup found no peer to sendADD_PROVIDERto, for example because every routing table peer was unreachable,Providenever returned, whatever its context. It now returns, as the classic provide does.
What's Changed
- docs: rewrite README by @guillaumemichel in #1305
- chore(deps): bump go.opentelemetry.io/otel/trace from 1.46.0 to 1.47.0 by @dependabot[bot] in #1307
- refactor(pb): read reply fields through generated getters by @guillaumemichel in #1308
- fix: finish stopped value lookups and optimistic provides without peers by @guillaumemichel in #1309
- fix(rtrefresh): signal completion after refreshes that stop at a gap by @guillaumemichel in #1310
- chore: bump deps by @guillaumemichel in #1311
Full Changelog: v0.43.0...v0.43.1
v0.43.0
Highlights
Routing table persists across restarts (#1299)
The DHT now saves its routing table peers, with their addresses, to its Datastore, and dials them the next time its routing table is empty. A restarting node no longer depends only on the bootstrap peers to rejoin the network: a node joining the Amino DHT reached 100 routing table peers in about 2s instead of 11–22s, with fewer file descriptors and connections.
RoutingTablePersistence(interval)sets how often the snapshot is saved (hourly by default, and once more onClose).RoutingTablePersistence(0)turns persistence off.BootstrapOrderpicks what the DHT dials first when its routing table is empty:BootstrapFirst(default, saved peers as a fallback),PersistedFirst, orConcurrent.- Saved peers are only dialed. They join the routing table through the usual checks and IP diversity limits.
dualturns persistence off for the LAN DHT.fullrtis unchanged.
Behavior changes: persistence is on by default and writes one key, /kad-dht/routing-table/<protocol ID>, to the Datastore the DHT is given. A DHT with no bootstrap peers but a datastore that survives restarts now dials its saved peers after a restart, where it used to dial nothing. Use RoutingTablePersistence(0) to keep the old behavior.
What's Changed
- chore: bump deps by @guillaumemichel in #1296
- refactor: apply go fix modernizers by @guillaumemichel in #1297
- feat: persist the routing table across restarts by @guillaumemichel in #1299
- test: skip synctest tests under race before Go 1.27 by @guillaumemichel in #1300
- fix(pb): check peer entries against frame size before decoding by @guillaumemichel in #1301
Full Changelog: v0.42.2...v0.43.0
v0.42.2
Note
This release was brought to you by the Shipyard team.
Highlights
Provider record writes are batched again (#1293)
v0.42.0 (#1277) inadvertently turned every provider record write and GC delete into an individual (fsynced) datastore operation, causing excessive disk I/O on busy nodes (ipfs/kubo#11432). Provider writes and GC deletes are now batched (256 records per batch), restoring the pre-v0.42.0 fsync rate. No protocol or record-layout change.
Local provider record writes respect shutdown (#1288)
The WithAddLocalRecord callback now receives the sweeping provider's lifecycle context instead of context.Background() (a regression from #1282), so local provider record writes are properly cancelled when the provider shuts down.
What's Changed
- chore: upgrade to go-libp2p v0.49.0 by @gammazero in #1289
- fix(provider): pass lifecycle context to local record callback by @guillaumemichel in #1288
- chore(deps): bump github.com/pion/stun/v3 from 3.1.1 to 3.1.5 by @dependabot[bot] in #1290
- docs: spec guardrails by @lidel in #1292
- fix(records): batch provider datastore writes and GC deletes by @guillaumemichel in #1293
Full Changelog: v0.42.1...v0.42.2
v0.42.1
Note
This release was brought to you by the Shipyard team.
What's Changed
- fix: validate local records in SearchValue by @guillaumemichel in #1285
Full Changelog: v0.42.0...v0.42.1
v0.42.0
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
- fix: cap closer peers accepted per response by @lidel in #1270
- fix: correct delete-error check in provider gc by @lidel in #1271
- chore(deps): bump golang.org/x/net from 0.53.0 to 0.55.0 by @dependabot[bot] in #1272
- Update dependencies by @gammazero in #1273
- chore(deps): bump golang.org/x/crypto from 0.51.0 to 0.52.0 by @dependabot[bot] in #1274
- test: fix flaky TestOptimisticProvide timeout and peerIDs seeding by @guillaumemichel in #1276
- upgrade go-test to v0.4.0 by @gammazero in #1275
- test: fix flaky TestProvidesMany by @guillaumemichel in #1278
- chore: bump go-libp2p-kbucket by @guillaumemichel in #1279
- chore: migrate from math/rand to math/rand/v2 by @guillaumemichel in #1280
- refactor(pb): bound the serialized size of a peer record by @guillaumemichel in #1281
- update dependencies by @gammazero in #1283
- refactor(records): consolidate records persistence by @guillaumemichel in #1277
- refactor: remove lifecycle context from constructors by @guillaumemichel in #1282
Full Changelog: v0.41.0...v0.42.0
v0.41.0
Note
This release was brought to you by the Shipyard team.
What's Changed
- chore(deps): bump github.com/quic-go/quic-go from 0.59.0 to 0.59.1 by @dependabot[bot] in #1258
- fix(keystore): non-colliding reset slot prefixes by @lidel in #1262
- tests: fix flaky
TestBootStrapWhenRTIsEmptyby @guillaumemichel in #1264 - fix: cut reprovide peak memory with key count by @lidel in #1259
- fix(provider): reprovide all regions when resume is disabled by @guillaumemichel in #1267
- fix(provider): cover full keyspace when peers cluster under one prefix by @guillaumemichel in #1265
Full Changelog: v0.40.0...v0.41.0
v0.40.0
Note
This release was brought to you by the Shipyard team.
Highlights
⚠️ Breaking change
SweepingProvider.Stats()now takes acontext.Contextand 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_PROVIDERsends so a single slow peer can't stall a reprovide cycle. (#1252 by @guillaumemichel) batchReprovidenow holdscycleStatsLkfor the full defer, fixing a stats race. (#1255 by @guillaumemichel)ResettableKeystorereset is faster and no longer blocks the worker. (#1256 by @guillaumemichel)
Other
- Dependency updates. (#1250 by @gammazero)
Full Changelog: v0.39.2...v0.40.0
v0.39.2
Note
This release was brought to you by the Shipyard team.
What's Changed
- feat(provider): allow WithReprovideInterval(0) for burst-only mode by @lidel in #1246
- test: fix flaky TestStartProvidingSingle by @guillaumemichel in #1247
- chore: bump boxo to v0.39.0 by @lidel in #1248
Full Changelog: v0.39.1...v0.39.2
v0.39.1
Note
This release was brought to you by the Shipyard team.
What's Changed
- tests: fix flaky TestStartProvidingSingle by @guillaumemichel in #1242
- fix(provider): reduce provide log verbosity by @lidel in #1243
- fix: data race on AddrInfo.Addrs in queryPeer by @lidel in #1244
Full Changelog: v0.39.0...v0.39.1
v0.39.0
Note
This release was brought to you by the Shipyard team.
Breaking changes
keystore.NewResettableKeystore()now takeskeystore.ResettableKeystoreOptioninstead ofkeystore.Option. Wrap existing options withKeystoreOption()to migrate.
What's Changed
- Expose provider record TTL as options by @phillebaba in #1237
- feat(provider/keystore): alt datastore wipe by @guillaumemichel in #1233
- chore: bump deps by @guillaumemichel in #1239
New Contributors
- @phillebaba made their first contribution in #1237
Full Changelog: v0.38.0...v0.39.0
