From aa54ff55a89b59c0ad425a9d293aa950c25355db Mon Sep 17 00:00:00 2001 From: Marcello Ardizzone Date: Fri, 16 Aug 2024 10:50:00 +0200 Subject: [PATCH] internal/debug: remove memsize to fix docker (#1308) * chg: remove memsize * chg: fix lint --- cmd/geth/main.go | 2 -- consensus/bor/heimdallgrpc/client.go | 2 +- go.mod | 1 - go.sum | 1 - internal/cli/command.go | 2 +- internal/debug/flags.go | 4 ---- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index dc9fe67742..41856804c0 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -379,8 +379,6 @@ func geth(ctx *cli.Context) error { // it unlocks any requested accounts, and starts the RPC/IPC interfaces and the // miner. func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isConsole bool) { - debug.Memsize.Add("node", stack) - // Start up the node itself utils.StartNode(ctx, stack, isConsole) diff --git a/consensus/bor/heimdallgrpc/client.go b/consensus/bor/heimdallgrpc/client.go index 7687b7f1c7..2f002b9b82 100644 --- a/consensus/bor/heimdallgrpc/client.go +++ b/consensus/bor/heimdallgrpc/client.go @@ -29,7 +29,7 @@ func NewHeimdallGRPCClient(address string) *HeimdallGRPCClient { grpc_retry.WithCodes(codes.Internal, codes.Unavailable, codes.Aborted, codes.NotFound), } - conn, err := grpc.Dial(address, + conn, err := grpc.NewClient(address, grpc.WithStreamInterceptor(grpc_retry.StreamClientInterceptor(opts...)), grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor(opts...)), grpc.WithTransportCredentials(insecure.NewCredentials()), diff --git a/go.mod b/go.mod index e627477b00..19db60724b 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,6 @@ require ( github.com/ethereum/c-kzg-4844 v0.4.3 github.com/fatih/color v1.17.0 github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e - github.com/fjl/memsize v0.0.2 github.com/fsnotify/fsnotify v1.7.0 github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 diff --git a/go.sum b/go.sum index 8bc6164fa1..dc37d6848e 100644 --- a/go.sum +++ b/go.sum @@ -1146,7 +1146,6 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= diff --git a/internal/cli/command.go b/internal/cli/command.go index 66ad650d9f..8c3bf02f0f 100644 --- a/internal/cli/command.go +++ b/internal/cli/command.go @@ -233,7 +233,7 @@ func (m *Meta2) NewFlagSet(n string) *flagset.Flagset { } func (m *Meta2) Conn() (*grpc.ClientConn, error) { - conn, err := grpc.Dial(m.addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(m.addr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, fmt.Errorf("failed to connect to server: %v", err) } diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 23e4745e8c..90801b444b 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -30,7 +30,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/exp" - "github.com/fjl/memsize/memsizeui" "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" "github.com/urfave/cli/v2" @@ -38,8 +37,6 @@ import ( "gopkg.in/natefinch/lumberjack.v2" ) -var Memsize memsizeui.Handler - var ( verbosityFlag = &cli.IntFlag{ Name: "verbosity", @@ -323,7 +320,6 @@ func StartPProf(address string, withMetrics bool) { if withMetrics { exp.Exp(metrics.DefaultRegistry) } - http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize)) log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address)) go func() { if err := http.ListenAndServe(address, nil); err != nil {