Skip to content

Commit

Permalink
wip: internal debug
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Oct 23, 2024
1 parent a621660 commit 50aa71d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/evmos/ethermint
go 1.21

require (
cosmossdk.io/core v0.12.0
cosmossdk.io/core v0.11.1
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.4.1
cosmossdk.io/math v1.3.0
Expand All @@ -25,7 +25,7 @@ require (
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/cosmos/rosetta v0.50.2
github.com/cosmos/rosetta v0.50.6
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/ethereum/go-ethereum v1.10.26
github.com/gogo/protobuf v1.3.2
Expand Down Expand Up @@ -68,6 +68,8 @@ require (
github.com/99designs/keyring v1.2.2 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/aws/aws-sdk-go v1.44.224 // indirect
Expand Down Expand Up @@ -136,6 +138,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.5 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/goware/urlx v0.3.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand Down Expand Up @@ -242,11 +245,13 @@ replace (
//cosmossdk.io/x/upgrade => cosmossdk.io/x/upgrade v0.1.4
// use cosmos keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
//github.com/cometbft/cometbft => github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9
github.com/cometbft/cometbft => github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9

//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.10-iavl-v1-kava.1
//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.50.10-test-patch 5f9239e3147358ef034bfc4d19aacb34e5ea2064
github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241007153930-5f9239e31473
//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241007153930-5f9239e31473
github.com/cosmos/cosmos-sdk => ../cosmos-sdk
// Use cosmos-sdk fork with staking transfer events, and custom tally handler support
//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.10-iavl-v1-kava.1
github.com/ethereum/go-ethereum => github.com/Kava-Labs/go-ethereum v1.10.27-0.20240308170502-da7973e5eee0
Expand Down
16 changes: 10 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkj
cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA=
cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0=
cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050=
cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8=
cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0=
Expand Down Expand Up @@ -238,6 +238,10 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
Expand Down Expand Up @@ -408,8 +412,8 @@ github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8=
github.com/cosmos/rosetta v0.50.2 h1:D2YazWBdv33GBS9nPWMi6umTDMGBu1iC+7j3EQz3EFU=
github.com/cosmos/rosetta v0.50.2/go.mod h1:L8OeVjrQ1kLRNv1BaXmU96fgdArUNWNvlEDez3iQbGs=
github.com/cosmos/rosetta v0.50.6 h1:+Hgog7CUHevZuPxZaoqR8klTs1G3ukAcoVTIMporBmw=
github.com/cosmos/rosetta v0.50.6/go.mod h1:KUnwp2i9W0766Dv78HYNV5YKym+imaKmDvXc2W0Y1wA=
github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM=
github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
Expand Down Expand Up @@ -692,6 +696,8 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo=
github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
Expand Down Expand Up @@ -806,8 +812,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9 h1:EdyFg0j6Q8oVy3EynAEQm/M2CyMhBZrTlFjcORLjw5g=
github.com/kava-labs/cometbft v0.0.0-20241007151334-8345af773eb9/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o=
github.com/kava-labs/cosmos-sdk v0.0.0-20241007153930-5f9239e31473 h1:0VoAKLYhjlLU3tLapBz/WZXaXrAlI4man+q08z4RWcA=
github.com/kava-labs/cosmos-sdk v0.0.0-20241007153930-5f9239e31473/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
17 changes: 10 additions & 7 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package server
import (
"context"
"fmt"
cmtconfig "github.com/cometbft/cometbft/config"
"io"
"net"
"net/http"
Expand Down Expand Up @@ -48,6 +49,7 @@ import (
"github.com/cosmos/cosmos-sdk/server/api"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servergrpc "github.com/cosmos/cosmos-sdk/server/grpc"
servercmtlog "github.com/cosmos/cosmos-sdk/server/log"
"github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/telemetry"
"github.com/cosmos/rosetta"
Expand Down Expand Up @@ -287,7 +289,7 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error {
return fmt.Errorf("error creating listener: %v", err)
}

svr.SetLogger(ctx.Logger.With("server", "abci"))
svr.SetLogger(servercmtlog.CometLoggerWrapper{Logger: ctx.Logger.With("server", "abci")})

err = svr.Start()
if err != nil {
Expand All @@ -306,8 +308,8 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error {

// DBProviderFromAppOpts returns a database using the DBBackend and DBDir specified in the ctx.Config.
// It uses opendb package which takes into account appOpts and provides configurability and observability.
func DBProviderFromAppOpts(appOpts types.AppOptions) node.DBProvider {
return func(ctx *node.DBContext) (dbm.DB, error) {
func DBProviderFromAppOpts(appOpts types.AppOptions) cmtconfig.DBProvider {
return func(ctx *cmtconfig.DBContext) (dbm.DB, error) {
dbType := dbm.BackendType(ctx.Config.DBBackend)

return opendb.OpenDB(appOpts, ctx.Config.DBDir(), ctx.ID, dbType)
Expand Down Expand Up @@ -406,7 +408,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt
genDocProvider,
DBProviderFromAppOpts(ctx.Viper),
node.DefaultMetricsProvider(cfg.Instrumentation),
ctx.Logger.With("server", "node"),
servercmtlog.CometLoggerWrapper{ctx.Logger.With("server", "node")},
)
if err != nil {
logger.Error("failed init node", "error", err.Error())
Expand Down Expand Up @@ -458,7 +460,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt
idxLogger := ctx.Logger.With("indexer", "evm")
idxer = indexer.NewKVIndexer(idxDB, idxLogger, clientCtx)
indexerService := NewEVMIndexerService(idxer, clientCtx.Client.(rpcclient.Client))
indexerService.SetLogger(idxLogger)
indexerService.SetLogger(servercmtlog.CometLoggerWrapper{Logger: idxLogger})

errCh := make(chan error)
go func() {
Expand Down Expand Up @@ -525,7 +527,8 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt

var apiSrv *api.Server
if config.API.Enable {
apiSrv = api.New(clientCtx, ctx.Logger.With("server", "api"))
//
apiSrv = api.New(clientCtx, servercmtlog.CometLoggerWrapper{Logger: ctx.Logger.With("server", "api")})
app.RegisterAPIRoutes(apiSrv, config.API)

if config.Telemetry.Enabled {
Expand All @@ -542,7 +545,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt
select {
case err := <-errCh:
return err
case <-time.After(types.ServerStartTime): // assume server started successfully
case <-time.After(ServerStartTime): // assume server started successfully
}

defer apiSrv.Close()
Expand Down

0 comments on commit 50aa71d

Please sign in to comment.