Skip to content

Commit 1271519

Browse files
committed
cleanup
1 parent 1526ab9 commit 1271519

File tree

6 files changed

+21
-27
lines changed

6 files changed

+21
-27
lines changed

app/app.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,9 @@ func NewEthermintApp(
820820
preEstimate := cast.ToBool(appOpts.Get(server.FlagBlockSTMPreEstimate))
821821
txDecoder := txConfig.TxDecoder()
822822
stores := app.GetStoreKeys()
823-
app.SetTxExecutor(baseapp.STMTxExecutor(stores, workers, preEstimate, txDecoder,
824-
func(txs [][]byte, workers int, txDecoder sdk.TxDecoder, ms storetypes.MultiStore) ([]sdk.Tx, []blockstm.MultiLocations) {
823+
var preEstimateFn func(txs [][]byte, workers int, txDecoder sdk.TxDecoder, ms storetypes.MultiStore) ([]sdk.Tx, []blockstm.MultiLocations)
824+
if preEstimate {
825+
preEstimateFn = func(txs [][]byte, workers int, txDecoder sdk.TxDecoder, ms storetypes.MultiStore) ([]sdk.Tx, []blockstm.MultiLocations) {
825826
var authStore, bankStore int
826827
index := make(map[storetypes.StoreKey]int, len(stores))
827828
for i, k := range stores {
@@ -835,7 +836,9 @@ func NewEthermintApp(
835836
}
836837
evmDenom := app.EvmKeeper.GetParams(sdk.NewContext(ms, cmtproto.Header{}, false, log.NewNopLogger())).EvmDenom
837838
return preEstimates(txs, workers, authStore, bankStore, evmDenom, txDecoder)
838-
}))
839+
}
840+
}
841+
app.SetTxExecutor(baseapp.STMTxExecutor(stores, workers, txDecoder, preEstimateFn))
839842
case "", config.BlockExecutorSequential:
840843
app.SetTxExecutor(baseapp.DefaultTxExecutor)
841844
default:

app/executor.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@ import (
66
"cosmossdk.io/collections"
77
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
88
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
9-
evmtypes "github.com/evmos/ethermint/x/evm/types"
109

1110
sdk "github.com/cosmos/cosmos-sdk/types"
1211

1312
blockstm "github.com/crypto-org-chain/go-block-stm"
1413
)
1514

16-
type evmKeeper interface {
17-
GetParams(ctx sdk.Context) evmtypes.Params
18-
}
19-
2015
// preEstimates returns a static estimation of the written keys for each transaction.
2116
// NOTE: make sure it sync with the latest sdk logic when sdk upgrade.
2217
func preEstimates(txs [][]byte, workers, authStore, bankStore int, evmDenom string, txDecoder sdk.TxDecoder) ([]sdk.Tx, []blockstm.MultiLocations) {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ require (
242242

243243
replace (
244244
// release/v0.50.x
245-
cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211071648-a1364555c691
246-
cosmossdk.io/x/tx => github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211071648-a1364555c691
247-
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211071648-a1364555c691
245+
cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211125221-bdd2a717b727
246+
cosmossdk.io/x/tx => github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211125221-bdd2a717b727
247+
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211125221-bdd2a717b727
248248
)
249249

250250
replace (

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,12 +867,12 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
867867
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
868868
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
869869
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
870-
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211071648-a1364555c691 h1:dsHxkRgPYkpvULAmatJuZestt/AR6g3B9MMnlgJfbG0=
871-
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211071648-a1364555c691/go.mod h1:u+LHV+8Y4uVyVbAGNxWjLYuP3vYXVqTJCk0dx3uC0pM=
872-
github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211071648-a1364555c691 h1:b2RwVoB5zHr+GqrPGiVe3mVxFwEaOPwUIVIxb8DAL+w=
873-
github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211071648-a1364555c691/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
874-
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211071648-a1364555c691 h1:iMghgVFWtj/BgTluwUcN9sHXxnbPsktiWVM5Wl8ImWk=
875-
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211071648-a1364555c691/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
870+
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211125221-bdd2a717b727 h1:udBg1BHe3JqWzaSVCKv5cFz1E6CzBbH/b+MZ7P6qHqc=
871+
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20241211125221-bdd2a717b727/go.mod h1:bkUh1YaLvBd4WAYd8iE0xwpHecaqH8A7vg6v/YCj0yo=
872+
github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211125221-bdd2a717b727 h1:tBO96f5iFZkDQ9iaCQDOo1LqkaPnK3qkWu5YPf2HCH0=
873+
github.com/mmsqe/cosmos-sdk/store v0.0.0-20241211125221-bdd2a717b727/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
874+
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211125221-bdd2a717b727 h1:44ZCPtIljY5TX30Zrllv8zADd5Mie0l0/UQPIaoLXrQ=
875+
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20241211125221-bdd2a717b727/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
876876
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
877877
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
878878
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=

gomod2nix.toml

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

x/evm/types/response.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ import (
1111

1212
type EvmTxResponsePatcher struct{}
1313

14+
// Patch fills the evm tx index and log indexes in the tx result
1415
func (p EvmTxResponsePatcher) Patch(input []*abci.ExecTxResult) []*abci.ExecTxResult {
15-
return PatchTxResponses(input)
16-
}
17-
18-
// PatchTxResponses fills the evm tx index and log indexes in the tx result
19-
func PatchTxResponses(input []*abci.ExecTxResult) []*abci.ExecTxResult {
2016
var (
2117
txIndex uint64
2218
logIndex uint64

0 commit comments

Comments
 (0)