{"action":"created","comment":{"url":"https://api.github.com/repos/openregister/openregister-java/pulls/comments/238988743","pull_request_review_id":181660973,"id":238988743,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODk4ODc0Mw==","diff_hunk":"@@ -17,7 +18,7 @@ public AddItemCommandHandler() {\n     }\n \n     @Override\n-    protected void executeCommand(RegisterCommand command, Register register) {\n+    protected void executeCommand(RegisterCommand command, Register register, ProofGenerator _proofGenerator) {","path":"src/main/java/uk/gov/register/serialization/handlers/AddItemCommandHandler.java","position":13,"original_position":13,"commit_id":"786dea0ab8bbb8b2cd30c50352cf8e5b964c59f5","original_commit_id":"824a37fee75aad64563cf95eb71deb8428e86106","user":{"login":"gidsg","id":1764158,"node_id":"MDQ6VXNlcjE3NjQxNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/1764158?v=4","gravatar_id":"","url":"https://api.github.com/users/gidsg","html_url":"https://github.com/gidsg","followers_url":"https://api.github.com/users/gidsg/followers","following_url":"https://api.github.com/users/gidsg/following{/other_user}","gists_url":"https://api.github.com/users/gidsg/gists{/gist_id}","starred_url":"https://api.github.com/users/gidsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gidsg/subscriptions","organizations_url":"https://api.github.com/users/gidsg/orgs","repos_url":"https://api.github.com/users/gidsg/repos","events_url":"https://api.github.com/users/gidsg/events{/privacy}","received_events_url":"https://api.github.com/users/gidsg/received_events","type":"User","site_admin":false},"body":"does not seem this `_proofGenerator` argument is used?","created_at":"2018-12-05T09:33:33Z","updated_at":"2018-12-05T09:33:33Z","html_url":"https://github.com/openregister/openregister-java/pull/542#discussion_r238988743","pull_request_url":"https://api.github.com/repos/openregister/openregister-java/pulls/542","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/comments/238988743"},"html":{"href":"https://github.com/openregister/openregister-java/pull/542#discussion_r238988743"},"pull_request":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/542"}}},"pull_request":{"url":"https://api.github.com/repos/openregister/openregister-java/pulls/542","id":235533027,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NTMzMDI3","html_url":"https://github.com/openregister/openregister-java/pull/542","diff_url":"https://github.com/openregister/openregister-java/pull/542.diff","patch_url":"https://github.com/openregister/openregister-java/pull/542.patch","issue_url":"https://api.github.com/repos/openregister/openregister-java/issues/542","number":542,"state":"open","locked":false,"title":"V2 Proofs and entry hashing","user":{"login":"MatMoore","id":87579,"node_id":"MDQ6VXNlcjg3NTc5","avatar_url":"https://avatars1.githubusercontent.com/u/87579?v=4","gravatar_id":"","url":"https://api.github.com/users/MatMoore","html_url":"https://github.com/MatMoore","followers_url":"https://api.github.com/users/MatMoore/followers","following_url":"https://api.github.com/users/MatMoore/following{/other_user}","gists_url":"https://api.github.com/users/MatMoore/gists{/gist_id}","starred_url":"https://api.github.com/users/MatMoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatMoore/subscriptions","organizations_url":"https://api.github.com/users/MatMoore/orgs","repos_url":"https://api.github.com/users/MatMoore/repos","events_url":"https://api.github.com/users/MatMoore/events{/privacy}","received_events_url":"https://api.github.com/users/MatMoore/received_events","type":"User","site_admin":false},"body":"### Context\r\nThis changes the data that goes into the merkle tree for the proof API to an objecthash of `key`, `timestamp`, `entry number` and `blob hash`, rather than a JSON string produced from the entry. This enables us to add additional metadata to entries without affecting the integrity of the merkle tree.\r\n\r\nTrello: https://trello.com/c/4NkpexnZ/3102-implement-rfc0009-hashing-algorithm-for-entries\r\n\r\n### Changes proposed in this pull request\r\n- [x] Rename V2 proof endpoints ([RFC 19](https://github.com/openregister/registers-rfcs/blob/master/content/proof-resource/index.md))\r\n- [x] Add new MerkleLeafStore implementation that uses ObjectHash ([RFC 9](https://github.com/openregister/registers-rfcs/blob/master/content/entry-hash/index.md))\r\n- [x] Make proof endpoints use the entry log directly instead of via a\r\n  `ReadOnlyRegister` facade. Proofs are a very low level thing and I don't\r\nthink there is any reason for it to be in this higher level interface\r\n- [x] Extract proof methods into a separate class and make `RegisterContext` build verifiable logs\r\n- [x] Make V2 proof API use V2 proofs\r\n\r\n### Guidance to review\r\nThe actual entry hashing part is very straightforward, but the example given in the [RFC](https://github.com/openregister/registers-rfcs/blob/master/content/entry-hash/index.md) is no longer correct due to [removing indexes](https://github.com/openregister/registers-rfcs/blob/master/content/indexes-removal/index.md), so I haven't compared the results to a known implementation. Instead I just stepped through the code in the debugger and made sure the component parts were correct.\r\n\r\nThe second commit is a very messy refactor of the proof code, and needs to be reviewed carefully. I made this change because the new entry hashes were very difficult to integrate without breaking proofs and RSF. I've tried to explain further in the commit message how I arrived at this solution.\r\n\r\nI've removed a few tests but I think all of them are covered by others.\r\n\r\nWhen reviewing this please pay special attention to the RSF code. Before merging we need to make sure that `/download-rsf` and `/load-rsf` still work the same and use V1 entry hashes.\r\n\r\nWe still need to add `/next/download-rsf` and `/next/load-rsf` in a future PR. The differences between the new and old RSF versions are:\r\n\r\n- `assert-root-hash` uses V2 entry hashes\r\n- `append-entry` identifies blobs using their V2 hashes","created_at":"2018-12-03T17:38:47Z","updated_at":"2018-12-05T09:33:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3c0006fc59edbc08d6cb8717ed03ef0f8e5800a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openregister/openregister-java/pulls/542/commits","review_comments_url":"https://api.github.com/repos/openregister/openregister-java/pulls/542/comments","review_comment_url":"https://api.github.com/repos/openregister/openregister-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openregister/openregister-java/issues/542/comments","statuses_url":"https://api.github.com/repos/openregister/openregister-java/statuses/786dea0ab8bbb8b2cd30c50352cf8e5b964c59f5","head":{"label":"openregister:entry-hashes","ref":"entry-hashes","sha":"786dea0ab8bbb8b2cd30c50352cf8e5b964c59f5","user":{"login":"openregister","id":10206003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjA2MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/10206003?v=4","gravatar_id":"","url":"https://api.github.com/users/openregister","html_url":"https://github.com/openregister","followers_url":"https://api.github.com/users/openregister/followers","following_url":"https://api.github.com/users/openregister/following{/other_user}","gists_url":"https://api.github.com/users/openregister/gists{/gist_id}","starred_url":"https://api.github.com/users/openregister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openregister/subscriptions","organizations_url":"https://api.github.com/users/openregister/orgs","repos_url":"https://api.github.com/users/openregister/repos","events_url":"https://api.github.com/users/openregister/events{/privacy}","received_events_url":"https://api.github.com/users/openregister/received_events","type":"Organization","site_admin":false},"repo":{"id":62739233,"node_id":"MDEwOlJlcG9zaXRvcnk2MjczOTIzMw==","name":"openregister-java","full_name":"openregister/openregister-java","private":false,"owner":{"login":"openregister","id":10206003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjA2MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/10206003?v=4","gravatar_id":"","url":"https://api.github.com/users/openregister","html_url":"https://github.com/openregister","followers_url":"https://api.github.com/users/openregister/followers","following_url":"https://api.github.com/users/openregister/following{/other_user}","gists_url":"https://api.github.com/users/openregister/gists{/gist_id}","starred_url":"https://api.github.com/users/openregister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openregister/subscriptions","organizations_url":"https://api.github.com/users/openregister/orgs","repos_url":"https://api.github.com/users/openregister/repos","events_url":"https://api.github.com/users/openregister/events{/privacy}","received_events_url":"https://api.github.com/users/openregister/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openregister/openregister-java","description":"Registers reference implementation","fork":false,"url":"https://api.github.com/repos/openregister/openregister-java","forks_url":"https://api.github.com/repos/openregister/openregister-java/forks","keys_url":"https://api.github.com/repos/openregister/openregister-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openregister/openregister-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openregister/openregister-java/teams","hooks_url":"https://api.github.com/repos/openregister/openregister-java/hooks","issue_events_url":"https://api.github.com/repos/openregister/openregister-java/issues/events{/number}","events_url":"https://api.github.com/repos/openregister/openregister-java/events","assignees_url":"https://api.github.com/repos/openregister/openregister-java/assignees{/user}","branches_url":"https://api.github.com/repos/openregister/openregister-java/branches{/branch}","tags_url":"https://api.github.com/repos/openregister/openregister-java/tags","blobs_url":"https://api.github.com/repos/openregister/openregister-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openregister/openregister-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openregister/openregister-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/openregister/openregister-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openregister/openregister-java/statuses/{sha}","languages_url":"https://api.github.com/repos/openregister/openregister-java/languages","stargazers_url":"https://api.github.com/repos/openregister/openregister-java/stargazers","contributors_url":"https://api.github.com/repos/openregister/openregister-java/contributors","subscribers_url":"https://api.github.com/repos/openregister/openregister-java/subscribers","subscription_url":"https://api.github.com/repos/openregister/openregister-java/subscription","commits_url":"https://api.github.com/repos/openregister/openregister-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/openregister/openregister-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/openregister/openregister-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/openregister/openregister-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/openregister/openregister-java/contents/{+path}","compare_url":"https://api.github.com/repos/openregister/openregister-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openregister/openregister-java/merges","archive_url":"https://api.github.com/repos/openregister/openregister-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openregister/openregister-java/downloads","issues_url":"https://api.github.com/repos/openregister/openregister-java/issues{/number}","pulls_url":"https://api.github.com/repos/openregister/openregister-java/pulls{/number}","milestones_url":"https://api.github.com/repos/openregister/openregister-java/milestones{/number}","notifications_url":"https://api.github.com/repos/openregister/openregister-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openregister/openregister-java/labels{/name}","releases_url":"https://api.github.com/repos/openregister/openregister-java/releases{/id}","deployments_url":"https://api.github.com/repos/openregister/openregister-java/deployments","created_at":"2016-07-06T17:09:50Z","updated_at":"2018-12-03T10:03:11Z","pushed_at":"2018-12-04T17:29:45Z","git_url":"git://github.com/openregister/openregister-java.git","ssh_url":"git@github.com:openregister/openregister-java.git","clone_url":"https://github.com/openregister/openregister-java.git","svn_url":"https://github.com/openregister/openregister-java","homepage":"https://www.registers.service.gov.uk/","size":17592,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":1,"watchers":7,"default_branch":"master"}},"base":{"label":"openregister:master","ref":"master","sha":"fe5829adf3479f656e3ae6b4e1dbf2c1b1c54f05","user":{"login":"openregister","id":10206003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjA2MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/10206003?v=4","gravatar_id":"","url":"https://api.github.com/users/openregister","html_url":"https://github.com/openregister","followers_url":"https://api.github.com/users/openregister/followers","following_url":"https://api.github.com/users/openregister/following{/other_user}","gists_url":"https://api.github.com/users/openregister/gists{/gist_id}","starred_url":"https://api.github.com/users/openregister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openregister/subscriptions","organizations_url":"https://api.github.com/users/openregister/orgs","repos_url":"https://api.github.com/users/openregister/repos","events_url":"https://api.github.com/users/openregister/events{/privacy}","received_events_url":"https://api.github.com/users/openregister/received_events","type":"Organization","site_admin":false},"repo":{"id":62739233,"node_id":"MDEwOlJlcG9zaXRvcnk2MjczOTIzMw==","name":"openregister-java","full_name":"openregister/openregister-java","private":false,"owner":{"login":"openregister","id":10206003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjA2MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/10206003?v=4","gravatar_id":"","url":"https://api.github.com/users/openregister","html_url":"https://github.com/openregister","followers_url":"https://api.github.com/users/openregister/followers","following_url":"https://api.github.com/users/openregister/following{/other_user}","gists_url":"https://api.github.com/users/openregister/gists{/gist_id}","starred_url":"https://api.github.com/users/openregister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openregister/subscriptions","organizations_url":"https://api.github.com/users/openregister/orgs","repos_url":"https://api.github.com/users/openregister/repos","events_url":"https://api.github.com/users/openregister/events{/privacy}","received_events_url":"https://api.github.com/users/openregister/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openregister/openregister-java","description":"Registers reference implementation","fork":false,"url":"https://api.github.com/repos/openregister/openregister-java","forks_url":"https://api.github.com/repos/openregister/openregister-java/forks","keys_url":"https://api.github.com/repos/openregister/openregister-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openregister/openregister-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openregister/openregister-java/teams","hooks_url":"https://api.github.com/repos/openregister/openregister-java/hooks","issue_events_url":"https://api.github.com/repos/openregister/openregister-java/issues/events{/number}","events_url":"https://api.github.com/repos/openregister/openregister-java/events","assignees_url":"https://api.github.com/repos/openregister/openregister-java/assignees{/user}","branches_url":"https://api.github.com/repos/openregister/openregister-java/branches{/branch}","tags_url":"https://api.github.com/repos/openregister/openregister-java/tags","blobs_url":"https://api.github.com/repos/openregister/openregister-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openregister/openregister-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openregister/openregister-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/openregister/openregister-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openregister/openregister-java/statuses/{sha}","languages_url":"https://api.github.com/repos/openregister/openregister-java/languages","stargazers_url":"https://api.github.com/repos/openregister/openregister-java/stargazers","contributors_url":"https://api.github.com/repos/openregister/openregister-java/contributors","subscribers_url":"https://api.github.com/repos/openregister/openregister-java/subscribers","subscription_url":"https://api.github.com/repos/openregister/openregister-java/subscription","commits_url":"https://api.github.com/repos/openregister/openregister-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/openregister/openregister-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/openregister/openregister-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/openregister/openregister-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/openregister/openregister-java/contents/{+path}","compare_url":"https://api.github.com/repos/openregister/openregister-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openregister/openregister-java/merges","archive_url":"https://api.github.com/repos/openregister/openregister-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openregister/openregister-java/downloads","issues_url":"https://api.github.com/repos/openregister/openregister-java/issues{/number}","pulls_url":"https://api.github.com/repos/openregister/openregister-java/pulls{/number}","milestones_url":"https://api.github.com/repos/openregister/openregister-java/milestones{/number}","notifications_url":"https://api.github.com/repos/openregister/openregister-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openregister/openregister-java/labels{/name}","releases_url":"https://api.github.com/repos/openregister/openregister-java/releases{/id}","deployments_url":"https://api.github.com/repos/openregister/openregister-java/deployments","created_at":"2016-07-06T17:09:50Z","updated_at":"2018-12-03T10:03:11Z","pushed_at":"2018-12-04T17:29:45Z","git_url":"git://github.com/openregister/openregister-java.git","ssh_url":"git@github.com:openregister/openregister-java.git","clone_url":"https://github.com/openregister/openregister-java.git","svn_url":"https://github.com/openregister/openregister-java","homepage":"https://www.registers.service.gov.uk/","size":17592,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/542"},"html":{"href":"https://github.com/openregister/openregister-java/pull/542"},"issue":{"href":"https://api.github.com/repos/openregister/openregister-java/issues/542"},"comments":{"href":"https://api.github.com/repos/openregister/openregister-java/issues/542/comments"},"review_comments":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/542/comments"},"review_comment":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openregister/openregister-java/pulls/542/commits"},"statuses":{"href":"https://api.github.com/repos/openregister/openregister-java/statuses/786dea0ab8bbb8b2cd30c50352cf8e5b964c59f5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gidsg"}}