{"action":"created","comment":{"url":"https://api.github.com/repos/maidsafe/routing/pulls/comments/359431249","pull_request_review_id":334083822,"id":359431249,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1OTQzMTI0OQ==","diff_hunk":"@@ -20,65 +20,107 @@ use routing::{\n };\n use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};\n \n-/// Randomly removes some nodes, but <1/3 from each section and never node 0.\n-/// Never trigger merge: never remove enough nodes to drop to `elder_size`.\n-/// max_per_pfx: limits dropping to the specified count per pfx. It would also\n-/// skip prefixes randomly allowing sections to split if this is executed in the same\n-/// iteration as `add_nodes_and_poll`.\n+/// Randomly removes some nodes.\n+///\n+/// Limits the number of nodes simultaneously dropped from a section such that the section still\n+/// remains functional (capable of reaching consensus), also accounting for the fact that any\n+/// dropped node might trigger relocation of other nodes. This limit is currently possibly too\n+/// conservative and might change in the future, but it still allows removing at least one node per\n+/// section.\n+///\n+/// If `max_per_pfx` is set, never drops more than that number of nodes per section.\n ///\n /// Note: it's necessary to call `poll_all` afterwards, as this function doesn't call it itself.\n fn drop_random_nodes<R: Rng>(\n     rng: &mut R,\n     nodes: &mut Vec<TestNode>,\n     max_per_pfx: Option<usize>,\n ) -> BTreeSet<XorName> {\n-    let mut dropped_nodes = BTreeSet::new();\n-    let elder_size = |node: &TestNode| unwrap!(node.inner.elder_size());\n-    let node_section_size = |node: &TestNode| {\n-        node.inner\n-            .section_elders(unwrap!(node.inner.our_prefix(), \"{}\", node.inner))\n-            .len()\n+    #[derive(Default)]\n+    struct SectionInfo {","path":"tests/mock_network/churn.rs","position":32,"original_position":32,"commit_id":"7275f27be17a3c821b9db8561da31dc3d49a44f4","original_commit_id":"e25e10a15843a86ac067a00cd0a06f904804c166","user":{"login":"jeanphilippeD","id":1621815,"node_id":"MDQ6VXNlcjE2MjE4MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1621815?v=4","gravatar_id":"","url":"https://api.github.com/users/jeanphilippeD","html_url":"https://github.com/jeanphilippeD","followers_url":"https://api.github.com/users/jeanphilippeD/followers","following_url":"https://api.github.com/users/jeanphilippeD/following{/other_user}","gists_url":"https://api.github.com/users/jeanphilippeD/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanphilippeD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanphilippeD/subscriptions","organizations_url":"https://api.github.com/users/jeanphilippeD/orgs","repos_url":"https://api.github.com/users/jeanphilippeD/repos","events_url":"https://api.github.com/users/jeanphilippeD/events{/privacy}","received_events_url":"https://api.github.com/users/jeanphilippeD/received_events","type":"User","site_admin":false},"body":"maybe SectionCountInfo as SectionInfo is used in other context.","created_at":"2019-12-18T16:07:44Z","updated_at":"2019-12-18T16:17:34Z","html_url":"https://github.com/maidsafe/routing/pull/1960#discussion_r359431249","pull_request_url":"https://api.github.com/repos/maidsafe/routing/pulls/1960","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/comments/359431249"},"html":{"href":"https://github.com/maidsafe/routing/pull/1960#discussion_r359431249"},"pull_request":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/1960"}}},"pull_request":{"url":"https://api.github.com/repos/maidsafe/routing/pulls/1960","id":354667035,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU0NjY3MDM1","html_url":"https://github.com/maidsafe/routing/pull/1960","diff_url":"https://github.com/maidsafe/routing/pull/1960.diff","patch_url":"https://github.com/maidsafe/routing/pull/1960.patch","issue_url":"https://api.github.com/repos/maidsafe/routing/issues/1960","number":1960,"state":"open","locked":false,"title":"Re-enable drops in churn tests","user":{"login":"madadam","id":5271,"node_id":"MDQ6VXNlcjUyNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/5271?v=4","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"body":"This PR fixes an accidental disabling of node drops in the churn tests. That uncovered some issues which this PR also fixes.","created_at":"2019-12-18T15:16:37Z","updated_at":"2019-12-18T16:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7d88a340d76b3bab498e36c0c4c742963ba5cba","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/maidsafe/routing/pulls/1960/commits","review_comments_url":"https://api.github.com/repos/maidsafe/routing/pulls/1960/comments","review_comment_url":"https://api.github.com/repos/maidsafe/routing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maidsafe/routing/issues/1960/comments","statuses_url":"https://api.github.com/repos/maidsafe/routing/statuses/7275f27be17a3c821b9db8561da31dc3d49a44f4","head":{"label":"madadam:fix-churn-test-drop","ref":"fix-churn-test-drop","sha":"7275f27be17a3c821b9db8561da31dc3d49a44f4","user":{"login":"madadam","id":5271,"node_id":"MDQ6VXNlcjUyNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/5271?v=4","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"repo":{"id":50021619,"node_id":"MDEwOlJlcG9zaXRvcnk1MDAyMTYxOQ==","name":"routing","full_name":"madadam/routing","private":false,"owner":{"login":"madadam","id":5271,"node_id":"MDQ6VXNlcjUyNzE=","avatar_url":"https://avatars0.githubusercontent.com/u/5271?v=4","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"html_url":"https://github.com/madadam/routing","description":"Routing - specialised storage DHT","fork":true,"url":"https://api.github.com/repos/madadam/routing","forks_url":"https://api.github.com/repos/madadam/routing/forks","keys_url":"https://api.github.com/repos/madadam/routing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madadam/routing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madadam/routing/teams","hooks_url":"https://api.github.com/repos/madadam/routing/hooks","issue_events_url":"https://api.github.com/repos/madadam/routing/issues/events{/number}","events_url":"https://api.github.com/repos/madadam/routing/events","assignees_url":"https://api.github.com/repos/madadam/routing/assignees{/user}","branches_url":"https://api.github.com/repos/madadam/routing/branches{/branch}","tags_url":"https://api.github.com/repos/madadam/routing/tags","blobs_url":"https://api.github.com/repos/madadam/routing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madadam/routing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madadam/routing/git/refs{/sha}","trees_url":"https://api.github.com/repos/madadam/routing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madadam/routing/statuses/{sha}","languages_url":"https://api.github.com/repos/madadam/routing/languages","stargazers_url":"https://api.github.com/repos/madadam/routing/stargazers","contributors_url":"https://api.github.com/repos/madadam/routing/contributors","subscribers_url":"https://api.github.com/repos/madadam/routing/subscribers","subscription_url":"https://api.github.com/repos/madadam/routing/subscription","commits_url":"https://api.github.com/repos/madadam/routing/commits{/sha}","git_commits_url":"https://api.github.com/repos/madadam/routing/git/commits{/sha}","comments_url":"https://api.github.com/repos/madadam/routing/comments{/number}","issue_comment_url":"https://api.github.com/repos/madadam/routing/issues/comments{/number}","contents_url":"https://api.github.com/repos/madadam/routing/contents/{+path}","compare_url":"https://api.github.com/repos/madadam/routing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madadam/routing/merges","archive_url":"https://api.github.com/repos/madadam/routing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madadam/routing/downloads","issues_url":"https://api.github.com/repos/madadam/routing/issues{/number}","pulls_url":"https://api.github.com/repos/madadam/routing/pulls{/number}","milestones_url":"https://api.github.com/repos/madadam/routing/milestones{/number}","notifications_url":"https://api.github.com/repos/madadam/routing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madadam/routing/labels{/name}","releases_url":"https://api.github.com/repos/madadam/routing/releases{/id}","deployments_url":"https://api.github.com/repos/madadam/routing/deployments","created_at":"2016-01-20T10:07:55Z","updated_at":"2016-01-20T10:07:56Z","pushed_at":"2019-12-18T15:16:17Z","git_url":"git://github.com/madadam/routing.git","ssh_url":"git@github.com:madadam/routing.git","clone_url":"https://github.com/madadam/routing.git","svn_url":"https://github.com/madadam/routing","homepage":null,"size":53489,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"maidsafe:fleming","ref":"fleming","sha":"3e517d83bd97b1ddf8de2524fa70bcaece8d2f90","user":{"login":"maidsafe","id":536423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNjQyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/536423?v=4","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"repo":{"id":31270514,"node_id":"MDEwOlJlcG9zaXRvcnkzMTI3MDUxNA==","name":"routing","full_name":"maidsafe/routing","private":false,"owner":{"login":"maidsafe","id":536423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNjQyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/536423?v=4","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/maidsafe/routing","description":"Routing - specialised storage DHT","fork":false,"url":"https://api.github.com/repos/maidsafe/routing","forks_url":"https://api.github.com/repos/maidsafe/routing/forks","keys_url":"https://api.github.com/repos/maidsafe/routing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maidsafe/routing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maidsafe/routing/teams","hooks_url":"https://api.github.com/repos/maidsafe/routing/hooks","issue_events_url":"https://api.github.com/repos/maidsafe/routing/issues/events{/number}","events_url":"https://api.github.com/repos/maidsafe/routing/events","assignees_url":"https://api.github.com/repos/maidsafe/routing/assignees{/user}","branches_url":"https://api.github.com/repos/maidsafe/routing/branches{/branch}","tags_url":"https://api.github.com/repos/maidsafe/routing/tags","blobs_url":"https://api.github.com/repos/maidsafe/routing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maidsafe/routing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maidsafe/routing/git/refs{/sha}","trees_url":"https://api.github.com/repos/maidsafe/routing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maidsafe/routing/statuses/{sha}","languages_url":"https://api.github.com/repos/maidsafe/routing/languages","stargazers_url":"https://api.github.com/repos/maidsafe/routing/stargazers","contributors_url":"https://api.github.com/repos/maidsafe/routing/contributors","subscribers_url":"https://api.github.com/repos/maidsafe/routing/subscribers","subscription_url":"https://api.github.com/repos/maidsafe/routing/subscription","commits_url":"https://api.github.com/repos/maidsafe/routing/commits{/sha}","git_commits_url":"https://api.github.com/repos/maidsafe/routing/git/commits{/sha}","comments_url":"https://api.github.com/repos/maidsafe/routing/comments{/number}","issue_comment_url":"https://api.github.com/repos/maidsafe/routing/issues/comments{/number}","contents_url":"https://api.github.com/repos/maidsafe/routing/contents/{+path}","compare_url":"https://api.github.com/repos/maidsafe/routing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maidsafe/routing/merges","archive_url":"https://api.github.com/repos/maidsafe/routing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maidsafe/routing/downloads","issues_url":"https://api.github.com/repos/maidsafe/routing/issues{/number}","pulls_url":"https://api.github.com/repos/maidsafe/routing/pulls{/number}","milestones_url":"https://api.github.com/repos/maidsafe/routing/milestones{/number}","notifications_url":"https://api.github.com/repos/maidsafe/routing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maidsafe/routing/labels{/name}","releases_url":"https://api.github.com/repos/maidsafe/routing/releases{/id}","deployments_url":"https://api.github.com/repos/maidsafe/routing/deployments","created_at":"2015-02-24T16:52:53Z","updated_at":"2019-12-18T15:42:44Z","pushed_at":"2019-12-18T15:42:41Z","git_url":"git://github.com/maidsafe/routing.git","ssh_url":"git@github.com:maidsafe/routing.git","clone_url":"https://github.com/maidsafe/routing.git","svn_url":"https://github.com/maidsafe/routing","homepage":null,"size":116058,"stargazers_count":210,"watchers_count":210,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":55,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":67,"open_issues":55,"watchers":210,"default_branch":"fleming"}},"_links":{"self":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/1960"},"html":{"href":"https://github.com/maidsafe/routing/pull/1960"},"issue":{"href":"https://api.github.com/repos/maidsafe/routing/issues/1960"},"comments":{"href":"https://api.github.com/repos/maidsafe/routing/issues/1960/comments"},"review_comments":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/1960/comments"},"review_comment":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maidsafe/routing/pulls/1960/commits"},"statuses":{"href":"https://api.github.com/repos/maidsafe/routing/statuses/7275f27be17a3c821b9db8561da31dc3d49a44f4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jeanphilippeD"}}