|
|
|
@ -501,18 +501,18 @@ func (node *Node) pongMessageHandler(msgPayload []byte) int { |
|
|
|
|
// otherwise, we may not be able to validate the consensus messages received
|
|
|
|
|
// which will result in first consensus timeout
|
|
|
|
|
// TODO: remove this after fully migrating to beacon chain-based committee membership
|
|
|
|
|
err = node.Consensus.SetLeaderPubKey(pong.LeaderPubKey) |
|
|
|
|
if err != nil { |
|
|
|
|
utils.GetLogInstance().Error("Unmarshal Consensus Leader PubKey Failed", "error", err) |
|
|
|
|
} else { |
|
|
|
|
utils.GetLogInstance().Info("Set Consensus Leader PubKey", "key", node.Consensus.GetLeaderPubKey()) |
|
|
|
|
} |
|
|
|
|
err = node.DRand.SetLeaderPubKey(pong.LeaderPubKey) |
|
|
|
|
if err != nil { |
|
|
|
|
utils.GetLogInstance().Error("Unmarshal DRand Leader PubKey Failed", "error", err) |
|
|
|
|
} else { |
|
|
|
|
utils.GetLogInstance().Info("Set DRand Leader PubKey", "key", node.Consensus.GetLeaderPubKey()) |
|
|
|
|
} |
|
|
|
|
//err = node.Consensus.SetLeaderPubKey(pong.LeaderPubKey)
|
|
|
|
|
//if err != nil {
|
|
|
|
|
// utils.GetLogInstance().Error("Unmarshal Consensus Leader PubKey Failed", "error", err)
|
|
|
|
|
//} else {
|
|
|
|
|
// utils.GetLogInstance().Info("Set Consensus Leader PubKey", "key", node.Consensus.GetLeaderPubKey())
|
|
|
|
|
//}
|
|
|
|
|
//err = node.DRand.SetLeaderPubKey(pong.LeaderPubKey)
|
|
|
|
|
//if err != nil {
|
|
|
|
|
// utils.GetLogInstance().Error("Unmarshal DRand Leader PubKey Failed", "error", err)
|
|
|
|
|
//} else {
|
|
|
|
|
// utils.GetLogInstance().Info("Set DRand Leader PubKey", "key", node.Consensus.GetLeaderPubKey())
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
peers := make([]*p2p.Peer, 0) |
|
|
|
|
|
|
|
|
@ -564,7 +564,8 @@ func (node *Node) pongMessageHandler(msgPayload []byte) int { |
|
|
|
|
node.serviceManager.TakeAction(&service.Action{Action: service.Notify, ServiceType: service.PeerDiscovery, Params: data}) |
|
|
|
|
|
|
|
|
|
// TODO: remove this after fully migrating to beacon chain-based committee membership
|
|
|
|
|
return node.Consensus.UpdatePublicKeys(publicKeys) + node.DRand.UpdatePublicKeys(publicKeys) |
|
|
|
|
// return node.Consensus.UpdatePublicKeys(publicKeys) + node.DRand.UpdatePublicKeys(publicKeys)
|
|
|
|
|
return 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (node *Node) epochShardStateMessageHandler(msgPayload []byte) int { |
|
|
|
|