From 098d223e7c70a8f2438d3447494409de40a0c829 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 10 Sep 2025 15:15:43 +0800 Subject: [PATCH 1/3] chore: cleanup unused cumulative gasWanted * max-tx-gas-wanted was broken since sdk 50 * clean up unused logci until sdk change like https://github.com/crypto-org-chain/cosmos-sdk/pull/507 included --- ante/evm/08_gas_consume.go | 20 ----- ante/evm/mono_decorator.go | 8 +- .../ante/test_evm_unit_08_gas_consume.go | 76 ------------------- 3 files changed, 1 insertion(+), 103 deletions(-) diff --git a/ante/evm/08_gas_consume.go b/ante/evm/08_gas_consume.go index 6580d43e2..17acabb35 100644 --- a/ante/evm/08_gas_consume.go +++ b/ante/evm/08_gas_consume.go @@ -16,26 +16,6 @@ import ( errortypes "github.com/cosmos/cosmos-sdk/types/errors" ) -// UpdateCumulativeGasWanted updates the cumulative gas wanted -func UpdateCumulativeGasWanted( - ctx sdktypes.Context, - msgGasWanted uint64, - maxTxGasWanted uint64, - cumulativeGasWanted uint64, -) uint64 { - if ctx.IsCheckTx() && maxTxGasWanted != 0 { - // We can't trust the tx gas limit, because we'll refund the unused gas. - if msgGasWanted > maxTxGasWanted { - cumulativeGasWanted += maxTxGasWanted - } else { - cumulativeGasWanted += msgGasWanted - } - } else { - cumulativeGasWanted += msgGasWanted - } - return cumulativeGasWanted -} - // ConsumeFeesAndEmitEvent deduces fees from sender and emits the event func ConsumeFeesAndEmitEvent( ctx sdktypes.Context, diff --git a/ante/evm/mono_decorator.go b/ante/evm/mono_decorator.go index 982336cf2..5f218c3e5 100644 --- a/ante/evm/mono_decorator.go +++ b/ante/evm/mono_decorator.go @@ -217,13 +217,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne return ctx, err } - gasWanted := UpdateCumulativeGasWanted( - ctx, - gas, - md.maxGasWanted, - decUtils.GasWanted, - ) - decUtils.GasWanted = gasWanted + decUtils.GasWanted += gas minPriority := GetMsgPriority( ethTx, diff --git a/tests/integration/ante/test_evm_unit_08_gas_consume.go b/tests/integration/ante/test_evm_unit_08_gas_consume.go index 605221891..22b550332 100644 --- a/tests/integration/ante/test_evm_unit_08_gas_consume.go +++ b/tests/integration/ante/test_evm_unit_08_gas_consume.go @@ -18,82 +18,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -func (s *EvmUnitAnteTestSuite) TestUpdateCumulativeGasWanted() { - keyring := testkeyring.New(1) - unitNetwork := network.NewUnitTestNetwork( - s.create, - network.WithChainID(testconstants.ChainID{ - ChainID: s.ChainID, - EVMChainID: s.EvmChainID, - }), - network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...), - ) - - testCases := []struct { - name string - msgGasWanted uint64 - maxTxGasWanted uint64 - cumulativeGasWanted uint64 - getCtx func() sdktypes.Context - expectedResponse uint64 - }{ - { - name: "when is NOT checkTx and cumulativeGasWanted is 0, returns msgGasWanted", - msgGasWanted: 100, - maxTxGasWanted: 150, - cumulativeGasWanted: 0, - getCtx: func() sdktypes.Context { - return unitNetwork.GetContext().WithIsCheckTx(false) - }, - expectedResponse: 100, - }, - { - name: "when is NOT checkTx and cumulativeGasWanted has value, returns cumulativeGasWanted + msgGasWanted", - msgGasWanted: 100, - maxTxGasWanted: 150, - cumulativeGasWanted: 50, - getCtx: func() sdktypes.Context { - return unitNetwork.GetContext().WithIsCheckTx(false) - }, - expectedResponse: 150, - }, - { - name: "when is checkTx, maxTxGasWanted is not 0 and msgGasWanted > maxTxGasWanted, returns cumulativeGasWanted + maxTxGasWanted", - msgGasWanted: 200, - maxTxGasWanted: 100, - cumulativeGasWanted: 50, - getCtx: func() sdktypes.Context { - return unitNetwork.GetContext().WithIsCheckTx(true) - }, - expectedResponse: 150, - }, - { - name: "when is checkTx, maxTxGasWanted is not 0 and msgGasWanted < maxTxGasWanted, returns cumulativeGasWanted + msgGasWanted", - msgGasWanted: 50, - maxTxGasWanted: 100, - cumulativeGasWanted: 50, - getCtx: func() sdktypes.Context { - return unitNetwork.GetContext().WithIsCheckTx(true) - }, - expectedResponse: 100, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - // Function under test - gasWanted := evmante.UpdateCumulativeGasWanted( - tc.getCtx(), - tc.msgGasWanted, - tc.maxTxGasWanted, - tc.cumulativeGasWanted, - ) - - s.Require().Equal(tc.expectedResponse, gasWanted) - }) - } -} - // NOTE: claim rewards are not tested since there is an independent suite to test just that func (s *EvmUnitAnteTestSuite) TestConsumeGasAndEmitEvent() { keyring := testkeyring.New(1) From 842f4a8b60576fcb30bf72b1c5af57c6c0e7ad3c Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 11 Sep 2025 09:21:55 +0800 Subject: [PATCH 2/3] fix max_gas_wanted --- ante/evm/mono_decorator.go | 6 ++- evmd/go.mod | 19 ++++--- evmd/go.sum | 36 +++++++------- go.mod | 21 +++++--- go.sum | 36 +++++++------- mempool/iterator.go | 49 +++++++++++++------ mempool/mempool.go | 49 +++++++++++++++++-- .../mempool/test_mempool_integration.go | 44 ++++++++--------- .../mempool/test_mempool_integration_abci.go | 4 +- tests/systemtests/go.mod | 4 +- 10 files changed, 170 insertions(+), 98 deletions(-) diff --git a/ante/evm/mono_decorator.go b/ante/evm/mono_decorator.go index 5f218c3e5..3c800d851 100644 --- a/ante/evm/mono_decorator.go +++ b/ante/evm/mono_decorator.go @@ -217,7 +217,11 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne return ctx, err } - decUtils.GasWanted += gas + if md.maxGasWanted != 0 { + decUtils.GasWanted += min(gas, md.maxGasWanted) + } else { + decUtils.GasWanted += gas + } minPriority := GetMsgPriority( ethTx, diff --git a/evmd/go.mod b/evmd/go.mod index 19fe00f12..8ba1779ab 100644 --- a/evmd/go.mod +++ b/evmd/go.mod @@ -62,7 +62,7 @@ require ( github.com/bgentry/speakeasy v0.2.0 // indirect github.com/bits-and-blooms/bitset v1.22.0 // indirect github.com/btcsuite/btcd v0.24.2 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.5 // indirect github.com/btcsuite/btcd/btcutil v1.1.6 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/bytedance/sonic v1.14.0 // indirect @@ -88,7 +88,7 @@ require ( github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.15.0 // indirect github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/creachadair/atomicfile v0.3.7 // indirect @@ -123,7 +123,7 @@ require ( github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/go-viper/mapstructure/v2 v2.3.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect @@ -202,8 +202,8 @@ require ( github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.22.0 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.63.0 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect @@ -233,7 +233,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zeebo/errs v1.4.0 // indirect github.com/zondax/hid v0.9.2 // indirect - github.com/zondax/ledger-go v0.14.3 // indirect + github.com/zondax/ledger-go v1.0.0 // indirect go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect @@ -262,7 +262,7 @@ require ( google.golang.org/api v0.222.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect google.golang.org/protobuf v1.36.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -285,3 +285,8 @@ replace ( // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) + +replace ( + cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc + github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc +) diff --git a/evmd/go.sum b/evmd/go.sum index 5f775b32e..f1332f734 100644 --- a/evmd/go.sum +++ b/evmd/go.sum @@ -632,8 +632,6 @@ cosmossdk.io/math v1.5.3 h1:WH6tu6Z3AUCeHbeOSHg2mt9rnoiUWVWaQ2t6Gkll96U= cosmossdk.io/math v1.5.3/go.mod h1:uqcZv7vexnhMFJF+6zh9EWdm/+Ylyln34IvPnBauPCQ= cosmossdk.io/schema v1.1.0 h1:mmpuz3dzouCoyjjcMcA/xHBEmMChN+EHh8EHxHRHhzE= cosmossdk.io/schema v1.1.0/go.mod h1:Gb7pqO+tpR+jLW5qDcNOSv0KtppYs7881kfzakguhhI= -cosmossdk.io/store v1.1.2 h1:3HOZG8+CuThREKv6cn3WSohAc6yccxO3hLzwK6rBC7o= -cosmossdk.io/store v1.1.2/go.mod h1:60rAGzTHevGm592kFhiUVkNC9w7gooSEn5iUBPzHQ6A= cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/evidence v0.2.0 h1:o72zbmgCM7U0v7z7b0XnMB+NqX0tFamqb1HHkQbhrZ0= @@ -737,8 +735,8 @@ github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= -github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.5 h1:dpAlnAwmT1yIBm3exhT1/8iUSD98RDJM5vqJVQDQLiU= +github.com/btcsuite/btcd/btcec/v2 v2.3.5/go.mod h1:m22FrOAiuxl/tht9wIqAoGHcbnCCaPWyauO8y2LGGtQ= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= @@ -855,8 +853,6 @@ github.com/cosmos/cosmos-db v1.1.3 h1:7QNT77+vkefostcKkhrzDK9uoIEryzFrU9eoMeaQOP github.com/cosmos/cosmos-db v1.1.3/go.mod h1:kN+wGsnwUJZYn8Sy5Q2O0vCYA99MJllkKASbs6Unb9U= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.53.4 h1:kPF6vY68+/xi1/VebSZGpoxQqA52qkhUzqkrgeBn3Mg= -github.com/cosmos/cosmos-sdk v0.53.4/go.mod h1:7U3+WHZtI44dEOnU46+lDzBb2tFh1QlMvi8Z5JugopI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/go-ethereum v0.0.0-20250806193535-2fc7571efa91 h1:kgu2NkKzSeJJlVsKeS+KbdzfUeaFqrqmmhwixd/PNH4= @@ -876,8 +872,8 @@ github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5Rtn github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= -github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= +github.com/cosmos/ledger-cosmos-go v0.15.0 h1:xmizkkEX19tyFLVL6PPMQNg21Jc9W9/bpbwxMDdtxXg= +github.com/cosmos/ledger-cosmos-go v0.15.0/go.mod h1:KJqW5U4/MMl8ICPO4WPjIAyC4TfYRnr28d9N9bBUKWc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -1050,8 +1046,8 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -1446,6 +1442,10 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc h1:ZQlfClnBisF68dbLy+cty/Y25UYMcBdr2CYeUgKCVwY= +github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc/go.mod h1:ngU7B7i5/u4ufHDYBdWERxBfqseQIQ9G+GeVAJs9ha8= +github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc h1:47vuX3B06/4pILuLYlcdXYEh+s5zbA80Fn1PTAcZm7Y= +github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc/go.mod h1:QY+PHicBEv5N3Pj8Mu9Q17We0w3uIfjhtGDMIwdhofw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -1575,8 +1575,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= @@ -1584,8 +1584,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= -github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= +github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= +github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1741,8 +1741,8 @@ github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtC github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= -github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +github.com/zondax/ledger-go v1.0.0 h1:BvNoksIyRqyQTW78rIZP9A44WwAminKiomQa7jXp9EI= +github.com/zondax/ledger-go v1.0.0/go.mod h1:HpgkgFh3Jkwi9iYLDATdyRxc8CxqxcywsFj6QerWzvo= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.4.0-alpha.1 h1:3yrqQzbRRPFPdOMWS/QQIVxVnzSkAZQYeWlZFv1kbj4= go.etcd.io/bbolt v1.4.0-alpha.1/go.mod h1:S/Z/Nm3iuOnyO1W4XuFfPci51Gj6F1Hv0z8hisyYYOw= @@ -2494,8 +2494,8 @@ google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a h1:SGktgSolFCo75dnHJF2yMvnns6jCmHFJ0vE4Vn2JKvQ= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a/go.mod h1:a77HrdMjoeKbnd2jmgcWdaS++ZLZAEq3orIOAEIKiVw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/go.mod b/go.mod index 320aef035..d6a8cc282 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/creachadair/tomledit v0.0.28 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/ethereum/go-ethereum v1.15.11 + github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.3 @@ -86,7 +87,7 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/bits-and-blooms/bitset v1.22.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/bytedance/sonic v1.14.0 // indirect github.com/bytedance/sonic/loader v0.3.0 // indirect @@ -108,7 +109,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.15.0 // indirect github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/creachadair/atomicfile v0.3.7 // indirect @@ -138,11 +139,10 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/go-viper/mapstructure/v2 v2.3.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.5 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect @@ -208,8 +208,8 @@ require ( github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.22.0 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.63.0 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect @@ -235,7 +235,7 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zeebo/errs v1.4.0 // indirect - github.com/zondax/ledger-go v0.14.3 // indirect + github.com/zondax/ledger-go v1.0.0 // indirect go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect @@ -259,7 +259,7 @@ require ( golang.org/x/tools v0.35.0 // indirect google.golang.org/api v0.222.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.2 // indirect @@ -281,3 +281,8 @@ replace ( ) retract v0.4.0 + +replace ( + cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc + github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc +) diff --git a/go.sum b/go.sum index 9cfa41a54..6f1af57ed 100644 --- a/go.sum +++ b/go.sum @@ -630,8 +630,6 @@ cosmossdk.io/math v1.5.3 h1:WH6tu6Z3AUCeHbeOSHg2mt9rnoiUWVWaQ2t6Gkll96U= cosmossdk.io/math v1.5.3/go.mod h1:uqcZv7vexnhMFJF+6zh9EWdm/+Ylyln34IvPnBauPCQ= cosmossdk.io/schema v1.1.0 h1:mmpuz3dzouCoyjjcMcA/xHBEmMChN+EHh8EHxHRHhzE= cosmossdk.io/schema v1.1.0/go.mod h1:Gb7pqO+tpR+jLW5qDcNOSv0KtppYs7881kfzakguhhI= -cosmossdk.io/store v1.1.2 h1:3HOZG8+CuThREKv6cn3WSohAc6yccxO3hLzwK6rBC7o= -cosmossdk.io/store v1.1.2/go.mod h1:60rAGzTHevGm592kFhiUVkNC9w7gooSEn5iUBPzHQ6A= cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/evidence v0.2.0 h1:o72zbmgCM7U0v7z7b0XnMB+NqX0tFamqb1HHkQbhrZ0= @@ -735,8 +733,8 @@ github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= -github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.5 h1:dpAlnAwmT1yIBm3exhT1/8iUSD98RDJM5vqJVQDQLiU= +github.com/btcsuite/btcd/btcec/v2 v2.3.5/go.mod h1:m22FrOAiuxl/tht9wIqAoGHcbnCCaPWyauO8y2LGGtQ= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= @@ -850,8 +848,6 @@ github.com/cosmos/cosmos-db v1.1.3 h1:7QNT77+vkefostcKkhrzDK9uoIEryzFrU9eoMeaQOP github.com/cosmos/cosmos-db v1.1.3/go.mod h1:kN+wGsnwUJZYn8Sy5Q2O0vCYA99MJllkKASbs6Unb9U= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.53.4 h1:kPF6vY68+/xi1/VebSZGpoxQqA52qkhUzqkrgeBn3Mg= -github.com/cosmos/cosmos-sdk v0.53.4/go.mod h1:7U3+WHZtI44dEOnU46+lDzBb2tFh1QlMvi8Z5JugopI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/go-ethereum v1.16.2-cosmos-1 h1:QIaIS6HIdPSBdTvpFhxswhMLUJgcr4irbd2o9ZKldAI= @@ -871,8 +867,8 @@ github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5Rtn github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= -github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= +github.com/cosmos/ledger-cosmos-go v0.15.0 h1:xmizkkEX19tyFLVL6PPMQNg21Jc9W9/bpbwxMDdtxXg= +github.com/cosmos/ledger-cosmos-go v0.15.0/go.mod h1:KJqW5U4/MMl8ICPO4WPjIAyC4TfYRnr28d9N9bBUKWc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -1035,8 +1031,8 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -1429,6 +1425,10 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc h1:ZQlfClnBisF68dbLy+cty/Y25UYMcBdr2CYeUgKCVwY= +github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20250911011846-ab2eecfdcecc/go.mod h1:ngU7B7i5/u4ufHDYBdWERxBfqseQIQ9G+GeVAJs9ha8= +github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc h1:47vuX3B06/4pILuLYlcdXYEh+s5zbA80Fn1PTAcZm7Y= +github.com/mmsqe/cosmos-sdk/store v0.0.0-20250911011846-ab2eecfdcecc/go.mod h1:QY+PHicBEv5N3Pj8Mu9Q17We0w3uIfjhtGDMIwdhofw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -1558,8 +1558,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= @@ -1567,8 +1567,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= -github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= +github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= +github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1724,8 +1724,8 @@ github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtC github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= -github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +github.com/zondax/ledger-go v1.0.0 h1:BvNoksIyRqyQTW78rIZP9A44WwAminKiomQa7jXp9EI= +github.com/zondax/ledger-go v1.0.0/go.mod h1:HpgkgFh3Jkwi9iYLDATdyRxc8CxqxcywsFj6QerWzvo= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.4.0-alpha.1 h1:3yrqQzbRRPFPdOMWS/QQIVxVnzSkAZQYeWlZFv1kbj4= go.etcd.io/bbolt v1.4.0-alpha.1/go.mod h1:S/Z/Nm3iuOnyO1W4XuFfPci51Gj6F1Hv0z8hisyYYOw= @@ -2477,8 +2477,8 @@ google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a h1:SGktgSolFCo75dnHJF2yMvnns6jCmHFJ0vE4Vn2JKvQ= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a/go.mod h1:a77HrdMjoeKbnd2jmgcWdaS++ZLZAEq3orIOAEIKiVw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/mempool/iterator.go b/mempool/iterator.go index b7a75b91c..f10805cc0 100644 --- a/mempool/iterator.go +++ b/mempool/iterator.go @@ -1,11 +1,14 @@ package mempool import ( + "fmt" "math/big" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/holiman/uint256" + "github.com/cometbft/cometbft/crypto/tmhash" + "github.com/cosmos/evm/mempool/miner" "github.com/cosmos/evm/mempool/txpool" msgtypes "github.com/cosmos/evm/x/vm/types" @@ -39,16 +42,27 @@ type EVMMempoolIterator struct { /** Blockchain Access **/ blockchain *Blockchain + + txGases map[string]uint64 } // NewEVMMempoolIterator creates a new unified iterator over EVM and Cosmos transactions. // It combines iterators from both transaction pools and selects transactions based on fee priority. // Returns nil if both iterators are empty or nil. The bondDenom parameter specifies the native // token denomination for fee comparisons, and chainId is used for EVM transaction conversion. -func NewEVMMempoolIterator(evmIterator *miner.TransactionsByPriceAndNonce, cosmosIterator mempool.Iterator, logger log.Logger, txConfig client.TxConfig, bondDenom string, chainID *big.Int, blockchain *Blockchain) mempool.Iterator { +func NewEVMMempoolIterator( + evmIterator *miner.TransactionsByPriceAndNonce, + cosmosIterator mempool.Iterator, + logger log.Logger, + txConfig client.TxConfig, + bondDenom string, + chainID *big.Int, + blockchain *Blockchain, + txGases map[string]uint64, +) mempool.Iterator { // Check if we have any transactions at all hasEVM := evmIterator != nil && !evmIterator.Empty() - hasCosmos := cosmosIterator != nil && cosmosIterator.Tx() != nil + hasCosmos := cosmosIterator != nil && cosmosIterator.Tx().Tx != nil // Add the iterator name to the logger logger = logger.With(log.ModuleKey, "EVMMempoolIterator") @@ -66,6 +80,7 @@ func NewEVMMempoolIterator(evmIterator *miner.TransactionsByPriceAndNonce, cosmo bondDenom: bondDenom, chainID: chainID, blockchain: blockchain, + txGases: txGases, } } @@ -97,10 +112,10 @@ func (i *EVMMempoolIterator) Next() mempool.Iterator { return i } -// Tx returns the current transaction from the iterator. +// Tx returns the current transaction from the iterator as mempool.Tx. // It selects between EVM and Cosmos transactions based on fee priority // and converts EVM transactions to SDK format. -func (i *EVMMempoolIterator) Tx() sdk.Tx { +func (i *EVMMempoolIterator) Tx() mempool.Tx { // Get current transactions from both iterators nextEVMTx, _ := i.getNextEVMTx() nextCosmosTx, _ := i.getNextCosmosTx() @@ -108,15 +123,14 @@ func (i *EVMMempoolIterator) Tx() sdk.Tx { i.logger.Debug("getting current transaction", "has_evm", nextEVMTx != nil, "has_cosmos", nextCosmosTx != nil) // Return the preferred transaction based on fee priority - tx := i.getPreferredTransaction(nextEVMTx, nextCosmosTx) + tx, gasWanted := i.getPreferredTransaction(nextEVMTx, nextCosmosTx) if tx == nil { i.logger.Debug("no preferred transaction available") - } else { - i.logger.Debug("returning preferred transaction") + return mempool.Tx{} } - - return tx + i.logger.Debug("returning preferred transaction") + return mempool.Tx{Tx: tx, GasWanted: gasWanted} } // ============================================================================= @@ -177,7 +191,7 @@ func (i *EVMMempoolIterator) getNextCosmosTx() (sdk.Tx, *uint256.Int) { return nil, nil } - tx := i.cosmosIterator.Tx() + tx := i.cosmosIterator.Tx().Tx if tx == nil { return nil, nil } @@ -193,11 +207,11 @@ func (i *EVMMempoolIterator) getNextCosmosTx() (sdk.Tx, *uint256.Int) { // getPreferredTransaction returns the preferred transaction based on fee priority. // Takes both transaction types as input and returns the preferred one, or nil if neither is available. -func (i *EVMMempoolIterator) getPreferredTransaction(nextEVMTx *txpool.LazyTransaction, nextCosmosTx sdk.Tx) sdk.Tx { +func (i *EVMMempoolIterator) getPreferredTransaction(nextEVMTx *txpool.LazyTransaction, nextCosmosTx sdk.Tx) (sdk.Tx, uint64) { // If no transactions available, return nil if nextEVMTx == nil && nextCosmosTx == nil { i.logger.Debug("no transactions available from either mempool") - return nil + return nil, 0 } // Determine which transaction type to prioritize based on fee comparison @@ -208,17 +222,22 @@ func (i *EVMMempoolIterator) getPreferredTransaction(nextEVMTx *txpool.LazyTrans // Prefer EVM transaction if available and convertible if nextEVMTx != nil { if evmTx := i.convertEVMToSDKTx(nextEVMTx); evmTx != nil { - return evmTx + return evmTx, i.txGases[nextEVMTx.Hash.String()] } } // Fall back to Cosmos if EVM is not available or conversion fails i.logger.Debug("EVM transaction conversion failed, falling back to Cosmos transaction") - return nextCosmosTx } + txBytes, err := i.txConfig.TxEncoder()(nextCosmosTx) + var gasWanted uint64 + if err == nil { + hash := fmt.Sprintf("%X", tmhash.Sum(txBytes)) + gasWanted = i.txGases[hash] + } // Prefer Cosmos transaction i.logger.Debug("preferring Cosmos transaction based on fee comparison") - return nextCosmosTx + return nextCosmosTx, gasWanted } // advanceCurrentIterator advances the appropriate iterator based on which transaction was used diff --git a/mempool/mempool.go b/mempool/mempool.go index 24c3687a4..c0bea8581 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -9,6 +9,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/holiman/uint256" + "github.com/cometbft/cometbft/crypto/tmhash" cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm/mempool/miner" @@ -66,6 +67,8 @@ type ( mtx sync.Mutex eventBus *cmttypes.EventBus + + txGases map[string]uint64 } ) @@ -186,6 +189,7 @@ func NewExperimentalEVMMempool(getCtxCallback func(height int64, prove bool) (sd blockGasLimit: config.BlockGasLimit, minTip: config.MinTip, anteHandler: config.AnteHandler, + txGases: make(map[string]uint64), } vmKeeper.SetEvmMempool(evmMempool) @@ -210,6 +214,16 @@ func (m *ExperimentalEVMMempool) GetTxPool() *txpool.TxPool { // transactions are inserted into the Cosmos sdkmempool. The method assumes // transactions have already passed CheckTx validation. func (m *ExperimentalEVMMempool) Insert(goCtx context.Context, tx sdk.Tx) error { + var gasLimit uint64 + if gasTx, ok := tx.(sdkmempool.GasTx); ok { + gasLimit = gasTx.GetGas() + } + return m.InsertWithGasWanted(goCtx, tx, gasLimit) +} + +// InsertWithGasWanted adds a transaction to the appropriate mempool (EVM or Cosmos) with a specified gasWanted value. +// This method is required to satisfy the ExtMempool interface. +func (m *ExperimentalEVMMempool) InsertWithGasWanted(goCtx context.Context, tx sdk.Tx, gasWanted uint64) (err error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -218,6 +232,7 @@ func (m *ExperimentalEVMMempool) Insert(goCtx context.Context, tx sdk.Tx) error m.logger.Debug("inserting transaction into mempool", "block_height", blockHeight) ethMsg, err := m.getEVMMessage(tx) + if err == nil { // Insert into EVM pool hash := ethMsg.Hash() @@ -228,12 +243,19 @@ func (m *ExperimentalEVMMempool) Insert(goCtx context.Context, tx sdk.Tx) error m.logger.Error("failed to insert EVM transaction", "error", errs[0], "tx_hash", hash) return errs[0] } + m.txGases[hash.String()] = gasWanted m.logger.Debug("EVM transaction inserted successfully", "tx_hash", hash) return nil } // Insert into cosmos pool for non-EVM transactions - m.logger.Debug("inserting Cosmos transaction", "error", err) + + hash, err := m.getCosmosTxHash(tx) + if err != nil { + return err + } + m.txGases[hash] = gasWanted + m.logger.Debug("inserting Cosmos transaction", "tx_hash", hash) err = m.cosmosPool.Insert(goCtx, tx) if err != nil { m.logger.Error("failed to insert Cosmos transaction", "error", err) @@ -243,6 +265,15 @@ func (m *ExperimentalEVMMempool) Insert(goCtx context.Context, tx sdk.Tx) error return err } +func (m *ExperimentalEVMMempool) getCosmosTxHash(tx sdk.Tx) (string, error) { + txBytes, err := m.txConfig.TxEncoder()(tx) + if err == nil { + hash := fmt.Sprintf("%X", tmhash.Sum(txBytes)) + return hash, nil + } + return "", err +} + // InsertInvalidNonce handles transactions that failed with nonce gap errors. // It attempts to insert EVM transactions into the pool as non-local transactions, // allowing them to be queued for future execution when the nonce gap is filled. @@ -284,7 +315,7 @@ func (m *ExperimentalEVMMempool) Select(goCtx context.Context, i [][]byte) sdkme evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain, m.txGases) return combinedIterator } @@ -299,7 +330,7 @@ func (m *ExperimentalEVMMempool) CountTx() int { // Remove removes a transaction from the appropriate sdkmempool. // For EVM transactions, removal is typically handled automatically by the pool // based on nonce progression. Cosmos transactions are removed from the Cosmos pool. -func (m *ExperimentalEVMMempool) Remove(tx sdk.Tx) error { +func (m *ExperimentalEVMMempool) Remove(tx sdk.Tx) (err error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -318,6 +349,7 @@ func (m *ExperimentalEVMMempool) Remove(tx sdk.Tx) error { } else { m.logger.Debug("skipping manual removal of EVM transaction, leaving to mempool to handle", "tx_hash", hash) } + delete(m.txGases, hash.String()) return nil } @@ -326,12 +358,19 @@ func (m *ExperimentalEVMMempool) Remove(tx sdk.Tx) error { } m.logger.Debug("removing Cosmos transaction") + err = m.cosmosPool.Remove(tx) if err != nil { m.logger.Error("failed to remove Cosmos transaction", "error", err) } else { m.logger.Debug("Cosmos transaction removed successfully") + var hash string + hash, err = m.getCosmosTxHash(tx) + if err == nil { + delete(m.txGases, hash) + } } + return err } @@ -371,13 +410,13 @@ func (m *ExperimentalEVMMempool) shouldRemoveFromEVMPool(tx sdk.Tx) bool { // SelectBy iterates through transactions until the provided filter function returns false. // It uses the same unified iterator as Select but allows early termination based on // custom criteria defined by the filter function. -func (m *ExperimentalEVMMempool) SelectBy(goCtx context.Context, i [][]byte, f func(sdk.Tx) bool) { +func (m *ExperimentalEVMMempool) SelectBy(goCtx context.Context, i [][]byte, f func(sdkmempool.Tx) bool) { m.mtx.Lock() defer m.mtx.Unlock() evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain, m.txGases) for combinedIterator != nil && f(combinedIterator.Tx()) { combinedIterator = combinedIterator.Next() diff --git a/tests/integration/mempool/test_mempool_integration.go b/tests/integration/mempool/test_mempool_integration.go index 32e24a4a1..6ce6d29a7 100644 --- a/tests/integration/mempool/test_mempool_integration.go +++ b/tests/integration/mempool/test_mempool_integration.go @@ -292,7 +292,7 @@ func (s *IntegrationTestSuite) TestMempoolSelect() { s.Require().NotNil(tx) // Verify it's an EVM transaction - if ethMsg, ok := tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx); ok { + if ethMsg, ok := tx.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx); ok { ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(1000000000), ethTx.GasPrice()) } else { @@ -357,7 +357,7 @@ func (s *IntegrationTestSuite) TestMempoolIterator() { s.Require().NotNil(tx) // Verify it's an EVM transaction - if ethMsg, ok := tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx); ok { + if ethMsg, ok := tx.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx); ok { ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(1000000000), ethTx.GasPrice()) } else { @@ -466,7 +466,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx1 := iterator.Tx() s.Require().NotNil(tx1) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok) ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(5000000000), ethTx.GasPrice(), "First transaction should be EVM with highest gas price") @@ -478,7 +478,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(tx2) // Should be Cosmos transaction with high fee - feeTx := tx2.(sdk.FeeTx) + feeTx := tx2.Tx.(sdk.FeeTx) cosmosGasPrice := s.calculateCosmosGasPrice(feeTx.GetFee().AmountOf("aatom").BigInt().Int64(), feeTx.GetGas()) s.Require().Equal(big.NewInt(5000000000), cosmosGasPrice, "Second transaction should be Cosmos with 25000 aatom gas price") }, @@ -504,7 +504,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { // First transaction should be high fee tx1 := iterator.Tx() s.Require().NotNil(tx1) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok) ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(5000000000), ethTx.GasPrice()) @@ -534,7 +534,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { // First transaction should be high fee tx1 := iterator.Tx() s.Require().NotNil(tx1) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok) ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(5000000000), ethTx.GasPrice()) @@ -542,7 +542,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx2 := iterator.Tx() s.Require().NotNil(tx2) - ethMsg, ok = tx2.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok = tx2.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok) ethTx = ethMsg.AsTransaction() s.Require().Equal(big.NewInt(1000000000), ethTx.GasPrice()) @@ -573,7 +573,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(tx1) // Calculate gas price: fee_amount / gas_limit = 5000000000 / 200000 = 25000 expectedGasPrice := big.NewInt(5000000000) - feeTx := tx1.(sdk.FeeTx) + feeTx := tx1.Tx.(sdk.FeeTx) actualGasPrice := s.calculateCosmosGasPrice(feeTx.GetFee().AmountOf("aatom").Int64(), feeTx.GetGas()) s.Require().Equal(expectedGasPrice, actualGasPrice, "Expected gas price should match fee_amount/gas_limit") iterator = iterator.Next() @@ -605,7 +605,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(tx1) // Check if first transaction is EVM (preferred when effective tips are equal) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok) ethTx := ethMsg.AsTransaction() // For EVM, effective tip = gas_price - base_fee (assuming base fee = 0) @@ -618,7 +618,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx2 := iterator.Tx() s.Require().NotNil(tx2) - feeTx := tx2.(sdk.FeeTx) + feeTx := tx2.Tx.(sdk.FeeTx) effectiveTip = s.calculateCosmosEffectiveTip(feeTx.GetFee().AmountOf("aatom").Int64(), feeTx.GetGas(), big.NewInt(0)) // base fee = 0 s.Require().Equal(big.NewInt(1000000000), effectiveTip, "Second transaction should be Cosmos with 1000 aatom effective tip") }, @@ -645,7 +645,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx1 := iterator.Tx() s.Require().NotNil(tx1) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok, "First transaction should be EVM due to higher effective tip") ethTx := ethMsg.AsTransaction() effectiveTip := ethTx.GasPrice() // effective_tip = gas_price - 0 @@ -657,7 +657,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx2 := iterator.Tx() s.Require().NotNil(tx2) - feeTx := tx2.(sdk.FeeTx) + feeTx := tx2.Tx.(sdk.FeeTx) effectiveTip2 := s.calculateCosmosEffectiveTip(feeTx.GetFee().AmountOf("aatom").Int64(), feeTx.GetGas(), big.NewInt(0)) // base fee = 0 s.Require().Equal(big.NewInt(2000000000), effectiveTip2, "Second transaction should be Cosmos with 2000 aatom effective tip") }, @@ -684,7 +684,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx1 := iterator.Tx() s.Require().NotNil(tx1) - feeTx := tx1.(sdk.FeeTx) + feeTx := tx1.Tx.(sdk.FeeTx) effectiveTip := s.calculateCosmosEffectiveTip(feeTx.GetFee().AmountOf("aatom").Int64(), feeTx.GetGas(), big.NewInt(0)) // base fee = 0 s.Require().Equal(big.NewInt(5000000000), effectiveTip, "First transaction should be Cosmos with 5000 aatom effective tip") @@ -694,7 +694,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { tx2 := iterator.Tx() s.Require().NotNil(tx2) - ethMsg, ok := tx2.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx2.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok, "Second transaction should be EVM") ethTx := ethMsg.AsTransaction() effectiveTip2 := ethTx.GasPrice() // effective_tip = gas_price - 0 @@ -744,7 +744,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { // First: EVM 8 tx1 := iterator.Tx() s.Require().NotNil(tx1) - ethMsg, ok := tx1.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg, ok := tx1.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok, "First transaction should be EVM with highest gas price") ethTx := ethMsg.AsTransaction() s.Require().Equal(big.NewInt(8000000000), ethTx.GasPrice(), "First transaction should be EVM with 8000 aatom/gas") @@ -754,7 +754,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx2 := iterator.Tx() s.Require().NotNil(tx2) - feeTx2 := tx2.(sdk.FeeTx) + feeTx2 := tx2.Tx.(sdk.FeeTx) cosmosGasPrice2 := s.calculateCosmosGasPrice(feeTx2.GetFee().AmountOf("aatom").Int64(), feeTx2.GetGas()) s.Require().Equal(big.NewInt(6000000000), cosmosGasPrice2, "Second transaction should be Cosmos with 6000 aatom/gas") @@ -763,7 +763,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx3 := iterator.Tx() s.Require().NotNil(tx3) - ethMsg3, ok := tx3.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg3, ok := tx3.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok, "Third transaction should be EVM") ethTx3 := ethMsg3.AsTransaction() s.Require().Equal(big.NewInt(4000000000), ethTx3.GasPrice(), "Third transaction should be EVM with 4000 aatom/gas") @@ -773,7 +773,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx4 := iterator.Tx() s.Require().NotNil(tx4) - feeTx4 := tx4.(sdk.FeeTx) + feeTx4 := tx4.Tx.(sdk.FeeTx) cosmosGasPrice4 := s.calculateCosmosGasPrice(feeTx4.GetFee().AmountOf("aatom").Int64(), feeTx4.GetGas()) s.Require().Equal(big.NewInt(3000000000), cosmosGasPrice4, "Fourth transaction should be Cosmos with 3000 aatom/gas") @@ -782,7 +782,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx5 := iterator.Tx() s.Require().NotNil(tx5) - ethMsg5, ok := tx5.GetMsgs()[0].(*evmtypes.MsgEthereumTx) + ethMsg5, ok := tx5.Tx.GetMsgs()[0].(*evmtypes.MsgEthereumTx) s.Require().True(ok, "Fifth transaction should be EVM") ethTx5 := ethMsg5.AsTransaction() s.Require().Equal(big.NewInt(2000000000), ethTx5.GasPrice(), "Fifth transaction should be EVM with 2000 aatom/gas") @@ -792,7 +792,7 @@ func (s *IntegrationTestSuite) TestTransactionOrdering() { s.Require().NotNil(iterator) tx6 := iterator.Tx() s.Require().NotNil(tx6) - feeTx6 := tx6.(sdk.FeeTx) + feeTx6 := tx6.Tx.(sdk.FeeTx) cosmosGasPrice6 := s.calculateCosmosGasPrice(feeTx6.GetFee().AmountOf("aatom").Int64(), feeTx6.GetGas()) s.Require().Equal(big.NewInt(1000000000), cosmosGasPrice6, "Sixth transaction should be Cosmos with 1000 aatom/gas") @@ -925,13 +925,13 @@ func (s *IntegrationTestSuite) TestSelectBy() { // Track filter function calls to ensure we don't have infinite loops callCount := 0 - wrappedFilter := func(tx sdk.Tx) bool { + wrappedFilter := func(tx mempool.Tx) bool { callCount++ // Prevent infinite loops by failing test if too many calls if callCount > 1000 { s.T().Fatal("Possible infinite loop detected - filter called more than 1000 times") } - return tc.filterFunc(tx) + return tc.filterFunc(tx.Tx) } // Test SelectBy directly diff --git a/tests/integration/mempool/test_mempool_integration_abci.go b/tests/integration/mempool/test_mempool_integration_abci.go index b4aa655f0..97adae52c 100644 --- a/tests/integration/mempool/test_mempool_integration_abci.go +++ b/tests/integration/mempool/test_mempool_integration_abci.go @@ -218,7 +218,7 @@ func (s *IntegrationTestSuite) TestTransactionOrderingWithABCIMethodCalls() { mpool := s.network.App.GetMempool() iterator := mpool.Select(s.network.GetContext(), nil) for _, txHash := range expTxHashes { - actualTxHash := s.getTxHash(iterator.Tx()) + actualTxHash := s.getTxHash(iterator.Tx().Tx) s.Require().Equal(txHash, actualTxHash) iterator = iterator.Next() @@ -430,7 +430,7 @@ func (s *IntegrationTestSuite) TestNonceGappedEVMTransactionsWithABCIMethodCalls // Check whether expected transactions are included and returned as pending state in mempool for _, txHash := range expTxHashes { - actualTxHash := s.getTxHash(iterator.Tx()) + actualTxHash := s.getTxHash(iterator.Tx().Tx) s.Require().Equal(txHash, actualTxHash) iterator = iterator.Next() diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 14c227134..972fcab4a 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -4,8 +4,10 @@ go 1.24.4 require ( cosmossdk.io/systemtests v1.3.0 + github.com/cosmos/cosmos-sdk v0.54.0-rc.1 github.com/ethereum/go-ethereum v1.15.5 github.com/stretchr/testify v1.10.0 + github.com/tidwall/gjson v1.18.0 ) require ( @@ -46,7 +48,6 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.1.3 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect - github.com/cosmos/cosmos-sdk v0.54.0-rc.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect @@ -144,7 +145,6 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect - github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/tidwall/sjson v1.2.5 // indirect From 45f316be4bf2ee799cb0bccd03b9925b4b3a159e Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 11 Sep 2025 09:23:56 +0800 Subject: [PATCH 3/3] doc --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e7dd1ab..fe4e5ee4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - [\#416](https://github.com/cosmos/evm/pull/416) Fix regression in CometBlockResultByNumber when height is 0 to use the latest block. This fixes eth_getFilterLogs RPC. - [\#545](https://github.com/cosmos/evm/pull/545) Check if mempool is not nil before accepting nonce gap error tx. - [\#585](https://github.com/cosmos/evm/pull/585) Use zero constructor to avoid nil pointer panic when BaseFee is 0d +- [\#595](https://github.com/cosmos/evm/pull/595) Fix max_gas_wanted for mempool. ### IMPROVEMENTS