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

Temporary canonical multihash in peer ID. #1449

Merged
merged 4 commits into from
Feb 13, 2020

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Feb 12, 2020

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.

@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