From cc8c53e8ba2017d7a3188ecec9e633bdc89d2ec8 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 24 Jan 2023 15:02:50 -0300 Subject: [PATCH] logs: add warn log to detect calls to legacy RPC [testnetdeploy] Signed-off-by: Ignacio Hagopian --- internal/router/middlewares/ratelim.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/router/middlewares/ratelim.go b/internal/router/middlewares/ratelim.go index 9d03ae82..d8475c83 100644 --- a/internal/router/middlewares/ratelim.go +++ b/internal/router/middlewares/ratelim.go @@ -11,6 +11,7 @@ import ( "time" "github.com/gorilla/mux" + "github.com/rs/zerolog/log" "github.com/sethvargo/go-limiter/httplimit" "github.com/sethvargo/go-limiter/memorystore" "github.com/textileio/go-tableland/pkg/errors" @@ -86,6 +87,7 @@ func RateLimitController(cfg RateLimiterConfig) (mux.MiddlewareFunc, error) { _ = json.NewEncoder(w).Encode(errors.ServiceError{Message: "reading request body"}) return } + log.Warn().Str("body", string(fullBody)).Msg("call to legacy RPC") var rpcMethod struct { Method string `json:"method"` }