{"action":"created","comment":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/comments/64308371","id":64308371,"diff_hunk":"@@ -231,6 +231,10 @@ def step_impl(context):\n     assert context.transactionID != \"\"\n     pass\n \n+@when(u'I unconditionally query chaincode \"{chaincodeName}\" function name \"{functionName}\" on \"{containerName}\"')","path":"bddtests/steps/peer_basic_impl.py","position":4,"original_position":4,"commit_id":"717926a3115e514e1f4224543d0c465dd7afeacc","original_commit_id":"717926a3115e514e1f4224543d0c465dd7afeacc","user":{"login":"jyellick","id":7431583,"avatar_url":"https://avatars.githubusercontent.com/u/7431583?v=3","gravatar_id":"","url":"https://api.github.com/users/jyellick","html_url":"https://github.com/jyellick","followers_url":"https://api.github.com/users/jyellick/followers","following_url":"https://api.github.com/users/jyellick/following{/other_user}","gists_url":"https://api.github.com/users/jyellick/gists{/gist_id}","starred_url":"https://api.github.com/users/jyellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyellick/subscriptions","organizations_url":"https://api.github.com/users/jyellick/orgs","repos_url":"https://api.github.com/users/jyellick/repos","events_url":"https://api.github.com/users/jyellick/events{/privacy}","received_events_url":"https://api.github.com/users/jyellick/received_events","type":"User","site_admin":false},"body":"This is nearly identical, essentially the \"unconditionally\" keyword acts as a way to more readable set the boolean \"failOnError\" in the now refactored `query_common` function.  Since there are only two possible values for that boolean, it did make sense to me to add it as a more formalized bracketed parameter (and this would have caused a larger changeset in the `peer_basic.feature` file.","created_at":"2016-05-23T23:46:07Z","updated_at":"2016-05-23T23:46:07Z","html_url":"https://github.com/hyperledger/fabric/pull/1557#discussion_r64308371","pull_request_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1557","_links":{"self":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/comments/64308371"},"html":{"href":"https://github.com/hyperledger/fabric/pull/1557#discussion_r64308371"},"pull_request":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1557"}}},"pull_request":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/1557","id":71120569,"html_url":"https://github.com/hyperledger/fabric/pull/1557","diff_url":"https://github.com/hyperledger/fabric/pull/1557.diff","patch_url":"https://github.com/hyperledger/fabric/pull/1557.patch","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/1557","number":1557,"state":"open","locked":false,"title":"Reject queries when out of date","user":{"login":"jyellick","id":7431583,"avatar_url":"https://avatars.githubusercontent.com/u/7431583?v=3","gravatar_id":"","url":"https://api.github.com/users/jyellick","html_url":"https://github.com/jyellick","followers_url":"https://api.github.com/users/jyellick/followers","following_url":"https://api.github.com/users/jyellick/following{/other_user}","gists_url":"https://api.github.com/users/jyellick/gists{/gist_id}","starred_url":"https://api.github.com/users/jyellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyellick/subscriptions","organizations_url":"https://api.github.com/users/jyellick/orgs","repos_url":"https://api.github.com/users/jyellick/repos","events_url":"https://api.github.com/users/jyellick/events{/privacy}","received_events_url":"https://api.github.com/users/jyellick/received_events","type":"User","site_admin":false},"body":"## Description\r\nThis changeset adds a flag to `helper.go` which tracks whether consensus believes the state to be valid or not.  When consensus believes state is no longer valid, it calls `InvalidateState()`, once it believe the replica has caught up, it calls `ValidateState()`.  When the peer receives a query, it first checks whether the helper believes the state is valid or not, and it not, rejects the query because the state may be inconsistent.\r\n\r\nNote, presently, the state is assumed to be good at startup, and is only invalidated by consensus at a later time.  We may wish to flip this assumption at some point in the future, but for now it is still an improvement.\r\n\r\nNote also that this change intentionally does nothing to change the processing of transaction submission.  Even though a peer is out of date, it does not mean that it cannot submit new transactions to the network.\r\n\r\n## Motivation and Context\r\nBefore this change, clients would receive old state with no indication that there was a problem, even if the peer knew it was thousands of blocks out of date.  After discussions with @binhn and @jeffgarratt it was concluded that queries should be rejected in this scenario.\r\n\r\nThis is intended to partially address issue #1091.\r\n\r\n## How Has This Been Tested?\r\nThis has been tested locally with behave test issue_680 and with a new behave test tagged as issue_1091.\r\n\r\nFor the new test, it gets a peer (vp3) into an inconsistent state, then queries, and verifies that an error is returned.  The test for issue_680 covers that once state transfer has completed that the 'invalid' flag is unset, and queries are replied to properly once more.\r\n\r\nRelying on CI to execute the other tests.\r\n\r\n## Checklist:\r\n- [X] I have added a [Signed-off-by](https://github.com/hyperledger/fabric/blob/master/CONTRIBUTING.md#legal-stuff)\r\n- [X] Either no new documentation is required by this change, OR I added new documentation\r\n- [X] Either no new tests are required by this change, OR I added new tests\r\n- [X] I have run [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), and [golint](https://github.com/golang/lint). I have cleaned up all valid errors and warnings in code I have added or modified. These tools may generate false positives. Don't be worried about ignoring some errors or warnings. The goal is clean, consistent, and readable code.\r\n\r\nSigned-off-by: Jason Yellick <jyellick@us.ibm.com>","created_at":"2016-05-23T21:05:03Z","updated_at":"2016-05-23T23:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2159dfc15c63189473aff0ee5e73db84056d2850","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1557/commits","review_comments_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1557/comments","review_comment_url":"https://api.github.com/repos/hyperledger/fabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/1557/comments","statuses_url":"https://api.github.com/repos/hyperledger/fabric/statuses/717926a3115e514e1f4224543d0c465dd7afeacc","head":{"label":"jyellick:reject-queries-outofdate","ref":"reject-queries-outofdate","sha":"717926a3115e514e1f4224543d0c465dd7afeacc","user":{"login":"jyellick","id":7431583,"avatar_url":"https://avatars.githubusercontent.com/u/7431583?v=3","gravatar_id":"","url":"https://api.github.com/users/jyellick","html_url":"https://github.com/jyellick","followers_url":"https://api.github.com/users/jyellick/followers","following_url":"https://api.github.com/users/jyellick/following{/other_user}","gists_url":"https://api.github.com/users/jyellick/gists{/gist_id}","starred_url":"https://api.github.com/users/jyellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyellick/subscriptions","organizations_url":"https://api.github.com/users/jyellick/orgs","repos_url":"https://api.github.com/users/jyellick/repos","events_url":"https://api.github.com/users/jyellick/events{/privacy}","received_events_url":"https://api.github.com/users/jyellick/received_events","type":"User","site_admin":false},"repo":{"id":55510365,"name":"fabric","full_name":"jyellick/fabric","owner":{"login":"jyellick","id":7431583,"avatar_url":"https://avatars.githubusercontent.com/u/7431583?v=3","gravatar_id":"","url":"https://api.github.com/users/jyellick","html_url":"https://github.com/jyellick","followers_url":"https://api.github.com/users/jyellick/followers","following_url":"https://api.github.com/users/jyellick/following{/other_user}","gists_url":"https://api.github.com/users/jyellick/gists{/gist_id}","starred_url":"https://api.github.com/users/jyellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyellick/subscriptions","organizations_url":"https://api.github.com/users/jyellick/orgs","repos_url":"https://api.github.com/users/jyellick/repos","events_url":"https://api.github.com/users/jyellick/events{/privacy}","received_events_url":"https://api.github.com/users/jyellick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jyellick/fabric","description":"Blockchain fabric incubator code","fork":true,"url":"https://api.github.com/repos/jyellick/fabric","forks_url":"https://api.github.com/repos/jyellick/fabric/forks","keys_url":"https://api.github.com/repos/jyellick/fabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jyellick/fabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jyellick/fabric/teams","hooks_url":"https://api.github.com/repos/jyellick/fabric/hooks","issue_events_url":"https://api.github.com/repos/jyellick/fabric/issues/events{/number}","events_url":"https://api.github.com/repos/jyellick/fabric/events","assignees_url":"https://api.github.com/repos/jyellick/fabric/assignees{/user}","branches_url":"https://api.github.com/repos/jyellick/fabric/branches{/branch}","tags_url":"https://api.github.com/repos/jyellick/fabric/tags","blobs_url":"https://api.github.com/repos/jyellick/fabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jyellick/fabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jyellick/fabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/jyellick/fabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jyellick/fabric/statuses/{sha}","languages_url":"https://api.github.com/repos/jyellick/fabric/languages","stargazers_url":"https://api.github.com/repos/jyellick/fabric/stargazers","contributors_url":"https://api.github.com/repos/jyellick/fabric/contributors","subscribers_url":"https://api.github.com/repos/jyellick/fabric/subscribers","subscription_url":"https://api.github.com/repos/jyellick/fabric/subscription","commits_url":"https://api.github.com/repos/jyellick/fabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/jyellick/fabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/jyellick/fabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/jyellick/fabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/jyellick/fabric/contents/{+path}","compare_url":"https://api.github.com/repos/jyellick/fabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jyellick/fabric/merges","archive_url":"https://api.github.com/repos/jyellick/fabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jyellick/fabric/downloads","issues_url":"https://api.github.com/repos/jyellick/fabric/issues{/number}","pulls_url":"https://api.github.com/repos/jyellick/fabric/pulls{/number}","milestones_url":"https://api.github.com/repos/jyellick/fabric/milestones{/number}","notifications_url":"https://api.github.com/repos/jyellick/fabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jyellick/fabric/labels{/name}","releases_url":"https://api.github.com/repos/jyellick/fabric/releases{/id}","deployments_url":"https://api.github.com/repos/jyellick/fabric/deployments","created_at":"2016-04-05T13:31:56Z","updated_at":"2016-04-05T13:31:58Z","pushed_at":"2016-05-23T20:54:07Z","git_url":"git://github.com/jyellick/fabric.git","ssh_url":"git@github.com:jyellick/fabric.git","clone_url":"https://github.com/jyellick/fabric.git","svn_url":"https://github.com/jyellick/fabric","homepage":"","size":42232,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hyperledger:master","ref":"master","sha":"c6628c21412c80aa0056e191ea45691bade549e5","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars.githubusercontent.com/u/7657900?v=3","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":42975662,"name":"fabric","full_name":"hyperledger/fabric","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars.githubusercontent.com/u/7657900?v=3","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/fabric","description":"Fabric is a blockchain project in Incubation proposed to the community and documented at https://goo.gl/RYQZ5N.  Information on what Incubation entails can be found in the Hyperledger Project Lifecycle document (https://goo.gl/4edNRc)","fork":false,"url":"https://api.github.com/repos/hyperledger/fabric","forks_url":"https://api.github.com/repos/hyperledger/fabric/forks","keys_url":"https://api.github.com/repos/hyperledger/fabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/fabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/fabric/teams","hooks_url":"https://api.github.com/repos/hyperledger/fabric/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/fabric/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/fabric/events","assignees_url":"https://api.github.com/repos/hyperledger/fabric/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/fabric/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/fabric/tags","blobs_url":"https://api.github.com/repos/hyperledger/fabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/fabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/fabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/fabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/fabric/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/fabric/languages","stargazers_url":"https://api.github.com/repos/hyperledger/fabric/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/fabric/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/fabric/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/fabric/subscription","commits_url":"https://api.github.com/repos/hyperledger/fabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/fabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/fabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/fabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/fabric/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/fabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/fabric/merges","archive_url":"https://api.github.com/repos/hyperledger/fabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/fabric/downloads","issues_url":"https://api.github.com/repos/hyperledger/fabric/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/fabric/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/fabric/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/fabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/fabric/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/fabric/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/fabric/deployments","created_at":"2015-09-23T03:17:14Z","updated_at":"2016-05-23T20:52:15Z","pushed_at":"2016-05-23T21:50:40Z","git_url":"git://github.com/hyperledger/fabric.git","ssh_url":"git@github.com:hyperledger/fabric.git","clone_url":"https://github.com/hyperledger/fabric.git","svn_url":"https://github.com/hyperledger/fabric","homepage":"","size":71701,"stargazers_count":684,"watchers_count":684,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":540,"mirror_url":null,"open_issues_count":278,"forks":540,"open_issues":278,"watchers":684,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1557"},"html":{"href":"https://github.com/hyperledger/fabric/pull/1557"},"issue":{"href":"https://api.github.com/repos/hyperledger/fabric/issues/1557"},"comments":{"href":"https://api.github.com/repos/hyperledger/fabric/issues/1557/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1557/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1557/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/fabric/statuses/717926a3115e514e1f4224543d0c465dd7afeacc"}}}}
{"actor":{"display_login":"jyellick"}}