{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/142503177","pull_request_review_id":66874918,"id":142503177,"diff_hunk":"@@ -1370,6 +1375,17 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr\n             connman->PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(\"alert\", finalAlert));\n         }\n \n+        // Ask this peer for the block headers of all of the blocks we know are invalid\n+        // If we receive headers messages for these invalid blocks, we will ban them.\n+        std::vector<uint256> invalid_block_hashes;\n+        for (const std::pair<const uint256, CBlockIndex*>& item : mapBlockIndex)","path":"src/net_processing.cpp","position":null,"original_position":19,"commit_id":"ad944f3eedcbcfcecb5d66b33e2b80ba94718531","original_commit_id":"e41ceb2edf274d0aa88037f31f772926d3764fc7","user":{"login":"theuni","id":417043,"avatar_url":"https://avatars1.githubusercontent.com/u/417043?v=4","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false},"body":"Yea, I'd say the fork-points need to be cached. Unsure if it'd be best to just do it here and be done with it, or maintain something in validation.cpp that (for ex) getchaintips could also use.","created_at":"2017-10-03T19:47:07Z","updated_at":"2017-10-03T19:47:07Z","html_url":"https://github.com/bitcoin/bitcoin/pull/11446#discussion_r142503177","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/142503177"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/11446#discussion_r142503177"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446"}},"in_reply_to_id":142493120},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446","id":144493858,"html_url":"https://github.com/bitcoin/bitcoin/pull/11446","diff_url":"https://github.com/bitcoin/bitcoin/pull/11446.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/11446.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/11446","number":11446,"state":"open","locked":false,"title":"Bad block interrogation","user":{"login":"achow101","id":3782274,"avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"body":"This is an implementation of the bad block interrogation idea that @gmaxwell has talked about.\r\n\r\nTo ensure that the nodes we are connected to are following the same consens rules as we are, ban all nodes that relay us an invalid block or block header instead of only banning the first peer.\r\n\r\nThen when we receive an invalid block, we want to check that all of our peers also found that block to be invalid, so we ask all of our peers for the header of that invalid block. If they found it valid, the header will be relayed and we will then ban them. Otherwise we keep the connection.\r\n\r\nTo ensure that our newly connected nodes are also following the same consensus rules, we ask them for the headers of blocks that we know are invalid when they connect after the version handshake. If they respond with a header, then we will ban them.\r\n\r\nThis still needs tests, but I'm not sure how we should do that. If you have any suggestions, I'm all ears.\r\n\r\n***\r\n\r\nNote, I know the implementation is slightly wrong, still working on it.","created_at":"2017-10-03T18:25:55Z","updated_at":"2017-10-03T19:47:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0c7ecf36beb2476cfd8e38dbeea4b712529fc9c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/11446/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/ad944f3eedcbcfcecb5d66b33e2b80ba94718531","head":{"label":"achow101:bad-block-interrogation","ref":"bad-block-interrogation","sha":"ad944f3eedcbcfcecb5d66b33e2b80ba94718531","user":{"login":"achow101","id":3782274,"avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"repo":{"id":45006379,"name":"bitcoin","full_name":"achow101/bitcoin","owner":{"login":"achow101","id":3782274,"avatar_url":"https://avatars3.githubusercontent.com/u/3782274?v=4","gravatar_id":"","url":"https://api.github.com/users/achow101","html_url":"https://github.com/achow101","followers_url":"https://api.github.com/users/achow101/followers","following_url":"https://api.github.com/users/achow101/following{/other_user}","gists_url":"https://api.github.com/users/achow101/gists{/gist_id}","starred_url":"https://api.github.com/users/achow101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achow101/subscriptions","organizations_url":"https://api.github.com/users/achow101/orgs","repos_url":"https://api.github.com/users/achow101/repos","events_url":"https://api.github.com/users/achow101/events{/privacy}","received_events_url":"https://api.github.com/users/achow101/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/achow101/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/achow101/bitcoin","forks_url":"https://api.github.com/repos/achow101/bitcoin/forks","keys_url":"https://api.github.com/repos/achow101/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/achow101/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/achow101/bitcoin/teams","hooks_url":"https://api.github.com/repos/achow101/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/achow101/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/achow101/bitcoin/events","assignees_url":"https://api.github.com/repos/achow101/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/achow101/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/achow101/bitcoin/tags","blobs_url":"https://api.github.com/repos/achow101/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/achow101/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/achow101/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/achow101/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/achow101/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/achow101/bitcoin/languages","stargazers_url":"https://api.github.com/repos/achow101/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/achow101/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/achow101/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/achow101/bitcoin/subscription","commits_url":"https://api.github.com/repos/achow101/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/achow101/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/achow101/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/achow101/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/achow101/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/achow101/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/achow101/bitcoin/merges","archive_url":"https://api.github.com/repos/achow101/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/achow101/bitcoin/downloads","issues_url":"https://api.github.com/repos/achow101/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/achow101/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/achow101/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/achow101/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/achow101/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/achow101/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/achow101/bitcoin/deployments","created_at":"2015-10-27T00:20:28Z","updated_at":"2016-10-27T14:10:02Z","pushed_at":"2017-10-03T19:45:14Z","git_url":"git://github.com/achow101/bitcoin.git","ssh_url":"git@github.com:achow101/bitcoin.git","clone_url":"https://github.com/achow101/bitcoin.git","svn_url":"https://github.com/achow101/bitcoin","homepage":"https://bitcoin.org/en/download","size":87889,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"b4a509a3f817121c3df98ddfd96b2769e18a3e5a","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2017-10-03T19:11:13Z","pushed_at":"2017-10-03T19:45:16Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":87519,"stargazers_count":17148,"watchers_count":17148,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":10484,"mirror_url":null,"open_issues_count":800,"forks":10484,"open_issues":800,"watchers":17148,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/11446"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/11446"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/11446/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11446/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/ad944f3eedcbcfcecb5d66b33e2b80ba94718531"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"theuni"}}