libp2p / rust-libp2p

The Rust Implementation of the libp2p networking stack.
https://libp2p.io
MIT License
4.35k stars 906 forks source link

Don't depend on the multihash identity feature #3276

Closed thomaseizinger closed 1 year ago

thomaseizinger commented 1 year ago

This feature is broken and will be removed eventually. To avoid deprecation warnings for our users that they can't fix, let's remove it here first.

See:

jmmaloney4 commented 1 year ago

In the the Peer ID spec, it states that "keys that serialize to at most 42 bytes must be hashed using the identity multihash codec." With the deprecation of the identity multi hash, however, we need to change this spec, or lobby to keep the identity multihash.

In a review on my PR, @rkuhn brought up some important cases where removing the identity multihash support would be problematic.

thomaseizinger commented 1 year ago

Sorry for the brevity in the issue. Yes we need to keep the functionality, it is only the implementation in multihash that is broken.

Given that the identity hasher doesn't actually do any hashing we can easily replicate this in here by checking the code manually for 0x0. That is what needs to be done as part of this issue :)