Skip to content

Commit

Permalink
feat(zetaclient): enable pprof http server (#3182)
Browse files Browse the repository at this point in the history
* feat(zetaclient): enable pprof http server

* changelog

* fmt
  • Loading branch information
gartnera authored Nov 20, 2024
1 parent 85d508a commit f5e5adb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [3091](https://github.com/zeta-chain/node/pull/3091) - improve build reproducability. `make release{,-build-only}` checksums should now be stable.
* [3124](https://github.com/zeta-chain/node/pull/3124) - integrate SPL deposits
* [3134](https://github.com/zeta-chain/node/pull/3134) - integrate SPL tokens withdraw to Solana
* [3182](https://github.com/zeta-chain/node/pull/3182) - enable zetaclient pprof server on port 6061

### Tests

Expand Down
11 changes: 11 additions & 0 deletions cmd/zetaclientd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"encoding/json"
"fmt"
"io"
"net/http"
_ "net/http/pprof" // #nosec G108 -- pprof enablement is intentional
"os"
"os/signal"
"path/filepath"
Expand Down Expand Up @@ -256,6 +258,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
Expand Down

0 comments on commit f5e5adb

Please sign in to comment.