You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OrbitDB incompatible with streaming blockstores (js-stores PR #358) #1244
Issue: OrbitDB incompatible with streaming blockstores
Description
OrbitDB fails when used with blockstores that return async iterables (streams) instead of Uint8Arrays. This is due to a breaking change introduced in js-stores PR #358 , which allows blockstores to return streams.
Note: This issue commonly manifests when upgrading to libp2p v3, as libp2p v3 uses blockstores that implement the new streaming format. However, the root cause is the blockstore format change, not libp2p v3 itself.
Error
When using blockstores that return async iterables, OrbitDB throws errors like:
CBOR decode error: data to decode must be a Uint8Array
fns.shift(...) is not a function (in sync.js when using it-pipe)
Root Cause
js-stores PR #358 introduced streaming blockstores where blockstore.get() can return:
Uint8Array (traditional)
AsyncIterable<Uint8Array> (new streaming format)
Promise<Uint8Array | AsyncIterable<Uint8Array>>
OrbitDB currently assumes storage.get() always returns Uint8Array directly or via a Promise, but doesn't handle async iterables.
Affected Code
All places where storage.get() or blockstore.get() is called:
src/oplog/oplog-store.js
src/storage/ipfs-block.js
src/oplog/heads.js
src/manifest-store.js
src/key-store.js
src/identities/identities.js
src/access-controllers/ipfs.js
src/sync.js
Solution
Create a utility function toUint8Array() that:
Returns Uint8Array as-is
Awaits Promise results and processes them
Collects chunks from AsyncIterable and concatenates to Uint8Array
Handles other buffer-like types
Then update all storage.get() calls to use await toUint8Array(storage.get(...)).
Just switched from go-orbit-db to orbit-db and stumbled upon this. Is there any solution to this, for example pinning certain versions until it's fixed?
For example I tried to use helia pinned to 5.3.0 like in orbit-db dependencies and it reaches for a public gateway with a 504.
Activity
mar1n3r0 commentedon Dec 30, 2025
Just switched from go-orbit-db to orbit-db and stumbled upon this. Is there any solution to this, for example pinning certain versions until it's fixed?
For example I tried to use helia pinned to 5.3.0 like in orbit-db dependencies and it reaches for a public gateway with a 504.
NiKrause commentedon Jan 1, 2026
Happy New Year! Yes, there is a solution.
Don't use libp2p v3 only v2 and associated Helia. libp2p v3 isn't ready yet.
You can go to my profile checkout simple-todo example for a working libp2p v2 dependency stack including Helia. Let me know if it helped.
Or checkout the lift-off example from OrbitDB repo here, not sure tho how old and complete it is.
tabcat commentedon Apr 16, 2026
Theres an rc released for libp2p 3/helia 6 https://www.npmjs.com/package/@orbitdb/core/v/4.0.0-3e1d628.0