{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/198910514","pull_request_review_id":132928683,"id":198910514,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODkxMDUxNA==","diff_hunk":"@@ -93,11 +94,13 @@ open class TransactionBuilder(\n      *\n      * @returns A new [WireTransaction] that will be unaffected by further changes to this [TransactionBuilder].\n      */\n-    @Throws(MissingContractAttachments::class)\n+    @Throws(TransactionBuildingException::class)","path":"core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt","position":32,"original_position":32,"commit_id":"48b9e1b83794215a53fc6515cb8433558dc94850","original_commit_id":"48b9e1b83794215a53fc6515cb8433558dc94850","user":{"login":"tudor-malene","id":1941897,"node_id":"MDQ6VXNlcjE5NDE4OTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1941897?v=4","gravatar_id":"","url":"https://api.github.com/users/tudor-malene","html_url":"https://github.com/tudor-malene","followers_url":"https://api.github.com/users/tudor-malene/followers","following_url":"https://api.github.com/users/tudor-malene/following{/other_user}","gists_url":"https://api.github.com/users/tudor-malene/gists{/gist_id}","starred_url":"https://api.github.com/users/tudor-malene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudor-malene/subscriptions","organizations_url":"https://api.github.com/users/tudor-malene/orgs","repos_url":"https://api.github.com/users/tudor-malene/repos","events_url":"https://api.github.com/users/tudor-malene/events{/privacy}","received_events_url":"https://api.github.com/users/tudor-malene/received_events","type":"User","site_admin":false},"body":"You're right. The Java compiler will complain.\r\n\r\nShould I create a deprecated version of the method that somehow wraps the TransactionBuildingException into a MissingContractAttachments?\r\n\r\nI think it makes much more sense to declare it throws a generic \"TransactionBuildingException\" to cover more future cases.","created_at":"2018-06-28T16:46:12Z","updated_at":"2018-06-28T16:46:12Z","html_url":"https://github.com/corda/corda/pull/3410#discussion_r198910514","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/3410","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/198910514"},"html":{"href":"https://github.com/corda/corda/pull/3410#discussion_r198910514"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/3410"}},"in_reply_to_id":198887335},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/3410","id":196207397,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjA3Mzk3","html_url":"https://github.com/corda/corda/pull/3410","diff_url":"https://github.com/corda/corda/pull/3410.diff","patch_url":"https://github.com/corda/corda/pull/3410.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/3410","number":3410,"state":"open","locked":false,"title":"CORDA-1314 Change logic around Contract version selection","user":{"login":"tudor-malene","id":1941897,"node_id":"MDQ6VXNlcjE5NDE4OTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1941897?v=4","gravatar_id":"","url":"https://api.github.com/users/tudor-malene","html_url":"https://github.com/tudor-malene","followers_url":"https://api.github.com/users/tudor-malene/followers","following_url":"https://api.github.com/users/tudor-malene/following{/other_user}","gists_url":"https://api.github.com/users/tudor-malene/gists{/gist_id}","starred_url":"https://api.github.com/users/tudor-malene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudor-malene/subscriptions","organizations_url":"https://api.github.com/users/tudor-malene/orgs","repos_url":"https://api.github.com/users/tudor-malene/repos","events_url":"https://api.github.com/users/tudor-malene/events{/privacy}","received_events_url":"https://api.github.com/users/tudor-malene/received_events","type":"User","site_admin":false},"body":"https://r3-cev.atlassian.net/browse/CORDA-1314\r\n\r\nHow it behaves now:\r\n\r\n- BankA, BankB start with Cash(Hash=1) and the HashConstraint\r\n- BankB issues some Cash and exchanges some with BankA\r\n- BankB decides to tinker with his Cordapp so will install Cash(Hash=2)\r\n- BankA sends some Cash to BankB, and BankB is happy to accept it because it \"trusts\" Cash(Hash=1)\r\n- BankB selects some Cash from it's vault and because the input states are using Hash=1, then that will be inherited by the output states and will be set in the \"attachments\" field\r\n- Now, if BankB self-Issues some Cash, then this will be created with (Hash=2). Obviously this new batch is not fungible with the old batch (Hash=1), because the HashConstraint will fail for one of them\r\n- BankB selects 1 coin from the second batch, and sends it to BankA. BankA does not know anything about this Cash(Hash=2) version so it rejects the transaction. ( this is back to this issue: https://r3-cev.atlassian.net/browse/ENT-1643)\r\n\r\n\r\nI've tested the above manually.\r\nTo create a proper test for this I need @szymonsztuka 's changes to the driver that would allow us to replace cordapps programmatically.\r\n\r\n\r\nFrom @mikehearn 's comment from the story:\r\n1. Let's fix the logging issue so constraint violations are really visible, constraint violations are going to be one of the major pain points our customers face until the time we implement signature constraints.\r\n- The constraint violations are visible in the log files. That code will be executed in the DJVM so we have to bubble the exception up \r\n\r\n2. Let's add a check to TransactionBuilder to catch the case where the app that's actively installed matches the state/contract class names but not the required hash, and throw before Alice is even ever contacted.\r\n- The change I've actually implemented for this case is: If the input states are constrained by the HashConstraint with Hash1, and I have the contract attachment with Hash1 in my store, with an uploader of 'app' ( which means it was installed at some point), then I will use Hash1 for the current transaction.\r\n- The `TransactionBuilder.determineContractAttachments` function should fail early if it cannot select the right attachment to satisfy the entire Tx\r\n\r\n3. Then let's tweak TransactionBuilder so that if we have the attachment that the constraint specifies in our attachment store, that's the one that's used.\r\n- see 2\r\n\r\n","created_at":"2018-06-20T16:49:10Z","updated_at":"2018-06-28T16:46:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac885f4b4ba810cb4306fea70c24417d2d046d1e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/3410/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/3410/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/3410/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/48b9e1b83794215a53fc6515cb8433558dc94850","head":{"label":"corda:feature/CORDA-1314/cordapp_versions_fix","ref":"feature/CORDA-1314/cordapp_versions_fix","sha":"48b9e1b83794215a53fc6515cb8433558dc94850","user":{"login":"corda","id":22600631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjAwNjMx","avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"node_id":"MDEwOlJlcG9zaXRvcnk3MDEzNzQxNw==","name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjAwNjMx","avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2018-06-28T16:39:58Z","pushed_at":"2018-06-28T16:24:55Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":147674,"stargazers_count":2007,"watchers_count":2007,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":537,"mirror_url":null,"archived":false,"open_issues_count":115,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":537,"open_issues":115,"watchers":2007,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"2f34b16b07e6fef84350b3642e2379602e65d7e1","user":{"login":"corda","id":22600631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjAwNjMx","avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"node_id":"MDEwOlJlcG9zaXRvcnk3MDEzNzQxNw==","name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNjAwNjMx","avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2018-06-28T16:39:58Z","pushed_at":"2018-06-28T16:24:55Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":147674,"stargazers_count":2007,"watchers_count":2007,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":537,"mirror_url":null,"archived":false,"open_issues_count":115,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":537,"open_issues":115,"watchers":2007,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/3410"},"html":{"href":"https://github.com/corda/corda/pull/3410"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/3410"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/3410/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/3410/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/3410/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/48b9e1b83794215a53fc6515cb8433558dc94850"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tudor-malene"}}