From 313c1eec816faa8957cbf23cd6f5842049f0f3eb Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 20 Aug 2025 15:00:01 +0100 Subject: [PATCH 01/23] Implement standalone transaction prioritizer Extract the logic of transaction prioritisation from various Ante handlers for both EVM and cosmos transactions into a side effect free lightweight API exposed via ABCI interface. --- app/app.go | 4 ++ app/prioritizer.go | 155 +++++++++++++++++++++++++++++++++++++++++++++ go.mod | 8 ++- go.sum | 8 +-- 4 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 app/prioritizer.go diff --git a/app/app.go b/app/app.go index 2d036cbede..1c7005225b 100644 --- a/app/app.go +++ b/app/app.go @@ -386,6 +386,8 @@ type App struct { wsServerStartSignal chan struct{} httpServerStartSignalSent bool wsServerStartSignalSent bool + + txPrioritizer sdk.TxPrioritizer } type AppOption func(*App) @@ -977,6 +979,8 @@ func New( app.RegisterDeliverTxHook(app.AddCosmosEventsToEVMReceiptIfApplicable) + app.txPrioritizer = NewSeiTxPrioritizer(&app.EvmKeeper, &app.UpgradeKeeper, &app.ParamsKeeper).GetTxPriority + app.BaseApp.SetTxPrioritizer(app.txPrioritizer) return app } diff --git a/app/prioritizer.go b/app/prioritizer.go new file mode 100644 index 0000000000..d0c191edf4 --- /dev/null +++ b/app/prioritizer.go @@ -0,0 +1,155 @@ +package app + +import ( + "math/big" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + "github.com/ethereum/go-ethereum/consensus/misc/eip4844" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/sei-protocol/sei-chain/app/antedecorators" + "github.com/sei-protocol/sei-chain/utils" + "github.com/sei-protocol/sei-chain/x/evm/derived" + evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" + evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" + oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" +) + +var _ sdk.TxPrioritizer = (*SeiTxPrioritizer)(nil).GetTxPriority + +type SeiTxPrioritizer struct { + evmKeeper *evmkeeper.Keeper + upgradeKeeper *upgradekeeper.Keeper + paramsKeeper *paramskeeper.Keeper +} + +func NewSeiTxPrioritizer(ek *evmkeeper.Keeper, uk *upgradekeeper.Keeper, pk *paramskeeper.Keeper) *SeiTxPrioritizer { + return &SeiTxPrioritizer{ + evmKeeper: ek, + upgradeKeeper: uk, + paramsKeeper: pk, + } +} + +func (s *SeiTxPrioritizer) GetTxPriority(ctx sdk.Context, tx sdk.Tx) (int64, error) { + if ctx.HasPriority() { + // The context already has a priority set, return it. + return ctx.Priority(), nil + } + if evmTx := evmtypes.GetEVMTransactionMessage(tx); evmTx != nil { + return s.getEvmTxPriority(ctx, evmTx) + } + if feeTx, ok := tx.(sdk.FeeTx); ok { + return s.getCosmosTxPriority(ctx, feeTx) + } + return 0, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must either be EVM or Fee") +} + +func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.MsgEVMTransaction) (int64, error) { + + if s.isUnassociatedAssociate(ctx, evmTx) { + return antedecorators.EVMAssociatePriority, nil + } + + // Check txData for sanity. + txData, err := evmtypes.UnpackTxData(evmTx.Data) + if err != nil { + return 0, err + } + if txData.GetGasFeeCap().Cmp(s.getEvmBaseFee(ctx)) < 0 { + return 0, sdkerrors.ErrInsufficientFee + } + minimumFee := s.evmKeeper.GetMinimumFeePerGas(ctx).TruncateInt().BigInt() + if txData.GetGasFeeCap().Cmp(minimumFee) < 0 { + return 0, sdkerrors.ErrInsufficientFee + } + if txData.GetGasTipCap().Sign() < 0 { + return 0, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "gas fee cap cannot be negative") + } + // Check blob hashes for sanity. + // If EVM version is Cancun or later, and the transaction contains at least one blob, we need to + // make sure the transaction carries a non-zero blob fee cap. + if evmTx.Derived.Version >= derived.Cancun && len(txData.GetBlobHashes()) > 0 { + // For now we are simply assuming excessive blob gas is 0. In the future we might change it to be + // dynamic based on prior block usage. + chainConfig := evmtypes.DefaultChainConfig().EthereumConfig(s.evmKeeper.ChainID(ctx)) + if txData.GetBlobFeeCap().Cmp(eip4844.CalcBlobFee(chainConfig, ðtypes.Header{Time: uint64(ctx.BlockTime().Unix())})) < 0 { + return 0, sdkerrors.ErrInsufficientFee + } + } + + gp := txData.EffectiveGasPrice(utils.Big0) + priority := sdk.NewDecFromBigInt(gp).Quo(s.evmKeeper.GetPriorityNormalizer(ctx)).TruncateInt().BigInt() + if priority.Cmp(big.NewInt(antedecorators.MaxPriority)) > 0 { + priority = big.NewInt(antedecorators.MaxPriority) + } + return priority.Int64(), nil +} + +func (s *SeiTxPrioritizer) isUnassociatedAssociate(ctx sdk.Context, evmTx *evmtypes.MsgEVMTransaction) bool { + // TODO: when is derived populated? Check that it is reasonable to use it here. + if evmTx.Derived == nil { + return false + } + + // TODO: this potentially looks up entries from KVstore. Do we want to? + ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)) + _, isAssociated := s.evmKeeper.GetEVMAddress(ctx, evmTx.Derived.SenderSeiAddr) + return evmTx.Derived.IsAssociate && !isAssociated +} + +func (s *SeiTxPrioritizer) getEvmBaseFee(ctx sdk.Context) *big.Int { + const ( + pacific1 = "pacific-1" + historicalBlockHeight = 114945913 + doneHeightName = "6.2.0" + ) + if ctx.ChainID() == pacific1 { + height := ctx.BlockHeight() + if height < historicalBlockHeight { + return s.evmKeeper.GetBaseFeePerGas(ctx).TruncateInt().BigInt() + } + + doneHeight := s.upgradeKeeper.GetDoneHeight( + ctx.WithGasMeter(sdk.NewInfiniteGasMeter(1, 1)), doneHeightName) + if height < doneHeight { + return s.evmKeeper.GetCurrBaseFeePerGas(ctx).TruncateInt().BigInt() + } + } + return s.evmKeeper.GetNextBaseFeePerGas(ctx).TruncateInt().BigInt() +} + +func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) (int64, error) { + if isOracleTx(feeTx) { + return antedecorators.OraclePriority, nil + } + + feeCoins := feeTx.GetFee() + feeParams := s.paramsKeeper.GetFeesParams(ctx) + feeCoins = feeCoins.NonZeroAmountsOf(append([]string{sdk.DefaultBondDenom}, feeParams.GetAllowedFeeDenoms()...)) + gas := feeTx.GetGas() + // skip checking that fees meet a minimum threshold for the validator. + var priority int64 + if gas > 0 { + priority = ante.GetTxPriority(feeCoins, int64(gas)) + } + return min(antedecorators.MaxPriority, priority), nil +} + +func isOracleTx(tx sdk.FeeTx) bool { + if len(tx.GetMsgs()) == 0 { + return false + } + for _, msg := range tx.GetMsgs() { + switch msg.(type) { + case *oracletypes.MsgAggregateExchangeRateVote: + continue + default: + return false + } + } + return true +} diff --git a/go.mod b/go.mod index 764f5245d6..65a9b4b670 100644 --- a/go.mod +++ b/go.mod @@ -351,7 +351,9 @@ replace ( github.com/CosmWasm/wasmvm => github.com/sei-protocol/sei-wasmvm v1.5.4-sei.0.0.3 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.2 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.66 + // TODO: To be replaced with a concrete version number. See: + // - https://github.com/sei-protocol/sei-cosmos/pull/598 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 @@ -359,7 +361,9 @@ replace ( github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.51 // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.1 + // TODO: To be replaced with a concrete version number. See: + // - https://github.com/sei-protocol/sei-tendermint/pull/301 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index ceca065aa0..3025d0fe9b 100644 --- a/go.sum +++ b/go.sum @@ -1991,16 +1991,16 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.66 h1:DZL0OWpv+3/tleudTXUeMJtjb2C92O9PiNJBQoYDhBE= -github.com/sei-protocol/sei-cosmos v0.3.66/go.mod h1:xckXRG0A8Fxr69YNYTE8/aqSprVui3Byt5iJEiSrEQ4= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207 h1:zHE2iXpIRLN8ejE7Jc3MliVqTEdkwFzSeGqvYQfYA0k= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207/go.mod h1:FrZ7UI0wayVFR63Lf6IRD3c7r2VCsXgULO15EpmGRow= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.1 h1:iWBlSVZGuyrU7ahf7i/RMd/ZZ01hd4Yvc//R/04gGYo= -github.com/sei-protocol/sei-tendermint v0.6.1/go.mod h1:hLgRpS2d6VM8XzlhEtFeosCYkpuviU2ztqmOairIivc= +github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465 h1:KxFtE3Cw0wZYRxnOw3wYE6ywHNl0nnn3kiX0RdH+v4o= +github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465/go.mod h1:hLgRpS2d6VM8XzlhEtFeosCYkpuviU2ztqmOairIivc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 1686671fb8b7a6b1a7be2251ca31a45520ee67ff Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 21 Aug 2025 12:19:57 +0100 Subject: [PATCH 02/23] Add unit tests for prioritizer --- app/prioritizer.go | 25 +++--- app/prioritizer_test.go | 167 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 app/prioritizer_test.go diff --git a/app/prioritizer.go b/app/prioritizer.go index d0c191edf4..b322bde38a 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -59,11 +59,13 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg if err != nil { return 0, err } - if txData.GetGasFeeCap().Cmp(s.getEvmBaseFee(ctx)) < 0 { + feeCap := txData.GetGasFeeCap() + fee := s.getEvmBaseFee(ctx) + if feeCap.Cmp(fee) < 0 { return 0, sdkerrors.ErrInsufficientFee } minimumFee := s.evmKeeper.GetMinimumFeePerGas(ctx).TruncateInt().BigInt() - if txData.GetGasFeeCap().Cmp(minimumFee) < 0 { + if feeCap.Cmp(minimumFee) < 0 { return 0, sdkerrors.ErrInsufficientFee } if txData.GetGasTipCap().Sign() < 0 { @@ -72,7 +74,7 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg // Check blob hashes for sanity. // If EVM version is Cancun or later, and the transaction contains at least one blob, we need to // make sure the transaction carries a non-zero blob fee cap. - if evmTx.Derived.Version >= derived.Cancun && len(txData.GetBlobHashes()) > 0 { + if evmTx.Derived != nil && evmTx.Derived.Version >= derived.Cancun && len(txData.GetBlobHashes()) > 0 { // For now we are simply assuming excessive blob gas is 0. In the future we might change it to be // dynamic based on prior block usage. chainConfig := evmtypes.DefaultChainConfig().EthereumConfig(s.evmKeeper.ChainID(ctx)) @@ -127,15 +129,18 @@ func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) return antedecorators.OraclePriority, nil } - feeCoins := feeTx.GetFee() - feeParams := s.paramsKeeper.GetFeesParams(ctx) - feeCoins = feeCoins.NonZeroAmountsOf(append([]string{sdk.DefaultBondDenom}, feeParams.GetAllowedFeeDenoms()...)) gas := feeTx.GetGas() - // skip checking that fees meet a minimum threshold for the validator. - var priority int64 - if gas > 0 { - priority = ante.GetTxPriority(feeCoins, int64(gas)) + if gas <= 0 { + return 0, nil } + + feeParams := s.paramsKeeper.GetFeesParams(ctx) + allowedDenoms := feeParams.GetAllowedFeeDenoms() + demons := make([]string, 0, len(allowedDenoms)+1) + demons = append(demons, sdk.DefaultBondDenom) + demons = append(demons, allowedDenoms...) + feeCoins := feeTx.GetFee().NonZeroAmountsOf(demons) + priority := ante.GetTxPriority(feeCoins, int64(gas)) return min(antedecorators.MaxPriority, priority), nil } diff --git a/app/prioritizer_test.go b/app/prioritizer_test.go new file mode 100644 index 0000000000..1314294afa --- /dev/null +++ b/app/prioritizer_test.go @@ -0,0 +1,167 @@ +package app_test + +import ( + "math/big" + "testing" + + cosmostypes "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + xparamtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" + "github.com/sei-protocol/sei-chain/x/evm/types/ethtx" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/sei-protocol/sei-chain/app" + "github.com/sei-protocol/sei-chain/app/antedecorators" + "github.com/sei-protocol/sei-chain/app/apptesting" + oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" +) + +type PrioritizerTestSuite struct { + apptesting.KeeperTestHelper + prioritizer *app.SeiTxPrioritizer +} + +func TestPrioritizerTestSuite(t *testing.T) { + suite.Run(t, new(PrioritizerTestSuite)) +} + +func (s *PrioritizerTestSuite) SetupTest() { + s.KeeperTestHelper.Setup() + s.prioritizer = app.NewSeiTxPrioritizer(&s.App.EvmKeeper, &s.App.UpgradeKeeper, &s.App.ParamsKeeper) +} + +var ( + _ sdk.FeeTx = (*mockFeeTx)(nil) + _ sdk.Tx = (*mockTx)(nil) +) + +type mockFeeTx struct { + sdk.Tx + fees sdk.Coins + gas uint64 + msgs []sdk.Msg +} + +func (tx *mockFeeTx) FeePayer() sdk.AccAddress { return nil } +func (tx *mockFeeTx) FeeGranter() sdk.AccAddress { return nil } +func (tx *mockFeeTx) GetFee() sdk.Coins { return tx.fees } +func (tx *mockFeeTx) GetGas() uint64 { return tx.gas } +func (tx *mockFeeTx) GetMsgs() []sdk.Msg { return tx.msgs } + +type mockTx struct { + msgs []sdk.Msg + gasEstimate uint64 +} + +func (tx *mockTx) GetGasEstimate() uint64 { return tx.gasEstimate } +func (tx *mockTx) GetMsgs() []sdk.Msg { return tx.msgs } +func (*mockTx) ValidateBasic() error { return nil } +func (*mockTx) GetSigners() []sdk.AccAddress { return nil } + +func (s *PrioritizerTestSuite) TestGetTxPriority() { + var ( + zeroValueTx = func(*PrioritizerTestSuite) sdk.Tx { return &mockTx{} } + zeroValueFeeTx = func(*PrioritizerTestSuite) sdk.Tx { return &mockFeeTx{} } + zeroGasFeeTx = func(*PrioritizerTestSuite) sdk.Tx { + return &mockFeeTx{ + gas: 0, + } + } + oracleVoteTx = func(s *PrioritizerTestSuite) sdk.Tx { + return &mockFeeTx{ + msgs: []sdk.Msg{&oracletypes.MsgAggregateExchangeRateVote{}}, + } + } + evmTx = func(s *PrioritizerTestSuite) sdk.Tx { + fromTx, err := ethtx.NewTxDataFromTx(ethtypes.NewTx(ðtypes.LegacyTx{ + Nonce: 1, + GasPrice: big.NewInt(100 << 50), + Gas: 1000, + To: new(common.Address), + Value: big.NewInt(1000), + Data: []byte("abc"), + })) + require.NoError(s.T(), err) + evmMsg, err := evmtypes.NewMsgEVMTransaction(fromTx) + require.NoError(s.T(), err) + return &mockFeeTx{ + msgs: []sdk.Msg{evmMsg}, + } + } + ) + + for _, tc := range []struct { + name string + givenTx func(s *PrioritizerTestSuite) sdk.Tx + givenContext func(sdk.Context) sdk.Context + wantPriority int64 + wantErr string + expectedErrAs interface{} + }{ + { + name: "unexpected Tx type is error", + givenTx: zeroValueTx, + wantErr: "must either be EVM or Fee", + }, + { + name: "context with priority present is context priority", + givenTx: zeroValueFeeTx, + givenContext: func(ctx sdk.Context) sdk.Context { + return ctx.WithPriority(123) + }, + wantPriority: 123, + }, + { + name: "oracle Tx type is oracle priority", + givenTx: oracleVoteTx, + wantPriority: antedecorators.OraclePriority, + }, + { + name: "zero gas FeeTx is zero priority", + givenTx: zeroGasFeeTx, + wantPriority: 0, + }, + { + name: "cosmos tx with denominators is has priority of smallest demon multiplier", + givenTx: func(s *PrioritizerTestSuite) sdk.Tx { + s.App.ParamsKeeper.SetFeesParams(s.Ctx, xparamtypes.FeesParams{ + AllowedFeeDenoms: []string{"fish", "lobster"}, + }) + return &mockFeeTx{ + gas: 4_200, + fees: []sdk.Coin{ + {Denom: "fish", Amount: sdk.NewInt(230_000_000)}, + {Denom: "lobster", Amount: sdk.NewInt(290_000_000_000)}, + }, + } + }, + wantPriority: cosmostypes.NewInt(230_000_000).QuoRaw(4_200).Int64(), + }, + { + name: "evm", + givenTx: evmTx, + wantPriority: 112589990684262400, + }, + } { + s.T().Run(tc.name, func(t *testing.T) { + s.SetupTest() + tx := tc.givenTx(s) + ctx := s.Ctx + if tc.givenContext != nil { + ctx = tc.givenContext(ctx) + } + gotPriority, gotErr := s.prioritizer.GetTxPriority(ctx, tx) + if tc.wantErr != "" { + require.Error(t, gotErr) + require.ErrorContains(t, gotErr, tc.wantErr) + } else { + require.NoError(t, gotErr) + require.Equal(t, tc.wantPriority, gotPriority) + } + }) + } +} From 1c327c0b98b2a105821ec66f09a3a17e59e714a4 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 22 Aug 2025 11:06:50 +0100 Subject: [PATCH 03/23] Preprocess EVM transactions to populate Derived --- app/prioritizer.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/prioritizer.go b/app/prioritizer.go index b322bde38a..10a6773633 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -5,13 +5,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/ante" + cosmosante "github.com/cosmos/cosmos-sdk/x/auth/ante" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/sei-protocol/sei-chain/app/antedecorators" "github.com/sei-protocol/sei-chain/utils" + evmante "github.com/sei-protocol/sei-chain/x/evm/ante" "github.com/sei-protocol/sei-chain/x/evm/derived" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" @@ -71,9 +72,15 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg if txData.GetGasTipCap().Sign() < 0 { return 0, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "gas fee cap cannot be negative") } - // Check blob hashes for sanity. - // If EVM version is Cancun or later, and the transaction contains at least one blob, we need to - // make sure the transaction carries a non-zero blob fee cap. + // Check blob hashes for sanity. If EVM version is Cancun or later, and the + // transaction contains at least one blob, we need to make sure the transaction + // carries a non-zero blob fee cap. + // + // Note that evmante.Preprocess is a stateless function and would return fast if + // tx is already pre-processed. + if err := evmante.Preprocess(ctx, evmTx, s.evmKeeper.ChainID(ctx), s.evmKeeper.EthBlockTestConfig.Enabled); err != nil { + return 0, err + } if evmTx.Derived != nil && evmTx.Derived.Version >= derived.Cancun && len(txData.GetBlobHashes()) > 0 { // For now we are simply assuming excessive blob gas is 0. In the future we might change it to be // dynamic based on prior block usage. @@ -140,7 +147,7 @@ func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) demons = append(demons, sdk.DefaultBondDenom) demons = append(demons, allowedDenoms...) feeCoins := feeTx.GetFee().NonZeroAmountsOf(demons) - priority := ante.GetTxPriority(feeCoins, int64(gas)) + priority := cosmosante.GetTxPriority(feeCoins, int64(gas)) return min(antedecorators.MaxPriority, priority), nil } From 117d427439830f0d8bfdb03ddd7b1c322c33ac1c Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 22 Aug 2025 12:44:24 +0100 Subject: [PATCH 04/23] Fix associate tx prioritisation --- app/prioritizer.go | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/app/prioritizer.go b/app/prioritizer.go index 10a6773633..e1f6aa7006 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -50,9 +50,23 @@ func (s *SeiTxPrioritizer) GetTxPriority(ctx sdk.Context, tx sdk.Tx) (int64, err } func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.MsgEVMTransaction) (int64, error) { - - if s.isUnassociatedAssociate(ctx, evmTx) { - return antedecorators.EVMAssociatePriority, nil + if err := evmante.Preprocess(ctx, evmTx, s.evmKeeper.ChainID(ctx), s.evmKeeper.EthBlockTestConfig.Enabled); err != nil { + return 0, err + } + if evmTx.Derived.IsAssociate { + _, isAssociated := s.evmKeeper.GetEVMAddress( + ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)), + evmTx.Derived.SenderSeiAddr) + if !isAssociated { + // Unassociated associate transactions have the second-highest priority. + // This is to ensure that associate transactions are processed before + // regular transactions, but after oracle transactions. + // + // Note that we are not checking if sufficient funds are present here to keep the + // priority calculation fast. CheckTx should fully check the transaction. + return antedecorators.EVMAssociatePriority, nil + } + return 0, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "account already has association set") } // Check txData for sanity. @@ -75,12 +89,6 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg // Check blob hashes for sanity. If EVM version is Cancun or later, and the // transaction contains at least one blob, we need to make sure the transaction // carries a non-zero blob fee cap. - // - // Note that evmante.Preprocess is a stateless function and would return fast if - // tx is already pre-processed. - if err := evmante.Preprocess(ctx, evmTx, s.evmKeeper.ChainID(ctx), s.evmKeeper.EthBlockTestConfig.Enabled); err != nil { - return 0, err - } if evmTx.Derived != nil && evmTx.Derived.Version >= derived.Cancun && len(txData.GetBlobHashes()) > 0 { // For now we are simply assuming excessive blob gas is 0. In the future we might change it to be // dynamic based on prior block usage. @@ -98,18 +106,6 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg return priority.Int64(), nil } -func (s *SeiTxPrioritizer) isUnassociatedAssociate(ctx sdk.Context, evmTx *evmtypes.MsgEVMTransaction) bool { - // TODO: when is derived populated? Check that it is reasonable to use it here. - if evmTx.Derived == nil { - return false - } - - // TODO: this potentially looks up entries from KVstore. Do we want to? - ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)) - _, isAssociated := s.evmKeeper.GetEVMAddress(ctx, evmTx.Derived.SenderSeiAddr) - return evmTx.Derived.IsAssociate && !isAssociated -} - func (s *SeiTxPrioritizer) getEvmBaseFee(ctx sdk.Context) *big.Int { const ( pacific1 = "pacific-1" From 0f9282939ca91203304990e4d6867c4f9fe48542 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Mon, 25 Aug 2025 21:47:29 +0100 Subject: [PATCH 05/23] Update to latest and refactor to make hinting clear --- app/app.go | 2 +- app/prioritizer.go | 20 +++++++++++++++++--- app/prioritizer_test.go | 33 +++++---------------------------- go.mod | 4 ++-- go.sum | 8 ++++---- 5 files changed, 29 insertions(+), 38 deletions(-) diff --git a/app/app.go b/app/app.go index 1c7005225b..b0319bb5dc 100644 --- a/app/app.go +++ b/app/app.go @@ -979,7 +979,7 @@ func New( app.RegisterDeliverTxHook(app.AddCosmosEventsToEVMReceiptIfApplicable) - app.txPrioritizer = NewSeiTxPrioritizer(&app.EvmKeeper, &app.UpgradeKeeper, &app.ParamsKeeper).GetTxPriority + app.txPrioritizer = NewSeiTxPrioritizer(logger, &app.EvmKeeper, &app.UpgradeKeeper, &app.ParamsKeeper).GetTxPriorityHint app.BaseApp.SetTxPrioritizer(app.txPrioritizer) return app } diff --git a/app/prioritizer.go b/app/prioritizer.go index e1f6aa7006..887886f1f8 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -17,25 +17,39 @@ import ( evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" oracletypes "github.com/sei-protocol/sei-chain/x/oracle/types" + "github.com/tendermint/tendermint/libs/log" ) -var _ sdk.TxPrioritizer = (*SeiTxPrioritizer)(nil).GetTxPriority +var _ sdk.TxPrioritizer = (*SeiTxPrioritizer)(nil).GetTxPriorityHint type SeiTxPrioritizer struct { evmKeeper *evmkeeper.Keeper upgradeKeeper *upgradekeeper.Keeper paramsKeeper *paramskeeper.Keeper + logger log.Logger } -func NewSeiTxPrioritizer(ek *evmkeeper.Keeper, uk *upgradekeeper.Keeper, pk *paramskeeper.Keeper) *SeiTxPrioritizer { +func NewSeiTxPrioritizer(logger log.Logger, ek *evmkeeper.Keeper, uk *upgradekeeper.Keeper, pk *paramskeeper.Keeper) *SeiTxPrioritizer { return &SeiTxPrioritizer{ + logger: logger, evmKeeper: ek, upgradeKeeper: uk, paramsKeeper: pk, } } -func (s *SeiTxPrioritizer) GetTxPriority(ctx sdk.Context, tx sdk.Tx) (int64, error) { +func (s *SeiTxPrioritizer) GetTxPriorityHint(ctx sdk.Context, tx sdk.Tx) (_priorityHint int64, _err error) { + defer func() { + if r := recover(); r != nil { + // Fall back to no-op priority if we panic for any reason. This is to avoid DoS + // vectors where a malicious actor crafts a transaction that panics the + // prioritizer. Since the prioritizer is used as a hint only, it's safe to fall + // back to zero priority in this case and log the panic for monitoring purposes. + s.logger.Error("tx prioritizer panicked", "error", r) + _priorityHint = 0 + _err = nil + } + }() if ctx.HasPriority() { // The context already has a priority set, return it. return ctx.Priority(), nil diff --git a/app/prioritizer_test.go b/app/prioritizer_test.go index 1314294afa..0e9d86cee4 100644 --- a/app/prioritizer_test.go +++ b/app/prioritizer_test.go @@ -1,18 +1,14 @@ package app_test import ( - "math/big" "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" xparamtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" - "github.com/sei-protocol/sei-chain/x/evm/types/ethtx" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "github.com/tendermint/tendermint/libs/log" "github.com/sei-protocol/sei-chain/app" "github.com/sei-protocol/sei-chain/app/antedecorators" @@ -31,7 +27,9 @@ func TestPrioritizerTestSuite(t *testing.T) { func (s *PrioritizerTestSuite) SetupTest() { s.KeeperTestHelper.Setup() - s.prioritizer = app.NewSeiTxPrioritizer(&s.App.EvmKeeper, &s.App.UpgradeKeeper, &s.App.ParamsKeeper) + logger, err := log.NewDefaultLogger(log.LogFormatPlain, "info") + require.NoError(s.T(), err) + s.prioritizer = app.NewSeiTxPrioritizer(logger, &s.App.EvmKeeper, &s.App.UpgradeKeeper, &s.App.ParamsKeeper) } var ( @@ -76,22 +74,6 @@ func (s *PrioritizerTestSuite) TestGetTxPriority() { msgs: []sdk.Msg{&oracletypes.MsgAggregateExchangeRateVote{}}, } } - evmTx = func(s *PrioritizerTestSuite) sdk.Tx { - fromTx, err := ethtx.NewTxDataFromTx(ethtypes.NewTx(ðtypes.LegacyTx{ - Nonce: 1, - GasPrice: big.NewInt(100 << 50), - Gas: 1000, - To: new(common.Address), - Value: big.NewInt(1000), - Data: []byte("abc"), - })) - require.NoError(s.T(), err) - evmMsg, err := evmtypes.NewMsgEVMTransaction(fromTx) - require.NoError(s.T(), err) - return &mockFeeTx{ - msgs: []sdk.Msg{evmMsg}, - } - } ) for _, tc := range []struct { @@ -141,11 +123,6 @@ func (s *PrioritizerTestSuite) TestGetTxPriority() { }, wantPriority: cosmostypes.NewInt(230_000_000).QuoRaw(4_200).Int64(), }, - { - name: "evm", - givenTx: evmTx, - wantPriority: 112589990684262400, - }, } { s.T().Run(tc.name, func(t *testing.T) { s.SetupTest() @@ -154,7 +131,7 @@ func (s *PrioritizerTestSuite) TestGetTxPriority() { if tc.givenContext != nil { ctx = tc.givenContext(ctx) } - gotPriority, gotErr := s.prioritizer.GetTxPriority(ctx, tx) + gotPriority, gotErr := s.prioritizer.GetTxPriorityHint(ctx, tx) if tc.wantErr != "" { require.Error(t, gotErr) require.ErrorContains(t, gotErr, tc.wantErr) diff --git a/go.mod b/go.mod index 65a9b4b670..e7313a6f28 100644 --- a/go.mod +++ b/go.mod @@ -353,7 +353,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 @@ -363,7 +363,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 3025d0fe9b..964668fca8 100644 --- a/go.sum +++ b/go.sum @@ -1991,16 +1991,16 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207 h1:zHE2iXpIRLN8ejE7Jc3MliVqTEdkwFzSeGqvYQfYA0k= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250820133804-748608a73207/go.mod h1:FrZ7UI0wayVFR63Lf6IRD3c7r2VCsXgULO15EpmGRow= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113 h1:70bvNDXV9bo2+/4Q63bxMpzxX/hteg5mYAq5sl+ZwPU= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113/go.mod h1:AYY6KFGzwh2sq2YbLSGb/8OylqrmI+53FAnFnoFcLno= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465 h1:KxFtE3Cw0wZYRxnOw3wYE6ywHNl0nnn3kiX0RdH+v4o= -github.com/sei-protocol/sei-tendermint v0.6.2-0.20250819154648-ae86e6f22465/go.mod h1:hLgRpS2d6VM8XzlhEtFeosCYkpuviU2ztqmOairIivc= +github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa h1:wSaecmWODkvBBXQ2Y5e1vjQMbk/VjVD+BfFaCBToftY= +github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa/go.mod h1:yZ3o7N43xa1C49b4YRnuAnN4mOynsrEWvLD2h55IyJM= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From c2084f55620a5c3b01a0d370ad90421005d632ba Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Tue, 26 Aug 2025 09:08:43 +0100 Subject: [PATCH 06/23] Use the same logic as EVM router ante to detect message type Wile at it, fix minor typo and improve logging. --- app/prioritizer.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/prioritizer.go b/app/prioritizer.go index 887886f1f8..cff4131dbc 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -45,7 +45,7 @@ func (s *SeiTxPrioritizer) GetTxPriorityHint(ctx sdk.Context, tx sdk.Tx) (_prior // vectors where a malicious actor crafts a transaction that panics the // prioritizer. Since the prioritizer is used as a hint only, it's safe to fall // back to zero priority in this case and log the panic for monitoring purposes. - s.logger.Error("tx prioritizer panicked", "error", r) + s.logger.Error("tx prioritizer panicked. Falling back on no priority", "error", r) _priorityHint = 0 _err = nil } @@ -54,8 +54,17 @@ func (s *SeiTxPrioritizer) GetTxPriorityHint(ctx sdk.Context, tx sdk.Tx) (_prior // The context already has a priority set, return it. return ctx.Priority(), nil } - if evmTx := evmtypes.GetEVMTransactionMessage(tx); evmTx != nil { - return s.getEvmTxPriority(ctx, evmTx) + + if ok, err := evmante.IsEVMMessage(tx); err != nil { + return 0, err + } else if ok { + evmTx := evmtypes.GetEVMTransactionMessage(tx) + if evmTx != nil { + return s.getEvmTxPriority(ctx, evmTx) + } + // This should never happen since IsEVMMessage returned true. But we defensively + // return zero priority to be safe. + return 0, nil } if feeTx, ok := tx.(sdk.FeeTx); ok { return s.getCosmosTxPriority(ctx, feeTx) @@ -153,10 +162,10 @@ func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) feeParams := s.paramsKeeper.GetFeesParams(ctx) allowedDenoms := feeParams.GetAllowedFeeDenoms() - demons := make([]string, 0, len(allowedDenoms)+1) - demons = append(demons, sdk.DefaultBondDenom) - demons = append(demons, allowedDenoms...) - feeCoins := feeTx.GetFee().NonZeroAmountsOf(demons) + denoms := make([]string, 0, len(allowedDenoms)+1) + denoms = append(denoms, sdk.DefaultBondDenom) + denoms = append(denoms, allowedDenoms...) + feeCoins := feeTx.GetFee().NonZeroAmountsOf(denoms) priority := cosmosante.GetTxPriority(feeCoins, int64(gas)) return min(antedecorators.MaxPriority, priority), nil } From 58f057105a38cca4c0c0c11bdeb038bd04175e0d Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 27 Aug 2025 10:32:17 +0100 Subject: [PATCH 07/23] Reduce unpacking of EVM tx data in preporcessing Refactor the preprocessor to optionally accept an already unpacked tx data. --- app/prioritizer.go | 13 ++++++++----- x/evm/ante/preprocess.go | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/prioritizer.go b/app/prioritizer.go index cff4131dbc..e8e4c748e4 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -73,7 +73,14 @@ func (s *SeiTxPrioritizer) GetTxPriorityHint(ctx sdk.Context, tx sdk.Tx) (_prior } func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.MsgEVMTransaction) (int64, error) { - if err := evmante.Preprocess(ctx, evmTx, s.evmKeeper.ChainID(ctx), s.evmKeeper.EthBlockTestConfig.Enabled); err != nil { + + // Unpack the transaction data first to avoid double unpacking as part of preprocessing. + txData, err := evmtypes.UnpackTxData(evmTx.Data) + if err != nil { + return 0, err + } + + if err := evmante.PreprocessUnpacked(ctx, evmTx, s.evmKeeper.ChainID(ctx), s.evmKeeper.EthBlockTestConfig.Enabled, txData); err != nil { return 0, err } if evmTx.Derived.IsAssociate { @@ -93,10 +100,6 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg } // Check txData for sanity. - txData, err := evmtypes.UnpackTxData(evmTx.Data) - if err != nil { - return 0, err - } feeCap := txData.GetGasFeeCap() fee := s.getEvmBaseFee(ctx) if feeCap.Cmp(fee) < 0 { diff --git a/x/evm/ante/preprocess.go b/x/evm/ante/preprocess.go index ebf1a678cf..0a2d97e088 100644 --- a/x/evm/ante/preprocess.go +++ b/x/evm/ante/preprocess.go @@ -120,6 +120,12 @@ func (p *EVMPreprocessDecorator) IsAccountBalancePositive(ctx sdk.Context, seiAd // stateless func Preprocess(ctx sdk.Context, msgEVMTransaction *evmtypes.MsgEVMTransaction, chainID *big.Int, isBlockTest bool) error { + return PreprocessUnpacked(ctx, msgEVMTransaction, chainID, isBlockTest, nil) +} + +// PreprocessUnpacked does the same thing as Preprocess but accepts already unpacked txData to save computation +// if txData is nil, it will unpack from msgEVMTransaction.Data. +func PreprocessUnpacked(ctx sdk.Context, msgEVMTransaction *evmtypes.MsgEVMTransaction, chainID *big.Int, isBlockTest bool, txData ethtx.TxData) error { if msgEVMTransaction.Derived != nil { if msgEVMTransaction.Derived.PubKey == nil { // this means the message has `Derived` set from the outside, in which case we should reject @@ -128,9 +134,14 @@ func Preprocess(ctx sdk.Context, msgEVMTransaction *evmtypes.MsgEVMTransaction, // already preprocessed return nil } - txData, err := evmtypes.UnpackTxData(msgEVMTransaction.Data) - if err != nil { - return err + + if txData == nil { + // TxData not passed in, unpack it. + var err error + txData, err = evmtypes.UnpackTxData(msgEVMTransaction.Data) + if err != nil { + return err + } } if atx, ok := txData.(*ethtx.AssociateTx); ok { From 67431efa9263a7de74a068098b91dd725484a3a5 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 3 Sep 2025 11:21:16 +0100 Subject: [PATCH 08/23] Upgrade to the latest sei tendermint and cosmos --- go.mod | 5 +++-- go.sum | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index e7313a6f28..6de48ad48c 100644 --- a/go.mod +++ b/go.mod @@ -234,6 +234,7 @@ require ( github.com/nishanths/predeclared v0.2.2 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect @@ -353,7 +354,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 @@ -363,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 964668fca8..3d2fc91bb0 100644 --- a/go.sum +++ b/go.sum @@ -1808,6 +1808,8 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -1991,16 +1993,16 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113 h1:70bvNDXV9bo2+/4Q63bxMpzxX/hteg5mYAq5sl+ZwPU= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250825203812-d33e84738113/go.mod h1:AYY6KFGzwh2sq2YbLSGb/8OylqrmI+53FAnFnoFcLno= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097 h1:GYCWnsyRq8bJR7Kd8uNzv6qXGvkJtf00oW6LBo48W6A= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097/go.mod h1:J6C4LZquSrQoYM4TKv7NfBAsVBrumdOt22qAWFcBKiU= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa h1:wSaecmWODkvBBXQ2Y5e1vjQMbk/VjVD+BfFaCBToftY= -github.com/sei-protocol/sei-tendermint v0.6.2-0.20250825202636-492b079861fa/go.mod h1:yZ3o7N43xa1C49b4YRnuAnN4mOynsrEWvLD2h55IyJM= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb h1:EOB8nc3Yod7+u6WFo2WFN1Q9k2Cfey98ZgI2DRQIGRs= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 942cb657d9e1105e72eb67d32b3cad41660e3251 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 4 Sep 2025 11:51:16 +0100 Subject: [PATCH 09/23] Upgrade to latest tendermint with additional metrics --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6de48ad48c..7fcb9c15c5 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 3d2fc91bb0..c0589cef25 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb h1:EOB8nc3Yod7+u6WFo2WFN1Q9k2Cfey98ZgI2DRQIGRs= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250903093204-d7c4560885bb/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114 h1:IzA1/Gvq36oz9+WJ/h+geVc40ojezsqL8UuhjjvFpW8= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 5e9aa33bd3a308cd3cc6c31a7955fd482722b438 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 4 Sep 2025 12:54:36 +0100 Subject: [PATCH 10/23] Bubble up fix to tendermint metrics tag --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7fcb9c15c5..aed8d782a2 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index c0589cef25..fbc3d4f065 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114 h1:IzA1/Gvq36oz9+WJ/h+geVc40ojezsqL8UuhjjvFpW8= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904092851-dd5eb68f2114/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe h1:CsyEzcwuz6EuE9EiOoZJeGCTJyxqIbLcv78AuEqy1Pc= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From a1c82ac847aa628c80a59cf22aeddcb75230087d Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 4 Sep 2025 20:24:28 +0100 Subject: [PATCH 11/23] Upgrade to latest tendermint with fix to tagging --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aed8d782a2..d20731d8a9 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index fbc3d4f065..ff812acd53 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe h1:CsyEzcwuz6EuE9EiOoZJeGCTJyxqIbLcv78AuEqy1Pc= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904114950-f04bd1612abe/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e h1:RfaBUes20yPRGrW30yDsAlXpCRwPXPLiqz3JQeJlKT4= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 741913021f846a79871ef87c9f902c418fc12e60 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Thu, 4 Sep 2025 20:41:02 +0100 Subject: [PATCH 12/23] Bubble up fix to metrics --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d20731d8a9..63e8c58744 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index ff812acd53..396387838e 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e h1:RfaBUes20yPRGrW30yDsAlXpCRwPXPLiqz3JQeJlKT4= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904192118-1e50d023118e/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1 h1:a4jv56aF0+H6AClS19/hwtd6rplDfmB0y5U4DYJwo44= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 589b9fabe7d369ac7d796306726ea1334a0d11e5 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 5 Sep 2025 10:59:12 +0100 Subject: [PATCH 13/23] Bubble up tendermint to update the default config template --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 63e8c58744..fbde65b3ce 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 396387838e..af698c222c 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1 h1:a4jv56aF0+H6AClS19/hwtd6rplDfmB0y5U4DYJwo44= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250904193719-be4a7ed8e0e1/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3 h1:TdpfcDwj++sHpYtDkM7YdonSNHBOuCM7lwg2hk1oBWI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 94b301d3960c9452f6446381183509545d751c7d Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 5 Sep 2025 15:25:55 +0100 Subject: [PATCH 14/23] Bubble up tender mint for additional logging --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fbde65b3ce..89df7057e7 100644 --- a/go.mod +++ b/go.mod @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index af698c222c..312eed6508 100644 --- a/go.sum +++ b/go.sum @@ -2001,8 +2001,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3 h1:TdpfcDwj++sHpYtDkM7YdonSNHBOuCM7lwg2hk1oBWI= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905095643-567b18808ce3/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6 h1:2JL/RW3ZsKNy7vNGp8IpkwHMRG0alE01rA4iDdfGNcY= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From 2a16f3c554acff6fdcded41df2b8baad12e4a475 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 5 Sep 2025 18:47:26 +0100 Subject: [PATCH 15/23] Bubble up cosmos --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 89df7057e7..ee9c8d4866 100644 --- a/go.mod +++ b/go.mod @@ -354,7 +354,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097 + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 diff --git a/go.sum b/go.sum index 312eed6508..66b63c872a 100644 --- a/go.sum +++ b/go.sum @@ -1993,8 +1993,8 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097 h1:GYCWnsyRq8bJR7Kd8uNzv6qXGvkJtf00oW6LBo48W6A= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250903101759-a6c998ee2097/go.mod h1:J6C4LZquSrQoYM4TKv7NfBAsVBrumdOt22qAWFcBKiU= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db h1:bZdfZ2K/sOXv64YYWnQ3OJ6F8km+2ps7U0kT4gTaqR0= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db/go.mod h1:J6C4LZquSrQoYM4TKv7NfBAsVBrumdOt22qAWFcBKiU= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= From 2dad46519e4f37f854de1b979e3357507e985530 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 5 Sep 2025 21:39:58 +0100 Subject: [PATCH 16/23] Bubble up latest changes --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ee9c8d4866..a02600f3cc 100644 --- a/go.mod +++ b/go.mod @@ -354,7 +354,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 @@ -364,7 +364,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905203244-31c1f39f5fce github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 66b63c872a..3538ffcea9 100644 --- a/go.sum +++ b/go.sum @@ -1993,16 +1993,16 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db h1:bZdfZ2K/sOXv64YYWnQ3OJ6F8km+2ps7U0kT4gTaqR0= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905171107-18673621d1db/go.mod h1:J6C4LZquSrQoYM4TKv7NfBAsVBrumdOt22qAWFcBKiU= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 h1:yqccLfr6bgcdSq9XKpLShu3DpOdl8YS2dQ4px/hWMbc= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30/go.mod h1:7mlEsGl1ASLn97VeRZg0L6V8IJc7uV5nf8za3JMAWBM= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6 h1:2JL/RW3ZsKNy7vNGp8IpkwHMRG0alE01rA4iDdfGNcY= -github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905142008-70f0196b0ff6/go.mod h1:8B6Wt+m8SKMeZBzTSoRNRFpcwyyrGpYX+7ZQlytR1qI= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905203244-31c1f39f5fce h1:sxqrZQgEzjs/8MofaB5g/IfpffK42xk2BymJq/irh50= +github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905203244-31c1f39f5fce/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/sei-wasmd v0.3.9 h1:gHbJcczxZYon4cYfdQz04sKmPdfDUtqA5mDDKW4dp2E= From e1b7c3d02d3e939813599475a0f3eb61a3f54c86 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 5 Sep 2025 21:56:27 +0100 Subject: [PATCH 17/23] Fix lint issues --- app/app.go | 2 +- app/prioritizer.go | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index b0319bb5dc..f7523c0ee0 100644 --- a/app/app.go +++ b/app/app.go @@ -980,7 +980,7 @@ func New( app.RegisterDeliverTxHook(app.AddCosmosEventsToEVMReceiptIfApplicable) app.txPrioritizer = NewSeiTxPrioritizer(logger, &app.EvmKeeper, &app.UpgradeKeeper, &app.ParamsKeeper).GetTxPriorityHint - app.BaseApp.SetTxPrioritizer(app.txPrioritizer) + app.SetTxPrioritizer(app.txPrioritizer) return app } diff --git a/app/prioritizer.go b/app/prioritizer.go index e8e4c748e4..72e2388f58 100644 --- a/app/prioritizer.go +++ b/app/prioritizer.go @@ -1,6 +1,7 @@ package app import ( + "math" "math/big" sdk "github.com/cosmos/cosmos-sdk/types" @@ -119,7 +120,7 @@ func (s *SeiTxPrioritizer) getEvmTxPriority(ctx sdk.Context, evmTx *evmtypes.Msg // For now we are simply assuming excessive blob gas is 0. In the future we might change it to be // dynamic based on prior block usage. chainConfig := evmtypes.DefaultChainConfig().EthereumConfig(s.evmKeeper.ChainID(ctx)) - if txData.GetBlobFeeCap().Cmp(eip4844.CalcBlobFee(chainConfig, ðtypes.Header{Time: uint64(ctx.BlockTime().Unix())})) < 0 { + if txData.GetBlobFeeCap().Cmp(eip4844.CalcBlobFee(chainConfig, ðtypes.Header{Time: uint64(ctx.BlockTime().Unix())})) < 0 { //nolint:gosec return 0, sdkerrors.ErrInsufficientFee } } @@ -162,6 +163,12 @@ func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) if gas <= 0 { return 0, nil } + var igas int64 + if gas > math.MaxInt64 { + igas = math.MaxInt64 + } else { + igas = int64(gas) //nolint:gosec + } feeParams := s.paramsKeeper.GetFeesParams(ctx) allowedDenoms := feeParams.GetAllowedFeeDenoms() @@ -169,7 +176,7 @@ func (s *SeiTxPrioritizer) getCosmosTxPriority(ctx sdk.Context, feeTx sdk.FeeTx) denoms = append(denoms, sdk.DefaultBondDenom) denoms = append(denoms, allowedDenoms...) feeCoins := feeTx.GetFee().NonZeroAmountsOf(denoms) - priority := cosmosante.GetTxPriority(feeCoins, int64(gas)) + priority := cosmosante.GetTxPriority(feeCoins, igas) return min(antedecorators.MaxPriority, priority), nil } From 64de5f9fc1cd969f0ce9cb2edebad21f4d140f64 Mon Sep 17 00:00:00 2001 From: yzang2019 Date: Thu, 25 Sep 2025 08:56:00 -0700 Subject: [PATCH 18/23] Add unit test for ante handler priority --- app/antedecorators/priority.go | 4 +- .../priority_propagation_test.go | 105 ++++++++++++++++++ go.mod | 2 +- go.sum | 2 - x/oracle/ante.go | 2 - 5 files changed, 108 insertions(+), 7 deletions(-) create mode 100644 app/antedecorators/priority_propagation_test.go diff --git a/app/antedecorators/priority.go b/app/antedecorators/priority.go index 0fe7b287a7..05b18502c1 100644 --- a/app/antedecorators/priority.go +++ b/app/antedecorators/priority.go @@ -1,6 +1,7 @@ package antedecorators import ( + "fmt" "math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,11 +33,10 @@ func (pd PriorityDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool // Cap priority // Use higher priorities for tiers including oracle tx's priority := intMin(ctx.Priority(), MaxPriority) - if isOracleTx(tx) { priority = OraclePriority } - + fmt.Printf("[Debug] PriorityDecorator has old priority of %d and new priority of %d\n", ctx.Priority(), priority) newCtx := ctx.WithPriority(priority) return next(newCtx, tx, simulate) diff --git a/app/antedecorators/priority_propagation_test.go b/app/antedecorators/priority_propagation_test.go new file mode 100644 index 0000000000..8e0a4a9a79 --- /dev/null +++ b/app/antedecorators/priority_propagation_test.go @@ -0,0 +1,105 @@ +package antedecorators_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/accesscontrol" + authante "github.com/cosmos/cosmos-sdk/x/auth/ante" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + minttypes "github.com/sei-protocol/sei-chain/x/mint/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/sei-protocol/sei-chain/app" + "github.com/sei-protocol/sei-chain/app/antedecorators" + oracle "github.com/sei-protocol/sei-chain/x/oracle" + "github.com/stretchr/testify/require" +) + +// PriorityCaptureDecorator captures ctx.Priority seen by the next decorator in the chain +type PriorityCaptureDecorator struct{ captured *int64 } + +func (d PriorityCaptureDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + if d.captured != nil { + *d.captured = ctx.Priority() + } + return next(ctx, tx, simulate) +} + +func (d PriorityCaptureDecorator) AnteDeps(txDeps []accesscontrol.AccessOperation, tx sdk.Tx, txIndex int, next sdk.AnteDepGenerator) ([]accesscontrol.AccessOperation, error) { + return next(txDeps, tx, txIndex) +} + +// Minimal FeeTx to drive ante chain +type fakeTx struct { + sdk.FeeTx + msgs []sdk.Msg +} + +func (t fakeTx) GetMsgs() []sdk.Msg { return t.msgs } +func (t fakeTx) ValidateBasic() error { return nil } +func (t fakeTx) GetGas() uint64 { return 0 } +func (t fakeTx) GetFee() sdk.Coins { return sdk.NewCoins() } +func (t fakeTx) FeePayer() sdk.AccAddress { return nil } +func (t fakeTx) FeeGranter() sdk.AccAddress { return nil } + +func TestPriorityWithExactAnteChain_BankSend(t *testing.T) { + testApp := app.Setup(false, false, false) + ctx := testApp.NewContext(false, tmproto.Header{}).WithBlockHeight(2).WithIsCheckTx(true) + testApp.ParamsKeeper.SetCosmosGasParams(ctx, *paramtypes.DefaultCosmosGasParams()) + testApp.ParamsKeeper.SetFeesParams(ctx, paramtypes.DefaultGenesis().GetFeesParams()) + + var seenAfterLimit int64 = -1 + var seenAfterReject int64 = -1 + var seenAfterSpamming int64 = -1 + var seenAfterPriority int64 = -1 + + decorators := []sdk.AnteFullDecorator{ + sdk.DefaultWrappedAnteDecorator(authante.NewSetUpContextDecorator(antedecorators.GetGasMeterSetter(testApp.ParamsKeeper))), + antedecorators.NewGaslessDecorator([]sdk.AnteFullDecorator{authante.NewDeductFeeDecorator(testApp.AccountKeeper, testApp.BankKeeper, testApp.FeeGrantKeeper, testApp.ParamsKeeper, nil)}, testApp.OracleKeeper, &testApp.EvmKeeper), + func() sdk.AnteFullDecorator { + var simLimit sdk.Gas = 1_000_000 + return sdk.DefaultWrappedAnteDecorator(wasmkeeper.NewLimitSimulationGasDecorator(&simLimit, antedecorators.GetGasMeterSetter(testApp.ParamsKeeper))) + }(), + sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterLimit}), + sdk.DefaultWrappedAnteDecorator(authante.NewRejectExtensionOptionsDecorator()), + sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterReject}), + oracle.NewSpammingPreventionDecorator(testApp.OracleKeeper), + sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterSpamming}), + sdk.DefaultWrappedAnteDecorator(antedecorators.NewPriorityDecorator()), + sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterPriority}), + } + handler, _ := sdk.ChainAnteDecorators(decorators...) + + from, _ := sdk.AccAddressFromBech32("sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw") + to, _ := sdk.AccAddressFromBech32("sei1jdppe6fnj2q7hjsepty5crxtrryzhuqsjrj95y") + msg := &banktypes.MsgSend{FromAddress: from.String(), ToAddress: to.String(), Amount: sdk.NewCoins(sdk.NewInt64Coin("usei", 1))} + + // fund the sender to cover fees + fund := sdk.NewCoins(sdk.NewInt64Coin("usei", 1_000_000_000)) + require.NoError(t, testApp.BankKeeper.MintCoins(ctx, minttypes.ModuleName, fund)) + require.NoError(t, testApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, from, fund)) + + txb := testApp.GetTxConfig().NewTxBuilder() + require.NoError(t, txb.SetMsgs(msg)) + txb.SetGasLimit(500_000) + txb.SetFeeAmount(sdk.NewCoins(sdk.NewInt64Coin("usei", 100_000))) + tx := txb.GetTx() + + _, err := handler(ctx, tx, false) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if seenAfterLimit == 0 || seenAfterReject == 0 || seenAfterSpamming == 0 { + t.Fatalf("expected non zero priority after limit/reject/spamming, got %d/%d/%d", seenAfterLimit, seenAfterReject, seenAfterSpamming) + } + if seenAfterPriority == 0 { + t.Fatalf("expected PriorityDecorator to set correct priority for BankSend, got %d", seenAfterPriority) + } +} diff --git a/go.mod b/go.mod index a02600f3cc..575ecc12ec 100644 --- a/go.mod +++ b/go.mod @@ -354,7 +354,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 + github.com/cosmos/cosmos-sdk => ../sei-cosmos github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 diff --git a/go.sum b/go.sum index 3538ffcea9..ffa183b7e1 100644 --- a/go.sum +++ b/go.sum @@ -1993,8 +1993,6 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 h1:yqccLfr6bgcdSq9XKpLShu3DpOdl8YS2dQ4px/hWMbc= -github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30/go.mod h1:7mlEsGl1ASLn97VeRZg0L6V8IJc7uV5nf8za3JMAWBM= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= diff --git a/x/oracle/ante.go b/x/oracle/ante.go index 530cc0c89f..bf5e1d824e 100644 --- a/x/oracle/ante.go +++ b/x/oracle/ante.go @@ -2,7 +2,6 @@ package oracle import ( "encoding/hex" - sdk "github.com/cosmos/cosmos-sdk/types" sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" @@ -39,7 +38,6 @@ func (spd SpammingPreventionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, si } } } - return next(ctx, tx, simulate) } From 4483db70872c7afbc0c032d27bace9d00f93f8fe Mon Sep 17 00:00:00 2001 From: yzang2019 Date: Thu, 25 Sep 2025 08:56:17 -0700 Subject: [PATCH 19/23] Revert "Add unit test for ante handler priority" This reverts commit 64de5f9fc1cd969f0ce9cb2edebad21f4d140f64. --- app/antedecorators/priority.go | 4 +- .../priority_propagation_test.go | 105 ------------------ go.mod | 2 +- go.sum | 2 + x/oracle/ante.go | 2 + 5 files changed, 7 insertions(+), 108 deletions(-) delete mode 100644 app/antedecorators/priority_propagation_test.go diff --git a/app/antedecorators/priority.go b/app/antedecorators/priority.go index 05b18502c1..0fe7b287a7 100644 --- a/app/antedecorators/priority.go +++ b/app/antedecorators/priority.go @@ -1,7 +1,6 @@ package antedecorators import ( - "fmt" "math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -33,10 +32,11 @@ func (pd PriorityDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool // Cap priority // Use higher priorities for tiers including oracle tx's priority := intMin(ctx.Priority(), MaxPriority) + if isOracleTx(tx) { priority = OraclePriority } - fmt.Printf("[Debug] PriorityDecorator has old priority of %d and new priority of %d\n", ctx.Priority(), priority) + newCtx := ctx.WithPriority(priority) return next(newCtx, tx, simulate) diff --git a/app/antedecorators/priority_propagation_test.go b/app/antedecorators/priority_propagation_test.go deleted file mode 100644 index 8e0a4a9a79..0000000000 --- a/app/antedecorators/priority_propagation_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package antedecorators_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/accesscontrol" - authante "github.com/cosmos/cosmos-sdk/x/auth/ante" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - minttypes "github.com/sei-protocol/sei-chain/x/mint/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/sei-protocol/sei-chain/app" - "github.com/sei-protocol/sei-chain/app/antedecorators" - oracle "github.com/sei-protocol/sei-chain/x/oracle" - "github.com/stretchr/testify/require" -) - -// PriorityCaptureDecorator captures ctx.Priority seen by the next decorator in the chain -type PriorityCaptureDecorator struct{ captured *int64 } - -func (d PriorityCaptureDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - if d.captured != nil { - *d.captured = ctx.Priority() - } - return next(ctx, tx, simulate) -} - -func (d PriorityCaptureDecorator) AnteDeps(txDeps []accesscontrol.AccessOperation, tx sdk.Tx, txIndex int, next sdk.AnteDepGenerator) ([]accesscontrol.AccessOperation, error) { - return next(txDeps, tx, txIndex) -} - -// Minimal FeeTx to drive ante chain -type fakeTx struct { - sdk.FeeTx - msgs []sdk.Msg -} - -func (t fakeTx) GetMsgs() []sdk.Msg { return t.msgs } -func (t fakeTx) ValidateBasic() error { return nil } -func (t fakeTx) GetGas() uint64 { return 0 } -func (t fakeTx) GetFee() sdk.Coins { return sdk.NewCoins() } -func (t fakeTx) FeePayer() sdk.AccAddress { return nil } -func (t fakeTx) FeeGranter() sdk.AccAddress { return nil } - -func TestPriorityWithExactAnteChain_BankSend(t *testing.T) { - testApp := app.Setup(false, false, false) - ctx := testApp.NewContext(false, tmproto.Header{}).WithBlockHeight(2).WithIsCheckTx(true) - testApp.ParamsKeeper.SetCosmosGasParams(ctx, *paramtypes.DefaultCosmosGasParams()) - testApp.ParamsKeeper.SetFeesParams(ctx, paramtypes.DefaultGenesis().GetFeesParams()) - - var seenAfterLimit int64 = -1 - var seenAfterReject int64 = -1 - var seenAfterSpamming int64 = -1 - var seenAfterPriority int64 = -1 - - decorators := []sdk.AnteFullDecorator{ - sdk.DefaultWrappedAnteDecorator(authante.NewSetUpContextDecorator(antedecorators.GetGasMeterSetter(testApp.ParamsKeeper))), - antedecorators.NewGaslessDecorator([]sdk.AnteFullDecorator{authante.NewDeductFeeDecorator(testApp.AccountKeeper, testApp.BankKeeper, testApp.FeeGrantKeeper, testApp.ParamsKeeper, nil)}, testApp.OracleKeeper, &testApp.EvmKeeper), - func() sdk.AnteFullDecorator { - var simLimit sdk.Gas = 1_000_000 - return sdk.DefaultWrappedAnteDecorator(wasmkeeper.NewLimitSimulationGasDecorator(&simLimit, antedecorators.GetGasMeterSetter(testApp.ParamsKeeper))) - }(), - sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterLimit}), - sdk.DefaultWrappedAnteDecorator(authante.NewRejectExtensionOptionsDecorator()), - sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterReject}), - oracle.NewSpammingPreventionDecorator(testApp.OracleKeeper), - sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterSpamming}), - sdk.DefaultWrappedAnteDecorator(antedecorators.NewPriorityDecorator()), - sdk.DefaultWrappedAnteDecorator(PriorityCaptureDecorator{captured: &seenAfterPriority}), - } - handler, _ := sdk.ChainAnteDecorators(decorators...) - - from, _ := sdk.AccAddressFromBech32("sei1y3pxq5dp900czh0mkudhjdqjq5m8cpmmps8yjw") - to, _ := sdk.AccAddressFromBech32("sei1jdppe6fnj2q7hjsepty5crxtrryzhuqsjrj95y") - msg := &banktypes.MsgSend{FromAddress: from.String(), ToAddress: to.String(), Amount: sdk.NewCoins(sdk.NewInt64Coin("usei", 1))} - - // fund the sender to cover fees - fund := sdk.NewCoins(sdk.NewInt64Coin("usei", 1_000_000_000)) - require.NoError(t, testApp.BankKeeper.MintCoins(ctx, minttypes.ModuleName, fund)) - require.NoError(t, testApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, from, fund)) - - txb := testApp.GetTxConfig().NewTxBuilder() - require.NoError(t, txb.SetMsgs(msg)) - txb.SetGasLimit(500_000) - txb.SetFeeAmount(sdk.NewCoins(sdk.NewInt64Coin("usei", 100_000))) - tx := txb.GetTx() - - _, err := handler(ctx, tx, false) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - if seenAfterLimit == 0 || seenAfterReject == 0 || seenAfterSpamming == 0 { - t.Fatalf("expected non zero priority after limit/reject/spamming, got %d/%d/%d", seenAfterLimit, seenAfterReject, seenAfterSpamming) - } - if seenAfterPriority == 0 { - t.Fatalf("expected PriorityDecorator to set correct priority for BankSend, got %d", seenAfterPriority) - } -} diff --git a/go.mod b/go.mod index 575ecc12ec..a02600f3cc 100644 --- a/go.mod +++ b/go.mod @@ -354,7 +354,7 @@ replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-cosmos/pull/598 - github.com/cosmos/cosmos-sdk => ../sei-cosmos + github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.2.0 github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.7-sei-3 diff --git a/go.sum b/go.sum index ffa183b7e1..3538ffcea9 100644 --- a/go.sum +++ b/go.sum @@ -1993,6 +1993,8 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-3 h1:Xf6qYewZK8+534cXOZI6iDVGYkN github.com/sei-protocol/go-ethereum v1.15.7-sei-3/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA= github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30 h1:yqccLfr6bgcdSq9XKpLShu3DpOdl8YS2dQ4px/hWMbc= +github.com/sei-protocol/sei-cosmos v0.3.67-0.20250905203746-88d839829c30/go.mod h1:7mlEsGl1ASLn97VeRZg0L6V8IJc7uV5nf8za3JMAWBM= github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axIraL/U= github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8DPicN+I= diff --git a/x/oracle/ante.go b/x/oracle/ante.go index bf5e1d824e..530cc0c89f 100644 --- a/x/oracle/ante.go +++ b/x/oracle/ante.go @@ -2,6 +2,7 @@ package oracle import ( "encoding/hex" + sdk "github.com/cosmos/cosmos-sdk/types" sdkacltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" @@ -38,6 +39,7 @@ func (spd SpammingPreventionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, si } } } + return next(ctx, tx, simulate) } From eee44b68c04174b2f9013c06f5b01ac9b60ddda9 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 1 Oct 2025 12:07:58 +0100 Subject: [PATCH 20/23] Upgrade tendermint to commit from merge to main --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3a8f07ec68..c71dd1ad2d 100644 --- a/go.mod +++ b/go.mod @@ -362,7 +362,7 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // TODO: To be replaced with a concrete version number. See: // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.4-0.20250905203244-31c1f39f5fce + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 4dfd0a0a57..3348e643e1 100644 --- a/go.sum +++ b/go.sum @@ -1997,8 +1997,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.4 h1:lMgzloTLo3ixNBHV+ETkUeh13fwOPqqdXZW3pZxQ8Bs= -github.com/sei-protocol/sei-tendermint v0.6.4/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk= From eaf95179593b637b0bbd2c7141b889d691eb5085 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 1 Oct 2025 14:04:07 +0100 Subject: [PATCH 21/23] Port over the changes from open sei-cosmos PR See: https://github.com/sei-protocol/sei-cosmos/pull/598 --- sei-cosmos/baseapp/abci.go | 44 ++++++++++++++++++++++++++++++++ sei-cosmos/baseapp/baseapp.go | 1 + sei-cosmos/baseapp/options.go | 6 +++++ sei-cosmos/types/abci.go | 2 ++ sei-cosmos/types/context.go | 10 +++++++- sei-cosmos/types/context_test.go | 30 ++++++++++++++++++++++ 6 files changed, 92 insertions(+), 1 deletion(-) diff --git a/sei-cosmos/baseapp/abci.go b/sei-cosmos/baseapp/abci.go index f45a904765..0486df9cfd 100644 --- a/sei-cosmos/baseapp/abci.go +++ b/sei-cosmos/baseapp/abci.go @@ -1214,3 +1214,47 @@ func (app *BaseApp) LoadLatest(ctx context.Context, req *abci.RequestLoadLatest) app.initialHeight = app.cms.LastCommitID().Version return &abci.ResponseLoadLatest{}, nil } + +func (app *BaseApp) GetTxPriorityHint(_ context.Context, req *abci.RequestGetTxPriorityHint) (_resp *abci.ResponseGetTxPriorityHint, _err error) { + defer func() { + if r := recover(); r != nil { + // Fall back to no-op priority if we panic for any reason. This is to avoid DoS + // vectors where a malicious actor crafts a transaction that panics the + // prioritizer. Since the prioritizer is used as a hint only, it's safe to fall + // back to zero priority in this case and log the panic for monitoring purposes. + app.logger.Error("tx prioritizer base app panicked. Falling back on no priority", "error", r) + if _err == nil { + _resp = &abci.ResponseGetTxPriorityHint{Priority: 0} + } + // Do not overwrite an existing error if one was already set to keep panics a + // non-event at this stage but safeguard against them. + } + }() + + defer telemetry.MeasureSince(time.Now(), "abci", "get_tx_priority_hint") + + tx, err := app.txDecoder(req.Tx) + if err != nil { + return nil, err + } + if tx == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "nil tx") + } + + // TODO: should we bother validating the messages here? + msgs := tx.GetMsgs() + if err := validateBasicTxMsgs(msgs); err != nil { + return nil, err + } + var priority int64 + if app.txPrioritizer != nil { + sdkCtx := app.getContextForTx(runTxModeCheck, req.Tx) + priority, err = app.txPrioritizer(sdkCtx, tx) + if err != nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, fmt.Sprintf("error getting tx priority: %s", err.Error())) + } + } + return &abci.ResponseGetTxPriorityHint{ + Priority: priority, + }, nil +} diff --git a/sei-cosmos/baseapp/baseapp.go b/sei-cosmos/baseapp/baseapp.go index c0a6798591..fad6e2f4c8 100644 --- a/sei-cosmos/baseapp/baseapp.go +++ b/sei-cosmos/baseapp/baseapp.go @@ -97,6 +97,7 @@ type BaseApp struct { //nolint: maligned preCommitHandler sdk.PreCommitHandler closeHandler sdk.CloseHandler inplaceTestnetInitializer sdk.InplaceTestnetInitializer + txPrioritizer sdk.TxPrioritizer appStore baseappVersions diff --git a/sei-cosmos/baseapp/options.go b/sei-cosmos/baseapp/options.go index 4d2747fd3d..988a712987 100644 --- a/sei-cosmos/baseapp/options.go +++ b/sei-cosmos/baseapp/options.go @@ -379,3 +379,9 @@ func (app *BaseApp) SetQueryMultiStore(ms sdk.CommitMultiStore) { func (app *BaseApp) SetMigrationHeight(height int64) { app.migrationHeight = height } + +// SetTxPrioritizer sets the transaction prioritizer for the BaseApp. If unset, +// calls to GetTxPriorityHint for all valid transactions will return 0. +func (app *BaseApp) SetTxPrioritizer(prioritizer sdk.TxPrioritizer) { + app.txPrioritizer = prioritizer +} diff --git a/sei-cosmos/types/abci.go b/sei-cosmos/types/abci.go index 6921d45eac..3d056cd2a3 100644 --- a/sei-cosmos/types/abci.go +++ b/sei-cosmos/types/abci.go @@ -37,3 +37,5 @@ type LoadVersionHandler func() error type PreCommitHandler func(ctx Context) error type CloseHandler func() error type InplaceTestnetInitializer func(cryptotypes.PubKey) error + +type TxPrioritizer func(Context, Tx) (int64, error) diff --git a/sei-cosmos/types/context.go b/sei-cosmos/types/context.go index 930994f2e6..d0bb009bea 100644 --- a/sei-cosmos/types/context.go +++ b/sei-cosmos/types/context.go @@ -46,6 +46,7 @@ type Context struct { eventManager *EventManager evmEventManager *EVMEventManager priority int64 // The tx priority, only relevant in CheckTx + hasPriority bool // Whether the tx has a priority set pendingTxChecker abci.PendingTxChecker // Checker for pending transaction, only relevant in CheckTx checkTxCallback func(Context, error) // callback to make at the end of CheckTx. Input param is the error (nil-able) of `runMsgs` deliverTxCallback func(Context) // callback to make at the end of DeliverTx. @@ -241,12 +242,19 @@ func (c Context) StoreTracer() gaskv.IStoreTracer { return c.storeTracer } -// WithEventManager returns a Context with an updated tx priority +// WithPriority returns a Context with an updated tx priority. func (c Context) WithPriority(p int64) Context { c.priority = p + c.hasPriority = true return c } +// HasPriority returns true iff the priority is set for this Context even if it +// was set to zero. +func (c Context) HasPriority() bool { + return c.hasPriority +} + // HeaderHash returns a copy of the header hash obtained during abci.RequestBeginBlock func (c Context) HeaderHash() tmbytes.HexBytes { hash := make([]byte, len(c.headerHash)) diff --git a/sei-cosmos/types/context_test.go b/sei-cosmos/types/context_test.go index 1dc062ac4e..ad6156f895 100644 --- a/sei-cosmos/types/context_test.go +++ b/sei-cosmos/types/context_test.go @@ -7,6 +7,7 @@ import ( "time" "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -226,3 +227,32 @@ func (s *contextTestSuite) TestUnwrapSDKContext() { ctx = context.Background() s.Require().Panics(func() { types.UnwrapSDKContext(ctx) }) } + +func TestContext_Priority(t *testing.T) { + var ( + requireNoPriority = func(t *testing.T, ctx types.Context) { + require.Zero(t, ctx.Priority()) + require.False(t, ctx.HasPriority()) + } + requirePriority = func(t *testing.T, ctx types.Context, priority int64) { + require.Equal(t, priority, ctx.Priority()) + require.True(t, ctx.HasPriority()) + } + ) + + // Assert that a new context has no priority set and does not have priority. + var subject types.Context + requireNoPriority(t, subject) + + // Assert that setting a priority sets the priority and marks the context as + // having priority set. But does not change the original context. + prioritisedSubject := subject.WithPriority(100) + requirePriority(t, prioritisedSubject, 100) + requireNoPriority(t, subject) + + // Assert that setting priority to 0 updates the priority but still marks the + // context as having priority set. But does not change the original context. + deprioritisedSubject := subject.WithPriority(0) + requirePriority(t, deprioritisedSubject, 0) + requireNoPriority(t, subject) +} From d2fccb380ef4cfdbc82ca712b7735e17c9aea7aa Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 1 Oct 2025 17:01:39 +0100 Subject: [PATCH 22/23] Upgrate to the compatible tendermint across all dependencies --- sei-cosmos/go.mod | 5 ++++- sei-cosmos/go.sum | 6 ++++-- sei-wasmd/go.mod | 7 +++++-- sei-wasmd/go.sum | 7 ++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sei-cosmos/go.mod b/sei-cosmos/go.mod index dd43018e2f..6b52ea6b5b 100644 --- a/sei-cosmos/go.mod +++ b/sei-cosmos/go.mod @@ -134,6 +134,7 @@ require ( github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect @@ -196,7 +197,9 @@ replace ( github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.51 // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.0 + // TODO: To be replaced with a concrete version number. See: + // - https://github.com/sei-protocol/sei-tendermint/pull/301 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 // latest grpc doesn't work with with our modified proto compiler, so we need to enforce // the following version across all dependencies. google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/sei-cosmos/go.sum b/sei-cosmos/go.sum index 4e499bef29..f77ed2a7ce 100644 --- a/sei-cosmos/go.sum +++ b/sei-cosmos/go.sum @@ -843,6 +843,8 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -966,8 +968,8 @@ github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axI github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE= github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= -github.com/sei-protocol/sei-tendermint v0.6.0 h1:H/qN54IUUnqMKbqL9rVt61ViIgPzpHixtKd43LV+C6I= -github.com/sei-protocol/sei-tendermint v0.6.0/go.mod h1:hLgRpS2d6VM8XzlhEtFeosCYkpuviU2ztqmOairIivc= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/sei-wasmd/go.mod b/sei-wasmd/go.mod index fb94647984..0b627c7560 100644 --- a/sei-wasmd/go.mod +++ b/sei-wasmd/go.mod @@ -40,7 +40,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect - github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -78,6 +77,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect @@ -107,6 +107,7 @@ require ( github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect @@ -165,7 +166,9 @@ replace ( // latest grpc doesn't work with with our modified proto compiler, so we need to enforce // the following version across all dependencies. github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.5.9 + // TODO: To be replaced with a concrete version number. See: + // - https://github.com/sei-protocol/sei-tendermint/pull/301 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/sei-wasmd/go.sum b/sei-wasmd/go.sum index 175435626f..f3cf07bd25 100644 --- a/sei-wasmd/go.sum +++ b/sei-wasmd/go.sum @@ -114,7 +114,6 @@ github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dm github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -681,6 +680,8 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -776,8 +777,8 @@ github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHo github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.5.9 h1:GLAuHGuCd1eDLfoU4uFMbqQo7z47XSV66Ln4/V8hsOY= -github.com/sei-protocol/sei-tendermint v0.5.9/go.mod h1:ip8M5kkQf8JC05np1xd4KR33ttJoseJi28Ea28ui85E= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= +github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk= From 00942ec4f688e45e398ce03091c2d87938329afc Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 1 Oct 2025 17:32:24 +0100 Subject: [PATCH 23/23] Update tendermint to concrete release tag --- go.mod | 4 +--- go.sum | 4 ++-- sei-cosmos/go.mod | 4 +--- sei-cosmos/go.sum | 4 ++-- sei-wasmd/go.mod | 4 +--- sei-wasmd/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index c71dd1ad2d..329bc201a6 100644 --- a/go.mod +++ b/go.mod @@ -360,9 +360,7 @@ replace ( github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.51 // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // TODO: To be replaced with a concrete version number. See: - // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 golang.org/x/crypto => golang.org/x/crypto v0.31.0 google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 3348e643e1..9b8151305d 100644 --- a/go.sum +++ b/go.sum @@ -1997,8 +1997,8 @@ github.com/sei-protocol/sei-iavl v0.2.0 h1:OisPjXiDT+oe+aeckzDEFgkZCYuUjHgs/PP8D github.com/sei-protocol/sei-iavl v0.2.0/go.mod h1:qRf8QYUPfrAO7K6VDB2B2l/N7K5L76OorioGBcJBIbw= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= +github.com/sei-protocol/sei-tendermint v0.6.5 h1:6jJOw330mcK8Xu8PYiChByHpsl+yGujsl1WZXDW0G4Q= +github.com/sei-protocol/sei-tendermint v0.6.5/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk= diff --git a/sei-cosmos/go.mod b/sei-cosmos/go.mod index 6b52ea6b5b..8307ff6436 100644 --- a/sei-cosmos/go.mod +++ b/sei-cosmos/go.mod @@ -197,9 +197,7 @@ replace ( github.com/sei-protocol/sei-db => github.com/sei-protocol/sei-db v0.0.51 // Latest goleveldb is broken, we have to stick to this version github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // TODO: To be replaced with a concrete version number. See: - // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5 // latest grpc doesn't work with with our modified proto compiler, so we need to enforce // the following version across all dependencies. google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/sei-cosmos/go.sum b/sei-cosmos/go.sum index f77ed2a7ce..3f4fe2b33e 100644 --- a/sei-cosmos/go.sum +++ b/sei-cosmos/go.sum @@ -968,8 +968,8 @@ github.com/sei-protocol/sei-db v0.0.51 h1:jK6Ps+jDbGdWIPZttaWk7VIsq8aLWWlkTp9axI github.com/sei-protocol/sei-db v0.0.51/go.mod h1:m5g7p0QeAS3dNJHIl28zQpzOgxQmvYqPb7t4hwgIOCA= github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE= github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= +github.com/sei-protocol/sei-tendermint v0.6.5 h1:6jJOw330mcK8Xu8PYiChByHpsl+yGujsl1WZXDW0G4Q= +github.com/sei-protocol/sei-tendermint v0.6.5/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/sei-wasmd/go.mod b/sei-wasmd/go.mod index 0b627c7560..a4d709dfec 100644 --- a/sei-wasmd/go.mod +++ b/sei-wasmd/go.mod @@ -166,9 +166,7 @@ replace ( // latest grpc doesn't work with with our modified proto compiler, so we need to enforce // the following version across all dependencies. github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - // TODO: To be replaced with a concrete version number. See: - // - https://github.com/sei-protocol/sei-tendermint/pull/301 - github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 + github.com/tendermint/tendermint => github.com/sei-protocol/sei-tendermint v0.6.5 github.com/tendermint/tm-db => github.com/sei-protocol/tm-db v0.0.4 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/sei-wasmd/go.sum b/sei-wasmd/go.sum index f3cf07bd25..b51d890443 100644 --- a/sei-wasmd/go.sum +++ b/sei-wasmd/go.sum @@ -777,8 +777,8 @@ github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHo github.com/sei-protocol/sei-iavl v0.1.9/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6 h1:HHWvrslBpkXBHUFs+azwl36NuFEJyMo6huvsNPG854c= github.com/sei-protocol/sei-ibc-go/v3 v3.3.6/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34 h1:mnyDE/eA6rlnQuXOKKKaLeOInboTHSGqfzoYbshq4sQ= -github.com/sei-protocol/sei-tendermint v0.6.5-0.20250929143910-b0665bf8bd34/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= +github.com/sei-protocol/sei-tendermint v0.6.5 h1:6jJOw330mcK8Xu8PYiChByHpsl+yGujsl1WZXDW0G4Q= +github.com/sei-protocol/sei-tendermint v0.6.5/go.mod h1:SSZv0P1NBP/4uB3gZr5XJIan3ks3Ui8FJJzIap4r6uc= github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY= github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY= github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk=