Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-goats-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/proxyd': patch
---

proxyd: Reduced RPC request logging
14 changes: 7 additions & 7 deletions go/proxyd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
MaxBatchRPCCalls = 100
cacheStatusHdr = "X-Proxyd-Cache-Status"
defaultServerTimeout = time.Second * 10
maxLogLength = 1000
maxLogLength = 2000
)

type Server struct {
Expand Down Expand Up @@ -151,6 +151,12 @@ func (s *Server) HandleRPC(w http.ResponseWriter, r *http.Request) {
}
RecordRequestPayloadSize(ctx, len(body))

log.Info("Raw RPC request",
"body", truncate(string(body)),
"req_id", GetReqID(ctx),
"auth", GetAuthCtx(ctx),
)

if IsBatch(body) {
reqs, err := ParseBatchRPCReq(body)
if err != nil {
Expand Down Expand Up @@ -238,12 +244,6 @@ func (s *Server) handleSingleRPC(ctx context.Context, req *RPCReq) (*RPCRes, boo
return NewRPCErrorRes(req.ID, ErrMethodNotWhitelisted), false
}

log.Info("RPC request",
"method", req.Method,
"params", truncate(string(req.Params)),
"id", truncate(string(req.ID)),
)

var backendRes *RPCRes
backendRes, err := s.cache.GetRPC(ctx, req)
if err != nil {
Expand Down