{"action":"created","comment":{"url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/comments/186124859","pull_request_review_id":117655289,"id":186124859,"diff_hunk":"@@ -744,12 +742,30 @@ def has_batch(self, batch_id):\n         with self._lock:\n             if batch_id in self._pending_batches:\n                 return True\n-            if batch_id in self._queued_batch_ids:\n+            if batch_id in self._batch_queue:\n                 return True\n \n         return False\n \n \n+class IncomingBatchQueue:\n+    def __init__(self):\n+        self._queue = queue.Queue()\n+        self._ids = ConcurrentSet()\n+\n+    def put(self, batch):\n+        self._ids.add(batch.header_signature)","path":"validator/sawtooth_validator/journal/publisher.py","position":606,"original_position":51,"commit_id":"ae7e1245550247fa43894485a6d468afa22394f0","original_commit_id":"a943a29158de4af785545efa776e58a48d54f154","user":{"login":"peterschwarz","id":282233,"avatar_url":"https://avatars0.githubusercontent.com/u/282233?v=4","gravatar_id":"","url":"https://api.github.com/users/peterschwarz","html_url":"https://github.com/peterschwarz","followers_url":"https://api.github.com/users/peterschwarz/followers","following_url":"https://api.github.com/users/peterschwarz/following{/other_user}","gists_url":"https://api.github.com/users/peterschwarz/gists{/gist_id}","starred_url":"https://api.github.com/users/peterschwarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterschwarz/subscriptions","organizations_url":"https://api.github.com/users/peterschwarz/orgs","repos_url":"https://api.github.com/users/peterschwarz/repos","events_url":"https://api.github.com/users/peterschwarz/events{/privacy}","received_events_url":"https://api.github.com/users/peterschwarz/received_events","type":"User","site_admin":false},"body":"If these needs to be kept in sync, atomically, and this and `get` are used across threads, there needs to be a lock around the actions here.  Based on your commit message this doesn't guarantee they stay in sync, from a thread perspective.","created_at":"2018-05-04T15:50:35Z","updated_at":"2018-05-04T15:55:33Z","html_url":"https://github.com/hyperledger/sawtooth-core/pull/1608#discussion_r186124859","pull_request_url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/comments/186124859"},"html":{"href":"https://github.com/hyperledger/sawtooth-core/pull/1608#discussion_r186124859"},"pull_request":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608"}}},"pull_request":{"url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608","id":185287762,"html_url":"https://github.com/hyperledger/sawtooth-core/pull/1608","diff_url":"https://github.com/hyperledger/sawtooth-core/pull/1608.diff","patch_url":"https://github.com/hyperledger/sawtooth-core/pull/1608.patch","issue_url":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/1608","number":1608,"state":"open","locked":false,"title":"Refactor Block Publisher to support Consensus Engine prototyping","user":{"login":"aludvik","id":24274338,"avatar_url":"https://avatars1.githubusercontent.com/u/24274338?v=4","gravatar_id":"","url":"https://api.github.com/users/aludvik","html_url":"https://github.com/aludvik","followers_url":"https://api.github.com/users/aludvik/followers","following_url":"https://api.github.com/users/aludvik/following{/other_user}","gists_url":"https://api.github.com/users/aludvik/gists{/gist_id}","starred_url":"https://api.github.com/users/aludvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludvik/subscriptions","organizations_url":"https://api.github.com/users/aludvik/orgs","repos_url":"https://api.github.com/users/aludvik/repos","events_url":"https://api.github.com/users/aludvik/events{/privacy}","received_events_url":"https://api.github.com/users/aludvik/received_events","type":"User","site_admin":false},"body":"This PR makes some initial strides towards supporting the consensus engine api, although it does not get all the way there. It also cleans up the block publisher code to make it easier to understand when this is easy to do.","created_at":"2018-05-01T22:00:52Z","updated_at":"2018-05-04T15:55:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a549b107733b36b884c0b18eee14cb1a6836f1b7","assignee":{"login":"aludvik","id":24274338,"avatar_url":"https://avatars1.githubusercontent.com/u/24274338?v=4","gravatar_id":"","url":"https://api.github.com/users/aludvik","html_url":"https://github.com/aludvik","followers_url":"https://api.github.com/users/aludvik/followers","following_url":"https://api.github.com/users/aludvik/following{/other_user}","gists_url":"https://api.github.com/users/aludvik/gists{/gist_id}","starred_url":"https://api.github.com/users/aludvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludvik/subscriptions","organizations_url":"https://api.github.com/users/aludvik/orgs","repos_url":"https://api.github.com/users/aludvik/repos","events_url":"https://api.github.com/users/aludvik/events{/privacy}","received_events_url":"https://api.github.com/users/aludvik/received_events","type":"User","site_admin":false},"assignees":[{"login":"aludvik","id":24274338,"avatar_url":"https://avatars1.githubusercontent.com/u/24274338?v=4","gravatar_id":"","url":"https://api.github.com/users/aludvik","html_url":"https://github.com/aludvik","followers_url":"https://api.github.com/users/aludvik/followers","following_url":"https://api.github.com/users/aludvik/following{/other_user}","gists_url":"https://api.github.com/users/aludvik/gists{/gist_id}","starred_url":"https://api.github.com/users/aludvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludvik/subscriptions","organizations_url":"https://api.github.com/users/aludvik/orgs","repos_url":"https://api.github.com/users/aludvik/repos","events_url":"https://api.github.com/users/aludvik/events{/privacy}","received_events_url":"https://api.github.com/users/aludvik/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"vaporos","id":2374712,"avatar_url":"https://avatars1.githubusercontent.com/u/2374712?v=4","gravatar_id":"","url":"https://api.github.com/users/vaporos","html_url":"https://github.com/vaporos","followers_url":"https://api.github.com/users/vaporos/followers","following_url":"https://api.github.com/users/vaporos/following{/other_user}","gists_url":"https://api.github.com/users/vaporos/gists{/gist_id}","starred_url":"https://api.github.com/users/vaporos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaporos/subscriptions","organizations_url":"https://api.github.com/users/vaporos/orgs","repos_url":"https://api.github.com/users/vaporos/repos","events_url":"https://api.github.com/users/vaporos/events{/privacy}","received_events_url":"https://api.github.com/users/vaporos/received_events","type":"User","site_admin":false},{"login":"boydjohnson","id":4340785,"avatar_url":"https://avatars1.githubusercontent.com/u/4340785?v=4","gravatar_id":"","url":"https://api.github.com/users/boydjohnson","html_url":"https://github.com/boydjohnson","followers_url":"https://api.github.com/users/boydjohnson/followers","following_url":"https://api.github.com/users/boydjohnson/following{/other_user}","gists_url":"https://api.github.com/users/boydjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/boydjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boydjohnson/subscriptions","organizations_url":"https://api.github.com/users/boydjohnson/orgs","repos_url":"https://api.github.com/users/boydjohnson/repos","events_url":"https://api.github.com/users/boydjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/boydjohnson/received_events","type":"User","site_admin":false},{"login":"dcmiddle","id":4999494,"avatar_url":"https://avatars0.githubusercontent.com/u/4999494?v=4","gravatar_id":"","url":"https://api.github.com/users/dcmiddle","html_url":"https://github.com/dcmiddle","followers_url":"https://api.github.com/users/dcmiddle/followers","following_url":"https://api.github.com/users/dcmiddle/following{/other_user}","gists_url":"https://api.github.com/users/dcmiddle/gists{/gist_id}","starred_url":"https://api.github.com/users/dcmiddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcmiddle/subscriptions","organizations_url":"https://api.github.com/users/dcmiddle/orgs","repos_url":"https://api.github.com/users/dcmiddle/repos","events_url":"https://api.github.com/users/dcmiddle/events{/privacy}","received_events_url":"https://api.github.com/users/dcmiddle/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608/commits","review_comments_url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608/comments","review_comment_url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/1608/comments","statuses_url":"https://api.github.com/repos/hyperledger/sawtooth-core/statuses/ae7e1245550247fa43894485a6d468afa22394f0","head":{"label":"aludvik:refactor-block-publisher","ref":"refactor-block-publisher","sha":"ae7e1245550247fa43894485a6d468afa22394f0","user":{"login":"aludvik","id":24274338,"avatar_url":"https://avatars1.githubusercontent.com/u/24274338?v=4","gravatar_id":"","url":"https://api.github.com/users/aludvik","html_url":"https://github.com/aludvik","followers_url":"https://api.github.com/users/aludvik/followers","following_url":"https://api.github.com/users/aludvik/following{/other_user}","gists_url":"https://api.github.com/users/aludvik/gists{/gist_id}","starred_url":"https://api.github.com/users/aludvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludvik/subscriptions","organizations_url":"https://api.github.com/users/aludvik/orgs","repos_url":"https://api.github.com/users/aludvik/repos","events_url":"https://api.github.com/users/aludvik/events{/privacy}","received_events_url":"https://api.github.com/users/aludvik/received_events","type":"User","site_admin":false},"repo":{"id":79595660,"name":"sawtooth-core","full_name":"aludvik/sawtooth-core","owner":{"login":"aludvik","id":24274338,"avatar_url":"https://avatars1.githubusercontent.com/u/24274338?v=4","gravatar_id":"","url":"https://api.github.com/users/aludvik","html_url":"https://github.com/aludvik","followers_url":"https://api.github.com/users/aludvik/followers","following_url":"https://api.github.com/users/aludvik/following{/other_user}","gists_url":"https://api.github.com/users/aludvik/gists{/gist_id}","starred_url":"https://api.github.com/users/aludvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aludvik/subscriptions","organizations_url":"https://api.github.com/users/aludvik/orgs","repos_url":"https://api.github.com/users/aludvik/repos","events_url":"https://api.github.com/users/aludvik/events{/privacy}","received_events_url":"https://api.github.com/users/aludvik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aludvik/sawtooth-core","description":"Core repository for Sawtooth Lake Distributed ledger","fork":true,"url":"https://api.github.com/repos/aludvik/sawtooth-core","forks_url":"https://api.github.com/repos/aludvik/sawtooth-core/forks","keys_url":"https://api.github.com/repos/aludvik/sawtooth-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aludvik/sawtooth-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aludvik/sawtooth-core/teams","hooks_url":"https://api.github.com/repos/aludvik/sawtooth-core/hooks","issue_events_url":"https://api.github.com/repos/aludvik/sawtooth-core/issues/events{/number}","events_url":"https://api.github.com/repos/aludvik/sawtooth-core/events","assignees_url":"https://api.github.com/repos/aludvik/sawtooth-core/assignees{/user}","branches_url":"https://api.github.com/repos/aludvik/sawtooth-core/branches{/branch}","tags_url":"https://api.github.com/repos/aludvik/sawtooth-core/tags","blobs_url":"https://api.github.com/repos/aludvik/sawtooth-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aludvik/sawtooth-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aludvik/sawtooth-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/aludvik/sawtooth-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aludvik/sawtooth-core/statuses/{sha}","languages_url":"https://api.github.com/repos/aludvik/sawtooth-core/languages","stargazers_url":"https://api.github.com/repos/aludvik/sawtooth-core/stargazers","contributors_url":"https://api.github.com/repos/aludvik/sawtooth-core/contributors","subscribers_url":"https://api.github.com/repos/aludvik/sawtooth-core/subscribers","subscription_url":"https://api.github.com/repos/aludvik/sawtooth-core/subscription","commits_url":"https://api.github.com/repos/aludvik/sawtooth-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/aludvik/sawtooth-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/aludvik/sawtooth-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/aludvik/sawtooth-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/aludvik/sawtooth-core/contents/{+path}","compare_url":"https://api.github.com/repos/aludvik/sawtooth-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aludvik/sawtooth-core/merges","archive_url":"https://api.github.com/repos/aludvik/sawtooth-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aludvik/sawtooth-core/downloads","issues_url":"https://api.github.com/repos/aludvik/sawtooth-core/issues{/number}","pulls_url":"https://api.github.com/repos/aludvik/sawtooth-core/pulls{/number}","milestones_url":"https://api.github.com/repos/aludvik/sawtooth-core/milestones{/number}","notifications_url":"https://api.github.com/repos/aludvik/sawtooth-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aludvik/sawtooth-core/labels{/name}","releases_url":"https://api.github.com/repos/aludvik/sawtooth-core/releases{/id}","deployments_url":"https://api.github.com/repos/aludvik/sawtooth-core/deployments","created_at":"2017-01-20T20:30:42Z","updated_at":"2017-01-20T20:30:46Z","pushed_at":"2018-05-04T14:50:56Z","git_url":"git://github.com/aludvik/sawtooth-core.git","ssh_url":"git@github.com:aludvik/sawtooth-core.git","clone_url":"https://github.com/aludvik/sawtooth-core.git","svn_url":"https://github.com/aludvik/sawtooth-core","homepage":"http://intelledger.github.io/","size":20098,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hyperledger:master","ref":"master","sha":"44deeb02b59e867d56a446e96f1c2ac117d6f4a0","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":57901437,"name":"sawtooth-core","full_name":"hyperledger/sawtooth-core","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperledger/sawtooth-core","description":"Core repository for Sawtooth Distributed Ledger","fork":false,"url":"https://api.github.com/repos/hyperledger/sawtooth-core","forks_url":"https://api.github.com/repos/hyperledger/sawtooth-core/forks","keys_url":"https://api.github.com/repos/hyperledger/sawtooth-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/sawtooth-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/sawtooth-core/teams","hooks_url":"https://api.github.com/repos/hyperledger/sawtooth-core/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/sawtooth-core/events","assignees_url":"https://api.github.com/repos/hyperledger/sawtooth-core/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/sawtooth-core/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/sawtooth-core/tags","blobs_url":"https://api.github.com/repos/hyperledger/sawtooth-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/sawtooth-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/sawtooth-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/sawtooth-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/sawtooth-core/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/sawtooth-core/languages","stargazers_url":"https://api.github.com/repos/hyperledger/sawtooth-core/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/sawtooth-core/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/sawtooth-core/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/sawtooth-core/subscription","commits_url":"https://api.github.com/repos/hyperledger/sawtooth-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/sawtooth-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/sawtooth-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/sawtooth-core/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/sawtooth-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/sawtooth-core/merges","archive_url":"https://api.github.com/repos/hyperledger/sawtooth-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/sawtooth-core/downloads","issues_url":"https://api.github.com/repos/hyperledger/sawtooth-core/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/sawtooth-core/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/sawtooth-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/sawtooth-core/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/sawtooth-core/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/sawtooth-core/deployments","created_at":"2016-05-02T15:51:53Z","updated_at":"2018-05-04T06:28:58Z","pushed_at":"2018-05-04T15:21:33Z","git_url":"git://github.com/hyperledger/sawtooth-core.git","ssh_url":"git@github.com:hyperledger/sawtooth-core.git","clone_url":"https://github.com/hyperledger/sawtooth-core.git","svn_url":"https://github.com/hyperledger/sawtooth-core","homepage":"https://www.hyperledger.org/projects/sawtooth","size":26001,"stargazers_count":840,"watchers_count":840,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":430,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":430,"open_issues":23,"watchers":840,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608"},"html":{"href":"https://github.com/hyperledger/sawtooth-core/pull/1608"},"issue":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/1608"},"comments":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/issues/1608/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/pulls/1608/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/sawtooth-core/statuses/ae7e1245550247fa43894485a6d468afa22394f0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"peterschwarz"}}