{"action":"created","comment":{"url":"https://api.github.com/repos/maidsafe/parsec/pulls/comments/230693341","pull_request_review_id":171478387,"id":230693341,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDY5MzM0MQ==","diff_hunk":"@@ -1712,6 +1748,85 @@ impl<T: NetworkEvent, S: SecretId> Parsec<T, S> {\n         }\n     }\n \n+    fn accusations_by_peer(\n+        &self,\n+        src: &S::PublicId,\n+    ) -> impl Iterator<Item = &Observation<T, S::PublicId>> {\n+        self.peer_list\n+            .peer_events(src)\n+            .filter_map(move |hash| self.events.get(hash))\n+            .filter_map(|event| event.vote().map(Vote::payload))\n+            .filter(|observation| match observation {\n+                Observation::Accusation { .. } => true,\n+                _ => false,\n+            })\n+    }\n+\n+    fn detect_accomplice(\n+        &mut self,\n+        creator: &S::PublicId,\n+        src: &S::PublicId,\n+        first_event_in_chunk: Hash,\n+    ) {\n+        let pending_accusations = self.pending_accusations.clone();\n+        for (offender, malice) in &pending_accusations {\n+            if offender != creator {\n+                // Did the sender also create this accusation?\n+                let offender = offender.clone();\n+                let malice = malice.clone();\n+                let acc = Observation::Accusation { offender, malice };\n+                if !self.accusations_by_peer(src).any(|a| a == &acc) {\n+                    println!(\"JON: accuse: {:?}, {:?}\", src, first_event_in_chunk);\n+                    self.accuse(src.clone(), Malice::Accomplice(first_event_in_chunk));\n+                }\n+            }\n+        }\n+    }\n+\n+    fn detect_accomplice_for_past_events(\n+        &self,\n+        event_creator: &S::PublicId,\n+        current_hash: Hash,\n+        src: &S::PublicId,\n+        first_event: Hash,\n+    ) -> PendingAccusations<T, S::PublicId> {","path":"src/parsec.rs","position":110,"original_position":110,"commit_id":"4257e69c42e4d5b9e5303a7a52024384d9193808","original_commit_id":"4257e69c42e4d5b9e5303a7a52024384d9193808","user":{"login":"pierrechevalier83","id":5790907,"node_id":"MDQ6VXNlcjU3OTA5MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/5790907?v=4","gravatar_id":"","url":"https://api.github.com/users/pierrechevalier83","html_url":"https://github.com/pierrechevalier83","followers_url":"https://api.github.com/users/pierrechevalier83/followers","following_url":"https://api.github.com/users/pierrechevalier83/following{/other_user}","gists_url":"https://api.github.com/users/pierrechevalier83/gists{/gist_id}","starred_url":"https://api.github.com/users/pierrechevalier83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierrechevalier83/subscriptions","organizations_url":"https://api.github.com/users/pierrechevalier83/orgs","repos_url":"https://api.github.com/users/pierrechevalier83/repos","events_url":"https://api.github.com/users/pierrechevalier83/events{/privacy}","received_events_url":"https://api.github.com/users/pierrechevalier83/received_events","type":"User","site_admin":false},"body":"Instead of looking at all our events and all their events, I think we should restrict this to all our events since the self_parent of their oldest event in the `Request` or `Response` and we should also only consider accusations that are contained in the `Request` or `Response`","created_at":"2018-11-05T10:08:31Z","updated_at":"2018-11-05T10:18:18Z","html_url":"https://github.com/maidsafe/parsec/pull/163#discussion_r230693341","pull_request_url":"https://api.github.com/repos/maidsafe/parsec/pulls/163","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/comments/230693341"},"html":{"href":"https://github.com/maidsafe/parsec/pull/163#discussion_r230693341"},"pull_request":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/163"}}},"pull_request":{"url":"https://api.github.com/repos/maidsafe/parsec/pulls/163","id":228204973,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MjA0OTcz","html_url":"https://github.com/maidsafe/parsec/pull/163","diff_url":"https://github.com/maidsafe/parsec/pull/163.diff","patch_url":"https://github.com/maidsafe/parsec/pull/163.patch","issue_url":"https://api.github.com/repos/maidsafe/parsec/issues/163","number":163,"state":"open","locked":false,"title":"MAID-3049: detect accomplice malice","user":{"login":"octol","id":1894054,"node_id":"MDQ6VXNlcjE4OTQwNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1894054?v=4","gravatar_id":"","url":"https://api.github.com/users/octol","html_url":"https://github.com/octol","followers_url":"https://api.github.com/users/octol/followers","following_url":"https://api.github.com/users/octol/following{/other_user}","gists_url":"https://api.github.com/users/octol/gists{/gist_id}","starred_url":"https://api.github.com/users/octol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octol/subscriptions","organizations_url":"https://api.github.com/users/octol/orgs","repos_url":"https://api.github.com/users/octol/repos","events_url":"https://api.github.com/users/octol/events{/privacy}","received_events_url":"https://api.github.com/users/octol/received_events","type":"User","site_admin":false},"body":"Draft of accomplice detection. Still work in progress!","created_at":"2018-11-04T21:41:39Z","updated_at":"2018-11-05T10:18:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd98a5c71d0f3488b7a27162527b4a481a530e79","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1077969453,"node_id":"MDU6TGFiZWwxMDc3OTY5NDUz","url":"https://api.github.com/repos/maidsafe/parsec/labels/WIP","name":"WIP","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/maidsafe/parsec/pulls/163/commits","review_comments_url":"https://api.github.com/repos/maidsafe/parsec/pulls/163/comments","review_comment_url":"https://api.github.com/repos/maidsafe/parsec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maidsafe/parsec/issues/163/comments","statuses_url":"https://api.github.com/repos/maidsafe/parsec/statuses/4257e69c42e4d5b9e5303a7a52024384d9193808","head":{"label":"octol:feat/malice-accomplice-3049","ref":"feat/malice-accomplice-3049","sha":"4257e69c42e4d5b9e5303a7a52024384d9193808","user":{"login":"octol","id":1894054,"node_id":"MDQ6VXNlcjE4OTQwNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1894054?v=4","gravatar_id":"","url":"https://api.github.com/users/octol","html_url":"https://github.com/octol","followers_url":"https://api.github.com/users/octol/followers","following_url":"https://api.github.com/users/octol/following{/other_user}","gists_url":"https://api.github.com/users/octol/gists{/gist_id}","starred_url":"https://api.github.com/users/octol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octol/subscriptions","organizations_url":"https://api.github.com/users/octol/orgs","repos_url":"https://api.github.com/users/octol/repos","events_url":"https://api.github.com/users/octol/events{/privacy}","received_events_url":"https://api.github.com/users/octol/received_events","type":"User","site_admin":false},"repo":{"id":145955068,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU5NTUwNjg=","name":"parsec","full_name":"octol/parsec","private":false,"owner":{"login":"octol","id":1894054,"node_id":"MDQ6VXNlcjE4OTQwNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1894054?v=4","gravatar_id":"","url":"https://api.github.com/users/octol","html_url":"https://github.com/octol","followers_url":"https://api.github.com/users/octol/followers","following_url":"https://api.github.com/users/octol/following{/other_user}","gists_url":"https://api.github.com/users/octol/gists{/gist_id}","starred_url":"https://api.github.com/users/octol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octol/subscriptions","organizations_url":"https://api.github.com/users/octol/orgs","repos_url":"https://api.github.com/users/octol/repos","events_url":"https://api.github.com/users/octol/events{/privacy}","received_events_url":"https://api.github.com/users/octol/received_events","type":"User","site_admin":false},"html_url":"https://github.com/octol/parsec","description":"Protocol for Asynchronous, Reliable, Secure and Efficient Consensus","fork":true,"url":"https://api.github.com/repos/octol/parsec","forks_url":"https://api.github.com/repos/octol/parsec/forks","keys_url":"https://api.github.com/repos/octol/parsec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octol/parsec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octol/parsec/teams","hooks_url":"https://api.github.com/repos/octol/parsec/hooks","issue_events_url":"https://api.github.com/repos/octol/parsec/issues/events{/number}","events_url":"https://api.github.com/repos/octol/parsec/events","assignees_url":"https://api.github.com/repos/octol/parsec/assignees{/user}","branches_url":"https://api.github.com/repos/octol/parsec/branches{/branch}","tags_url":"https://api.github.com/repos/octol/parsec/tags","blobs_url":"https://api.github.com/repos/octol/parsec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octol/parsec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octol/parsec/git/refs{/sha}","trees_url":"https://api.github.com/repos/octol/parsec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octol/parsec/statuses/{sha}","languages_url":"https://api.github.com/repos/octol/parsec/languages","stargazers_url":"https://api.github.com/repos/octol/parsec/stargazers","contributors_url":"https://api.github.com/repos/octol/parsec/contributors","subscribers_url":"https://api.github.com/repos/octol/parsec/subscribers","subscription_url":"https://api.github.com/repos/octol/parsec/subscription","commits_url":"https://api.github.com/repos/octol/parsec/commits{/sha}","git_commits_url":"https://api.github.com/repos/octol/parsec/git/commits{/sha}","comments_url":"https://api.github.com/repos/octol/parsec/comments{/number}","issue_comment_url":"https://api.github.com/repos/octol/parsec/issues/comments{/number}","contents_url":"https://api.github.com/repos/octol/parsec/contents/{+path}","compare_url":"https://api.github.com/repos/octol/parsec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octol/parsec/merges","archive_url":"https://api.github.com/repos/octol/parsec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octol/parsec/downloads","issues_url":"https://api.github.com/repos/octol/parsec/issues{/number}","pulls_url":"https://api.github.com/repos/octol/parsec/pulls{/number}","milestones_url":"https://api.github.com/repos/octol/parsec/milestones{/number}","notifications_url":"https://api.github.com/repos/octol/parsec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octol/parsec/labels{/name}","releases_url":"https://api.github.com/repos/octol/parsec/releases{/id}","deployments_url":"https://api.github.com/repos/octol/parsec/deployments","created_at":"2018-08-24T07:00:37Z","updated_at":"2018-10-31T20:14:22Z","pushed_at":"2018-11-04T21:38:15Z","git_url":"git://github.com/octol/parsec.git","ssh_url":"git@github.com:octol/parsec.git","clone_url":"https://github.com/octol/parsec.git","svn_url":"https://github.com/octol/parsec","homepage":null,"size":934,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":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:master","ref":"master","sha":"8ad4686943e02d96f01045732b54f1b49f478b87","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":136022756,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwMjI3NTY=","name":"parsec","full_name":"maidsafe/parsec","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/parsec","description":"Protocol for Asynchronous, Reliable, Secure and Efficient Consensus","fork":false,"url":"https://api.github.com/repos/maidsafe/parsec","forks_url":"https://api.github.com/repos/maidsafe/parsec/forks","keys_url":"https://api.github.com/repos/maidsafe/parsec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maidsafe/parsec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maidsafe/parsec/teams","hooks_url":"https://api.github.com/repos/maidsafe/parsec/hooks","issue_events_url":"https://api.github.com/repos/maidsafe/parsec/issues/events{/number}","events_url":"https://api.github.com/repos/maidsafe/parsec/events","assignees_url":"https://api.github.com/repos/maidsafe/parsec/assignees{/user}","branches_url":"https://api.github.com/repos/maidsafe/parsec/branches{/branch}","tags_url":"https://api.github.com/repos/maidsafe/parsec/tags","blobs_url":"https://api.github.com/repos/maidsafe/parsec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maidsafe/parsec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maidsafe/parsec/git/refs{/sha}","trees_url":"https://api.github.com/repos/maidsafe/parsec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maidsafe/parsec/statuses/{sha}","languages_url":"https://api.github.com/repos/maidsafe/parsec/languages","stargazers_url":"https://api.github.com/repos/maidsafe/parsec/stargazers","contributors_url":"https://api.github.com/repos/maidsafe/parsec/contributors","subscribers_url":"https://api.github.com/repos/maidsafe/parsec/subscribers","subscription_url":"https://api.github.com/repos/maidsafe/parsec/subscription","commits_url":"https://api.github.com/repos/maidsafe/parsec/commits{/sha}","git_commits_url":"https://api.github.com/repos/maidsafe/parsec/git/commits{/sha}","comments_url":"https://api.github.com/repos/maidsafe/parsec/comments{/number}","issue_comment_url":"https://api.github.com/repos/maidsafe/parsec/issues/comments{/number}","contents_url":"https://api.github.com/repos/maidsafe/parsec/contents/{+path}","compare_url":"https://api.github.com/repos/maidsafe/parsec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maidsafe/parsec/merges","archive_url":"https://api.github.com/repos/maidsafe/parsec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maidsafe/parsec/downloads","issues_url":"https://api.github.com/repos/maidsafe/parsec/issues{/number}","pulls_url":"https://api.github.com/repos/maidsafe/parsec/pulls{/number}","milestones_url":"https://api.github.com/repos/maidsafe/parsec/milestones{/number}","notifications_url":"https://api.github.com/repos/maidsafe/parsec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maidsafe/parsec/labels{/name}","releases_url":"https://api.github.com/repos/maidsafe/parsec/releases{/id}","deployments_url":"https://api.github.com/repos/maidsafe/parsec/deployments","created_at":"2018-06-04T12:36:27Z","updated_at":"2018-11-02T18:05:19Z","pushed_at":"2018-11-05T09:52:48Z","git_url":"git://github.com/maidsafe/parsec.git","ssh_url":"git@github.com:maidsafe/parsec.git","clone_url":"https://github.com/maidsafe/parsec.git","svn_url":"https://github.com/maidsafe/parsec","homepage":null,"size":925,"stargazers_count":113,"watchers_count":113,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":26,"open_issues":6,"watchers":113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/163"},"html":{"href":"https://github.com/maidsafe/parsec/pull/163"},"issue":{"href":"https://api.github.com/repos/maidsafe/parsec/issues/163"},"comments":{"href":"https://api.github.com/repos/maidsafe/parsec/issues/163/comments"},"review_comments":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/163/comments"},"review_comment":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maidsafe/parsec/pulls/163/commits"},"statuses":{"href":"https://api.github.com/repos/maidsafe/parsec/statuses/4257e69c42e4d5b9e5303a7a52024384d9193808"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pierrechevalier83"}}