-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add consensus originator check #1984
Add consensus originator check #1984
Conversation
iulianpascalau
commented
Jun 21, 2020
- added peer id in consensus message as to not allow impersonating. Anyone caught sending a consensus message that won't contain its originator peer id will be subject to peer banning.
…nyone caught sending a consensus message that won't contain its originator peer id will be subject to peer banning.
…nsensus-originator-check
heartbeat/data/proto/heartbeat.proto
Outdated
@@ -31,7 +31,7 @@ message HeartbeatDTO { | |||
string PeerType = 11; | |||
string Identity = 12; | |||
bool IsValidator = 13; | |||
int64 LastUptimeDowntime = 14; | |||
int64 LastUptimeDowntime = 14; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:( will fix that. Gofmt does not run automatically for .proto files
@@ -83,6 +84,12 @@ func (wrk *Worker) checkConsensusMessageValidity(cnsMsg *consensus.Message) erro | |||
err.Error()) | |||
} | |||
|
|||
cnsMsgOriginator := core.PeerID(cnsMsg.OriginatorPid) | |||
if cnsMsgOriginator != originator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The base branch was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.