-
Notifications
You must be signed in to change notification settings - Fork 293
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
[consensus] remove duplicated signature verification #3228
[consensus] remove duplicated signature verification #3228
Conversation
Check the following issue on the detailed explanation of why this commit makes sense. harmony-one#3225 The onPrepare and onCommit will do signature verification of the message payload. So, there is no need to do duplicated sanity check when handling Prepare/Commit messages. We reserve the signature verification on other messages, as they are not duplicated. This PR can reduce the CPU load of leader during consensus. Signed-off-by: Leo Chen <leo@harmony.one>
big assumption, but intention looks correct. however, I think a malicious validator can fool the leader in may be moving the |
Thanks for the comments and good insight, I didn't look closely on the double-sign checking though. Let me dive deeper. |
Signed-off-by: Leo Chen <leo@harmony.one>
@gupadhyaya , @rlan35 , please review again. |
instead of not doing any sanity check on p2p message with signatures, we should try explore p2p level message checking to make sure it's not tampered. P2p |
@LeoHChen |
And for validator OnAnnounce. The message fields are directly used for serious checks that may trigger view change. e.g in onAnnounceSanityChecks. Actually for OnAnnounce, since there is no block data to check (block data is in Prepared message). The p2p message signature is the only verification to verify it's the real leader. We should keep the sig checking for onAnnounce then. |
Nevermind these comments. The sig checks are only removed for leader logic. Then it looks good. |
blockNum and ViewID are checked in isRightBlockNumAndViewID, and BlockHash are verified with the sig, so they are all good. |
Check the following issue on the detailed explanation of why this commit makes sense.
#3225
The onPrepare and onCommit will do signature verification of the message payload.
So, there is no need to do duplicated sanity check when handling Prepare/Commit messages.
We reserve the signature verification on other messages, as they are not duplicated.
This PR can reduce the CPU load of leader during consensus.
Signed-off-by: Leo Chen leo@harmony.one