{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/239251988","pull_request_review_id":181881802,"id":239251988,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTI1MTk4OA==","diff_hunk":"@@ -29,6 +30,12 @@ class ResolveTransactionsFlow(txHashesArg: Set<SecureHash>,\n \n     // Need it ordered in terms of iteration. Needs to be a variable for the check-pointing logic to work.\n     private val txHashes = txHashesArg.toList()\n+    // Hash map of transaction id and set of all parent network parameters hashes it is direct child of.\n+    // This is to prevent downgrade attacks, where we obtain transaction chain with network parameters out of order.\n+    // We need to make an assumption that parameters epoch can only increase in the dependency chain and verify that.\n+    private val stxRootParametersMap = HashMap<SecureHash, MutableSet<SecureHash>>()","path":"core/src/main/kotlin/net/corda/core/internal/ResolveTransactionsFlow.kt","position":15,"original_position":15,"commit_id":"02f6486b92605bf8c45dcce9cd667e4fda71c13d","original_commit_id":"02f6486b92605bf8c45dcce9cd667e4fda71c13d","user":{"login":"shamsasari","id":3883563,"node_id":"MDQ6VXNlcjM4ODM1NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/3883563?v=4","gravatar_id":"","url":"https://api.github.com/users/shamsasari","html_url":"https://github.com/shamsasari","followers_url":"https://api.github.com/users/shamsasari/followers","following_url":"https://api.github.com/users/shamsasari/following{/other_user}","gists_url":"https://api.github.com/users/shamsasari/gists{/gist_id}","starred_url":"https://api.github.com/users/shamsasari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shamsasari/subscriptions","organizations_url":"https://api.github.com/users/shamsasari/orgs","repos_url":"https://api.github.com/users/shamsasari/repos","events_url":"https://api.github.com/users/shamsasari/events{/privacy}","received_events_url":"https://api.github.com/users/shamsasari/received_events","type":"User","site_admin":false},"body":"I think there's something wrong with the usage of `stxRootParametersMap` (see comments below). It would be conceptually easier if this was a `HashMap<SecureHash, MutableSet<Int>>`, i.e. a map of tx id to set of parent epochs.","created_at":"2018-12-05T21:53:27Z","updated_at":"2018-12-05T21:55:54Z","html_url":"https://github.com/corda/corda/pull/4351#discussion_r239251988","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/4351","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/239251988"},"html":{"href":"https://github.com/corda/corda/pull/4351#discussion_r239251988"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/4351"}}},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/4351","id":235570112,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NTcwMTEy","html_url":"https://github.com/corda/corda/pull/4351","diff_url":"https://github.com/corda/corda/pull/4351.diff","patch_url":"https://github.com/corda/corda/pull/4351.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/4351","number":4351,"state":"open","locked":false,"title":"CORDA-2089 (Part #2) - Resolve network parameters","user":{"login":"kasiastreich","id":24268146,"node_id":"MDQ6VXNlcjI0MjY4MTQ2","avatar_url":"https://avatars1.githubusercontent.com/u/24268146?v=4","gravatar_id":"","url":"https://api.github.com/users/kasiastreich","html_url":"https://github.com/kasiastreich","followers_url":"https://api.github.com/users/kasiastreich/followers","following_url":"https://api.github.com/users/kasiastreich/following{/other_user}","gists_url":"https://api.github.com/users/kasiastreich/gists{/gist_id}","starred_url":"https://api.github.com/users/kasiastreich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasiastreich/subscriptions","organizations_url":"https://api.github.com/users/kasiastreich/orgs","repos_url":"https://api.github.com/users/kasiastreich/repos","events_url":"https://api.github.com/users/kasiastreich/events{/privacy}","received_events_url":"https://api.github.com/users/kasiastreich/received_events","type":"User","site_admin":false},"body":"Add FetchParametersFlow to transaction resolution.\r\n\r\nAdd no downgrade rule for parameters in ResolveTransactionsFlow\r\nMake sure that parameters in the transaction\r\ngraph are ordered (this is to prevent the downgrade attack, when the\r\nmalicious notary and participants sign transaction that shouldn't be\r\nnotarised otherwise). We ensure that by checking that epochs of network\r\nparameters in the transaction chain are ordered.","created_at":"2018-12-03T19:47:43Z","updated_at":"2018-12-05T21:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f08df15aee27fbb672e8f1d76efd44aa08759e1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"josecoll","id":23558646,"node_id":"MDQ6VXNlcjIzNTU4NjQ2","avatar_url":"https://avatars0.githubusercontent.com/u/23558646?v=4","gravatar_id":"","url":"https://api.github.com/users/josecoll","html_url":"https://github.com/josecoll","followers_url":"https://api.github.com/users/josecoll/followers","following_url":"https://api.github.com/users/josecoll/following{/other_user}","gists_url":"https://api.github.com/users/josecoll/gists{/gist_id}","starred_url":"https://api.github.com/users/josecoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josecoll/subscriptions","organizations_url":"https://api.github.com/users/josecoll/orgs","repos_url":"https://api.github.com/users/josecoll/repos","events_url":"https://api.github.com/users/josecoll/events{/privacy}","received_events_url":"https://api.github.com/users/josecoll/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/4351/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/4351/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/4351/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/02f6486b92605bf8c45dcce9cd667e4fda71c13d","head":{"label":"corda:kstreich-resolve-tags-flow","ref":"kstreich-resolve-tags-flow","sha":"02f6486b92605bf8c45dcce9cd667e4fda71c13d","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","private":false,"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},"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-12-05T18:55:50Z","pushed_at":"2018-12-05T18:55:47Z","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":170192,"stargazers_count":2543,"watchers_count":2543,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":650,"mirror_url":null,"archived":false,"open_issues_count":93,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":650,"open_issues":93,"watchers":2543,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"382e3b651f38c3d56bee8f1d9ab2ca83db9b7385","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","private":false,"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},"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-12-05T18:55:50Z","pushed_at":"2018-12-05T18:55:47Z","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":170192,"stargazers_count":2543,"watchers_count":2543,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":650,"mirror_url":null,"archived":false,"open_issues_count":93,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":650,"open_issues":93,"watchers":2543,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/4351"},"html":{"href":"https://github.com/corda/corda/pull/4351"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/4351"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/4351/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/4351/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/4351/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/02f6486b92605bf8c45dcce9cd667e4fda71c13d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shamsasari"}}