kubo/core
Guillaume Michel 2a669d869b
fix: SweepingProvider shouldn't error when missing DHT (#10975)
* fix: SweepingProvider shouldn't error when missing DHT

* fix: prevent panic when SweepingProvider has no DHT

when SweepingProvider is enabled but no DHT is available (e.g., Routing.Type=none),
the daemon would panic with a nil pointer dereference in ResettableKeystore.ResetCids.

this fix:
- returns NoopProvider when no DHT implementation is available
- skips keystore initialization for NoopProvider to avoid unnecessary operations
- allows nodes to run without DHT when using HTTP-only routing or offline mode

the panic occurred because initKeyStore tried to access a nil keystore when
SweepingProvider returned nil for the keystore parameter. by checking if the
provider is NoopProvider and skipping keystore operations, we avoid the panic
while maintaining correct behavior for all other provider types.

cc #10974 #10975

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-09-19 19:59:46 +02:00
..
commands fix: allow custom http provide when libp2p node is offline (#10974) 2025-09-19 18:55:42 +02:00
coreapi refactor(config): migration 17-to-18 to unify Provider/Reprovider into Provide.DHT (#10951) 2025-09-18 22:17:43 +02:00
corehttp feat: ipfs-webui v4.9.0 with retrieval diagnostics (#10969) 2025-09-19 04:16:21 +02:00
coreiface fix: ipfs pin ls <cid> --names (#10970) 2025-09-19 03:17:45 +02:00
corerepo chore: use go-log/v2 (#10801) 2025-05-19 13:04:05 -07:00
coreunix fix: resolve TestAddMultipleGCLive race condition (#10916) 2025-08-18 20:49:26 +02:00
mock fix: deadlock on retrieving WebTransport addresses (#9857) 2023-05-08 16:11:03 +02:00
node fix: SweepingProvider shouldn't error when missing DHT (#10975) 2025-09-19 19:59:46 +02:00
.gitignore ignore testdb 2014-07-05 15:04:04 -07:00
builder.go chore: migrate bootstrap to ipfs/boxo (#10158) 2023-10-31 18:25:14 +01:00
core_test.go chore: update boxo, go-libp2p, and internalize mplex (#10095) 2023-08-24 06:11:02 +00:00
core.go refactor(config): migration 17-to-18 to unify Provider/Reprovider into Provide.DHT (#10951) 2025-09-18 22:17:43 +02:00