Temporary canonical multihash in peer ID.#1449
Merged
Merged
Conversation
twittner
approved these changes
Feb 12, 2020
tomaka
approved these changes
Feb 13, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.16and the changes of this PR with0.17. #1444 should resolve #1437 and this PR should ensure that it stays resolved once we start using the "identity hash". Then, eventually, thecanonicalfield introduced here could be removed in0.18or later.In the context of this PR, the general lack of guarantees w.r.t.
AsRef<[u8]>,PeerId::as_bytes()andPeerId::into_bytes()is now documented, and implementations ofstd::borrow::Borrowadded which do provide the necessary guarantees. Similarly, construction ofKeys inlibp2p-kadis changed from requiringAsRef<[u8]>toBorrow<[u8]>to more clearly state the requirements.I hope this makes sense and is sound, please let me know if it doesn't.