build(deps): upgrade helia and libp2p dependencies#140
Conversation
- @helia/delegated-routing-v1-http-api-client 6.0.1 -> 8.0.1 - @libp2p/gossipsub 15.0.21 -> 16.0.2 - libp2p 3.2.3 -> 3.3.3, @libp2p/interface 3.2.2 -> 3.2.3 - @libp2p/crypto, fetch, identify, peer-id, @multiformats/multiaddr, blockstore-core patch bumps Adaptations for breaking changes: - delegated-routing client 8.x no longer exposes the libp2p routing symbols on the raw client, so getDelegatedRoutingFields now uses the delegatedRoutingV1HttpApiClientContentRouting() factory, with get/put overridden to fail fast since pkc HTTP routers do not serve IPNS records. - @libp2p/interface 3.2.3+ and @libp2p/peer-id 6.0.10+ type against multiformats 14 while helia 6 is still on 13. We stay on 13 at runtime (ipfs-unixfs-exporter strict-checks CID class identity, so a 14 CID breaks helia cat()) and bridge the three libp2p-facing call sites with typed casts; the 13 vs 14 difference is type-level only.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpgrades Helia/libp2p-related dependencies, refactors delegated routing to use the content-routing HTTP client (disabling IPNS operations), adds an asHeliaCatCid adapter for CID compatibility, and adds a regression test verifying UnixFS sub-path (directory/file) cat behavior. ChangesDependency upgrade and code compatibility
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues:
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…lient 7, importers (#139) - multiformats 13.4.2 -> 14.0.0 - ipns 10.1.3 -> 11.0.0 - uint8arrays 5.1.0 -> 6.1.1 - kubo-rpc-client 6.1.0 -> 7.1.0 - ipfs-unixfs-importer 16.1.4 -> 17.0.1 - blockstore-core 6.1.3 -> 7.0.1 Every one of these majors is the same breaking change: CIDs/byte arrays now come from multiformats 14 (Uint8Array<ArrayBuffer>). With the whole top-level tree on multiformats 14 the typed casts added in the previous commit are no longer needed and have been removed. The one remaining multiformats-13 island is helia 6's internals. ipfs-unixfs-exporter (inside @helia/unixfs) strict-checks CID class identity (CID.asCID(path) === path), so a multiformats-14 CID instance is rejected at runtime with "Path must be string or CID". heliaFs.cat is therefore handed the CID *string* (asHeliaCatCid): @helia/unixfs's resolve() only template-interpolates the cid, and the exporter's string branch parses it with its own multiformats copy, keeping the DAG walk self-consistent. CID.parse stays as input validation. Remove once helia ships on multiformats 14.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
87-123:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInconsistency between PR summary and actual upgrades.
The PR summary states "Deliberately not upgraded: ipns 11, multiformats 14, uint8arrays 6, blockstore-core 7, ipfs-unixfs-importer 17, kubo-rpc-client 7", but the package.json shows all of these packages ARE upgraded to exactly those versions. This suggests the PR summary is stale or refers to an earlier commit.
Please update the PR summary to accurately reflect the final dependency versions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 87 - 123, The PR summary is out of sync with package.json: the dependencies ipns, multiformats, uint8arrays, blockstore-core, ipfs-unixfs-importer, and kubo-rpc-client are actually upgraded to versions 11, 14, 6, 7, 17, and 7 respectively; update the PR description/summary to remove the "Deliberately not upgraded" claim and list the true final versions (or explain any exceptions), referencing those package names (ipns, multiformats, uint8arrays, blockstore-core, ipfs-unixfs-importer, kubo-rpc-client) so the summary matches the package.json changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@package.json`:
- Around line 87-123: The PR summary is out of sync with package.json: the
dependencies ipns, multiformats, uint8arrays, blockstore-core,
ipfs-unixfs-importer, and kubo-rpc-client are actually upgraded to versions 11,
14, 6, 7, 17, and 7 respectively; update the PR description/summary to remove
the "Deliberately not upgraded" claim and list the true final versions (or
explain any exceptions), referencing those package names (ipns, multiformats,
uint8arrays, blockstore-core, ipfs-unixfs-importer, kubo-rpc-client) so the
summary matches the package.json changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b0aa2610-29b1-4296-8718-94d66ab5dbfb
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!package-lock.json
📒 Files selected for processing (2)
package.jsonsrc/helia/helia-for-pkc.ts
…er CID identity)
The cat wrapper split <root>/<bucket>/update into a root CID + path option,
which made @helia/unixfs resolve() mint an intermediate CID object that the
mf-13 exporter rejected ("Path must be string or CID"), breaking every
libp2pjs CommentUpdate fetch (timeouts + wrong-state-order across the
libp2pjs CI configs; bare-CID configs were unaffected). Hand the whole path
as one string instead, keeping it on the exporter's string branch.
Adds a deterministic regression test under test/node-and-browser/helia.
Closes #139
Summary
Upgrades all helia and libp2p dependencies, plus the surrounding multiformats-14 ecosystem, to their latest versions:
helia, @helia/block-brokers, @helia/ipns and @helia/unixfs were already at latest (6.1.4 / 5.2.4 / 9.2.1 / 7.2.1). The majors of multiformats, ipns, uint8arrays, kubo-rpc-client, ipfs-unixfs-importer and blockstore-core all share a single breaking change: CIDs and returned byte arrays now come from multiformats 14 (Uint8Array backed by ArrayBuffer). With the whole top-level tree on multiformats 14, no type casts are needed at the libp2p boundaries.
Breaking-change adaptations
delegated-routing client 8.x silently stops registering as a content router. The raw client returned by
delegatedRoutingV1HttpApiClient()no longer exposes the libp2p contentRouting/peerRouting symbols, so placing it in libp2pservicesregisters zero content routers andfindProvidersthrowsNoContentRoutersError(this broke every IPNS-over-pubsub warmup).getDelegatedRoutingFieldsnow uses the dedicateddelegatedRoutingV1HttpApiClientContentRouting()factory, withget/putoverridden to fail fast since pkc HTTP routers do not serve IPNS records. This replaces the old hack of undefiningclient.getIPNS/getPeers/putIPNS, and peer routing (getPeers) is now simply never registered.helia 6 internals are the one remaining multiformats-13 island. ipfs-unixfs-exporter (inside @helia/unixfs) strict-checks CID class identity (
CID.asCID(path) === path || path instanceof CID), so a multiformats-14 CID instance is rejected at runtime withInvalidParametersError: Path must be string or CID, which broke every heliacat()/fetchCidcall.heliaFs.catis therefore handed the CID string (asHeliaCatCidin helia-for-pkc.ts): @helia/unixfs'sresolve()only template-interpolates the cid into an/ipfs/...path, and the exporter's string branch parses it with its own multiformats copy, keeping the whole DAG walk self-consistent.CID.parsestays as input validation. Remove once helia ships on multiformats 14.npm
overrideswere considered for unifying multiformats and rejected: they do not propagate to downstream consumers of the published package.Verification
npm run buildpasses (node, browser, bundle and all verify steps)npx tsc --project test/tsconfig.json --noEmitpassesSummary by CodeRabbit
Chores
New Features
Breaking Changes