Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
17 changes: 10 additions & 7 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -59,6 +58,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
Expand All @@ -77,15 +84,11 @@ 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),
sequentialVerifyDecorator,
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
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
}
23 changes: 22 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -896,8 +904,21 @@ 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 {
// ctx = ctx.WithContext(context.WithValue(ctx.Context(), ante.ContextKeyTxIndexKey, i))
deliverTxResp := app.DeliverTx(ctx, abci.RequestDeliverTx{
Tx: tx,
})
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ 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.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.10
github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.1.13
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -1096,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.15 h1:xwGdXv/N3mRPXqRJfKdFAqd38SywepmQkPw5FDhyjbY=
github.com/sei-protocol/sei-cosmos v0.1.15/go.mod h1:Z6iuVdX6zbTJufXkMyXJh2MKJZmjsGE4M8zk01IewgU=
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.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=
Expand Down
2 changes: 1 addition & 1 deletion loadtest/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down