Skip to content

Temporary canonical multihash in peer ID.#1449

Merged
tomaka merged 4 commits into
libp2p:masterfrom
romanb:peer-id-identity-compat
Feb 13, 2020
Merged

Temporary canonical multihash in peer ID.#1449
tomaka merged 4 commits into
libp2p:masterfrom
romanb:peer-id-identity-compat

Conversation

@romanb

@romanb romanb commented Feb 12, 2020

Copy link
Copy Markdown
Contributor

Together with #1444 this is a proposal for a possible resolution of the remaining issues relating to #555, including #1437.

The idea would be to publish #1444 with 0.16 and the changes of this PR with 0.17. #1444 should resolve #1437 and this PR should ensure that it stays resolved once we start using the "identity hash". Then, eventually, the canonical field introduced here could be removed in 0.18 or later.

In the context of this PR, the general lack of guarantees w.r.t. AsRef<[u8]>, PeerId::as_bytes() and PeerId::into_bytes() is now documented, and implementations of std::borrow::Borrow added which do provide the necessary guarantees. Similarly, construction of Keys in libp2p-kad is changed from requiring AsRef<[u8]> to Borrow<[u8]> to more clearly state the requirements.

I hope this makes sense and is sound, please let me know if it doesn't.

@romanb romanb requested review from tomaka and twittner February 12, 2020 14:12
@tomaka tomaka merged commit b872bd9 into libp2p:master Feb 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.

#1436 triggers assertion failure in libp2p-kad

3 participants