{"action":"created","issue":{"url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/2710","repository_url":"https://api.github.com/repos/cosmos/cosmos-sdk","labels_url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/2710/labels{/name}","comments_url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/2710/comments","events_url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/2710/events","html_url":"https://github.com/cosmos/cosmos-sdk/issues/2710","id":378243669,"node_id":"MDU6SXNzdWUzNzgyNDM2Njk=","number":2710,"title":"lcd proof verification failiure","user":{"login":"HaoyangLiu","id":2945006,"node_id":"MDQ6VXNlcjI5NDUwMDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2945006?v=4","gravatar_id":"","url":"https://api.github.com/users/HaoyangLiu","html_url":"https://github.com/HaoyangLiu","followers_url":"https://api.github.com/users/HaoyangLiu/followers","following_url":"https://api.github.com/users/HaoyangLiu/following{/other_user}","gists_url":"https://api.github.com/users/HaoyangLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/HaoyangLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaoyangLiu/subscriptions","organizations_url":"https://api.github.com/users/HaoyangLiu/orgs","repos_url":"https://api.github.com/users/HaoyangLiu/repos","events_url":"https://api.github.com/users/HaoyangLiu/events{/privacy}","received_events_url":"https://api.github.com/users/HaoyangLiu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-07T11:12:22Z","updated_at":"2018-11-09T13:10:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I encountered some failures in lcd proof verification when a precommit set contains nil precommit.\r\n```\r\nERROR: Invalid commit -- invalid signature: Vote{1:EC62DF754270 24/00/2(Precommit) 000000000000 E2D7362DCD9F @ 2018-11-07T10:30:07.939731553Z}\r\n```\r\nThe above is the error message. It seems that the signature of precommit is invalid.\r\n\r\nThe above error message is printed by this [code](https://github.com/tendermint/tendermint/blob/90eda9bfb6e6daeed1c8015df41cb36772d91778/types/validator_set.go#L291).\r\nAccording to my analysis, for a full gaiad node, when it get a precommit which votes nil, then the BlockID is shown as follows:\r\n```\r\nBlockID = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONBlockID} \r\n Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} nil\r\n PartsHeader = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONPartSetHeader} \r\n  Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} nil\r\n  Total = 0\r\n```\r\nHowever, for a lcd node, when it get a precommit which votes nil, then the BlockID is shown as follows:\r\n```\r\nBlockID = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONBlockID} \r\n Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} len:0, cap:0\r\n PartsHeader = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONPartSetHeader} \r\n  Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} len:0, cap:0\r\n  Total = 0\r\n ```\r\nThis precommit can pass the verification of a full node, but fail in lcd verification. The key difference is that the block hash is empty array from lcd view while it is nil pointer from full node view. A full node view gets precommits vote by p2p gossip, and a lcd node gets precommits by calling rpc and unmarshal with amino. \r\nI have very little knowledge about amino. So I can't figure out the root reason. However, if we direactly assgin nil to blockID hash in lcd, then the signature verification will be passed.\r\n\r\nPlease refer to this [repository](https://github.com/HaoyangLiu/lcd-proof-issue.git) to reproduce this issue."},"comment":{"url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/comments/437354967","html_url":"https://github.com/cosmos/cosmos-sdk/issues/2710#issuecomment-437354967","issue_url":"https://api.github.com/repos/cosmos/cosmos-sdk/issues/2710","id":437354967,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzM1NDk2Nw==","user":{"login":"alexanderbez","id":5265989,"node_id":"MDQ6VXNlcjUyNjU5ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/5265989?v=4","gravatar_id":"","url":"https://api.github.com/users/alexanderbez","html_url":"https://github.com/alexanderbez","followers_url":"https://api.github.com/users/alexanderbez/followers","following_url":"https://api.github.com/users/alexanderbez/following{/other_user}","gists_url":"https://api.github.com/users/alexanderbez/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderbez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderbez/subscriptions","organizations_url":"https://api.github.com/users/alexanderbez/orgs","repos_url":"https://api.github.com/users/alexanderbez/repos","events_url":"https://api.github.com/users/alexanderbez/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderbez/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T13:10:33Z","updated_at":"2018-11-09T13:10:33Z","author_association":"CONTRIBUTOR","body":"/cc @jaekwon. I'm not sure, but this may have something to do with the latest proof verification updates."}}
{"actor":{"display_login":"alexanderbez"}}