From 384a352599cb86eb4873267527a0a0374334d6c6 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Tue, 6 Sep 2022 12:56:38 -0700 Subject: [PATCH 1/7] Use SR25519 as signing algo --- go.mod | 2 +- go.sum | 5 ++--- loadtest/sign.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index b857e98d67..d011b5a59b 100644 --- a/go.mod +++ b/go.mod @@ -129,7 +129,7 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.15 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.16 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.10 diff --git a/go.sum b/go.sum index 9452bb2b7f..e69af20e4d 100644 --- a/go.sum +++ b/go.sum @@ -950,7 +950,6 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= @@ -1096,8 +1095,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sei-protocol/sei-cosmos v0.1.15 h1:xwGdXv/N3mRPXqRJfKdFAqd38SywepmQkPw5FDhyjbY= -github.com/sei-protocol/sei-cosmos v0.1.15/go.mod h1:Z6iuVdX6zbTJufXkMyXJh2MKJZmjsGE4M8zk01IewgU= +github.com/sei-protocol/sei-cosmos v0.1.16 h1:M6g3yGEMBPFFxnvqIinFG9csFCzuQlWWKAM7W8Xrmg8= +github.com/sei-protocol/sei-cosmos v0.1.16/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= github.com/sei-protocol/sei-tendermint v0.1.10 h1:htJPj7sP/o7o9pIVfv1JO3HB5DKj4HMHeIjQpg3G1rY= github.com/sei-protocol/sei-tendermint v0.1.10/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/loadtest/sign.go b/loadtest/sign.go index cd430b4e98..0ebaccd94e 100644 --- a/loadtest/sign.go +++ b/loadtest/sign.go @@ -44,7 +44,7 @@ func GetKey(accountIdx uint64) cryptotypes.PrivKey { } kr, _ := keyring.New(sdk.KeyringServiceName(), "test", filepath.Join(userHomeDir, ".sei"), os.Stdin) keyringAlgos, _ := kr.SupportedAlgorithms() - algoStr := string(hd.Secp256k1Type) + algoStr := string(hd.Sr25519Type) algo, _ := keyring.NewSigningAlgoFromString(algoStr, keyringAlgos) hdpath := hd.CreateHDPath(sdk.GetConfig().GetCoinType(), 0, 0).String() derivedPriv, _ := algo.Derive()(accountInfo.Mnemonic, "", hdpath) From 27ed0fb7e4b4eeb76f0d5e3749a132132bfd1f60 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Tue, 6 Sep 2022 19:06:18 -0700 Subject: [PATCH 2/7] batch verification --- app/ante.go | 10 +++++++++- app/app.go | 22 +++++++++++++++++++++- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/ante.go b/app/ante.go index bd181ab354..269f0b9414 100644 --- a/app/ante.go +++ b/app/ante.go @@ -59,6 +59,14 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } + var sigVerifyDecorator sdk.AnteDecorator + sequentialVerifyDecorator := ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) + if options.BatchVerifier == nil { + sigVerifyDecorator = sequentialVerifyDecorator + } else { + sigVerifyDecorator = ante.NewBatchSigVerificationDecorator(options.BatchVerifier, sequentialVerifyDecorator) + } + memPoolDecorator := ante.NewMempoolFeeDecorator() anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first @@ -77,7 +85,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSetPubKeyDecorator(options.AccountKeeper), ante.NewValidateSigCountDecorator(options.AccountKeeper), ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), - ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), + sigVerifyDecorator, ante.NewIncrementSequenceDecorator(options.AccountKeeper), ibcante.NewAnteDecorator(options.IBCKeeper), dex.NewTickSizeMultipleDecorator(*options.DexKeeper), diff --git a/app/app.go b/app/app.go index 74a0c59d99..19fcea3366 100644 --- a/app/app.go +++ b/app/app.go @@ -307,6 +307,9 @@ type App struct { configurator module.Configurator optimisticProcessingInfo *OptimisticProcessingInfo + + batchVerifier *ante.SR25519BatchVerifier + txDecoder sdk.TxDecoder } // New returns a reference to an initialized blockchain app @@ -365,6 +368,7 @@ func New( Tracer: &tr, TracerContext: context.Background(), }, + txDecoder: encodingConfig.TxConfig.TxDecoder(), } app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) @@ -694,14 +698,18 @@ func New( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) + signModeHandler := encodingConfig.TxConfig.SignModeHandler() + app.batchVerifier = ante.NewSR25519BatchVerifier(app.AccountKeeper, signModeHandler) + anteHandler, err := NewAnteHandler( HandlerOptions{ HandlerOptions: ante.HandlerOptions{ AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, FeegrantKeeper: app.FeeGrantKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SignModeHandler: signModeHandler, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + BatchVerifier: app.batchVerifier, }, IBCKeeper: app.IBCKeeper, TXCounterStoreKey: keys[wasm.StoreKey], @@ -896,6 +904,18 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ beginBlockResp := app.BeginBlock(ctx, beginBlockReq) events = append(events, beginBlockResp.Events...) + + typedTxs := []sdk.Tx{} + for _, tx := range req.GetTxs() { + typedTx, err := app.txDecoder(tx) + if err != nil { + typedTxs = append(typedTxs, nil) + } else { + typedTxs = append(typedTxs, typedTx) + } + } + app.batchVerifier.VerifyTxs(ctx, typedTxs) + txResults := []*abci.ExecTxResult{} for _, tx := range txs { deliverTxResp := app.DeliverTx(ctx, abci.RequestDeliverTx{ diff --git a/go.mod b/go.mod index d011b5a59b..de5df445a9 100644 --- a/go.mod +++ b/go.mod @@ -129,7 +129,7 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.16 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.17 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.10 diff --git a/go.sum b/go.sum index e69af20e4d..9786936e36 100644 --- a/go.sum +++ b/go.sum @@ -1095,8 +1095,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sei-protocol/sei-cosmos v0.1.16 h1:M6g3yGEMBPFFxnvqIinFG9csFCzuQlWWKAM7W8Xrmg8= -github.com/sei-protocol/sei-cosmos v0.1.16/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= +github.com/sei-protocol/sei-cosmos v0.1.17 h1:6n6XFLVXwRw8O4a/2rF/HVLdcOR+LTLoI7zKOGqQp0w= +github.com/sei-protocol/sei-cosmos v0.1.17/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= github.com/sei-protocol/sei-tendermint v0.1.10 h1:htJPj7sP/o7o9pIVfv1JO3HB5DKj4HMHeIjQpg3G1rY= github.com/sei-protocol/sei-tendermint v0.1.10/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From 136eb4fdaf1b3f128a53711528f20cbedb06aa80 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Tue, 6 Sep 2022 21:04:01 -0700 Subject: [PATCH 3/7] idx --- app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 19fcea3366..73c35f7938 100644 --- a/app/app.go +++ b/app/app.go @@ -917,7 +917,8 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ app.batchVerifier.VerifyTxs(ctx, typedTxs) txResults := []*abci.ExecTxResult{} - for _, tx := range txs { + for i, tx := range txs { + ctx = ctx.WithContext(context.WithValue(ctx.Context(), ante.ContextKeyTxIndexKey, i)) deliverTxResp := app.DeliverTx(ctx, abci.RequestDeliverTx{ Tx: tx, }) From ebe0c5401de7114fb63e5de9353b671296237ee9 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Tue, 6 Sep 2022 23:05:03 -0700 Subject: [PATCH 4/7] bump --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index de5df445a9..ad6f690b77 100644 --- a/go.mod +++ b/go.mod @@ -129,7 +129,7 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.17 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.18 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.10 diff --git a/go.sum b/go.sum index 9786936e36..94b738e222 100644 --- a/go.sum +++ b/go.sum @@ -1095,8 +1095,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sei-protocol/sei-cosmos v0.1.17 h1:6n6XFLVXwRw8O4a/2rF/HVLdcOR+LTLoI7zKOGqQp0w= -github.com/sei-protocol/sei-cosmos v0.1.17/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= +github.com/sei-protocol/sei-cosmos v0.1.18 h1:U3I/WLUU4j+3xhPd75kzR4JEuJoFQ+ocGUSObeNvT1E= +github.com/sei-protocol/sei-cosmos v0.1.18/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= github.com/sei-protocol/sei-tendermint v0.1.10 h1:htJPj7sP/o7o9pIVfv1JO3HB5DKj4HMHeIjQpg3G1rY= github.com/sei-protocol/sei-tendermint v0.1.10/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= From e07f80f3a1289370c13a2567ab8e59c0f678d0ae Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Thu, 8 Sep 2022 13:02:03 -0700 Subject: [PATCH 5/7] bump --- app/ante.go | 14 +++++++------- app/app.go | 34 +++++++++++++++++----------------- go.mod | 4 ++-- go.sum | 8 ++++---- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/ante.go b/app/ante.go index 269f0b9414..e7c76db090 100644 --- a/app/ante.go +++ b/app/ante.go @@ -59,13 +59,13 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } - var sigVerifyDecorator sdk.AnteDecorator + // var sigVerifyDecorator sdk.AnteDecorator sequentialVerifyDecorator := ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) - if options.BatchVerifier == nil { - sigVerifyDecorator = sequentialVerifyDecorator - } else { - sigVerifyDecorator = ante.NewBatchSigVerificationDecorator(options.BatchVerifier, sequentialVerifyDecorator) - } + // if options.BatchVerifier == nil { + // sigVerifyDecorator = sequentialVerifyDecorator + // } else { + // sigVerifyDecorator = ante.NewBatchSigVerificationDecorator(options.BatchVerifier, sequentialVerifyDecorator) + // } memPoolDecorator := ante.NewMempoolFeeDecorator() anteDecorators := []sdk.AnteDecorator{ @@ -85,7 +85,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSetPubKeyDecorator(options.AccountKeeper), ante.NewValidateSigCountDecorator(options.AccountKeeper), ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), - sigVerifyDecorator, + sequentialVerifyDecorator, ante.NewIncrementSequenceDecorator(options.AccountKeeper), ibcante.NewAnteDecorator(options.IBCKeeper), dex.NewTickSizeMultipleDecorator(*options.DexKeeper), diff --git a/app/app.go b/app/app.go index 73c35f7938..cf25735ecb 100644 --- a/app/app.go +++ b/app/app.go @@ -308,8 +308,8 @@ type App struct { optimisticProcessingInfo *OptimisticProcessingInfo - batchVerifier *ante.SR25519BatchVerifier - txDecoder sdk.TxDecoder + // batchVerifier *ante.SR25519BatchVerifier + // txDecoder sdk.TxDecoder } // New returns a reference to an initialized blockchain app @@ -368,7 +368,7 @@ func New( Tracer: &tr, TracerContext: context.Background(), }, - txDecoder: encodingConfig.TxConfig.TxDecoder(), + // txDecoder: encodingConfig.TxConfig.TxDecoder(), } app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) @@ -699,7 +699,7 @@ func New( app.SetBeginBlocker(app.BeginBlocker) signModeHandler := encodingConfig.TxConfig.SignModeHandler() - app.batchVerifier = ante.NewSR25519BatchVerifier(app.AccountKeeper, signModeHandler) + // app.batchVerifier = ante.NewSR25519BatchVerifier(app.AccountKeeper, signModeHandler) anteHandler, err := NewAnteHandler( HandlerOptions{ @@ -709,7 +709,7 @@ func New( FeegrantKeeper: app.FeeGrantKeeper, SignModeHandler: signModeHandler, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - BatchVerifier: app.batchVerifier, + // BatchVerifier: app.batchVerifier, }, IBCKeeper: app.IBCKeeper, TXCounterStoreKey: keys[wasm.StoreKey], @@ -905,20 +905,20 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ beginBlockResp := app.BeginBlock(ctx, beginBlockReq) events = append(events, beginBlockResp.Events...) - typedTxs := []sdk.Tx{} - for _, tx := range req.GetTxs() { - typedTx, err := app.txDecoder(tx) - if err != nil { - typedTxs = append(typedTxs, nil) - } else { - typedTxs = append(typedTxs, typedTx) - } - } - app.batchVerifier.VerifyTxs(ctx, typedTxs) + // typedTxs := []sdk.Tx{} + // for _, tx := range req.GetTxs() { + // typedTx, err := app.txDecoder(tx) + // if err != nil { + // typedTxs = append(typedTxs, nil) + // } else { + // typedTxs = append(typedTxs, typedTx) + // } + // } + // app.batchVerifier.VerifyTxs(ctx, typedTxs) txResults := []*abci.ExecTxResult{} - for i, tx := range txs { - ctx = ctx.WithContext(context.WithValue(ctx.Context(), ante.ContextKeyTxIndexKey, i)) + for _, tx := range txs { + // ctx = ctx.WithContext(context.WithValue(ctx.Context(), ante.ContextKeyTxIndexKey, i)) deliverTxResp := app.DeliverTx(ctx, abci.RequestDeliverTx{ Tx: tx, }) diff --git a/go.mod b/go.mod index ad6f690b77..bb89b02303 100644 --- a/go.mod +++ b/go.mod @@ -129,9 +129,9 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.18 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.19 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.10 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.12 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 94b738e222..87e9693ac1 100644 --- a/go.sum +++ b/go.sum @@ -1095,10 +1095,10 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sei-protocol/sei-cosmos v0.1.18 h1:U3I/WLUU4j+3xhPd75kzR4JEuJoFQ+ocGUSObeNvT1E= -github.com/sei-protocol/sei-cosmos v0.1.18/go.mod h1:7yYJh9sOFSsNwtAgP3z7T75eXRAXdDa9kSxujGMTtto= -github.com/sei-protocol/sei-tendermint v0.1.10 h1:htJPj7sP/o7o9pIVfv1JO3HB5DKj4HMHeIjQpg3G1rY= -github.com/sei-protocol/sei-tendermint v0.1.10/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= +github.com/sei-protocol/sei-cosmos v0.1.19 h1:hH1uFjTOVrk3E1k1JeLM8G4sQzYdD89j0QC8mFkf2qs= +github.com/sei-protocol/sei-cosmos v0.1.19/go.mod h1:cJvfshvpSyVwp+e+3dwT9uxdehqrtGksa6I3ykX1XIM= +github.com/sei-protocol/sei-tendermint v0.1.12 h1:t5XBO3B/eAVzpyqGEAmyoU3bPj/5KpTLWcQ19mjDsGA= +github.com/sei-protocol/sei-tendermint v0.1.12/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= From b54a42675ed0a73bd5c37e7fd1b28aa018020238 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Thu, 8 Sep 2022 15:03:45 -0700 Subject: [PATCH 6/7] bump --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index bb89b02303..157cbde10b 100644 --- a/go.mod +++ b/go.mod @@ -129,9 +129,9 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.19 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.1.20 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.12 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.13 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 87e9693ac1..0e4844c03b 100644 --- a/go.sum +++ b/go.sum @@ -1095,10 +1095,10 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sei-protocol/sei-cosmos v0.1.19 h1:hH1uFjTOVrk3E1k1JeLM8G4sQzYdD89j0QC8mFkf2qs= -github.com/sei-protocol/sei-cosmos v0.1.19/go.mod h1:cJvfshvpSyVwp+e+3dwT9uxdehqrtGksa6I3ykX1XIM= -github.com/sei-protocol/sei-tendermint v0.1.12 h1:t5XBO3B/eAVzpyqGEAmyoU3bPj/5KpTLWcQ19mjDsGA= -github.com/sei-protocol/sei-tendermint v0.1.12/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= +github.com/sei-protocol/sei-cosmos v0.1.20 h1:QqYntfddnFBRLGCOVdIlwDg5Xa3TlfmhSEcg9ehx1Ys= +github.com/sei-protocol/sei-cosmos v0.1.20/go.mod h1:9JV9q6Ds2FpU409zu8sw8feCaOiGZApUMjaHvXQOmc8= +github.com/sei-protocol/sei-tendermint v0.1.13 h1:uaMXhi+zpaqcUDlshxjqmPmUI/zSZla2a2ZmOtDK5RM= +github.com/sei-protocol/sei-tendermint v0.1.13/go.mod h1:Olwbjyagrpoxj5DAUhHxMTWDVEfQ3FYdpypaJ3+6Hs8= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= From ae843faaff1b3eb7680ab5c34d4593f4b1734554 Mon Sep 17 00:00:00 2001 From: Xiaoyu Chen Date: Thu, 8 Sep 2022 16:06:09 -0700 Subject: [PATCH 7/7] remove extra tracing --- app/abci.go | 10 +++++----- app/ante.go | 7 +------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/abci.go b/app/abci.go index 9c2dba8ddf..35b2a84ae5 100644 --- a/app/abci.go +++ b/app/abci.go @@ -31,11 +31,11 @@ func (app *App) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*abci.Re } func (app *App) DeliverTx(ctx sdk.Context, req abci.RequestDeliverTx) abci.ResponseDeliverTx { - tracectx, span := (*app.tracingInfo.Tracer).Start(app.tracingInfo.TracerContext, "DeliverTx") - oldCtx := app.tracingInfo.TracerContext - app.tracingInfo.TracerContext = tracectx - defer span.End() - defer func() { app.tracingInfo.TracerContext = oldCtx }() + // tracectx, span := (*app.tracingInfo.Tracer).Start(app.tracingInfo.TracerContext, "DeliverTx") + // oldCtx := app.tracingInfo.TracerContext + // app.tracingInfo.TracerContext = tracectx + // defer span.End() + // defer func() { app.tracingInfo.TracerContext = oldCtx }() return app.BaseApp.DeliverTx(ctx, req) } diff --git a/app/ante.go b/app/ante.go index e7c76db090..9e2edcc61f 100644 --- a/app/ante.go +++ b/app/ante.go @@ -9,7 +9,6 @@ import ( ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" "github.com/sei-protocol/sei-chain/app/antedecorators" - "github.com/sei-protocol/sei-chain/utils" "github.com/sei-protocol/sei-chain/utils/tracing" "github.com/sei-protocol/sei-chain/x/dex" dexkeeper "github.com/sei-protocol/sei-chain/x/dex/keeper" @@ -91,9 +90,5 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { dex.NewTickSizeMultipleDecorator(*options.DexKeeper), } - tracedDecorators := utils.Map(anteDecorators, func(d sdk.AnteDecorator) sdk.AnteDecorator { - return antedecorators.NewTracedAnteDecorator(d, options.TracingInfo) - }) - - return sdk.ChainAnteDecorators(tracedDecorators...), nil + return sdk.ChainAnteDecorators(anteDecorators...), nil }