Skip to content

Commit

Permalink
Log before validation
Browse files Browse the repository at this point in the history
  • Loading branch information
emlautarom1 committed Jul 2, 2024
1 parent 23dbf0b commit bba52e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aggregator/rpc_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ func mapErrors(err error) error {
// reply doesn't need to be checked. If there are no errors, the task response is accepted
// rpc framework forces a reply type to exist, so we put bool as a placeholder
func (s *RpcServer) ProcessSignedCheckpointTaskResponse(signedCheckpointTaskResponse *messages.SignedCheckpointTaskResponse, reply *bool) error {
s.logger.Info("Received signed task response", "response", signedCheckpointTaskResponse)

err := signedCheckpointTaskResponse.IsValid()
if err != nil {
return err
}

s.logger.Info("Received signed task response", "response", signedCheckpointTaskResponse)
s.listener.IncTotalSignedCheckpointTaskResponse()
s.listener.ObserveLastMessageReceivedTime(signedCheckpointTaskResponse.OperatorId, CheckpointTaskResponseLabel)

Expand All @@ -117,12 +118,13 @@ func (s *RpcServer) ProcessSignedCheckpointTaskResponse(signedCheckpointTaskResp
}

func (s *RpcServer) ProcessSignedStateRootUpdateMessage(signedStateRootUpdateMessage *messages.SignedStateRootUpdateMessage, reply *bool) error {
s.logger.Info("Received signed state root update message", "updateMessage", signedStateRootUpdateMessage)

err := signedStateRootUpdateMessage.IsValid()
if err != nil {
return err
}

s.logger.Info("Received signed state root update message", "updateMessage", signedStateRootUpdateMessage)
s.listener.IncTotalSignedCheckpointTaskResponse()
s.listener.ObserveLastMessageReceivedTime(signedStateRootUpdateMessage.OperatorId, StateRootUpdateMessageLabel)

Expand All @@ -140,13 +142,13 @@ func (s *RpcServer) ProcessSignedStateRootUpdateMessage(signedStateRootUpdateMes
}

func (s *RpcServer) ProcessSignedOperatorSetUpdateMessage(signedOperatorSetUpdateMessage *messages.SignedOperatorSetUpdateMessage, reply *bool) error {
s.logger.Info("Received signed operator set update message", "message", signedOperatorSetUpdateMessage)

err := signedOperatorSetUpdateMessage.IsValid()
if err != nil {
return err
}

s.logger.Info("Received signed operator set update message", "message", signedOperatorSetUpdateMessage)

operatorId := signedOperatorSetUpdateMessage.OperatorId
s.listener.ObserveLastMessageReceivedTime(operatorId, OperatorSetUpdateMessageLabel)
s.listener.IncTotalSignedOperatorSetUpdateMessage()
Expand Down

0 comments on commit bba52e4

Please sign in to comment.