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

Update to latest multihash. #1566

Merged
merged 5 commits into from
May 13, 2020
Merged

Update to latest multihash. #1566

merged 5 commits into from
May 13, 2020

Conversation

dvc94ch
Copy link
Contributor

@dvc94ch dvc94ch commented May 7, 2020

Also fixes an unused warning when compiled with no-default-features

@dvc94ch dvc94ch force-pushed the update-multihash branch from 7ec79cb to 0ed2567 Compare May 7, 2020 15:48
@tomaka
Copy link
Member

tomaka commented May 12, 2020

Since the multihash crate doesn't have any changelog:
How does it work for the hasher of a certain multihash to be always available? Does that mean that every single hash algorithm is now included in the crate? Or do we fail to parse unknown multihashes with unsupported algorithms? Or is there a hidden panic?

@dvc94ch
Copy link
Contributor Author

dvc94ch commented May 12, 2020

It hasn't changed, all multihashes have always been included. The only difference is that now digest is called on Code directly instead of heap allocating a hasher, which only makes sense if you want to use the Digest api.

What you could do if you don't want all the hashers is provide a custom Code in libp2p with only the hashes that you want to include. A custom code needs to implement TryFrom<u64> and you can return whatever error you want.

Also multihash would require a feature gate to be added no-default-code.

@tomaka
Copy link
Member

tomaka commented May 12, 2020

Could you add an entry in CHANGELOG.md if you don't mind? Since multihash is exposed on the public API, that's a breaking change that should be mentioned

@dvc94ch
Copy link
Contributor Author

dvc94ch commented May 12, 2020

Added an entry, let me know if you want it to contain more information.

--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@
   be supported. IPv4 listener addresses are not affected by this change.
   [PR 1555](https://github.com/libp2p/rust-libp2p/pull/1555)
 
+- `libp2p-core`: Updated to multihash 0.11.0.
+
 # Version 0.18.1 (2020-04-17)
 
 - `libp2p-swarm`: Make sure inject_dial_failure is called in all situations.

src/lib.rs Show resolved Hide resolved
@tomaka tomaka merged commit 0443fea into libp2p:master May 13, 2020
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.

4 participants