From d60fae5128014b2e44c196ff0c68c90549e5837d Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Thu, 12 Oct 2023 12:11:21 +0530 Subject: [PATCH] add more logs --- eth/protocols/eth/dispatcher.go | 12 ++++++++++++ eth/protocols/eth/handlers.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/eth/protocols/eth/dispatcher.go b/eth/protocols/eth/dispatcher.go index 95666b6f1c..685e3fff6f 100644 --- a/eth/protocols/eth/dispatcher.go +++ b/eth/protocols/eth/dispatcher.go @@ -19,6 +19,7 @@ package eth import ( "errors" "fmt" + "runtime" "time" "github.com/ethereum/go-ethereum/log" @@ -64,6 +65,17 @@ func (r *Request) Close() error { return nil } + // Get function caller details + pc, file, no, ok := runtime.Caller(1) + details := runtime.FuncForPC(pc) + if ok { + extra := "" + if details != nil { + extra = details.Name() + } + log.Info("***** request.Close() called from", "file", fmt.Sprintf("%s#%d", file, no), "name", extra) + } + cancelOp := &cancel{ id: r.id, fail: make(chan error), diff --git a/eth/protocols/eth/handlers.go b/eth/protocols/eth/handlers.go index d1cbead3df..17e6d40fb3 100644 --- a/eth/protocols/eth/handlers.go +++ b/eth/protocols/eth/handlers.go @@ -42,7 +42,7 @@ func handleGetBlockHeaders66(backend Backend, msg Decoder, peer *Peer) error { err := peer.ReplyBlockHeadersRLP(query.RequestId, response) - log.Info("***** Returning from handleGetBlockHeaders66", "response", response, "err", err) + log.Info("***** Returning from handleGetBlockHeaders66", "response.length", len(response), "err", err) return err }