diff --git a/go.mod b/go.mod index 7b3cf1b668..5e1ebd07cc 100644 --- a/go.mod +++ b/go.mod @@ -371,5 +371,5 @@ replace ( github.com/bnb-chain/tss-lib => github.com/zeta-chain/tss-lib v0.0.0-20240916163010-2e6b438bd901 github.com/ethereum/go-ethereum => github.com/zeta-chain/go-ethereum v1.13.16-0.20241022183758-422c6ef93ccc github.com/libp2p/go-libp2p => github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4 - gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20241115165301-8535262eb16f + gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20241211022951-f486d1f8425c ) diff --git a/go.sum b/go.sum index 6e3e894a3e..995f6c22e7 100644 --- a/go.sum +++ b/go.sum @@ -1526,8 +1526,8 @@ github.com/zeta-chain/go-ethereum v1.13.16-0.20241022183758-422c6ef93ccc h1:FVOt github.com/zeta-chain/go-ethereum v1.13.16-0.20241022183758-422c6ef93ccc/go.mod h1:MgO2/CmxFnj6W7v/5hrz3ypco3kHkb8856pRnFkY4xQ= github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4 h1:FmO3HfVdZ7LzxBUfg6sVzV7ilKElQU2DZm8PxJ7KcYI= github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4/go.mod h1:TBv5NY/CqWYIfUstXO1fDWrt4bDoqgCw79yihqBspg8= -github.com/zeta-chain/go-tss v0.0.0-20241115165301-8535262eb16f h1:zKBTanf2jf/oyr3f27GgvibSdVThmCdcV9sc5/6uOyQ= -github.com/zeta-chain/go-tss v0.0.0-20241115165301-8535262eb16f/go.mod h1:nqelgf4HKkqlXaVg8X38a61WfyYB+ivCt6nnjoTIgCc= +github.com/zeta-chain/go-tss v0.0.0-20241211022951-f486d1f8425c h1:Fb++MnF1ls/A0wjlh8cYRROvTHZ773BdhUzAHDN+Ja0= +github.com/zeta-chain/go-tss v0.0.0-20241211022951-f486d1f8425c/go.mod h1:nqelgf4HKkqlXaVg8X38a61WfyYB+ivCt6nnjoTIgCc= github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241021075719-d40d2e28467c h1:ZoFxMMZtivRLquXVq1sEVlT45UnTPMO1MSXtc88nDv4= github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20241021075719-d40d2e28467c/go.mod h1:SjT7QirtJE8stnAe1SlNOanxtfSfijJm3MGJ+Ax7w7w= github.com/zeta-chain/protocol-contracts-solana/go-idl v0.0.0-20241108171442-e48d82f94892 h1:oI5qCrw2SXDf2a2UYAn0tpaKHbKpJcR+XDtceyY00wE= diff --git a/zetaclient/metrics/telemetry.go b/zetaclient/metrics/telemetry.go index c78bcd565d..48c82338c1 100644 --- a/zetaclient/metrics/telemetry.go +++ b/zetaclient/metrics/telemetry.go @@ -31,7 +31,6 @@ type TelemetryServer struct { status types.Status ipAddress string HotKeyBurnRate *BurnRate - knownPeers []peer.AddrInfo connectedPeers []peer.AddrInfo rtt map[peer.ID]int64 } @@ -43,7 +42,6 @@ func NewTelemetryServer() *TelemetryServer { lastScannedBlockNumber: make(map[int64]uint64), lastStartTimestamp: time.Now(), HotKeyBurnRate: NewBurnRate(100), - knownPeers: make([]peer.AddrInfo, 0), connectedPeers: make([]peer.AddrInfo, 0), rtt: make(map[peer.ID]int64), } @@ -69,18 +67,6 @@ func (t *TelemetryServer) GetPingRTT() map[peer.ID]int64 { return t.rtt } -func (t *TelemetryServer) SetKnownPeers(peers []peer.AddrInfo) { - t.mu.Lock() - defer t.mu.Unlock() - t.knownPeers = peers -} - -func (t *TelemetryServer) GetKnownPeers() []peer.AddrInfo { - t.mu.Lock() - defer t.mu.Unlock() - return t.knownPeers -} - func (t *TelemetryServer) SetConnectedPeers(peers []peer.AddrInfo) { t.mu.Lock() defer t.mu.Unlock() @@ -189,7 +175,6 @@ func (t *TelemetryServer) Handlers() http.Handler { router.Handle("/ip", http.HandlerFunc(t.ipHandler)).Methods(http.MethodGet) router.Handle("/hotkeyburnrate", http.HandlerFunc(t.hotKeyFeeBurnRate)).Methods(http.MethodGet) router.Handle("/connectedpeers", http.HandlerFunc(t.connectedPeersHandler)).Methods(http.MethodGet) - router.Handle("/knownpeers", http.HandlerFunc(t.knownPeersHandler)).Methods(http.MethodGet) router.Handle("/pingrtt", http.HandlerFunc(t.pingRTTHandler)).Methods(http.MethodGet) router.Handle("/systemtime", http.HandlerFunc(systemTimeHandler)).Methods(http.MethodGet) router.Use(logMiddleware()) @@ -306,18 +291,6 @@ func (t *TelemetryServer) connectedPeersHandler(w http.ResponseWriter, _ *http.R fmt.Fprintf(w, "%s", string(data)) } -func (t *TelemetryServer) knownPeersHandler(w http.ResponseWriter, _ *http.Request) { - w.WriteHeader(http.StatusOK) - peers := t.GetKnownPeers() - data, err := json.Marshal(peers) - if err != nil { - t.logger.Error().Err(err).Msg("Failed to marshal known peers") - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - fmt.Fprintf(w, "%s", string(data)) -} - func (t *TelemetryServer) pingRTTHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) rtt := t.GetPingRTT() diff --git a/zetaclient/tss/healthcheck.go b/zetaclient/tss/healthcheck.go index 69f8c76b7c..384ae79490 100644 --- a/zetaclient/tss/healthcheck.go +++ b/zetaclient/tss/healthcheck.go @@ -92,12 +92,6 @@ func HealthcheckWorker(ctx context.Context, server *tss.TssServer, p Healthcheck return nil } - knownPeersCounter := func(_ context.Context, _ *ticker.Ticker) error { - peers := server.GetKnownPeers() - p.Telemetry.SetKnownPeers(peers) - return nil - } - connectedPeersCounter := func(_ context.Context, _ *ticker.Ticker) error { p2pHost := server.GetP2PHost() connectedPeers := lo.Map(p2pHost.Network().Conns(), func(conn libp2p_network.Conn, _ int) peer.AddrInfo { @@ -112,7 +106,6 @@ func HealthcheckWorker(ctx context.Context, server *tss.TssServer, p Healthcheck } runBackgroundTicker(ctx, pinger, p.Interval, "TSSHealthcheckPeersPing", logger) - runBackgroundTicker(ctx, knownPeersCounter, p.Interval, "TSSHealthcheckKnownPeersCounter", logger) runBackgroundTicker(ctx, connectedPeersCounter, p.Interval, "TSSHealthcheckConnectedPeersCounter", logger) return nil diff --git a/zetaclient/tss/service.go b/zetaclient/tss/service.go index ed8a034eee..7a8391ff89 100644 --- a/zetaclient/tss/service.go +++ b/zetaclient/tss/service.go @@ -48,7 +48,6 @@ type Zetacore interface { type Telemetry interface { SetP2PID(id string) SetConnectedPeers(peers []peer.AddrInfo) - SetKnownPeers(peers []peer.AddrInfo) SetPingRTT(peers map[peer.ID]int64) }