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

[p2p] ignore messages not intended for explorer nodes #3248

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,20 @@ func (node *Node) validateShardBoundMessage(
return nil, nil, true, errors.WithStack(err)
}

// ignore messages not intended for explorer
if node.NodeConfig.Role() == nodeconfig.ExplorerNode {
switch m.Type {
case
msg_pb.MessageType_ANNOUNCE,
msg_pb.MessageType_PREPARE,
msg_pb.MessageType_COMMIT,
msg_pb.MessageType_VIEWCHANGE,
msg_pb.MessageType_NEWVIEW:
atomic.AddUint32(&node.NumIgnoredMessages, 1)
return nil, nil, true, nil
}
}

// when node is in ViewChanging mode, it still accepts normal messages into FBFTLog
// in order to avoid possible trap forever but drop PREPARE and COMMIT
// which are message types specifically for a node acting as leader
Expand Down