{"action":"created","issue":{"url":"https://api.github.com/repos/ethcore/parity/issues/990","repository_url":"https://api.github.com/repos/ethcore/parity","labels_url":"https://api.github.com/repos/ethcore/parity/issues/990/labels{/name}","comments_url":"https://api.github.com/repos/ethcore/parity/issues/990/comments","events_url":"https://api.github.com/repos/ethcore/parity/issues/990/events","html_url":"https://github.com/ethcore/parity/issues/990","id":150670569,"number":990,"title":"count initialization, in the fn nearest_node_entries, not in the write place?","user":{"login":"efaysal","id":7907467,"avatar_url":"https://avatars.githubusercontent.com/u/7907467?v=3","gravatar_id":"","url":"https://api.github.com/users/efaysal","html_url":"https://github.com/efaysal","followers_url":"https://api.github.com/users/efaysal/followers","following_url":"https://api.github.com/users/efaysal/following{/other_user}","gists_url":"https://api.github.com/users/efaysal/gists{/gist_id}","starred_url":"https://api.github.com/users/efaysal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efaysal/subscriptions","organizations_url":"https://api.github.com/users/efaysal/orgs","repos_url":"https://api.github.com/users/efaysal/repos","events_url":"https://api.github.com/users/efaysal/events{/privacy}","received_events_url":"https://api.github.com/users/efaysal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ethcore/parity/labels/F2-bug","name":"F2-bug","color":"eb3420"}],"state":"open","locked":false,"assignee":{"login":"arkpar","id":9008569,"avatar_url":"https://avatars.githubusercontent.com/u/9008569?v=3","gravatar_id":"","url":"https://api.github.com/users/arkpar","html_url":"https://github.com/arkpar","followers_url":"https://api.github.com/users/arkpar/followers","following_url":"https://api.github.com/users/arkpar/following{/other_user}","gists_url":"https://api.github.com/users/arkpar/gists{/gist_id}","starred_url":"https://api.github.com/users/arkpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkpar/subscriptions","organizations_url":"https://api.github.com/users/arkpar/orgs","repos_url":"https://api.github.com/users/arkpar/repos","events_url":"https://api.github.com/users/arkpar/events{/privacy}","received_events_url":"https://api.github.com/users/arkpar/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-04-24T15:06:38Z","updated_at":"2016-04-27T13:03:07Z","closed_at":null,"body":"count was initialled  out of two loops:\r\n\r\n1) loop over k-buckets\r\n2) loop over nodes in each k-bucket\r\n\r\nSurprisingly the count was incremented inside them, and tested:\r\nif count == BUCKET_SIZE  ...  which is BUCKET_SIZE: usize = 16;\t\r\n\r\nSomething is not  adequate there. \r\n\r\ncount is a flag that control how many nodes have been discovered given that target and placed in the appropriate k-bucket, each  k-bucket should not contain more than 16, your case. For each k-bucket, a specific count should be assigned, and if it exceed 16, a removal process has to start on that k-bucket. \r\n\r\nGiven a target, normally the search has to fill, 511 k-buckets,  each k-bucket should have only 16 nodes.  Note that as Ethereum is using node ID  with 512 bits, only few k-buckets will really be filled, 511,510,  till around, let's say 490,  at most , other k-buckets after are quasi-empty.  This is supported by a lot of simulations that I did, and can be statistically demonstrated. \r\n\r\nThe code will be more simple, if one just select, well scrambled or well randomly selecting, a specific number of nodes  from all the k-buckets that the server(client)  has and send them any time a target is asking for. It will be more efficient ( at the level of coding and also to concretely connect the peers randomly) than following blindly what Kademlia was proposing. Kademlia is simply not designed for node ID  with 512 bits and more. \r\n\r\n  \r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ethcore/parity/issues/comments/215074785","html_url":"https://github.com/ethcore/parity/issues/990#issuecomment-215074785","issue_url":"https://api.github.com/repos/ethcore/parity/issues/990","id":215074785,"user":{"login":"arkpar","id":9008569,"avatar_url":"https://avatars.githubusercontent.com/u/9008569?v=3","gravatar_id":"","url":"https://api.github.com/users/arkpar","html_url":"https://github.com/arkpar","followers_url":"https://api.github.com/users/arkpar/followers","following_url":"https://api.github.com/users/arkpar/following{/other_user}","gists_url":"https://api.github.com/users/arkpar/gists{/gist_id}","starred_url":"https://api.github.com/users/arkpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkpar/subscriptions","organizations_url":"https://api.github.com/users/arkpar/orgs","repos_url":"https://api.github.com/users/arkpar/repos","events_url":"https://api.github.com/users/arkpar/events{/privacy}","received_events_url":"https://api.github.com/users/arkpar/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T13:03:07Z","updated_at":"2016-04-27T13:03:07Z","body":"`nearest_node_entries` is not supposed to update node table in any way. Removal process is started in `update_node`. Ethereum p2p protocol is defined here: https://github.com/ethereum/devp2p/blob/master/rlpx.md\r\nYou should submit an issue with that repo or https://github.com/ethereum/EIPs if you feel it should be changed."}}