{"action":"created","issue":{"url":"https://api.github.com/repos/zcash/zcash/issues/3353","repository_url":"https://api.github.com/repos/zcash/zcash","labels_url":"https://api.github.com/repos/zcash/zcash/issues/3353/labels{/name}","comments_url":"https://api.github.com/repos/zcash/zcash/issues/3353/comments","events_url":"https://api.github.com/repos/zcash/zcash/issues/3353/events","html_url":"https://github.com/zcash/zcash/pull/3353","id":334690016,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NTk5NDAw","number":3353,"title":"Cache Sapling witnesses in the wallet","user":{"login":"Eirik0","id":6133620,"node_id":"MDQ6VXNlcjYxMzM2MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/6133620?v=4","gravatar_id":"","url":"https://api.github.com/users/Eirik0","html_url":"https://github.com/Eirik0","followers_url":"https://api.github.com/users/Eirik0/followers","following_url":"https://api.github.com/users/Eirik0/following{/other_user}","gists_url":"https://api.github.com/users/Eirik0/gists{/gist_id}","starred_url":"https://api.github.com/users/Eirik0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eirik0/subscriptions","organizations_url":"https://api.github.com/users/Eirik0/orgs","repos_url":"https://api.github.com/users/Eirik0/repos","events_url":"https://api.github.com/users/Eirik0/events{/privacy}","received_events_url":"https://api.github.com/users/Eirik0/received_events","type":"User","site_admin":false},"labels":[{"id":546339364,"node_id":"MDU6TGFiZWw1NDYzMzkzNjQ=","url":"https://api.github.com/repos/zcash/zcash/labels/Sapling","name":"Sapling","color":"0e8a16","default":false},{"id":156615475,"node_id":"MDU6TGFiZWwxNTY2MTU0NzU=","url":"https://api.github.com/repos/zcash/zcash/labels/wallet","name":"wallet","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/zcash/zcash/milestones/73","html_url":"https://github.com/zcash/zcash/milestone/73","labels_url":"https://api.github.com/repos/zcash/zcash/milestones/73/labels","id":3126623,"node_id":"MDk6TWlsZXN0b25lMzEyNjYyMw==","number":73,"title":"v2.0.0","description":"First Sapling-compatible release, containing the main-net activation height.","creator":{"login":"str4d","id":4993799,"node_id":"MDQ6VXNlcjQ5OTM3OTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4993799?v=4","gravatar_id":"","url":"https://api.github.com/users/str4d","html_url":"https://github.com/str4d","followers_url":"https://api.github.com/users/str4d/followers","following_url":"https://api.github.com/users/str4d/following{/other_user}","gists_url":"https://api.github.com/users/str4d/gists{/gist_id}","starred_url":"https://api.github.com/users/str4d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/str4d/subscriptions","organizations_url":"https://api.github.com/users/str4d/orgs","repos_url":"https://api.github.com/users/str4d/repos","events_url":"https://api.github.com/users/str4d/events{/privacy}","received_events_url":"https://api.github.com/users/str4d/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":24,"state":"open","created_at":"2018-02-19T11:41:00Z","updated_at":"2018-07-25T09:52:46Z","due_on":"2018-08-13T07:00:00Z","closed_at":null},"comments":8,"created_at":"2018-06-21T23:07:43Z","updated_at":"2018-07-25T18:03:51Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zcash/zcash/pulls/3353","html_url":"https://github.com/zcash/zcash/pull/3353","diff_url":"https://github.com/zcash/zcash/pull/3353.diff","patch_url":"https://github.com/zcash/zcash/pull/3353.patch"},"body":"Closes #3062 \r\n\r\nI have not update the tests in test_wallet.cpp. Also, there are several other methods in the wallet that have to do with witnesses and note data which will need to be updated, but this PR focuses on IncrementNoteWitnesses and DecrementNoteWitnesses."},"comment":{"url":"https://api.github.com/repos/zcash/zcash/issues/comments/407844077","html_url":"https://github.com/zcash/zcash/pull/3353#issuecomment-407844077","issue_url":"https://api.github.com/repos/zcash/zcash/issues/3353","id":407844077,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzg0NDA3Nw==","user":{"login":"ebfull","id":3794471,"node_id":"MDQ6VXNlcjM3OTQ0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/3794471?v=4","gravatar_id":"","url":"https://api.github.com/users/ebfull","html_url":"https://github.com/ebfull","followers_url":"https://api.github.com/users/ebfull/followers","following_url":"https://api.github.com/users/ebfull/following{/other_user}","gists_url":"https://api.github.com/users/ebfull/gists{/gist_id}","starred_url":"https://api.github.com/users/ebfull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebfull/subscriptions","organizations_url":"https://api.github.com/users/ebfull/orgs","repos_url":"https://api.github.com/users/ebfull/repos","events_url":"https://api.github.com/users/ebfull/events{/privacy}","received_events_url":"https://api.github.com/users/ebfull/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T18:03:51Z","updated_at":"2018-07-25T18:03:51Z","author_association":"CONTRIBUTOR","body":"```\r\nassert(pcoinsTip->GetSaplingAnchorAt(pindex->pprev->hashFinalSaplingRoot, saplingTree));\r\n```\r\n\r\nThis assertion is using `hashFinalSaplingRoot` (the field in the header) before it's constrained to equal the correct content. Here's some consensus code that does the right thing:\r\n\r\n```\r\nif (NetworkUpgradeActive(pindex->pprev->nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING)) {\r\n        view.PopAnchor(pindex->pprev->hashFinalSaplingRoot, SAPLING);\r\n    } else {\r\n        view.PopAnchor(ZCSaplingIncrementalMerkleTree::empty_root(), SAPLING);\r\n}\r\n```\r\n\r\nSo, the assertion should be changed so that it only applies when `NetworkUpgradeActive(pindex->pprev->nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING)`."}}
{"actor":{"display_login":"ebfull"}}