kubo/docs/changelogs
Guillaume Michel d56fe3a026
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Check / lint (push) Waiting to run
Docker Check / build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
feat(cli/rpc/add): fast provide of root CID (#11046)
* feat: fast provide
* Check error from provideRoot
* do not provide if nil router
* fix(commands): prevent panic from typed nil DHTClient interface

Fixes panic when ipfsNode.DHTClient is a non-nil interface containing a
nil pointer value (typed nil). This happened when Routing.Type=delegated
or when using HTTP-only routing without DHT.

The panic occurred because:
- Go interfaces can be non-nil while containing nil pointer values
- Simple `if DHTClient == nil` checks pass, but calling methods panics
- Example: `(*ddht.DHT)(nil)` stored in interface passes nil check

Solution:
- Add HasActiveDHTClient() method to check both interface and concrete value
- Update all 7 call sites to use proper check before DHT operations
- Rename provideRoot → provideCIDSync for clarity
- Add structured logging with "fast-provide" prefix for easier filtering
- Add tests covering nil cases and valid DHT configurations

Fixes: https://github.com/ipfs/kubo/pull/11046#issuecomment-3525313349

* feat(add): split fast-provide into two flags for async/sync control

Renames --fast-provide to --fast-provide-root and adds --fast-provide-wait
to give users control over synchronous vs asynchronous providing behavior.

Changes:
- --fast-provide-root (default: true): enables immediate root CID providing
- --fast-provide-wait (default: false): controls whether to block until complete
- Default behavior: async provide (fast, non-blocking)
- Opt-in: --fast-provide-wait for guaranteed discoverability (slower, blocking)
- Can disable with --fast-provide-root=false to rely on background reproviding

Implementation:
- Async mode: launches goroutine with detached context for fire-and-forget
  - Added 10 second timeout to prevent hanging on network issues
  - Timeout aligns with other kubo operations (ping, DNS resolve, p2p)
  - Sufficient for DHT with sweep provider or accelerated client
- Sync mode: blocks on provideCIDSync until completion (uses req.Context)
- Improved structured logging with "fast-provide-root:" prefix
  - Removed redundant "root CID" from messages (already in prefix)
  - Clear async/sync distinction in log messages
- Added FAST PROVIDE OPTIMIZATION section to ipfs add --help explaining:
  - The problem: background queue takes time, content not immediately discoverable
  - The solution: extra immediate announcement of just the root CID
  - The benefit: peers can find content right away while queue handles rest
  - Usage: async by default, --fast-provide-wait for guaranteed completion

Changelog:
- Added highlight section for fast root CID providing feature
- Updated TOC and overview
- Included usage examples with clear comments explaining each mode
- Emphasized this is extra announcement independent of background queue

The feature works best with sweep provider and accelerated DHT client
where provide operations are significantly faster.

* fix(add): respect Provide config in fast-provide-root

fast-provide-root should honor the same config settings as the regular
provide system:
- skip when Provide.Enabled is false
- skip when Provide.DHT.Interval is 0
- respect Provide.Strategy (all/pinned/roots/mfs/combinations)

This ensures fast-provide only runs when appropriate based on user
configuration and the nature of the content being added (pinned vs
unpinned, added to MFS or not).

* Update core/commands/add.go

---------

Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-11-14 11:08:29 -08:00
..
v0.2.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.3.md docs: bulk spelling edits (#9544) 2023-02-20 23:37:10 +01:00
v0.4.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.5.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.6.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.7.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.8.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.9.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.10.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.11.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.12.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.13.md collection of typo fixes (#10647) 2025-01-13 18:55:10 +01:00
v0.14.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.15.md docs: bulk spelling edits (#9544) 2023-02-20 23:37:10 +01:00
v0.16.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.17.md docs: bulk spelling edits (#9544) 2023-02-20 23:37:10 +01:00
v0.18.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.19.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.20.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.21.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.22.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.23.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.24.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.25.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.26.md chore: update changelog 2024-01-22 14:35:53 +01:00
v0.27.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.28.md chore: update changelog for v0.28 2024-04-15 07:15:38 +00:00
v0.29.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.30.md feat: Add CI for Spell Checking (#10637) 2025-01-30 17:50:51 +01:00
v0.31.md feat(ci): reusable spellcheck from unified CI (#10873) 2025-08-14 00:35:35 +00:00
v0.32.md Update to boxo with refactored providerQueryManager. (#10595) 2024-11-26 03:34:06 -08:00
v0.33.md Merge remote-tracking branch 'origin/master' into merge-release-v0.33.2 2025-02-14 01:30:03 +01:00
v0.34.md docs: Fix typo in v0.34 changelog (#10771) 2025-04-01 07:26:38 -07:00
v0.35.md chore: spellcheck to avoid ai fix prs 2025-05-21 20:21:33 +02:00
v0.36.md fix typos in docs and comments (#10920) 2025-08-18 08:43:25 -07:00
v0.37.md docs: fix typo in v0.37 changelog 2025-08-27 20:33:02 +02:00
v0.38.md feat: enable DHT Provide Sweep by default (#10955) 2025-11-12 23:55:17 +01:00
v0.39.md feat(cli/rpc/add): fast provide of root CID (#11046) 2025-11-14 11:08:29 -08:00