-
Notifications
You must be signed in to change notification settings - Fork 562
chore(evm): Deprecate x/params usage in x/evm #1472
chore(evm): Deprecate x/params usage in x/evm #1472
Conversation
…ping params in module Keeper
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1472 +/- ##
==========================================
- Coverage 68.65% 68.52% -0.14%
==========================================
Files 105 106 +1
Lines 9954 10077 +123
==========================================
+ Hits 6834 6905 +71
- Misses 2737 2775 +38
- Partials 383 397 +14
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should register amino encoding for the new messages
Also some tests are failing, can you please check |
# Conflicts: # app/ante/eth.go # client/docs/statik/statik.go # rpc/backend/backend_suite_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff @Vvaradinov. Left a couple of small comments and have this question:
When executing any CLI command with this branch checked out, I get the following warnings:
ethermintd keys list
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.Params
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.ExtraEIPs
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.ChainConfig
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.State
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.TransactionLogs
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.Log
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.TxResult
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.AccessTuple
2022/12/09 13:18:45 proto: duplicate proto type registered: ethermint.evm.v1.TraceConfig
...
Is this to be expected?
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
…ps://github.com/evmos/ethermint into Vvaradinov/refactor-deprecated-evm-params-logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @Vvaradinov !! LGTM! Left a few nit comments
…ps://github.com/evmos/ethermint into Vvaradinov/refactor-deprecated-evm-params-logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Requesting the same comments as the other PRs
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK! Minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one @Vvaradinov utACK
Description
This PR is the first of a series of changes that need to be made to all modules in the Ethermint and Evmos repos.
The Cosmos SDK
x/params
module has been deprecated in favor of each module housing and providing way to modify their parameters. Each module that has parameters that are changeable during runtime have an authority, the authority can be a module or user account. The Cosmos-SDK team recommends migrating modules away from using the param module. An example of how this could look like can be found cosmos/cosmos-sdk#12363.Notes
tx.proto
- Added new tx proto messageMsgUpdateParams
authority
which we set inapp.go
to the address of the Cosmos SDK governance module. This means only after a sucesfull governance proposal the x/gov module account can make the param change.keeper/params.go
- Where parameter getter and set functions live. This has been refactored so now parameters are set by the individual key directly in the store. A getter function for each of the parameters has been created for ease of use.keeper/msg_server
- A newUpdateParams
function was added that chcekcs if the correctauthority
is provided and updates the parameters.keeper/keeper.go
- The now deprecatedparamstore
has been removed and anauthority
has been added to theKeeper
structtypes/interfaces.go
- This defines a newLegacyParams
type with aSubspace
interface from the now deprecatedx/params
module solely for the purpose of making an in-store migration.types/codec.go
- A new interface needs to be registered in theRegisterInterfaces
function.evm
module anAminoCdc
needs to be registered in order to support EIP-712keeper/migrations.go
- Where all migration functions live. We have added the legacySubspacetypes.Subspace
to theMigrator
struct in order to use in the migration process.migrations
- The migrations folder contains all store upgrade versions and their respective changes. Amigrate.go
file defines the changes and in this case where we obtain the current params from the depreactedx/params
module and store the new params directly in the module store.This folder may also contain a copy of the
types
and generated proto files to isolate and keep a copy of the state at that version.NOTE - all previous version migrations were deleted because they were dependent on the
x/params
modulehandler.go
- AMsgUpdateParams
route has been added that routes messages to theUpdateParams
function.module.go
ConsensusVersion
is set to the latest migration.Route
should register theNewHandler
for our messages..Subspace
has been added to theAppModule
in order to use for the migration.RegisterServices
and it panics if the migration encounters an error.To manually test the new message you need to generate a json proposal. An easy way to generate one is with the CLI command
ethermintd tx gov draft-proposal
. Following the steps the proposal json file should look something like this:Here I am changing the
EVMDenom
toavlad
Closes: ENG-1037