-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: compute piece CID in client #925
Conversation
assert(service.upload.add.called) | ||
assert.equal(service.upload.add.callCount, 1) | ||
assert.equal(pieceCIDs.length, 1) | ||
assert.equal(pieceCIDs[0].toString(), 'bafkzcibbammseumg3mjlev5odi5bpcsrp4gg62d7xnx44zkxzvgedq7nxldbc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this look right to you guys? I was expecting baga...
but then I think that is v1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per spec it should come out as bafkz
https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0069.md
I think we should wasm version as it's noticeably faster, but I'm still struggling to find a way to make it bundler friendly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We can swap to https://github.com/web3-storage/fr32-sha2-256-trunc254-padded-binary-tree-multihash/ + hookup this to invocation as follow up PRs
🤖 I have created a release *beep* *boop* --- ## [9.3.0](upload-client-v9.2.0...upload-client-v9.3.0) (2023-09-15) ### Features * compute piece CID in client ([#925](#925)) ([2297f01](2297f01)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
This PR alters the client to compute piece CIDs for each shard, and exposes it via the
CARMetadata
provided to theonShardStored
callback.I removed the
ShardStoringStream
. In hindsight, the only real utility it was providing was parallelizing the calls toStore.add(...)
. I swapped in a parallel transform stream that allows us to do the same thing, but also concurrently calculate the piece CID of the shard.Note: the client does not yet do anything with the piece CID, but in theory it will be trivial to collect them and then send a bunch of invocations to trigger filecoin.