From 23e2a5573cdbf91186ab439dc133091b1840de6b Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 30 May 2026 00:19:53 +0800 Subject: [PATCH] ethstats: ethstats pong reply mangles any ping substring in the nonce if a ping payload's nonce contain ping, the pong is malformed --- ethstats/ethstats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index c17e225165..4082e6b516 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -388,7 +388,7 @@ func (s *Service) readLoop(conn *connWrapper) { // If the network packet is a system ping, respond to it directly var ping string if err := json.Unmarshal(blob, &ping); err == nil && strings.HasPrefix(ping, "primus::ping::") { - if err := conn.WriteJSON(strings.ReplaceAll(ping, "ping", "pong")); err != nil { + if err := conn.WriteJSON(strings.Replace(ping, "primus::ping::", "primus::pong::", 1)); err != nil { log.Warn("Failed to respond to system ping message", "err", err) return }