{"action":"created","issue":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/1981","repository_url":"https://api.github.com/repos/hyperledger/fabric","labels_url":"https://api.github.com/repos/hyperledger/fabric/issues/1981/labels{/name}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/1981/comments","events_url":"https://api.github.com/repos/hyperledger/fabric/issues/1981/events","html_url":"https://github.com/hyperledger/fabric/issues/1981","id":162025890,"number":1981,"title":"Remove chaincode instance variables from example chaincodes","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-06-23T21:20:09Z","updated_at":"2016-06-27T10:41:30Z","closed_at":null,"body":"## Description\r\nAfter some discussion with @muralisrini related to the non-determinism bug found and fixed in PR #1969 it was suggested that an issue be opened to remove the chaincode instance variables from the example chaincodes included in the fabric tree, including the excellent busywork suite from @bcbrock.\r\n\r\nAs others may try to use these chaincodes as a starting point for their own application, we should demonstrate chaincode best practices in tree, and ensure that none of our chaincode relies on local state which will not be replicated across chaincode container restarts, or state transfer.\r\n\r\nAnother bolder suggestion would be to completely disallow variable persistence from chaincode invocation to chaincode invocation, possibly by forcing chaincode instances to be recreated from invocation to invocation, possibly via something like a factory pattern as suggested by @corecode."},"comment":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/comments/228711746","html_url":"https://github.com/hyperledger/fabric/issues/1981#issuecomment-228711746","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/1981","id":228711746,"user":{"login":"corecode","id":177979,"avatar_url":"https://avatars.githubusercontent.com/u/177979?v=3","gravatar_id":"","url":"https://api.github.com/users/corecode","html_url":"https://github.com/corecode","followers_url":"https://api.github.com/users/corecode/followers","following_url":"https://api.github.com/users/corecode/following{/other_user}","gists_url":"https://api.github.com/users/corecode/gists{/gist_id}","starred_url":"https://api.github.com/users/corecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corecode/subscriptions","organizations_url":"https://api.github.com/users/corecode/orgs","repos_url":"https://api.github.com/users/corecode/repos","events_url":"https://api.github.com/users/corecode/events{/privacy}","received_events_url":"https://api.github.com/users/corecode/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T10:41:30Z","updated_at":"2016-06-27T10:41:30Z","body":"We have no mechanism to realize that the chaincode may have to reload its state.  For now, the most conservative strategy is to not cache anything in the chaincode.  Clearly it already is very difficult to write deterministic chaincode in the first place.  Let's leave out dangerous optimizations for the time being."}}
{"actor":{"display_login":"corecode"}}