p2p/discover: new distance metric based on sha3(id)
The previous metric was pubkey1^pubkey2, as specified in the Kademlia paper. We missed that EC public keys are not uniformly distributed. Using the hash of the public keys addresses that. It also makes it a bit harder to generate node IDs that are close to a particular node.
Showing
- p2p/discover/node.go 4 additions, 4 deletionsp2p/discover/node.go
- p2p/discover/node_test.go 13 additions, 9 deletionsp2p/discover/node_test.go
- p2p/discover/table.go 30 additions, 24 deletionsp2p/discover/table.go
- p2p/discover/table_test.go 297 additions, 55 deletionsp2p/discover/table_test.go
- p2p/discover/udp.go 4 additions, 4 deletionsp2p/discover/udp.go
- p2p/discover/udp_test.go 6 additions, 10 deletionsp2p/discover/udp_test.go
Loading
Please register or sign in to comment