{"action":"created","comment":{"url":"https://api.github.com/repos/ElementsProject/elements/pulls/comments/182258869","pull_request_review_id":113021311,"id":182258869,"diff_hunk":"@@ -63,6 +63,11 @@ class CSignatureCache\n         CSHA256().Write(nonce.begin(), 32).Write(hash.begin(), 32).Write(&pubkey[0], pubkey.size()).Write(&vchSig[0], vchSig.size()).Write(&vchCommitment[0], vchCommitment.size()).Write(&scriptPubKey[0], scriptPubKey.size()).Finalize(entry.begin());\n     }\n \n+    void ComputeEntry(uint256& entry, const uint256& wtxid, const std::vector<unsigned char>& commitment)\n+    {\n+        CSHA256().Write(nonce.begin(), 32).Write(wtxid.begin(), 32).Write(commitment.data(), 32).Finalize(entry.begin());","path":"src/script/sigcache.cpp","position":6,"original_position":6,"commit_id":"583a3758321961287e6242f7ed00f28cb28ac438","original_commit_id":"6a677d6795b2fcd1e3d30144928b65d6e18bac17","user":{"login":"apoelstra","id":1351933,"avatar_url":"https://avatars0.githubusercontent.com/u/1351933?v=4","gravatar_id":"","url":"https://api.github.com/users/apoelstra","html_url":"https://github.com/apoelstra","followers_url":"https://api.github.com/users/apoelstra/followers","following_url":"https://api.github.com/users/apoelstra/following{/other_user}","gists_url":"https://api.github.com/users/apoelstra/gists{/gist_id}","starred_url":"https://api.github.com/users/apoelstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apoelstra/subscriptions","organizations_url":"https://api.github.com/users/apoelstra/orgs","repos_url":"https://api.github.com/users/apoelstra/repos","events_url":"https://api.github.com/users/apoelstra/events{/privacy}","received_events_url":"https://api.github.com/users/apoelstra/received_events","type":"User","site_admin":false},"body":"I think `commitment.data()` has size 33, not 32. Is there a `size()` method you can use instead of hardcoding the number?","created_at":"2018-04-17T22:15:30Z","updated_at":"2018-04-17T22:15:30Z","html_url":"https://github.com/ElementsProject/elements/pull/335#discussion_r182258869","pull_request_url":"https://api.github.com/repos/ElementsProject/elements/pulls/335","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/comments/182258869"},"html":{"href":"https://github.com/ElementsProject/elements/pull/335#discussion_r182258869"},"pull_request":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/335"}}},"pull_request":{"url":"https://api.github.com/repos/ElementsProject/elements/pulls/335","id":182232758,"html_url":"https://github.com/ElementsProject/elements/pull/335","diff_url":"https://github.com/ElementsProject/elements/pull/335.diff","patch_url":"https://github.com/ElementsProject/elements/pull/335.patch","issue_url":"https://api.github.com/repos/ElementsProject/elements/issues/335","number":335,"state":"open","locked":false,"title":"Fix range/surjection proof caching","user":{"login":"instagibbs","id":5767891,"avatar_url":"https://avatars0.githubusercontent.com/u/5767891?v=4","gravatar_id":"","url":"https://api.github.com/users/instagibbs","html_url":"https://github.com/instagibbs","followers_url":"https://api.github.com/users/instagibbs/followers","following_url":"https://api.github.com/users/instagibbs/following{/other_user}","gists_url":"https://api.github.com/users/instagibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/instagibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instagibbs/subscriptions","organizations_url":"https://api.github.com/users/instagibbs/orgs","repos_url":"https://api.github.com/users/instagibbs/repos","events_url":"https://api.github.com/users/instagibbs/events{/privacy}","received_events_url":"https://api.github.com/users/instagibbs/received_events","type":"User","site_admin":false},"body":"Edit: Turns out we're not caching these results at all. Likely a rebase regression due to the sigcache overhaul upstream. :(\r\n\r\nEach element only needs to commit to 2 fields: wtxid and the corresponding commitment.\r\n\r\nTechnically speaking, the commitment could simply be the vout number of the commitment, but this fast enough.\r\n\r\nPartially resolves https://github.com/ElementsProject/elements/issues/334 by removing the quadratic hashing, and a bunch of unnecessary serialization.","created_at":"2018-04-17T16:59:10Z","updated_at":"2018-04-17T22:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20ec82534454816fb44db1f53eb477b6b92811fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ElementsProject/elements/pulls/335/commits","review_comments_url":"https://api.github.com/repos/ElementsProject/elements/pulls/335/comments","review_comment_url":"https://api.github.com/repos/ElementsProject/elements/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ElementsProject/elements/issues/335/comments","statuses_url":"https://api.github.com/repos/ElementsProject/elements/statuses/583a3758321961287e6242f7ed00f28cb28ac438","head":{"label":"instagibbs:unifycache","ref":"unifycache","sha":"583a3758321961287e6242f7ed00f28cb28ac438","user":{"login":"instagibbs","id":5767891,"avatar_url":"https://avatars0.githubusercontent.com/u/5767891?v=4","gravatar_id":"","url":"https://api.github.com/users/instagibbs","html_url":"https://github.com/instagibbs","followers_url":"https://api.github.com/users/instagibbs/followers","following_url":"https://api.github.com/users/instagibbs/following{/other_user}","gists_url":"https://api.github.com/users/instagibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/instagibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instagibbs/subscriptions","organizations_url":"https://api.github.com/users/instagibbs/orgs","repos_url":"https://api.github.com/users/instagibbs/repos","events_url":"https://api.github.com/users/instagibbs/events{/privacy}","received_events_url":"https://api.github.com/users/instagibbs/received_events","type":"User","site_admin":false},"repo":{"id":45544816,"name":"elements","full_name":"instagibbs/elements","owner":{"login":"instagibbs","id":5767891,"avatar_url":"https://avatars0.githubusercontent.com/u/5767891?v=4","gravatar_id":"","url":"https://api.github.com/users/instagibbs","html_url":"https://github.com/instagibbs","followers_url":"https://api.github.com/users/instagibbs/followers","following_url":"https://api.github.com/users/instagibbs/following{/other_user}","gists_url":"https://api.github.com/users/instagibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/instagibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instagibbs/subscriptions","organizations_url":"https://api.github.com/users/instagibbs/orgs","repos_url":"https://api.github.com/users/instagibbs/repos","events_url":"https://api.github.com/users/instagibbs/events{/privacy}","received_events_url":"https://api.github.com/users/instagibbs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/instagibbs/elements","description":"Feature experiments to advance the art of Bitcoin","fork":true,"url":"https://api.github.com/repos/instagibbs/elements","forks_url":"https://api.github.com/repos/instagibbs/elements/forks","keys_url":"https://api.github.com/repos/instagibbs/elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/instagibbs/elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/instagibbs/elements/teams","hooks_url":"https://api.github.com/repos/instagibbs/elements/hooks","issue_events_url":"https://api.github.com/repos/instagibbs/elements/issues/events{/number}","events_url":"https://api.github.com/repos/instagibbs/elements/events","assignees_url":"https://api.github.com/repos/instagibbs/elements/assignees{/user}","branches_url":"https://api.github.com/repos/instagibbs/elements/branches{/branch}","tags_url":"https://api.github.com/repos/instagibbs/elements/tags","blobs_url":"https://api.github.com/repos/instagibbs/elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/instagibbs/elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/instagibbs/elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/instagibbs/elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/instagibbs/elements/statuses/{sha}","languages_url":"https://api.github.com/repos/instagibbs/elements/languages","stargazers_url":"https://api.github.com/repos/instagibbs/elements/stargazers","contributors_url":"https://api.github.com/repos/instagibbs/elements/contributors","subscribers_url":"https://api.github.com/repos/instagibbs/elements/subscribers","subscription_url":"https://api.github.com/repos/instagibbs/elements/subscription","commits_url":"https://api.github.com/repos/instagibbs/elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/instagibbs/elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/instagibbs/elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/instagibbs/elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/instagibbs/elements/contents/{+path}","compare_url":"https://api.github.com/repos/instagibbs/elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/instagibbs/elements/merges","archive_url":"https://api.github.com/repos/instagibbs/elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/instagibbs/elements/downloads","issues_url":"https://api.github.com/repos/instagibbs/elements/issues{/number}","pulls_url":"https://api.github.com/repos/instagibbs/elements/pulls{/number}","milestones_url":"https://api.github.com/repos/instagibbs/elements/milestones{/number}","notifications_url":"https://api.github.com/repos/instagibbs/elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/instagibbs/elements/labels{/name}","releases_url":"https://api.github.com/repos/instagibbs/elements/releases{/id}","deployments_url":"https://api.github.com/repos/instagibbs/elements/deployments","created_at":"2015-11-04T14:39:00Z","updated_at":"2016-02-15T19:58:12Z","pushed_at":"2018-04-17T20:07:24Z","git_url":"git://github.com/instagibbs/elements.git","ssh_url":"git@github.com:instagibbs/elements.git","clone_url":"https://github.com/instagibbs/elements.git","svn_url":"https://github.com/instagibbs/elements","homepage":"","size":52122,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"alpha"}},"base":{"label":"ElementsProject:elements-0.14.1","ref":"elements-0.14.1","sha":"9f17022c5d6a0a1127566786fbf8eca8976b3fe1","user":{"login":"ElementsProject","id":12729539,"avatar_url":"https://avatars2.githubusercontent.com/u/12729539?v=4","gravatar_id":"","url":"https://api.github.com/users/ElementsProject","html_url":"https://github.com/ElementsProject","followers_url":"https://api.github.com/users/ElementsProject/followers","following_url":"https://api.github.com/users/ElementsProject/following{/other_user}","gists_url":"https://api.github.com/users/ElementsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/ElementsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElementsProject/subscriptions","organizations_url":"https://api.github.com/users/ElementsProject/orgs","repos_url":"https://api.github.com/users/ElementsProject/repos","events_url":"https://api.github.com/users/ElementsProject/events{/privacy}","received_events_url":"https://api.github.com/users/ElementsProject/received_events","type":"Organization","site_admin":false},"repo":{"id":37064937,"name":"elements","full_name":"ElementsProject/elements","owner":{"login":"ElementsProject","id":12729539,"avatar_url":"https://avatars2.githubusercontent.com/u/12729539?v=4","gravatar_id":"","url":"https://api.github.com/users/ElementsProject","html_url":"https://github.com/ElementsProject","followers_url":"https://api.github.com/users/ElementsProject/followers","following_url":"https://api.github.com/users/ElementsProject/following{/other_user}","gists_url":"https://api.github.com/users/ElementsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/ElementsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElementsProject/subscriptions","organizations_url":"https://api.github.com/users/ElementsProject/orgs","repos_url":"https://api.github.com/users/ElementsProject/repos","events_url":"https://api.github.com/users/ElementsProject/events{/privacy}","received_events_url":"https://api.github.com/users/ElementsProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ElementsProject/elements","description":"Open Source implementation of advanced blockchain features extending the Bitcoin protocol","fork":false,"url":"https://api.github.com/repos/ElementsProject/elements","forks_url":"https://api.github.com/repos/ElementsProject/elements/forks","keys_url":"https://api.github.com/repos/ElementsProject/elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ElementsProject/elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ElementsProject/elements/teams","hooks_url":"https://api.github.com/repos/ElementsProject/elements/hooks","issue_events_url":"https://api.github.com/repos/ElementsProject/elements/issues/events{/number}","events_url":"https://api.github.com/repos/ElementsProject/elements/events","assignees_url":"https://api.github.com/repos/ElementsProject/elements/assignees{/user}","branches_url":"https://api.github.com/repos/ElementsProject/elements/branches{/branch}","tags_url":"https://api.github.com/repos/ElementsProject/elements/tags","blobs_url":"https://api.github.com/repos/ElementsProject/elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ElementsProject/elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ElementsProject/elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/ElementsProject/elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ElementsProject/elements/statuses/{sha}","languages_url":"https://api.github.com/repos/ElementsProject/elements/languages","stargazers_url":"https://api.github.com/repos/ElementsProject/elements/stargazers","contributors_url":"https://api.github.com/repos/ElementsProject/elements/contributors","subscribers_url":"https://api.github.com/repos/ElementsProject/elements/subscribers","subscription_url":"https://api.github.com/repos/ElementsProject/elements/subscription","commits_url":"https://api.github.com/repos/ElementsProject/elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/ElementsProject/elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/ElementsProject/elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/ElementsProject/elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/ElementsProject/elements/contents/{+path}","compare_url":"https://api.github.com/repos/ElementsProject/elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ElementsProject/elements/merges","archive_url":"https://api.github.com/repos/ElementsProject/elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ElementsProject/elements/downloads","issues_url":"https://api.github.com/repos/ElementsProject/elements/issues{/number}","pulls_url":"https://api.github.com/repos/ElementsProject/elements/pulls{/number}","milestones_url":"https://api.github.com/repos/ElementsProject/elements/milestones{/number}","notifications_url":"https://api.github.com/repos/ElementsProject/elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ElementsProject/elements/labels{/name}","releases_url":"https://api.github.com/repos/ElementsProject/elements/releases{/id}","deployments_url":"https://api.github.com/repos/ElementsProject/elements/deployments","created_at":"2015-06-08T12:17:33Z","updated_at":"2018-04-13T09:20:03Z","pushed_at":"2018-04-17T17:36:21Z","git_url":"git://github.com/ElementsProject/elements.git","ssh_url":"git@github.com:ElementsProject/elements.git","clone_url":"https://github.com/ElementsProject/elements.git","svn_url":"https://github.com/ElementsProject/elements","homepage":"","size":51642,"stargazers_count":513,"watchers_count":513,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":193,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":193,"open_issues":78,"watchers":513,"default_branch":"elements-0.14.1"}},"_links":{"self":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/335"},"html":{"href":"https://github.com/ElementsProject/elements/pull/335"},"issue":{"href":"https://api.github.com/repos/ElementsProject/elements/issues/335"},"comments":{"href":"https://api.github.com/repos/ElementsProject/elements/issues/335/comments"},"review_comments":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/335/comments"},"review_comment":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ElementsProject/elements/pulls/335/commits"},"statuses":{"href":"https://api.github.com/repos/ElementsProject/elements/statuses/583a3758321961287e6242f7ed00f28cb28ac438"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"apoelstra"}}