From e61cbcbce0d8bbb02c306ba1cf5f9a5cfe05ea39 Mon Sep 17 00:00:00 2001 From: jongwhan lee Date: Sat, 17 Jul 2021 16:37:08 +0900 Subject: [PATCH 1/6] Problem: verbose logs display with FATAL option (fix #320) add my script increase amount for metamask add run amount ok hide log show info my logger hook log revive eth log tidy up use suplog log replace ok removed suplog tidy up tidy up fix compile remove sh tidy up tidy up --- app/ante/ante.go | 9 +++++---- cmd/ethermintd/root.go | 1 + go.mod | 8 +------- go.sum | 22 ---------------------- log/log.go | 25 +++++++++++++++++++++++++ server/start.go | 14 ++++++++++++-- server/util.go | 13 +++++++------ x/evm/handler.go | 10 ++++++---- x/evm/types/utils.go | 5 ++--- 9 files changed, 59 insertions(+), 48 deletions(-) create mode 100644 log/log.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 45a6ed79c1..e12b64ed13 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -1,10 +1,10 @@ package ante import ( + "fmt" "runtime/debug" "github.com/palantir/stacktrace" - log "github.com/xlab/suplog" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -14,6 +14,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/tharsis/ethermint/crypto/ethsecp256k1" + mintlog "github.com/tharsis/ethermint/log" ) const ( @@ -120,10 +121,10 @@ func Recover(err *error) { *err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r) if e, ok := r.(error); ok { - log.WithError(e).Errorln("ante handler panicked with an error") - log.Debugln(string(debug.Stack())) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("ante handler panicked with an error %v", e)) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(string(debug.Stack())) } else { - log.Errorln(r) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("%v", r)) } } } diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index 9e07460958..7e70f9052f 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -178,6 +178,7 @@ type appCreator struct { // newApp is an appCreator func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + var cache sdk.MultiStorePersistentCache if cast.ToBool(appOpts.Get(sdkserver.FlagInterBlockCache)) { diff --git a/go.mod b/go.mod index e9d317e9f6..d02db61cc4 100644 --- a/go.mod +++ b/go.mod @@ -4,19 +4,14 @@ go 1.15 require ( github.com/armon/go-metrics v0.3.9 - github.com/aws/aws-sdk-go v1.38.21 // indirect - github.com/bitly/go-simplejson v0.5.0 // indirect github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce - github.com/bugsnag/bugsnag-go v2.1.0+incompatible // indirect - github.com/bugsnag/panicwrap v1.3.2 // indirect github.com/cespare/cp v1.1.1 // indirect github.com/cosmos/cosmos-sdk v0.43.0-rc1 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go v1.0.0-beta1 github.com/deckarep/golang-set v1.7.1 // indirect github.com/ethereum/go-ethereum v1.10.3 - github.com/gofrs/uuid v4.0.0+incompatible // indirect github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.2.0 // indirect @@ -25,7 +20,6 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-immutable-radix v1.3.0 // indirect github.com/improbable-eng/grpc-web v0.14.0 - github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.0.1 github.com/palantir/stacktrace v0.0.0-20161112013806-78658fd2d177 github.com/pkg/errors v0.9.1 @@ -34,6 +28,7 @@ require ( github.com/regen-network/cosmos-proto v0.3.1 github.com/rjeczalik/notify v0.9.2 // indirect github.com/rs/cors v1.7.0 + github.com/sirupsen/logrus v1.8.1 github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.8.1 @@ -43,7 +38,6 @@ require ( github.com/tendermint/tm-db v0.6.4 github.com/tyler-smith/go-bip39 v1.1.0 github.com/xlab/closer v0.0.0-20190328110542-03326addb7c2 - github.com/xlab/suplog v1.3.0 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect google.golang.org/genproto v0.0.0-20210712171009-5404628d0f46 google.golang.org/grpc v1.39.0 diff --git a/go.sum b/go.sum index 543e0eb049..44d3397b70 100644 --- a/go.sum +++ b/go.sum @@ -112,11 +112,8 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.25.16/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.38.21 h1:D08DXWI4QRaawLaW+OtsIEClOI90I6eheJs1GwXTQVI= -github.com/aws/aws-sdk-go v1.38.21/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -133,12 +130,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= @@ -162,9 +155,6 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bugsnag/bugsnag-go v1.5.3/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/bugsnag-go v2.1.0+incompatible h1:SuqsBHDutts2rZh4swHEWTexxi0F/JZ/6j1rR9BFe7I= -github.com/bugsnag/bugsnag-go v2.1.0+incompatible/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -357,8 +347,6 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -567,9 +555,7 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -595,8 +581,6 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kilic/bls12-381 v0.0.0-20201226121925-69dacb279461/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= @@ -715,7 +699,6 @@ github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -1005,15 +988,11 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/closer v0.0.0-20190328110542-03326addb7c2 h1:LPYwXwwHigHHFX3SFa9W9zBIa5reyaLJos2e95eHh68= github.com/xlab/closer v0.0.0-20190328110542-03326addb7c2/go.mod h1:Y8IYP9aVODN3Vnw1FCqygCG5IWyYBeBlZqQ5aX+fHFw= -github.com/xlab/suplog v1.3.0 h1:bbnKR8R8gSs2Q4Y25u2xH6shNNV/4r+bNspqViJQTLY= -github.com/xlab/suplog v1.3.0/go.mod h1:Fq+wOrO0v1DZhfHxgCFB/MlFMzost3Mf/xLuJlfyUA0= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yihuang/panicwrap v1.3.4-0.20210716032932-61c0a7c0cd05 h1:pAujDEt8f+lZIOOfVXpkoMemkOi0e6On1aaZWK4dxSM= -github.com/yihuang/panicwrap v1.3.4-0.20210716032932-61c0a7c0cd05/go.mod h1:AeUysGSIOPvhV1BZNplN56n5EEm3YfgYc/X3mhpjRiA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1166,7 +1145,6 @@ golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= diff --git a/log/log.go b/log/log.go new file mode 100644 index 0000000000..c68e8f026b --- /dev/null +++ b/log/log.go @@ -0,0 +1,25 @@ +package log + +import ( + tmlog "github.com/tendermint/tendermint/libs/log" + + "github.com/sirupsen/logrus" +) + +type EthermintLogger struct { + TendermintLogger *tmlog.Logger +} + +func (f EthermintLogger) Levels() []logrus.Level { + //return make([]logrus.Level, 0) + return []logrus.Level{logrus.DebugLevel, logrus.InfoLevel, logrus.TraceLevel, logrus.WarnLevel} +} + +func (f EthermintLogger) Fire(entry *logrus.Entry) error { + // a, _ := (*entry).String() + a := (*entry).Message + (*f.TendermintLogger).Info(a) + return nil +} + +var EthermintLoggerInstance EthermintLogger = EthermintLogger{nil} diff --git a/server/start.go b/server/start.go index 4c6c6afa35..1ca88e4c65 100644 --- a/server/start.go +++ b/server/start.go @@ -2,6 +2,7 @@ package server import ( "context" + "fmt" "io" "net" "net/http" @@ -15,6 +16,7 @@ import ( "github.com/rs/cors" "github.com/spf13/cobra" "github.com/xlab/closer" + "google.golang.org/grpc" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" @@ -35,12 +37,13 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - ethlog "github.com/ethereum/go-ethereum/log" ethrpc "github.com/ethereum/go-ethereum/rpc" + ethlog "github.com/ethereum/go-ethereum/log" "github.com/tharsis/ethermint/cmd/ethermintd/config" "github.com/tharsis/ethermint/ethereum/rpc" ethdebug "github.com/tharsis/ethermint/ethereum/rpc/namespaces/debug" + mintlog "github.com/tharsis/ethermint/log" ) // Tendermint full-node start flags @@ -170,6 +173,10 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty home := cfg.RootDir logger := ctx.Logger + mintlog.EthermintLoggerInstance.TendermintLogger = &logger + + (*mintlog.EthermintLoggerInstance.TendermintLogger).Info(fmt.Sprintf("startInProcess ~~~~~~~~ %s", ctx.Config.LogLevel)) + traceWriterFile := ctx.Viper.GetString(flagTraceStore) db, err := openDB(home) if err != nil { @@ -238,7 +245,10 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty var httpSrvDone = make(chan struct{}, 1) var wsSrv rpc.WebsocketsServer - ethlog.Root().SetHandler(ethlog.StdoutHandler) + if ctx.Config.LogLevel == "debug" { + ethlog.Root().SetHandler(ethlog.StdoutHandler) + } + if config.EVMRPC.Enable { tmEndpoint := "/websocket" tmRPCAddr := cfg.RPC.ListenAddress diff --git a/server/util.go b/server/util.go index 219b670353..ee110f4718 100644 --- a/server/util.go +++ b/server/util.go @@ -1,13 +1,14 @@ package server import ( + "fmt" "net/http" "time" "github.com/gorilla/mux" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/spf13/cobra" - log "github.com/xlab/suplog" + mintlog "github.com/tharsis/ethermint/log" sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" @@ -51,15 +52,14 @@ func ConnectTmWS(tmRPCAddr, tmEndpoint string) *rpcclient.WSClient { rpcclient.WriteWait(120*time.Second), rpcclient.PingPeriod(50*time.Second), rpcclient.OnReconnect(func() { - log.WithField("tendermint_rpc", tmRPCAddr+tmEndpoint). - Debugln("EVM RPC reconnects to Tendermint WS") + (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(fmt.Sprintf("EVM RPC reconnects to Tendermint WS %s", tmRPCAddr+tmEndpoint)) }), ) if err != nil { - log.WithError(err).Fatalln("Tendermint WS client could not be created for ", tmRPCAddr+tmEndpoint) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("Tendermint WS client could not be created for %s, Error %v", tmRPCAddr+tmEndpoint, err)) } else if err := tmWsClient.OnStart(); err != nil { - log.WithError(err).Fatalln("Tendermint WS client could not start for ", tmRPCAddr+tmEndpoint) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("Tendermint WS client could not start for %s, Error %v", tmRPCAddr+tmEndpoint, err)) } return tmWsClient @@ -71,7 +71,8 @@ func MountGRPCWebServices( grpcResources []string, ) { for _, res := range grpcResources { - log.Printf("[GRPC Web] HTTP POST mounted on %s", res) + + (*mintlog.EthermintLoggerInstance.TendermintLogger).Info(fmt.Sprintf("[GRPC Web] HTTP POST mounted on %s", res)) s := router.Methods("POST").Subrouter() s.HandleFunc(res, func(resp http.ResponseWriter, req *http.Request) { diff --git a/x/evm/handler.go b/x/evm/handler.go index 21ae7abc08..9e6f2ca51d 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -1,9 +1,10 @@ package evm import ( + "fmt" "runtime/debug" - log "github.com/xlab/suplog" + mintlog "github.com/tharsis/ethermint/log" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -36,10 +37,11 @@ func Recover(err *error) { *err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r) if e, ok := r.(error); ok { - log.WithError(e).Errorln("evm msg handler panicked with an error") - log.Debugln(string(debug.Stack())) + + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("evm msg handler panicked with an error %v", e)) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(string(debug.Stack())) } else { - log.Errorln(r) + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("%v", r)) } } } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index 5bfca98130..d277c0c138 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -3,14 +3,13 @@ package types import ( "fmt" - log "github.com/xlab/suplog" - "github.com/gogo/protobuf/proto" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/crypto" + mintlog "github.com/tharsis/ethermint/log" ) var EmptyCodeHash = crypto.Keccak256(nil) @@ -19,7 +18,7 @@ var EmptyCodeHash = crypto.Keccak256(nil) func DecodeTxResponse(in []byte) (*MsgEthereumTxResponse, error) { var txMsgData sdk.TxMsgData if err := proto.Unmarshal(in, &txMsgData); err != nil { - log.WithError(err).Errorln("failed to unmarshal TxMsgData") + (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("failed to unmarshal TxMsgData %v", err)) return nil, err } From 9aaa73bb470b69e84678df227a73082ca676f52d Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Fri, 23 Jul 2021 16:09:03 +0200 Subject: [PATCH 2/6] logger handler --- app/ante/ante.go | 19 ++++++---- go.mod | 2 +- go.sum | 2 -- init.sh | 4 +-- log/handler.go | 76 ++++++++++++++++++++++++++++++++++++++++ log/log.go | 25 ------------- server/start.go | 17 +++------ server/util.go | 22 ++++++++---- tests/solidity/README.md | 2 +- testutil/network/util.go | 4 +-- x/evm/handler.go | 19 ++++++---- x/evm/types/utils.go | 2 -- 12 files changed, 127 insertions(+), 67 deletions(-) create mode 100644 log/handler.go delete mode 100644 log/log.go diff --git a/app/ante/ante.go b/app/ante/ante.go index e12b64ed13..bb20ab6131 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -6,6 +6,8 @@ import ( "github.com/palantir/stacktrace" + tmlog "github.com/tendermint/tendermint/libs/log" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -14,7 +16,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/tharsis/ethermint/crypto/ethsecp256k1" - mintlog "github.com/tharsis/ethermint/log" ) const ( @@ -50,7 +51,7 @@ func NewAnteHandler( ) (newCtx sdk.Context, err error) { var anteHandler sdk.AnteHandler - defer Recover(&err) + defer Recover(ctx.Logger(), &err) txWithExtensions, ok := tx.(authante.HasExtensionOptionsTx) if ok { @@ -116,15 +117,21 @@ func NewAnteHandler( } } -func Recover(err *error) { +func Recover(logger tmlog.Logger, err *error) { if r := recover(); r != nil { *err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r) if e, ok := r.(error); ok { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("ante handler panicked with an error %v", e)) - (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(string(debug.Stack())) + logger.Error( + "ante handler panicked", + "error", e, + "stack trace", string(debug.Stack()), + ) } else { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("%v", r)) + logger.Error( + "ante handler panicked", + "recover", fmt.Sprintf("%v", r), + ) } } } diff --git a/go.mod b/go.mod index d02db61cc4..13ffacdc5b 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/regen-network/cosmos-proto v0.3.1 github.com/rjeczalik/notify v0.9.2 // indirect github.com/rs/cors v1.7.0 - github.com/sirupsen/logrus v1.8.1 + github.com/rs/zerolog v1.23.0 github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.8.1 diff --git a/go.sum b/go.sum index 44d3397b70..25990e08b8 100644 --- a/go.sum +++ b/go.sum @@ -864,8 +864,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= diff --git a/init.sh b/init.sh index 9af30facda..be64b4927a 100755 --- a/init.sh +++ b/init.sh @@ -6,8 +6,8 @@ KEYRING="test" KEYALGO="eth_secp256k1" LOGLEVEL="info" # to trace evm -#TRACE="--trace" -TRACE="" +TRACE="--trace" +# TRACE="" # remove existing daemon and client diff --git a/log/handler.go b/log/handler.go new file mode 100644 index 0000000000..900b099555 --- /dev/null +++ b/log/handler.go @@ -0,0 +1,76 @@ +package log + +import ( + "github.com/rs/zerolog" + + "github.com/cosmos/cosmos-sdk/server" + ethlog "github.com/ethereum/go-ethereum/log" + tmlog "github.com/tendermint/tendermint/libs/log" +) + +var _ ethlog.Handler = &Handler{} + +// Logger wraps the zero log Wrapper and extends it to support the ethereum logger interface. +type Handler struct { + *server.ZeroLogWrapper +} + +func NewHandler(logger tmlog.Logger) ethlog.Handler { + zerologger, ok := logger.(*server.ZeroLogWrapper) + if !ok { + // default to Stdout if not an SDK logger wrapper + return ethlog.StdoutHandler + } + + return &Handler{ + ZeroLogWrapper: zerologger, + } +} + +// Log implements the go-ethereum Logger Handler interface +func (h *Handler) Log(r *ethlog.Record) error { + lvl := EthLogLvlToZerolog(r.Lvl) + + h.ZeroLogWrapper. + WithLevel(lvl). + Fields(getLogFields(r.Ctx...)). + Time(r.KeyNames.Time, r.Time). + Msg(r.Msg) + return nil +} + +func EthLogLvlToZerolog(lvl ethlog.Lvl) zerolog.Level { + var level zerolog.Level + + switch lvl { + case ethlog.LvlCrit: + level = zerolog.FatalLevel + case ethlog.LvlDebug: + level = zerolog.DebugLevel + case ethlog.LvlError: + level = zerolog.ErrorLevel + case ethlog.LvlInfo: + level = zerolog.InfoLevel + case ethlog.LvlTrace: + level = zerolog.TraceLevel + case ethlog.LvlWarn: + level = zerolog.WarnLevel + default: + level = zerolog.NoLevel + } + + return level +} + +func getLogFields(keyVals ...interface{}) map[string]interface{} { + if len(keyVals)%2 != 0 { + return nil + } + + fields := make(map[string]interface{}) + for i := 0; i < len(keyVals); i += 2 { + fields[keyVals[i].(string)] = keyVals[i+1] + } + + return fields +} diff --git a/log/log.go b/log/log.go deleted file mode 100644 index c68e8f026b..0000000000 --- a/log/log.go +++ /dev/null @@ -1,25 +0,0 @@ -package log - -import ( - tmlog "github.com/tendermint/tendermint/libs/log" - - "github.com/sirupsen/logrus" -) - -type EthermintLogger struct { - TendermintLogger *tmlog.Logger -} - -func (f EthermintLogger) Levels() []logrus.Level { - //return make([]logrus.Level, 0) - return []logrus.Level{logrus.DebugLevel, logrus.InfoLevel, logrus.TraceLevel, logrus.WarnLevel} -} - -func (f EthermintLogger) Fire(entry *logrus.Entry) error { - // a, _ := (*entry).String() - a := (*entry).Message - (*f.TendermintLogger).Info(a) - return nil -} - -var EthermintLoggerInstance EthermintLogger = EthermintLogger{nil} diff --git a/server/start.go b/server/start.go index 1ca88e4c65..4e0ae39144 100644 --- a/server/start.go +++ b/server/start.go @@ -2,7 +2,6 @@ package server import ( "context" - "fmt" "io" "net" "net/http" @@ -43,7 +42,7 @@ import ( "github.com/tharsis/ethermint/cmd/ethermintd/config" "github.com/tharsis/ethermint/ethereum/rpc" ethdebug "github.com/tharsis/ethermint/ethereum/rpc/namespaces/debug" - mintlog "github.com/tharsis/ethermint/log" + "github.com/tharsis/ethermint/log" ) // Tendermint full-node start flags @@ -173,10 +172,6 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty home := cfg.RootDir logger := ctx.Logger - mintlog.EthermintLoggerInstance.TendermintLogger = &logger - - (*mintlog.EthermintLoggerInstance.TendermintLogger).Info(fmt.Sprintf("startInProcess ~~~~~~~~ %s", ctx.Config.LogLevel)) - traceWriterFile := ctx.Viper.GetString(flagTraceStore) db, err := openDB(home) if err != nil { @@ -245,15 +240,13 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty var httpSrvDone = make(chan struct{}, 1) var wsSrv rpc.WebsocketsServer - if ctx.Config.LogLevel == "debug" { - ethlog.Root().SetHandler(ethlog.StdoutHandler) - } + ethlog.Root().SetHandler(log.NewHandler(ctx.Logger)) if config.EVMRPC.Enable { tmEndpoint := "/websocket" tmRPCAddr := cfg.RPC.ListenAddress logger.Info("EVM RPC Connecting to Tendermint WebSocket at", "address", tmRPCAddr+tmEndpoint) - tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint) + tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) rpcServer := ethrpc.NewServer() apis := rpc.GetRPCAPIs(ctx, clientCtx, tmWsClient) @@ -273,7 +266,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty r.HandleFunc("/", rpcServer.ServeHTTP).Methods("POST") if grpcSrv != nil { grpcWeb := grpcweb.WrapServer(grpcSrv) - MountGRPCWebServices(r, grpcWeb, grpcweb.ListGRPCResources(grpcSrv)) + MountGRPCWebServices(r, grpcWeb, grpcweb.ListGRPCResources(grpcSrv), ctx.Logger) } handlerWithCors := cors.New(cors.Options{ @@ -321,7 +314,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty _, port, _ := net.SplitHostPort(config.EVMRPC.RPCAddress) // allocate separate WS connection to Tendermint - tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint) + tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) wsSrv = rpc.NewWebsocketsServer(logger, tmWsClient, "localhost:"+port, config.EVMRPC.WsAddress) go wsSrv.Start() } diff --git a/server/util.go b/server/util.go index ee110f4718..b45456c943 100644 --- a/server/util.go +++ b/server/util.go @@ -1,19 +1,18 @@ package server import ( - "fmt" "net/http" "time" "github.com/gorilla/mux" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/spf13/cobra" - mintlog "github.com/tharsis/ethermint/log" sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/version" + tmlog "github.com/tendermint/tendermint/libs/log" rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" "github.com/tharsis/ethermint/app" @@ -45,21 +44,29 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type ) } -func ConnectTmWS(tmRPCAddr, tmEndpoint string) *rpcclient.WSClient { +func ConnectTmWS(tmRPCAddr, tmEndpoint string, logger tmlog.Logger) *rpcclient.WSClient { tmWsClient, err := rpcclient.NewWS(tmRPCAddr, tmEndpoint, rpcclient.MaxReconnectAttempts(256), rpcclient.ReadWait(120*time.Second), rpcclient.WriteWait(120*time.Second), rpcclient.PingPeriod(50*time.Second), rpcclient.OnReconnect(func() { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(fmt.Sprintf("EVM RPC reconnects to Tendermint WS %s", tmRPCAddr+tmEndpoint)) + logger.Debug("EVM RPC reconnects to Tendermint WS", "address", tmRPCAddr+tmEndpoint) }), ) if err != nil { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("Tendermint WS client could not be created for %s, Error %v", tmRPCAddr+tmEndpoint, err)) + logger.Error( + "Tendermint WS client could not be created", + "address", tmRPCAddr+tmEndpoint, + "error", err, + ) } else if err := tmWsClient.OnStart(); err != nil { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("Tendermint WS client could not start for %s, Error %v", tmRPCAddr+tmEndpoint, err)) + logger.Error( + "Tendermint WS client could not start", + "address", tmRPCAddr+tmEndpoint, + "error", err, + ) } return tmWsClient @@ -69,10 +76,11 @@ func MountGRPCWebServices( router *mux.Router, grpcWeb *grpcweb.WrappedGrpcServer, grpcResources []string, + logger tmlog.Logger, ) { for _, res := range grpcResources { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Info(fmt.Sprintf("[GRPC Web] HTTP POST mounted on %s", res)) + logger.Info("[GRPC Web] HTTP POST mounted", "resource", res) s := router.Methods("POST").Subrouter() s.HandleFunc(res, func(resp http.ResponseWriter, req *http.Request) { diff --git a/tests/solidity/README.md b/tests/solidity/README.md index 7a0947f795..f16b6e8946 100644 --- a/tests/solidity/README.md +++ b/tests/solidity/README.md @@ -56,7 +56,7 @@ The [`init-test-node.sh`](./init-test-node.sh) script sets up ethermint with the Each with roughly 100 ETH available (1e18 photon). -Running `ethermintd list keys` should output: +Running `ethermintd keys list --keyring-backend=test` should output: ```json [ diff --git a/testutil/network/util.go b/testutil/network/util.go index b49e3671e7..4642b5b826 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -117,7 +117,7 @@ func startInProcess(cfg Config, val *Validator) error { if val.AppConfig.EVMRPC.Enable { tmEndpoint := "/websocket" tmRPCAddr := val.Ctx.Config.RPC.ListenAddress - tmWsClient := ethsrv.ConnectTmWS(tmRPCAddr, tmEndpoint) + tmWsClient := ethsrv.ConnectTmWS(tmRPCAddr, tmEndpoint, val.Ctx.Logger) val.jsonRPC = jsonrpc.NewServer() @@ -132,7 +132,7 @@ func startInProcess(cfg Config, val *Validator) error { r.HandleFunc("/", val.jsonRPC.ServeHTTP).Methods("POST") if val.grpc != nil { grpcWeb := grpcweb.WrapServer(val.grpc) - ethsrv.MountGRPCWebServices(r, grpcWeb, grpcweb.ListGRPCResources(val.grpc)) + ethsrv.MountGRPCWebServices(r, grpcWeb, grpcweb.ListGRPCResources(val.grpc), val.Ctx.Logger) } handlerWithCors := cors.New(cors.Options{ diff --git a/x/evm/handler.go b/x/evm/handler.go index 9e6f2ca51d..1b2fa03ddf 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -4,7 +4,7 @@ import ( "fmt" "runtime/debug" - mintlog "github.com/tharsis/ethermint/log" + tmlog "github.com/tendermint/tendermint/libs/log" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -15,7 +15,7 @@ import ( // NewHandler returns a handler for Ethermint type messages. func NewHandler(server types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (result *sdk.Result, err error) { - defer Recover(&err) + defer Recover(ctx.Logger(), &err) ctx = ctx.WithEventManager(sdk.NewEventManager()) @@ -32,16 +32,21 @@ func NewHandler(server types.MsgServer) sdk.Handler { } } -func Recover(err *error) { +func Recover(logger tmlog.Logger, err *error) { if r := recover(); r != nil { *err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r) if e, ok := r.(error); ok { - - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("evm msg handler panicked with an error %v", e)) - (*mintlog.EthermintLoggerInstance.TendermintLogger).Debug(string(debug.Stack())) + logger.Error( + "message handler panicked", + "error", e, + "stack trace", string(debug.Stack()), + ) } else { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("%v", r)) + logger.Error( + "message handler panicked", + "recover", fmt.Sprintf("%v", r), + ) } } } diff --git a/x/evm/types/utils.go b/x/evm/types/utils.go index d277c0c138..44ee600a7a 100644 --- a/x/evm/types/utils.go +++ b/x/evm/types/utils.go @@ -9,7 +9,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/crypto" - mintlog "github.com/tharsis/ethermint/log" ) var EmptyCodeHash = crypto.Keccak256(nil) @@ -18,7 +17,6 @@ var EmptyCodeHash = crypto.Keccak256(nil) func DecodeTxResponse(in []byte) (*MsgEthereumTxResponse, error) { var txMsgData sdk.TxMsgData if err := proto.Unmarshal(in, &txMsgData); err != nil { - (*mintlog.EthermintLoggerInstance.TendermintLogger).Error(fmt.Sprintf("failed to unmarshal TxMsgData %v", err)) return nil, err } From 8ae63548011b39a9f55694636446c0299d62812c Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Tue, 27 Jul 2021 11:50:15 +0200 Subject: [PATCH 3/6] fix --- server/evmrpc.go | 3 +- server/start.go | 72 +----------------------------------------------- 2 files changed, 2 insertions(+), 73 deletions(-) diff --git a/server/evmrpc.go b/server/evmrpc.go index 6c60e6606b..4fc3f6dd84 100644 --- a/server/evmrpc.go +++ b/server/evmrpc.go @@ -18,7 +18,7 @@ import ( // StartEVMRPC start evm rpc server func StartEVMRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr string, tmEndpoint string, config config.Config) (*http.Server, chan struct{}, error) { - tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint) + tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) rpcServer := ethrpc.NewServer() @@ -75,7 +75,6 @@ func StartEVMRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr string _, port, _ := net.SplitHostPort(config.EVMRPC.RPCAddress) // allocate separate WS connection to Tendermint - tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint) wsSrv := rpc.NewWebsocketsServer(ctx.Logger, tmWsClient, "localhost:"+port, config.EVMRPC.WsAddress) wsSrv.Start() return httpSrv, httpSrvDone, nil diff --git a/server/start.go b/server/start.go index 5584ad641e..5f98adfe3f 100644 --- a/server/start.go +++ b/server/start.go @@ -13,11 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/spf13/cobra" -<<<<<<< HEAD - "github.com/xlab/closer" -======= ->>>>>>> 0d055294613411af571742856d989ddbf287febe "google.golang.org/grpc" abciserver "github.com/tendermint/tendermint/abci/server" @@ -43,13 +39,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" -<<<<<<< HEAD - ethrpc "github.com/ethereum/go-ethereum/rpc" -======= ethlog "github.com/ethereum/go-ethereum/log" ->>>>>>> 0d055294613411af571742856d989ddbf287febe - ethlog "github.com/ethereum/go-ethereum/log" "github.com/tharsis/ethermint/cmd/ethermintd/config" ethdebug "github.com/tharsis/ethermint/ethereum/rpc/namespaces/debug" "github.com/tharsis/ethermint/log" @@ -335,60 +326,9 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty return err } -<<<<<<< HEAD - ethlog.Root().SetHandler(log.NewHandler(ctx.Logger)) - - if config.EVMRPC.Enable { - tmEndpoint := "/websocket" - tmRPCAddr := cfg.RPC.ListenAddress - logger.Info("EVM RPC Connecting to Tendermint WebSocket at", "address", tmRPCAddr+tmEndpoint) - tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) - - rpcServer := ethrpc.NewServer() - apis := rpc.GetRPCAPIs(ctx, clientCtx, tmWsClient) - - for _, api := range apis { - if err := rpcServer.RegisterName(api.Namespace, api.Service); err != nil { - logger.Error( - "failed to register service in EVM RPC namespace", - "namespace", api.Namespace, - "service", api.Service, - ) - return err - } - } - - r := mux.NewRouter() - r.HandleFunc("/", rpcServer.ServeHTTP).Methods("POST") - if grpcSrv != nil { - grpcWeb := grpcweb.WrapServer(grpcSrv) - MountGRPCWebServices(r, grpcWeb, grpcweb.ListGRPCResources(grpcSrv), ctx.Logger) - } - - handlerWithCors := cors.New(cors.Options{ - AllowedOrigins: []string{"*"}, - AllowedMethods: []string{ - http.MethodHead, - http.MethodGet, - http.MethodPost, - http.MethodPut, - http.MethodPatch, - http.MethodDelete, - }, - AllowedHeaders: []string{"*"}, - AllowCredentials: false, - OptionsPassthrough: false, - }) - - httpSrv = &http.Server{ - Addr: config.EVMRPC.RPCAddress, - Handler: handlerWithCors.Handler(r), - } -======= clientCtx := clientCtx. WithHomeDir(home). WithChainID(genDoc.ChainID) ->>>>>>> 0d055294613411af571742856d989ddbf287febe apiSrv = api.New(clientCtx, ctx.Logger.With("server", "api")) app.RegisterAPIRoutes(apiSrv, config.API) @@ -407,15 +347,6 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty } } -<<<<<<< HEAD - logger.Info("Starting EVM WebSocket server", "address", config.EVMRPC.WsAddress) - _, port, _ := net.SplitHostPort(config.EVMRPC.RPCAddress) - - // allocate separate WS connection to Tendermint - tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) - wsSrv = rpc.NewWebsocketsServer(logger, tmWsClient, "localhost:"+port, config.EVMRPC.WsAddress) - go wsSrv.Start() -======= var ( grpcSrv *grpc.Server grpcWebSrv *http.Server @@ -432,7 +363,6 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty return err } } ->>>>>>> 0d055294613411af571742856d989ddbf287febe } var rosettaSrv crgserver.Server @@ -471,7 +401,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty } } - ethlog.Root().SetHandler(ethlog.StdoutHandler) + ethlog.Root().SetHandler(log.NewHandler(logger)) var ( httpSrv *http.Server From c9fc183715a554259d842fce33e70eedeee8dbb5 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee <51560997+leejw51crypto@users.noreply.github.com> Date: Fri, 20 Aug 2021 00:29:00 +0900 Subject: [PATCH 4/6] fix eth log override (#371) remove redundant log tidy up --- log/handler.go | 70 +++++++++---------------------------------------- server/start.go | 1 - 2 files changed, 12 insertions(+), 59 deletions(-) diff --git a/log/handler.go b/log/handler.go index 900b099555..658170b026 100644 --- a/log/handler.go +++ b/log/handler.go @@ -1,76 +1,30 @@ package log import ( - "github.com/rs/zerolog" + "fmt" - "github.com/cosmos/cosmos-sdk/server" ethlog "github.com/ethereum/go-ethereum/log" tmlog "github.com/tendermint/tendermint/libs/log" ) -var _ ethlog.Handler = &Handler{} +var ethermintLogger *tmlog.Logger = nil -// Logger wraps the zero log Wrapper and extends it to support the ethereum logger interface. -type Handler struct { - *server.ZeroLogWrapper +func FuncHandler(fn func(r *ethlog.Record) error) ethlog.Handler { + return funcHandler(fn) } -func NewHandler(logger tmlog.Logger) ethlog.Handler { - zerologger, ok := logger.(*server.ZeroLogWrapper) - if !ok { - // default to Stdout if not an SDK logger wrapper - return ethlog.StdoutHandler - } +type funcHandler func(r *ethlog.Record) error - return &Handler{ - ZeroLogWrapper: zerologger, - } +func (h funcHandler) Log(r *ethlog.Record) error { + return h(r) } -// Log implements the go-ethereum Logger Handler interface -func (h *Handler) Log(r *ethlog.Record) error { - lvl := EthLogLvlToZerolog(r.Lvl) - - h.ZeroLogWrapper. - WithLevel(lvl). - Fields(getLogFields(r.Ctx...)). - Time(r.KeyNames.Time, r.Time). - Msg(r.Msg) - return nil -} - -func EthLogLvlToZerolog(lvl ethlog.Lvl) zerolog.Level { - var level zerolog.Level - - switch lvl { - case ethlog.LvlCrit: - level = zerolog.FatalLevel - case ethlog.LvlDebug: - level = zerolog.DebugLevel - case ethlog.LvlError: - level = zerolog.ErrorLevel - case ethlog.LvlInfo: - level = zerolog.InfoLevel - case ethlog.LvlTrace: - level = zerolog.TraceLevel - case ethlog.LvlWarn: - level = zerolog.WarnLevel - default: - level = zerolog.NoLevel - } +func NewHandler(logger tmlog.Logger) ethlog.Handler { - return level -} + ethermintLogger = &logger -func getLogFields(keyVals ...interface{}) map[string]interface{} { - if len(keyVals)%2 != 0 { + return FuncHandler(func(r *ethlog.Record) error { + (*ethermintLogger).Debug(fmt.Sprintf("[EVM] %v", r)) return nil - } - - fields := make(map[string]interface{}) - for i := 0; i < len(keyVals); i += 2 { - fields[keyVals[i].(string)] = keyVals[i+1] - } - - return fields + }) } diff --git a/server/start.go b/server/start.go index 8af760281c..cbda36547d 100644 --- a/server/start.go +++ b/server/start.go @@ -41,7 +41,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ethlog "github.com/ethereum/go-ethereum/log" - ethdebug "github.com/tharsis/ethermint/ethereum/rpc/namespaces/debug" "github.com/tharsis/ethermint/log" "github.com/tharsis/ethermint/server/config" From 817fe1f0e15e050e5f1e1ce9c9e9694dda8d7b57 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Thu, 19 Aug 2021 18:41:24 +0200 Subject: [PATCH 5/6] log test --- cmd/ethermintd/root.go | 11 +++--- ethereum/rpc/apis.go | 2 ++ log/handler.go | 82 +++++++++++++++++++++++++++++++++++------- log/handler_test.go | 62 ++++++++++++++++++++++++++++++++ server/json_rpc.go | 2 +- 5 files changed, 140 insertions(+), 19 deletions(-) create mode 100644 log/handler_test.go diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index 90c10f9d28..4d87e9de5e 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -6,14 +6,11 @@ import ( "os" "path/filepath" - "github.com/cosmos/cosmos-sdk/simapp/params" - "github.com/cosmos/cosmos-sdk/snapshots" - "github.com/spf13/cast" "github.com/spf13/cobra" tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" + tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/baseapp" @@ -24,6 +21,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/rpc" sdkserver "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/simapp/params" + "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" @@ -183,7 +182,7 @@ type appCreator struct { } // newApp is an appCreator -func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { +func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { var cache sdk.MultiStorePersistentCache @@ -236,7 +235,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a // appExport creates a new simapp (optionally at a given height) // and exports state. func (a appCreator) appExport( - logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, + logger tmlog.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, ) (servertypes.ExportedApp, error) { diff --git a/ethereum/rpc/apis.go b/ethereum/rpc/apis.go index d9c4fecf50..baea369dc7 100644 --- a/ethereum/rpc/apis.go +++ b/ethereum/rpc/apis.go @@ -5,7 +5,9 @@ package rpc import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" + "github.com/ethereum/go-ethereum/rpc" + "github.com/tharsis/ethermint/ethereum/rpc/backend" "github.com/tharsis/ethermint/ethereum/rpc/namespaces/debug" "github.com/tharsis/ethermint/ethereum/rpc/namespaces/eth" diff --git a/log/handler.go b/log/handler.go index 658170b026..5f10b47f70 100644 --- a/log/handler.go +++ b/log/handler.go @@ -1,30 +1,88 @@ package log import ( - "fmt" + "github.com/rs/zerolog" + + "github.com/cosmos/cosmos-sdk/server" ethlog "github.com/ethereum/go-ethereum/log" tmlog "github.com/tendermint/tendermint/libs/log" ) -var ethermintLogger *tmlog.Logger = nil +var _ ethlog.Handler = &Handler{} -func FuncHandler(fn func(r *ethlog.Record) error) ethlog.Handler { - return funcHandler(fn) +// Logger wraps the zero log Wrapper and extends it to support the ethereum logger interface. +type Handler struct { + *server.ZeroLogWrapper } -type funcHandler func(r *ethlog.Record) error +func NewHandler(logger tmlog.Logger) ethlog.Handler { + zerologger, ok := logger.(*server.ZeroLogWrapper) + if !ok { + // default to Stdout if not an SDK logger wrapper + return ethlog.StdoutHandler + } -func (h funcHandler) Log(r *ethlog.Record) error { - return h(r) + return &Handler{ + ZeroLogWrapper: zerologger, + } } -func NewHandler(logger tmlog.Logger) ethlog.Handler { +// Log implements the go-ethereum Logger Handler interface +func (h *Handler) Log(r *ethlog.Record) error { + lvl := EthLogLvlToZerolog(r.Lvl) + + h.WithLevel(lvl). + Fields(getLogFields(r.Ctx...)). + Time(r.KeyNames.Time, r.Time). + Msg(r.Msg) + return nil +} + +func EthLogLvlToZerolog(lvl ethlog.Lvl) zerolog.Level { + var level zerolog.Level + + switch lvl { + case ethlog.LvlCrit: + level = zerolog.FatalLevel + case ethlog.LvlDebug: + level = zerolog.DebugLevel + case ethlog.LvlError: + level = zerolog.ErrorLevel + case ethlog.LvlInfo: + level = zerolog.InfoLevel + case ethlog.LvlTrace: + level = zerolog.TraceLevel + case ethlog.LvlWarn: + level = zerolog.WarnLevel + default: + level = zerolog.NoLevel + } - ethermintLogger = &logger + return level +} - return FuncHandler(func(r *ethlog.Record) error { - (*ethermintLogger).Debug(fmt.Sprintf("[EVM] %v", r)) +func getLogFields(keyVals ...interface{}) map[string]interface{} { + if len(keyVals)%2 != 0 { return nil - }) + } + + fields := make(map[string]interface{}) + for i := 0; i < len(keyVals); i += 2 { + fields[keyVals[i].(string)] = keyVals[i+1] + } + + return fields } + +// var ethermintLogger *tmlog.Logger = nil + +// func NewHandler(logger tmlog.Logger) ethlog.Handler { + +// ethermintLogger = &logger + +// return ethlog.FuncHandler(func(r *ethlog.Record) error { +// (*ethermintLogger).Debug(fmt.Sprintf("[EVM] %v", r)) +// return nil +// }) +// } diff --git a/log/handler_test.go b/log/handler_test.go new file mode 100644 index 0000000000..d10c71910e --- /dev/null +++ b/log/handler_test.go @@ -0,0 +1,62 @@ +package log + +import ( + "bytes" + "testing" + + "github.com/rs/zerolog" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/types/time" + + "github.com/cosmos/cosmos-sdk/server" + + ethlog "github.com/ethereum/go-ethereum/log" +) + +const ( + timeKey = "t" + lvlKey = "lvl" + msgKey = "msg" + ctxKey = "ctx" +) + +func TestLog(t *testing.T) { + out := &bytes.Buffer{} + + logger := &server.ZeroLogWrapper{ + Logger: zerolog.New(out).Level(zerolog.DebugLevel).With().Timestamp().Logger(), + } + + h := NewHandler(logger) + + err := h.Log(ðlog.Record{ + Time: time.Now().UTC(), + Lvl: ethlog.LvlCrit, + Msg: "critical error", + KeyNames: ethlog.RecordKeyNames{ + Time: timeKey, + Msg: msgKey, + Lvl: lvlKey, + Ctx: ctxKey, + }, + }) + + require.NoError(t, err) + require.Contains(t, string(out.Bytes()), "\"message\":\"critical error\"") + require.Contains(t, string(out.Bytes()), "\"level\":\"fatal\"") +} + +func TestOverrideRootLogger(t *testing.T) { + out := &bytes.Buffer{} + + logger := &server.ZeroLogWrapper{ + Logger: zerolog.New(out).Level(zerolog.DebugLevel).With().Timestamp().Logger(), + } + + h := NewHandler(logger) + ethlog.Root().SetHandler(h) + + ethlog.Root().Info("some info") + require.Contains(t, string(out.Bytes()), "\"message\":\"some info\"") + require.Contains(t, string(out.Bytes()), "\"level\":\"info\"") +} diff --git a/server/json_rpc.go b/server/json_rpc.go index 0fc08708d5..23043fc014 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -76,7 +76,7 @@ func StartJSONRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr strin _, port, _ := net.SplitHostPort(config.JSONRPC.Address) // allocate separate WS connection to Tendermint - tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint) + tmWsClient = ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) wsSrv := rpc.NewWebsocketsServer(ctx.Logger, tmWsClient, "localhost:"+port, config.JSONRPC.WsAddress) wsSrv.Start() return httpSrv, httpSrvDone, nil From 43879ea5dcd46379ec4ff88b8ba52a459df626b7 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Thu, 19 Aug 2021 18:46:36 +0200 Subject: [PATCH 6/6] c++ --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63bb59d639..522d15cc3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ the Tracer type used to collect execution traces from the EVM transaction execut ### Improvements +* (server) [tharsis#343](https://github.com/tharsis/ethermint/pull/343) Define a wrap tendermint logger `Handler` go-ethereum's `root` logger. * (rpc) [tharsis#457](https://github.com/tharsis/ethermint/pull/457) Configure RPC gas cap through app config. * (evm) [tharsis#434](https://github.com/tharsis/ethermint/pull/434) Support different `Tracer` types for the EVM. * (deps) [tharsis#427](https://github.com/tharsis/ethermint/pull/427) Bump ibc-go to [`v1.0.0`](https://github.com/cosmos/ibc-go/releases/tag/v1.0.0)