This repository was archived by the owner on Apr 4, 2024. It is now read-only.
chore(evm): Deprecate x/params usage in x/evm#1472
Merged
Conversation
…ping params in module Keeper
11 tasks
11 tasks
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
|
fedekunze
reviewed
Nov 18, 2022
Contributor
ramacarlucho
left a comment
There was a problem hiding this comment.
We should register amino encoding for the new messages
Contributor
|
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
Contributor
MalteHerrmann
left a comment
There was a problem hiding this comment.
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
GAtom22
reviewed
Dec 12, 2022
Contributor
GAtom22
left a comment
There was a problem hiding this comment.
Great work @Vvaradinov !! LGTM! Left a few nit comments
…ps://github.com/evmos/ethermint into Vvaradinov/refactor-deprecated-evm-params-logic
fedekunze
suggested changes
Dec 16, 2022
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
danburck
approved these changes
Jan 4, 2023
Contributor
danburck
left a comment
There was a problem hiding this comment.
nice one @Vvaradinov utACK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/paramsmodule 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 messageMsgUpdateParamsauthoritywhich we set inapp.goto 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 newUpdateParamsfunction was added that chcekcs if the correctauthorityis provided and updates the parameters.keeper/keeper.go- The now deprecatedparamstorehas been removed and anauthorityhas been added to theKeeperstructtypes/interfaces.go- This defines a newLegacyParamstype with aSubspaceinterface from the now deprecatedx/paramsmodule solely for the purpose of making an in-store migration.types/codec.go- A new interface needs to be registered in theRegisterInterfacesfunction.evmmodule anAminoCdcneeds to be registered in order to support EIP-712keeper/migrations.go- Where all migration functions live. We have added the legacySubspacetypes.Subspaceto theMigratorstruct in order to use in the migration process.migrations- The migrations folder contains all store upgrade versions and their respective changes. Amigrate.gofile defines the changes and in this case where we obtain the current params from the depreactedx/paramsmodule and store the new params directly in the module store.This folder may also contain a copy of the
typesand 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/paramsmodulehandler.go- AMsgUpdateParamsroute has been added that routes messages to theUpdateParamsfunction.module.goConsensusVersionis set to the latest migration.Routeshould register theNewHandlerfor our messages..Subspacehas been added to theAppModulein order to use for the migration.RegisterServicesand 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:{ "messages": [ { "@type": "/ethermint.evm.v1.MsgUpdateParams", "authority": "ethm10d07y265gmmuvt4z0w9aw880jnsr700jpva843", "params": { "evm_denom": "avlad", "enable_create": false, "enable_call": false, "extra_eips": { "extra_eips": [] }, "chain_config": { "homestead_block": null, "dao_fork_block": null, "dao_fork_support": false, "eip150_block": null, "eip150_hash": "", "eip155_block": null, "eip158_block": null, "byzantium_block": null, "constantinople_block": null, "petersburg_block": null, "istanbul_block": null, "muir_glacier_block": null, "berlin_block": null, "london_block": null, "arrow_glacier_block": null, "gray_glacier_block": null, "merge_netsplit_block": null, "shanghai_block": null, "cancun_block": null }, "allow_unprotected_txs": false } } ], "metadata": "ipfs://CID", "deposit": "20aphoton" }Here I am changing the
EVMDenomtoavladCloses: ENG-1037