-
Notifications
You must be signed in to change notification settings - Fork 959
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
Kademlia uses SHA256(SHA256(publickey)) #694
Comments
I see what you mean since you are using the hash as a key into a hash table. While it may be better for performance if it weren't rehashed, it shouldn't change the correctness of the lookups no? |
Could you clarify? Do you refer to the fact that peer IDs are a hash of a public key, and then the key used in the DHT is a hash of the peer ID? |
@anacrolix Mmh, so the comment refers to the /// List of values and peers that are providing them.
///
/// Our local peer ID can be in this container.
// TODO: Note that in reality the value is a SHA-256 of the actual value (https://github.com/libp2p/rust-libp2p/issues/694)
values_providers: FnvHashMap<Multihash, SmallVec<[PeerId; 20]>>, |
Yes! |
Isn't this resolved by #1025? |
The libp2p Kademlia in fact rehashes everything with SHA256 before inserting into k-buckets. This needs to be fixed in our code base.
Let's wait for #580 before doing this.
The text was updated successfully, but these errors were encountered: