Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(inflation): Deprecate x/params usage in x/inflation #1107

Merged
merged 34 commits into from
Dec 16, 2022

Conversation

Vvaradinov
Copy link
Contributor

Description

Deprecate the usage of the now legacy Cosmos SDK params module within x/inflation.

As of 0.47.0 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.

Closes: ENG-1076, ENG-582


All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

PR review checkboxes:

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • included the correct type prefix in the PR title
  • targeted the correct branch (see PR Targeting)
  • provided a link in the PR description to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all required CI checks have passed

Code maintenance:

I have...

  • written unit and integration tests
  • added relevant godoc and code comments.
  • updated relevant documentation (docs/) or specification (x/<module>/spec/)

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code

@linear
Copy link

linear bot commented Nov 24, 2022

ENG-1076 Deprecate Cosmos x/params logic from Inflation module

In relation to ENG-965

ENG-582 Fix inflation params

Current

Inflation params are not defines as the expected convention:

	ParamStoreKeyMintDenom              = []byte("ParamStoreKeyMintDenom")
	ParamStoreKeyExponentialCalculation = []byte("ParamStoreKeyExponentialCalculation")
	ParamStoreKeyInflationDistribution  = []byte("ParamStoreKeyInflationDistribution")
	ParamStoreKeyEnableInflation        = []byte("ParamStoreKeyEnableInflation")

Expected

Inflation params should be

	ParamStoreKeyMintDenom              = []byte("MintDenom")
	ParamStoreKeyExponentialCalculation = []byte("ExponentialCalculation")
	ParamStoreKeyInflationDistribution  = []byte("InflationDistribution")
	ParamStoreKeyEnableInflation        = []byte("EnableInflation")

Notes

This change requires a store migration

@github-actions github-actions bot added the proto label Nov 24, 2022
x/inflation/types/msg.go Fixed Show fixed Hide fixed
@Vvaradinov Vvaradinov changed the title chore(inflation): Refactor module params storage to version 0.47.0 Cosmos SDK chore(inflation): Deprecate x/params usage in x/inflation Nov 25, 2022
@Vvaradinov Vvaradinov marked this pull request as ready for review December 1, 2022 12:56
Copy link
Contributor

@GAtom22 GAtom22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work Vlad! Left a few comments and questions

app/app.go Outdated Show resolved Hide resolved
proto/evmos/inflation/v1/tx.proto Outdated Show resolved Hide resolved
x/inflation/genesis.go Outdated Show resolved Hide resolved
x/inflation/genesis.go Outdated Show resolved Hide resolved
x/inflation/handler.go Outdated Show resolved Hide resolved
x/inflation/handler.go Outdated Show resolved Hide resolved
x/inflation/keeper/keeper.go Outdated Show resolved Hide resolved
x/inflation/keeper/msg_server.go Outdated Show resolved Hide resolved
x/inflation/keeper/msg_server.go Outdated Show resolved Hide resolved
x/inflation/types/msg.go Outdated Show resolved Hide resolved
Vvaradinov and others added 3 commits December 1, 2022 17:49
Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
Copy link
Contributor

@MalteHerrmann MalteHerrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK! Two minor comments

proto/evmos/inflation/v1/tx.proto Outdated Show resolved Hide resolved
x/inflation/module.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Vvaradinov, the parameter change proposal passes, it should also update the inflation rate

EDIT: let's coordinate about those changes with @danburck

proto/evmos/inflation/v1/tx.proto Outdated Show resolved Hide resolved
x/inflation/keeper/msg_server.go Show resolved Hide resolved
x/inflation/keeper/msg_server.go Show resolved Hide resolved
x/inflation/keeper/params.go Outdated Show resolved Hide resolved
fedekunze and others added 2 commits December 15, 2022 00:08
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #1107 (1be6c8f) into main (71ee45d) will decrease coverage by 0.19%.
The diff coverage is 64.86%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1107      +/-   ##
==========================================
- Coverage   77.02%   76.82%   -0.20%     
==========================================
  Files         146      149       +3     
  Lines        8022     8061      +39     
==========================================
+ Hits         6179     6193      +14     
- Misses       1662     1682      +20     
- Partials      181      186       +5     
Impacted Files Coverage Δ
x/inflation/keeper/keeper.go 77.77% <33.33%> (-11.70%) ⬇️
x/inflation/types/codec.go 41.66% <41.66%> (+41.66%) ⬆️
x/inflation/types/msg.go 50.00% <50.00%> (ø)
x/inflation/keeper/params.go 64.70% <60.00%> (-35.30%) ⬇️
x/inflation/keeper/msg_server.go 66.66% <66.66%> (ø)
x/inflation/migrations/v2/migrate.go 78.57% <78.57%> (ø)
app/app.go 81.81% <100.00%> (ø)
x/inflation/keeper/migrations.go 100.00% <100.00%> (ø)
x/inflation/types/params.go 86.51% <100.00%> (-2.38%) ⬇️

@Vvaradinov Vvaradinov enabled auto-merge (squash) December 15, 2022 15:40
x/inflation/types/msg.go Show resolved Hide resolved
x/inflation/types/msg.go Outdated Show resolved Hide resolved
x/inflation/migrations/v2/migrate_test.go Show resolved Hide resolved
x/inflation/keeper/params.go Show resolved Hide resolved
@fedekunze fedekunze merged commit 6d17942 into main Dec 16, 2022
@fedekunze fedekunze deleted the Vvaradinov/inflation-params-refactor branch December 16, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants