Skip to content

Commit

Permalink
Problem: recent version of SetPreBlocker is not used (evmos#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe authored Sep 5, 2023
1 parent 1ed6685 commit 52b2310
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
11 changes: 10 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,10 @@ func NewEthermintApp(
feemarket.NewAppModule(app.FeeMarketKeeper, feeMarketSs),
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, evmSs),
)
app.BaseApp.SetMigrationModuleManager(app.mm)

app.mm.SetOrderPreBlockers(
upgradetypes.ModuleName,
)

// During begin block slashing happens after distr.BeginBlocker so that
// there is nothing left over in the validator fee pool, so as to keep the
Expand Down Expand Up @@ -699,6 +702,7 @@ func NewEthermintApp(
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetPreBlocker(app.PreBlocker)
app.SetEndBlocker(app.EndBlocker)
app.setAnteHandler(encodingConfig.TxConfig, cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted)))
// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
Expand Down Expand Up @@ -768,6 +772,11 @@ func (app *EthermintApp) setPostHandler() {
// Name returns the name of the App
func (app *EthermintApp) Name() string { return app.BaseApp.Name() }

// PreBlocker updates every pre begin block
func (app *EthermintApp) PreBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (sdk.ResponsePreBlock, error) {
return app.mm.PreBlock(ctx, req)
}

// BeginBlocker updates every begin block
func (app *EthermintApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.0.1
cosmossdk.io/math v1.1.2
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d
cosmossdk.io/tools/rosetta v0.2.1
github.com/armon/go-metrics v0.4.1
Expand Down Expand Up @@ -54,7 +54,7 @@ require (
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.2.0 // indirect
cosmossdk.io/log v1.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
Expand Down Expand Up @@ -220,7 +220,7 @@ replace (
github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20230412133340-ac70df4b45f6
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.47.0-rc1.0.20230811024733-ced0261a7ebd
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20230905040840-b3af5590283b
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98ok
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/log v1.2.0 h1:BbykkDsutXPSy8RojFB3KZEWyvMsToLy0ykb/ZhsLqQ=
cosmossdk.io/log v1.2.0/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4=
cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg=
cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k=
cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk=
cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4=
cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM=
cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0=
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d h1:E/8y0oG3u9hBR8l4F9MtC0LdZIamPCUwUoLlrHrX86I=
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY=
cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw=
Expand Down Expand Up @@ -386,6 +386,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/cometbft-db v0.0.0-20230412133340-ac70df4b45f6 h1:d4h4Ki1UE/LF6CKwYEm3OZ+HIBCrzSmOokG1vce0O98=
github.com/crypto-org-chain/cometbft-db v0.0.0-20230412133340-ac70df4b45f6/go.mod h1:hF5aclS++7WrW8USOA3zPeKI0CuzwUD2TPYug25ANlQ=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20230905040840-b3af5590283b h1:d2GOFR3i3BjDlPsmJkp8Gsrt9LK2nq2IVEnE/rMv1Fo=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20230905040840-b3af5590283b/go.mod h1:EHwCeN9IXonsjKcjpS12MqeStdZvIdxt3VYXhus3G3c=
github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
Expand Down Expand Up @@ -827,8 +829,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
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/mmsqe/cosmos-sdk v0.47.0-rc1.0.20230811024733-ced0261a7ebd h1:gSI3JiFIUCT4IWfqmT1mt8e4riT8Tc5Vtmd4ztxKu0M=
github.com/mmsqe/cosmos-sdk v0.47.0-rc1.0.20230811024733-ced0261a7ebd/go.mod h1:T9rq+KgUyG8iWcOa3IWH20Y1zBUBVichjBXseDIMkp8=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down
14 changes: 7 additions & 7 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ schema = 3
version = "v1.0.0"
hash = "sha256-ZD1fhIefk3qkt9I4+ed9NBmBqTDvym9cXWmgFBh5qu0="
[mod."cosmossdk.io/log"]
version = "v1.2.0"
hash = "sha256-c3rrloofFFuyW8TikJusWhKh0q9LjXqrD7l6Xdcvmq4="
version = "v1.2.1"
hash = "sha256-2Mb0jQ5Yvi+2fvhCVEiiacwODXM8+6vhsKOnHz+wsiY="
[mod."cosmossdk.io/math"]
version = "v1.0.1"
hash = "sha256-ZTibgcCj1SkZteUzeLUfAca/jx1oZmE7JIPxdWv3QUs="
version = "v1.1.2"
hash = "sha256-i/qHqbA3ptTvIBITkdWITn+owFBwcgJSBiV04MhSGyA="
[mod."cosmossdk.io/simapp"]
version = "v0.0.0-20230608160436-666c345ad23d"
hash = "sha256-6BMBA98BpK3jG6++ZE4LdPQwwpS+lZ0GLMRF1fO4UfM="
Expand Down Expand Up @@ -138,9 +138,9 @@ schema = 3
version = "v1.0.0-beta.2"
hash = "sha256-Am8A44NSxdY77GIEDx1AY+pLU0npeyuTlr3mc4stg3I="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.47.0-rc1.0.20230811024733-ced0261a7ebd"
hash = "sha256-atTk3g1MDW+f1YFoX6KCMIjHo2CT8uz3o2AMvIZ1loU="
replaced = "github.com/mmsqe/cosmos-sdk"
version = "v0.46.0-beta2.0.20230905040840-b3af5590283b"
hash = "sha256-53mdlsAOxUKnk+Ep1KuS1m/mmVZcmZQauLpq9xrzINY="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA="
Expand Down

0 comments on commit 52b2310

Please sign in to comment.