You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
json.MarshalIndent adds indents to the serialized json struct which unnecessarily increases the size of the message on the wire.
tss/ws/server/handler.go:L497-L503
case msg := <-wsc.requestChan:
wsc.Logger.Info("send msg from requestChan to target client", "method", msg.Method)
jsonBytes, err := json.MarshalIndent(msg, "", " ")
if err != nil {
wsc.Logger.Error("Failed to marshal RPCRequest to JSON", "err", err)
continue
}
tss/node/server/http.go:L189-L195
jsonResult, err := json.MarshalIndent(signResp, "", " ")
if err != nil {
hs.logger.Error().Err(err).Msg("fail to marshal response to json message")
w.WriteHeader(http.StatusInternalServerError)
return
}
Expected behavior
To enhance the efficiency of message transmission, it’s recommended to replace json.MarshalIndent with json.Marshal. Moreover, a switch to a more efficient wire format, such as a binary one, could significantly improve data transmission efficiency.
The text was updated successfully, but these errors were encountered:
Describe the bug
json.MarshalIndent adds indents to the serialized json struct which unnecessarily increases the size of the message on the wire.
tss/ws/server/handler.go:L497-L503
tss/node/server/http.go:L189-L195
Expected behavior
To enhance the efficiency of message transmission, it’s recommended to replace
json.MarshalIndent
with json.Marshal
. Moreover, a switch to a more efficient wire format, such as a binary one, could significantly improve data transmission efficiency.The text was updated successfully, but these errors were encountered: