payload: {"action":"created","comment":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/315495028","pull_request_review_id":276916653,"id":315495028,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNTQ5NTAyOA==","diff_hunk":"@@ -249,39 +258,55 @@ private CheckedMapProof checkProof() {\n     return commonPrefix;\n   }\n \n-  private static HashCode getEmptyProofListHash() {\n-    return HashCode.fromBytes(new byte[Hashing.DEFAULT_HASH_SIZE_BYTES]);\n+  private static HashCode getEmptyProofIndexHash() {\n+    HashCode merkleRoot = HashCode.fromBytes(new byte[Hashing.DEFAULT_HASH_SIZE_BYTES]);\n+    return getIndexHash(merkleRoot);\n   }\n \n-  private static HashCode getSingleEntryRootHash(MapProofEntry entry) {\n-    return getSingleEntryRootHash(entry.getDbKey(), entry.getHash());\n+  private static HashCode getSingleEntryProofIndexHash(MapProofEntry proofEntry) {\n+    HashCode merkleRoot = getSingleEntryMerkleRoot(proofEntry.getDbKey(),\n+        proofEntry.getHash());\n+    return getIndexHash(merkleRoot);\n   }\n \n-  private static HashCode getSingleEntryRootHash(MapEntry<ByteString, ByteString> entry) {\n-    DbKey dbKey = DbKey.newLeafKey(entry.getKey());\n-    HashCode valueHash = HASH_FUNCTION.hashByteString(entry.getValue());\n-    return getSingleEntryRootHash(dbKey, valueHash);\n+  private static HashCode getSingleEntryProofIndexHash(MapEntry<ByteString, ByteString> mapEntry) {\n+    DbKey dbKey = DbKey.newLeafKey(mapEntry.getKey());\n+    HashCode valueHash = getLeafEntryHash(mapEntry.getValue());\n+    HashCode merkleRoot = getSingleEntryMerkleRoot(dbKey, valueHash);\n+    return getIndexHash(merkleRoot);\n   }\n \n-  private static HashCode getSingleEntryRootHash(DbKey key, HashCode valueHash) {\n+  private static HashCode getIndexHash(HashCode merkleRoot) {\n+    return HASH_FUNCTION.newHasher()\n+        .putByte(MAP_ROOT_PREFIX)\n+        .putObject(merkleRoot, hashCodeFunnel())\n+        .hash();\n+  }\n+\n+  private static HashCode getSingleEntryMerkleRoot(DbKey key, HashCode valueHash) {\n     assert key.getNodeType() == Type.LEAF;\n     return HASH_FUNCTION.newHasher()\n+        .putByte(MAP_NODE_PREFIX)\n         .putObject(key, dbKeyFunnel())","path":"exonum-java-binding/common/src/main/java/com/exonum/binding/common/proofs/map/UncheckedFlatMapProof.java","position":120,"original_position":120,"commit_id":"a0d856cf6a53dd16409e71c721b07bab4914fe1e","original_commit_id":"58bc995f44f5f04156448e0ec73e443ab5a40862","user":{"login":"MakarovS","id":6428594,"node_id":"MDQ6VXNlcjY0Mjg1OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6428594?v=4","gravatar_id":"","url":"https://api.github.com/users/MakarovS","html_url":"https://github.com/MakarovS","followers_url":"https://api.github.com/users/MakarovS/followers","following_url":"https://api.github.com/users/MakarovS/following{/other_user}","gists_url":"https://api.github.com/users/MakarovS/gists{/gist_id}","starred_url":"https://api.github.com/users/MakarovS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakarovS/subscriptions","organizations_url":"https://api.github.com/users/MakarovS/orgs","repos_url":"https://api.github.com/users/MakarovS/repos","events_url":"https://api.github.com/users/MakarovS/events{/privacy}","received_events_url":"https://api.github.com/users/MakarovS/received_events","type":"User","site_admin":false},"body":"Yes, I also noticed this inconsistency, but it's like that in core - https://github.com/exonum/exonum/blob/master/components/merkledb/src/hash.rs#L143\r\n@pavel-mukhanov is there a reason why database key path isn't compressed in case of a single entry proof?","created_at":"2019-08-20T03:37:30Z","updated_at":"2019-08-20T03:37:30Z","html_url":"https://github.com/exonum/exonum-java-binding/pull/1032#discussion_r315495028","pull_request_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/315495028"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/1032#discussion_r315495028"},"pull_request":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032"}},"in_reply_to_id":315070919},"pull_request":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032","id":299678727,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk5Njc4NzI3","html_url":"https://github.com/exonum/exonum-java-binding/pull/1032","diff_url":"https://github.com/exonum/exonum-java-binding/pull/1032.diff","patch_url":"https://github.com/exonum/exonum-java-binding/pull/1032.patch","issue_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/1032","number":1032,"state":"open","locked":false,"title":"New proofs hashing rules for ProofMaps [ECR-3320]","user":{"login":"MakarovS","id":6428594,"node_id":"MDQ6VXNlcjY0Mjg1OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6428594?v=4","gravatar_id":"","url":"https://api.github.com/users/MakarovS","html_url":"https://github.com/MakarovS","followers_url":"https://api.github.com/users/MakarovS/followers","following_url":"https://api.github.com/users/MakarovS/following{/other_user}","gists_url":"https://api.github.com/users/MakarovS/gists{/gist_id}","starred_url":"https://api.github.com/users/MakarovS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakarovS/subscriptions","organizations_url":"https://api.github.com/users/MakarovS/orgs","repos_url":"https://api.github.com/users/MakarovS/repos","events_url":"https://api.github.com/users/MakarovS/events{/privacy}","received_events_url":"https://api.github.com/users/MakarovS/received_events","type":"User","site_admin":false},"body":"## Overview\r\nNew proofs hashing rules for ProofMaps.\r\n\r\n---\r\nSee: https://jira.bf.local/browse/ECR-3320\r\n\r\n### Definition of Done\r\n\r\n- [x] There are no TODOs left in the code\r\n- [x] Change is covered by automated [tests](https://github.com/exonum/exonum-java-binding/blob/master/CONTRIBUTING.md#tests)\r\n- [x] The [coding guidelines](https://github.com/exonum/exonum-java-binding/blob/master/CONTRIBUTING.md#the-code-style) are followed\r\n- [x] Public API has Javadoc\r\n- [x] Method preconditions are checked and documented in the Javadoc of the method\r\n- [x] Changelog is updated if needed (in case of notable or breaking changes)\r\n- [x] The continuous integration build passes\r\n","created_at":"2019-07-22T00:26:18Z","updated_at":"2019-08-20T03:37:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c7ae6d032d2a08eae5e97aee52fb61791e52265","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032/commits","review_comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032/comments","review_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/1032/comments","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/a0d856cf6a53dd16409e71c721b07bab4914fe1e","head":{"label":"exonum:ECR-3320","ref":"ECR-3320","sha":"a0d856cf6a53dd16409e71c721b07bab4914fe1e","user":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"repo":{"id":92375988,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3NTk4OA==","name":"exonum-java-binding","full_name":"exonum/exonum-java-binding","private":false,"owner":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/exonum/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":false,"url":"https://api.github.com/repos/exonum/exonum-java-binding","forks_url":"https://api.github.com/repos/exonum/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/exonum/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exonum/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exonum/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/exonum/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/exonum/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/exonum/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/exonum/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/exonum/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/exonum/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/exonum/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/exonum/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/exonum/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exonum/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/exonum/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exonum/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/exonum/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/exonum/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exonum/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/exonum/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/exonum/exonum-java-binding/deployments","created_at":"2017-05-25T07:12:56Z","updated_at":"2019-08-16T12:00:08Z","pushed_at":"2019-08-20T02:56:48Z","git_url":"git://github.com/exonum/exonum-java-binding.git","ssh_url":"git@github.com:exonum/exonum-java-binding.git","clone_url":"https://github.com/exonum/exonum-java-binding.git","svn_url":"https://github.com/exonum/exonum-java-binding","homepage":"http://exonum.com","size":5203,"stargazers_count":53,"watchers_count":53,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":22,"open_issues":18,"watchers":53,"default_branch":"master"}},"base":{"label":"exonum:merkledb","ref":"merkledb","sha":"172227db887a3e83f5c5979b6733bb6a04b1ce03","user":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"repo":{"id":92375988,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3NTk4OA==","name":"exonum-java-binding","full_name":"exonum/exonum-java-binding","private":false,"owner":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/exonum/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":false,"url":"https://api.github.com/repos/exonum/exonum-java-binding","forks_url":"https://api.github.com/repos/exonum/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/exonum/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exonum/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exonum/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/exonum/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/exonum/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/exonum/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/exonum/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/exonum/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/exonum/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/exonum/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/exonum/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/exonum/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exonum/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/exonum/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exonum/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/exonum/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/exonum/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exonum/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/exonum/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/exonum/exonum-java-binding/deployments","created_at":"2017-05-25T07:12:56Z","updated_at":"2019-08-16T12:00:08Z","pushed_at":"2019-08-20T02:56:48Z","git_url":"git://github.com/exonum/exonum-java-binding.git","ssh_url":"git@github.com:exonum/exonum-java-binding.git","clone_url":"https://github.com/exonum/exonum-java-binding.git","svn_url":"https://github.com/exonum/exonum-java-binding","homepage":"http://exonum.com","size":5203,"stargazers_count":53,"watchers_count":53,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":22,"open_issues":18,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/1032"},"issue":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/1032"},"comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/1032/comments"},"review_comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032/comments"},"review_comment":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/1032/commits"},"statuses":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/a0d856cf6a53dd16409e71c721b07bab4914fe1e"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"MakarovS"}}