Skip to content
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(hasher): add blake3 #395

Merged
merged 7 commits into from
Nov 30, 2023
Merged

feat(hasher): add blake3 #395

merged 7 commits into from
Nov 30, 2023

Conversation

whizzzkid
Copy link
Contributor

Fixes: #394

In this PR:

@SgtPooki when trying to build ipfs-webui locally with this, it fails:

Failed to compile.

Module not found: Error: Can't resolve 'wasm_bg.wasm' in '../ipld-explorer-components/node_modules/blake3-multihash/gen'

The error generates from here: https://github.com/web3-storage/blake3-multihash/blob/main/gen/wasm.js#L231 any ideas on how to test this?

@whizzzkid whizzzkid requested a review from a team as a code owner September 1, 2023 04:43
Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ipfs-webui issue could be related to vite's build process not pulling in wasm dependencies?

Comment on lines 42 to 43
encode: async (data: Uint8Array): Promise<Uint8Array> => {
const { digest } = await blake3Digest(data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could pull the import down into this so we only import this library dynamically when we need it, and add as a peer/optional/optionalPeer. That may solve the ipfs-webui issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Done, however I didn't test the wasm issue.

@SgtPooki
Copy link
Member

the ipfs-webui issue could be related to vite's build process not pulling in wasm dependencies?

https://www.npmjs.com/package/vite-plugin-wasm ?

Signed-off-by: Nishant Arora <[email protected]>
…r' into fix/394-blake3-error

* refs/remotes/origin/fix/394-blake3-error:
  chore: pull new translations (#396)
  chore(ci): remove circleci config (#388)
@whizzzkid whizzzkid requested a review from SgtPooki October 30, 2023 15:17
@whizzzkid whizzzkid enabled auto-merge (squash) October 30, 2023 15:17
@lidel lidel mentioned this pull request Nov 24, 2023
9 tasks
@SgtPooki SgtPooki changed the title fix(hasher): Introducing Blake3-multihash feat(hasher): add blake3 Nov 30, 2023
@whizzzkid whizzzkid merged commit 5a37a5e into master Nov 30, 2023
3 checks passed
@whizzzkid whizzzkid deleted the fix/394-blake3-error branch November 30, 2023 04:06
SgtPooki pushed a commit that referenced this pull request Nov 30, 2023
* feat(blake3): ➕ Adding blake3-multihash

Signed-off-by: Nishant Arora <[email protected]>

* feat(blake3): 👔 Adding blake3 hasher

Signed-off-by: Nishant Arora <[email protected]>

* fix: ♻️ Addressing comments

Signed-off-by: Nishant Arora <[email protected]>

* fix: 🔀 Marking dep as peerDep

Signed-off-by: Nishant Arora <[email protected]>

---------

Signed-off-by: Nishant Arora <[email protected]>
github-actions bot pushed a commit that referenced this pull request Nov 30, 2023
## [5.1.0](v5.0.0...v5.1.0) (2023-11-30)

### Features

* **hasher:** add blake3 ([#395](#395)) ([6ea74e5](6ea74e5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error on Blake3 CID
2 participants