diff --git a/cmd/zetaclientd/start.go b/cmd/zetaclientd/start.go index 46d204fa34..39ff979452 100644 --- a/cmd/zetaclientd/start.go +++ b/cmd/zetaclientd/start.go @@ -5,6 +5,9 @@ import ( "encoding/json" "fmt" "io" + "net/http" + // #nosec G108 -- pprof enablement is intentional + _ "net/http/pprof" "os" "os/signal" "path/filepath" @@ -253,6 +256,15 @@ func Start(_ *cobra.Command, _ []string) error { time.Sleep(30 * time.Second) } }() + // pprof http server + // zetacored/cometbft is already listening for pprof on 6060 (by default) + go func() { + // #nosec G114 -- timeouts uneeded + err := http.ListenAndServe("localhost:6061", nil) + if err != nil { + log.Error().Err(err).Msg("pprof http server error") + } + }() // Generate a new TSS if keygen is set and add it into the tss server // If TSS has already been generated, and keygen was successful ; we use the existing TSS