From 7ae25793da2499c158367679193a8fdcdb8a25da Mon Sep 17 00:00:00 2001 From: I know Date: Fri, 14 Jul 2023 18:51:43 +0800 Subject: [PATCH 1/2] fix secure mtl-32 --- tss/node/signer/keygen.go | 20 +++++++++++++++----- tss/node/signer/sign.go | 16 ++++++++++++---- tss/node/signer/sign_rollback.go | 16 ++++++++++++---- tss/node/signer/sign_slash.go | 16 ++++++++++++---- tss/node/signer/verify.go | 24 ++++++++++++++++++------ tss/node/signer/verify_rollback.go | 8 ++++++-- tss/node/signer/verify_slash.go | 4 +++- 7 files changed, 78 insertions(+), 26 deletions(-) diff --git a/tss/node/signer/keygen.go b/tss/node/signer/keygen.go index 180eac139..157b22738 100644 --- a/tss/node/signer/keygen.go +++ b/tss/node/signer/keygen.go @@ -54,14 +54,18 @@ func (p *Processor) Keygen() { if err := json.Unmarshal(req.Params, &keyR); err != nil { logger.Error().Msg("failed to unmarshal ask request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err = p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } verifyResult := p.verifyThreshold(keyR) if !verifyResult { logger.Error().Msg("verify threshold in keygen request is false") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "verify threshold in keygen request is false") - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } @@ -74,14 +78,18 @@ func (p *Processor) Keygen() { if err != nil { logger.Err(err).Msg("failed to keygen !") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 202, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } } else { if resp.Status == common.Success { keygenResponse := tsscommon.KeygenResponse{ ClusterPublicKey: resp.PubKey, } RpcResponse := tdtypes.NewRPCSuccessResponse(tdtypes.JSONRPCStringID(resId), keygenResponse) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } logger.Info().Msgf("keygen start to set group publickey for l1 contract") err := p.setGroupPublicKey(p.localPubKeyByte, resp.PubKeyByte) if err != nil { @@ -89,7 +97,9 @@ func (p *Processor) Keygen() { } } else { RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 202, "failed", resp.FailReason) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } } } diff --git a/tss/node/signer/sign.go b/tss/node/signer/sign.go index 45bfa8e8f..98a4b84b6 100644 --- a/tss/node/signer/sign.go +++ b/tss/node/signer/sign.go @@ -47,14 +47,18 @@ func (p *Processor) Sign() { if err := json.Unmarshal(req.Params, &nodeSignRequest); err != nil { logger.Error().Msg("failed to unmarshal ask request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } var requestBody tsscommon.SignStateRequest if err := json.Unmarshal(rawMsg, &requestBody); err != nil { logger.Error().Msg("failed to unmarshal asker's params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } if requestBody.StartBlock == nil || @@ -63,7 +67,9 @@ func (p *Processor) Sign() { requestBody.OffsetStartsAtIndex.Cmp(big.NewInt(0)) < 0 { logger.Error().Msg("StartBlock and OffsetStartsAtIndex must not be nil or negative") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "StartBlock and OffsetStartsAtIndex must not be nil or negative") - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } nodeSignRequest.RequestBody = requestBody @@ -84,7 +90,9 @@ func (p *Processor) SignGo(resId tdtypes.JSONRPCStringID, sign tsscommon.NodeSig if err != nil { RpcResponse := tdtypes.NewRPCErrorResponse(resId, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } logger.Err(err).Msg("check event failed") return err } diff --git a/tss/node/signer/sign_rollback.go b/tss/node/signer/sign_rollback.go index 4d9a9fd69..30508ed13 100644 --- a/tss/node/signer/sign_rollback.go +++ b/tss/node/signer/sign_rollback.go @@ -35,21 +35,27 @@ func (p *Processor) SignRollBack() { if err := json.Unmarshal(req.Params, &nodeSignRequest); err != nil { logger.Error().Msg("failed to unmarshal roll back request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } var requestBody tsscommon.RollBackRequest if err := json.Unmarshal(rawMsg, &requestBody); err != nil { logger.Error().Msg("failed to umarshal roll back params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } if requestBody.StartBlock == nil || requestBody.StartBlock.Cmp(big.NewInt(0)) < 0 { logger.Error().Msg("StartBlock must not be nil or negative") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "StartBlock must not be nil or negative") - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } nodeSignRequest.RequestBody = requestBody @@ -57,7 +63,9 @@ func (p *Processor) SignRollBack() { if err != nil { logger.Err(err).Msg("failed to encode roll back msg") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } diff --git a/tss/node/signer/sign_slash.go b/tss/node/signer/sign_slash.go index 9b79ef6c5..31bea0d2f 100644 --- a/tss/node/signer/sign_slash.go +++ b/tss/node/signer/sign_slash.go @@ -40,14 +40,18 @@ func (p *Processor) SignSlash() { if err := json.Unmarshal(req.Params, &nodeSignRequest); err != nil { logger.Error().Msg("failed to unmarshal node sign request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } var requestBody tsscommon.SlashRequest if err := json.Unmarshal(rawMsg, &requestBody); err != nil { logger.Error().Msg("failed to umarshal slash params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } nodeSignRequest.RequestBody = requestBody @@ -56,7 +60,9 @@ func (p *Processor) SignSlash() { if err != nil { RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } logger.Err(err).Msg("check event failed") continue } @@ -70,7 +76,9 @@ func (p *Processor) SignSlash() { if err != nil { logger.Err(err).Msg("failed to encode SlashMsg") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } diff --git a/tss/node/signer/verify.go b/tss/node/signer/verify.go index 4add95360..769667a2e 100644 --- a/tss/node/signer/verify.go +++ b/tss/node/signer/verify.go @@ -33,7 +33,9 @@ func (p *Processor) Verify() { if err := json.Unmarshal(req.Params, &askRequest); err != nil { logger.Error().Msg("failed to unmarshal ask request") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to unmarshal ", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } if askRequest.StartBlock == nil || @@ -42,7 +44,9 @@ func (p *Processor) Verify() { askRequest.OffsetStartsAtIndex.Cmp(big.NewInt(0)) < 0 { logger.Error().Msg("StartBlock and OffsetStartsAtIndex must not be nil or negative") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "invalid askRequest", "StartBlock and OffsetStartsAtIndex must not be nil or negative") - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } return } var resId = req.ID @@ -51,7 +55,9 @@ func (p *Processor) Verify() { if len(askRequest.StateRoots) == 0 { logger.Error().Msg("stateroots size is empty") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "stateroots size is empty ", "do not need to sign") - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } else { wg := &sync.WaitGroup{} @@ -61,7 +67,9 @@ func (p *Processor) Verify() { if err != nil { logger.Error().Msgf("failed to verify block %s", err.Error()) RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "get error when verify ", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } } else { @@ -69,7 +77,9 @@ func (p *Processor) Verify() { if err != nil { logger.Err(err).Msg("failed to conv msg to hash") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to conv msg to hash", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } else { hashStr := hexutil.Encode(hash) @@ -80,7 +90,9 @@ func (p *Processor) Verify() { Result: result, } RpcResponse = tdtypes.NewRPCSuccessResponse(resId, askResponse) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } } } diff --git a/tss/node/signer/verify_rollback.go b/tss/node/signer/verify_rollback.go index 5a4ce570b..0d8e06dec 100644 --- a/tss/node/signer/verify_rollback.go +++ b/tss/node/signer/verify_rollback.go @@ -35,14 +35,18 @@ func (p *Processor) VerifyRollBack() { if err != nil { logger.Error().Msgf("failed to do verify for rollback, %s", err.Error()) RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to do verify for rollback ", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } askResponse := common.AskResponse{ Result: ret, } RpcResponse = tdtypes.NewRPCSuccessResponse(resId, askResponse) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } } } }() diff --git a/tss/node/signer/verify_slash.go b/tss/node/signer/verify_slash.go index 153658e6e..21d64964b 100644 --- a/tss/node/signer/verify_slash.go +++ b/tss/node/signer/verify_slash.go @@ -28,7 +28,9 @@ func (p *Processor) VerifySlash() { if err := json.Unmarshal(req.Params, &askRequest); err != nil { logger.Error().Msg("failed to unmarshal ask request") RpcResponse = tdtypes.NewRPCErrorResponse(resId, 201, "failed to unmarshal", err.Error()) - p.wsClient.SendMsg(RpcResponse) + if err := p.wsClient.SendMsg(RpcResponse); err != nil { + logger.Error().Msg("failed to send msg to manager") + } continue } From a0fbe3fabdc8e00d4a23222b54f1b309e5a74f27 Mon Sep 17 00:00:00 2001 From: I know Date: Fri, 14 Jul 2023 19:09:50 +0800 Subject: [PATCH 2/2] fix secure mtl-32 --- tss/node/signer/keygen.go | 10 +++++----- tss/node/signer/sign.go | 8 ++++---- tss/node/signer/sign_rollback.go | 8 ++++---- tss/node/signer/sign_slash.go | 8 ++++---- tss/node/signer/verify.go | 12 ++++++------ tss/node/signer/verify_rollback.go | 4 ++-- tss/node/signer/verify_slash.go | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tss/node/signer/keygen.go b/tss/node/signer/keygen.go index 157b22738..a42a495be 100644 --- a/tss/node/signer/keygen.go +++ b/tss/node/signer/keygen.go @@ -55,7 +55,7 @@ func (p *Processor) Keygen() { logger.Error().Msg("failed to unmarshal ask request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err = p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -64,7 +64,7 @@ func (p *Processor) Keygen() { logger.Error().Msg("verify threshold in keygen request is false") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "verify threshold in keygen request is false") if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -79,7 +79,7 @@ func (p *Processor) Keygen() { logger.Err(err).Msg("failed to keygen !") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 202, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } } else { if resp.Status == common.Success { @@ -88,7 +88,7 @@ func (p *Processor) Keygen() { } RpcResponse := tdtypes.NewRPCSuccessResponse(tdtypes.JSONRPCStringID(resId), keygenResponse) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } logger.Info().Msgf("keygen start to set group publickey for l1 contract") err := p.setGroupPublicKey(p.localPubKeyByte, resp.PubKeyByte) @@ -98,7 +98,7 @@ func (p *Processor) Keygen() { } else { RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 202, "failed", resp.FailReason) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } } } diff --git a/tss/node/signer/sign.go b/tss/node/signer/sign.go index 98a4b84b6..c8bc03d3b 100644 --- a/tss/node/signer/sign.go +++ b/tss/node/signer/sign.go @@ -48,7 +48,7 @@ func (p *Processor) Sign() { logger.Error().Msg("failed to unmarshal ask request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -57,7 +57,7 @@ func (p *Processor) Sign() { logger.Error().Msg("failed to unmarshal asker's params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -68,7 +68,7 @@ func (p *Processor) Sign() { logger.Error().Msg("StartBlock and OffsetStartsAtIndex must not be nil or negative") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "StartBlock and OffsetStartsAtIndex must not be nil or negative") if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -91,7 +91,7 @@ func (p *Processor) SignGo(resId tdtypes.JSONRPCStringID, sign tsscommon.NodeSig RpcResponse := tdtypes.NewRPCErrorResponse(resId, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } logger.Err(err).Msg("check event failed") return err diff --git a/tss/node/signer/sign_rollback.go b/tss/node/signer/sign_rollback.go index 30508ed13..b1f0f4e89 100644 --- a/tss/node/signer/sign_rollback.go +++ b/tss/node/signer/sign_rollback.go @@ -36,7 +36,7 @@ func (p *Processor) SignRollBack() { logger.Error().Msg("failed to unmarshal roll back request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -45,7 +45,7 @@ func (p *Processor) SignRollBack() { logger.Error().Msg("failed to umarshal roll back params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -54,7 +54,7 @@ func (p *Processor) SignRollBack() { logger.Error().Msg("StartBlock must not be nil or negative") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", "StartBlock must not be nil or negative") if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -64,7 +64,7 @@ func (p *Processor) SignRollBack() { logger.Err(err).Msg("failed to encode roll back msg") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } diff --git a/tss/node/signer/sign_slash.go b/tss/node/signer/sign_slash.go index 31bea0d2f..5a93fb865 100644 --- a/tss/node/signer/sign_slash.go +++ b/tss/node/signer/sign_slash.go @@ -41,7 +41,7 @@ func (p *Processor) SignSlash() { logger.Error().Msg("failed to unmarshal node sign request") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -50,7 +50,7 @@ func (p *Processor) SignSlash() { logger.Error().Msg("failed to umarshal slash params request body") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -61,7 +61,7 @@ func (p *Processor) SignSlash() { RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } logger.Err(err).Msg("check event failed") continue @@ -77,7 +77,7 @@ func (p *Processor) SignSlash() { logger.Err(err).Msg("failed to encode SlashMsg") RpcResponse := tdtypes.NewRPCErrorResponse(req.ID, 201, "failed", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } diff --git a/tss/node/signer/verify.go b/tss/node/signer/verify.go index 769667a2e..39176ee85 100644 --- a/tss/node/signer/verify.go +++ b/tss/node/signer/verify.go @@ -34,7 +34,7 @@ func (p *Processor) Verify() { logger.Error().Msg("failed to unmarshal ask request") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to unmarshal ", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -45,7 +45,7 @@ func (p *Processor) Verify() { logger.Error().Msg("StartBlock and OffsetStartsAtIndex must not be nil or negative") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "invalid askRequest", "StartBlock and OffsetStartsAtIndex must not be nil or negative") if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } return } @@ -56,7 +56,7 @@ func (p *Processor) Verify() { logger.Error().Msg("stateroots size is empty") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "stateroots size is empty ", "do not need to sign") if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } else { @@ -68,7 +68,7 @@ func (p *Processor) Verify() { logger.Error().Msgf("failed to verify block %s", err.Error()) RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "get error when verify ", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -78,7 +78,7 @@ func (p *Processor) Verify() { logger.Err(err).Msg("failed to conv msg to hash") RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to conv msg to hash", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } else { @@ -91,7 +91,7 @@ func (p *Processor) Verify() { } RpcResponse = tdtypes.NewRPCSuccessResponse(resId, askResponse) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } } diff --git a/tss/node/signer/verify_rollback.go b/tss/node/signer/verify_rollback.go index 0d8e06dec..475748694 100644 --- a/tss/node/signer/verify_rollback.go +++ b/tss/node/signer/verify_rollback.go @@ -36,7 +36,7 @@ func (p *Processor) VerifyRollBack() { logger.Error().Msgf("failed to do verify for rollback, %s", err.Error()) RpcResponse = tdtypes.NewRPCErrorResponse(req.ID, 201, "failed to do verify for rollback ", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue } @@ -45,7 +45,7 @@ func (p *Processor) VerifyRollBack() { } RpcResponse = tdtypes.NewRPCSuccessResponse(resId, askResponse) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } } } diff --git a/tss/node/signer/verify_slash.go b/tss/node/signer/verify_slash.go index 21d64964b..9bebce6a2 100644 --- a/tss/node/signer/verify_slash.go +++ b/tss/node/signer/verify_slash.go @@ -29,7 +29,7 @@ func (p *Processor) VerifySlash() { logger.Error().Msg("failed to unmarshal ask request") RpcResponse = tdtypes.NewRPCErrorResponse(resId, 201, "failed to unmarshal", err.Error()) if err := p.wsClient.SendMsg(RpcResponse); err != nil { - logger.Error().Msg("failed to send msg to manager") + logger.Error().Err(err).Msg("failed to send msg to manager") } continue }