Comments (8)
from go-car.
Fixed and released already!
> new CID(Buffer.from([0x01, 0x55, 0x00, 0x00]))
CID(bafkqaaa)
Still unsure if this is a great idea or not. Starting to lean toward removing the zero-roots restriction here instead now.
from go-car.
@whyrusleeping @mikeal let me know your thoughts on just removing this limitation ( strictly on read )
from go-car.
I allowed for rootless in the JavaScript version, but the problem we have now is that there's existing code in the wild that assumes it's receiving a root because of that line of code, so zero-roots disallowed is at the level of an almost-spec feature and maybe should be considered locked in for CARv1.
from go-car.
@rvagg fair enough. Do you have thoughts on
I worked around this by sticking an "empty CID" \x01\x55\x00\x00 into the root array
?
from go-car.
That CID isn't valid in JavaScript unfortunately, there's a mismatch between go-multihash and js-multihash.
> new CID(Buffer.from([0x01, 0x55, 0x00, 0x00]))
Uncaught Error: multihash too short. must be > 3 bytes.
Maybe [0x01, 0x55, 0x00, 0x01, 0x00]
? a length=1 identity multihash using raw? I'll put in a PR to js-multihash to see whether this is something that should be done there or go-multihash. This isn't going to propagate quickly, though, so your shorter version might not be safe for a while.
What's the use-case with zero-root CARs here. Is this just for constructing test fixtures? Or is it for something that would be used in production? I'm sure you've gone over this before but it's not stuck in my head, sorry.
Maybe it's fine to just adopt this as a "whatever works" approach for CARv1 and get this fixed in CARv2 where we could explicitly state that zero roots is OK. It could even go in as a recommendation for CARv1 if you want zero roots.
from go-car.
No worries, lots of concepts flying around, keeping track of all is HARD.
The use case for root-less cars is streaming out a dag into a car. You can not possibly know the root of that dag until the very end.
new CID(Buffer.from([0x01, 0x55, 0x00, 0x00]))
Uncaught Error: multihash too short. must be > 3 bytes.
That looks like an outright bug and should be fixed regardless
from go-car.
discussion about zero roots "hack" vs "fix": ipld/specs#255
from go-car.
Related Issues (20)
- Blockstore: Finalize but still readable HOT 1
- manual release created (v2.8.0)
- manual release created (v2.8.1)
- manual release created (v2.8.2)
- Open a ReadWrite blockstore without knowing the root Cid HOT 8
- manual release created (v2.9.0)
- Export insertion index
- Export insertion index
- manual release created (v2.10.0)
- Feedback/proposal: separate concerns more and provide a safe wrapper around the car format HOT 8
- manual release created (v2.10.1) HOT 1
- Creation of CARv2 from directory instead of file HOT 12
- manual release created (v2.10.2)
- manual release created (v2.11.0)
- manual release created (v2.12.0)
- manual release created (v2.13.0)
- manual release created (v2.13.1)
- Limit definitions HOT 2
- Proposal: IntactPack - storing UnixFS data in contiguous blocks for multi-mode Filecoin retrieval HOT 12
- Provide Package for cmd functions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-car.