From 123564daaffadfe836ef4c8b4e264c0752bbbbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= Date: Mon, 29 Nov 2021 14:34:57 +0100 Subject: [PATCH 1/3] feat: store migration setup --- x/evm/keeper/migrations.go | 13 +++++++++++++ x/evm/module.go | 6 +++--- x/feemarket/keeper/migrations.go | 13 +++++++++++++ x/feemarket/module.go | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 x/evm/keeper/migrations.go create mode 100644 x/feemarket/keeper/migrations.go diff --git a/x/evm/keeper/migrations.go b/x/evm/keeper/migrations.go new file mode 100644 index 0000000000..3be1ada66f --- /dev/null +++ b/x/evm/keeper/migrations.go @@ -0,0 +1,13 @@ +package keeper + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper Keeper +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper Keeper) Migrator { + return Migrator{ + keeper: keeper, + } +} diff --git a/x/evm/module.go b/x/evm/module.go index 8c38bf55d7..ff07071ebe 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -115,15 +115,15 @@ func (AppModule) Name() string { // RegisterInvariants interface for registering invariants. Performs a no-op // as the evm module doesn't expose invariants. func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - // Invariats lead to performance degradation - // - // keeper.RegisterInvariants(ir, *am.keeper) } // RegisterQueryService registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + _ = keeper.NewMigrator(*am.keeper) } // Route returns the message routing key for the evm module. diff --git a/x/feemarket/keeper/migrations.go b/x/feemarket/keeper/migrations.go new file mode 100644 index 0000000000..3be1ada66f --- /dev/null +++ b/x/feemarket/keeper/migrations.go @@ -0,0 +1,13 @@ +package keeper + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper Keeper +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper Keeper) Migrator { + return Migrator{ + keeper: keeper, + } +} diff --git a/x/feemarket/module.go b/x/feemarket/module.go index f6937e8802..88939671be 100644 --- a/x/feemarket/module.go +++ b/x/feemarket/module.go @@ -116,6 +116,8 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + _ = keeper.NewMigrator(am.keeper) } // Route returns the message routing key for the fee market module. From 042bd0600311982c297ba16c037ff4a685bb1fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= Date: Mon, 29 Nov 2021 14:43:24 +0100 Subject: [PATCH 2/3] comment --- cmd/ethermintd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index 6ac50016b7..277bf1b5f3 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -99,7 +99,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), ), genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), - genutilcli.MigrateGenesisCmd(), + genutilcli.MigrateGenesisCmd(), // TODO: shouldn't this include the local app version instead of the SDK? genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), From 4d4f0ad5722a6833d65fdff9c43ae085c65ba6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= Date: Mon, 29 Nov 2021 14:52:25 +0100 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c882c92b..156472405f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,11 +39,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Improvements +* (app) [tharsis#794](https://github.com/tharsis/ethermint/pull/794) Setup in-place store migrators. * (ci) [tharsis#784](https://github.com/tharsis/ethermint/pull/784) Enable automatic backport of PRs. * (rpc) [tharsis#786](https://github.com/tharsis/ethermint/pull/786) Improve error message of `SendTransaction`/`SendRawTransaction` JSON-RPC APIs. ### Bug Fixes +* (evm) [tharsis#794](https://github.com/tharsis/ethermint/pull/794) Register EVM gRPC `Msg` server. * (feemarket) [tharsis#770](https://github.com/tharsis/ethermint/pull/770) Enable fee market (EIP1559) by default. * (rpc) [tharsis#769](https://github.com/tharsis/ethermint/pull/769) Fix default Ethereum signer for JSON-RPC. * (rpc) [tharsis#781](https://github.com/tharsis/ethermint/pull/781) Fix get block invalid transactions filter.