openethereum/util/network-devp2p
Jim Posen 485d4aa8f3 Fix XOR distance calculation in discovery Kademlia impl (#8589)
* network-devp2p: Test for discovery bucket insertion.

All test values are randomly generated and the assertions are checked manually.
Test fails because distance metric is implemented incorrectly.

* network-devp2p: Fix discovery distance function.

The Kademlia distance function (XOR) was implemented incorrectly as a population count.

* network-devp2p: Refactor nearest_node_entries to be on instance.

Optimizations are possible with more access to the discovery state.

* network-devp2p: Fix loss of precision in nearest_node_entries.

* network-devp2p: More efficient nearest node search.

The discovery algorithm to identify the nearest k nodes does not need to scan
all entries in all buckets.
2018-06-01 09:42:45 +02:00
..
src Fix XOR distance calculation in discovery Kademlia impl (#8589) 2018-06-01 09:42:45 +02:00
tests Remove the error when stopping the network (#8671) 2018-05-22 12:35:13 +08:00
Cargo.toml bump tinykeccak to 1.4 (#8728) 2018-05-31 13:53:09 +02:00