Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lcd proof verification failiure #2710

Closed
HaoyangLiu opened this issue Nov 7, 2018 · 2 comments
Closed

lcd proof verification failiure #2710

HaoyangLiu opened this issue Nov 7, 2018 · 2 comments

Comments

@HaoyangLiu
Copy link

HaoyangLiu commented Nov 7, 2018

I encountered some failures in lcd proof verification when a precommit set contains nil precommit.

ERROR: Invalid commit -- invalid signature: Vote{1:EC62DF754270 24/00/2(Precommit) 000000000000 E2D7362DCD9F @ 2018-11-07T10:30:07.939731553Z}

The above is the error message. It seems that the signature of precommit is invalid.

The above error message is printed by this code.
According to my analysis, for a full gaiad node, when it get a precommit which votes nil, then the BlockID is shown as follows:

BlockID = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONBlockID} 
 Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} nil
 PartsHeader = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONPartSetHeader} 
  Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} nil
  Total = 0

However, for a lcd node, when it get a precommit which votes nil, then the BlockID is shown as follows:

BlockID = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONBlockID} 
 Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} len:0, cap:0
 PartsHeader = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/types.CanonicalJSONPartSetHeader} 
  Hash = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/libs/common.HexBytes} len:0, cap:0
  Total = 0

This 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.
I 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.

Please refer to this repository to reproduce this issue.

@alexanderbez
Copy link
Contributor

/cc @jaekwon. I'm not sure, but this may have something to do with the latest proof verification updates.

@HaoyangLiu
Copy link
Author

I have verified this issue on 0.26.0. It disappeared. Maybe the latest amino fixed this issue. Anyway, good news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants