diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index 06e30c1e0ef..1aa674f1958 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -384,11 +384,13 @@ func (w *client) Transmit(ctx context.Context, req *pb.TransmitRequest) (resp *p return nil, errors.Wrap(err, "Transmit call failed") } - signature, err := w.Sign(req) - if err != nil { - return nil, errors.Wrap(err, "Transmit call failed") + if w.tlsCertFile != nil { + signature, err := w.Sign(req) + if err != nil { + return nil, errors.Wrap(err, "Transmit call failed") + } + ctx = metadata.AppendToOutgoingContext(ctx, "csa-key", w.csaKey.PublicKeyString(), "signature", signature) } - ctx = metadata.AppendToOutgoingContext(ctx, "csa-key", w.csaKey.PublicKeyString(), "signature", signature) resp, err = w.rawClient.Transmit(ctx, req) w.handleTimeout(err) if err != nil { @@ -442,11 +444,13 @@ func (w *client) LatestReport(ctx context.Context, req *pb.LatestReportRequest) return nil, errors.Wrap(err, "LatestReport failed") } - signature, err := w.Sign(req) - if err != nil { - return nil, errors.Wrap(err, "Transmit call failed") + if w.tlsCertFile != nil { + signature, err := w.Sign(req) + if err != nil { + return nil, errors.Wrap(err, "Transmit call failed") + } + ctx = metadata.AppendToOutgoingContext(ctx, "csa-key", w.csaKey.PublicKeyString(), "signature", signature) } - ctx = metadata.AppendToOutgoingContext(ctx, "csa-key", w.csaKey.PublicKeyString(), "signature", signature) var cached bool if w.cache == nil { resp, err = w.rawClient.LatestReport(ctx, req)