Open
Conversation
Author
This part is done in this PR.
I think, instead of defining a parameter in the cosmos-sdk's mint module, we can create a separate subspace in our app for storing such extra parameters and use them in the custom inflation calculator function, which will again be defined in our code. The reason is that this particular parameter is very specific to our way of calculating the inflation and doesn't seem fit to be included in the sdk for generic purposes. |
boz
reviewed
Aug 17, 2021
boz
left a comment
There was a problem hiding this comment.
Looks great - thanks for the light touch on the upstream repo 🚀
x/mint/abci.go
Outdated
| bondedRatio := k.BondedRatio(ctx) | ||
| minter.Inflation = minter.NextInflationRate(params, bondedRatio) | ||
| if ic == nil { | ||
| minter.Inflation = minter.NextInflationRate(params, bondedRatio) |
There was a problem hiding this comment.
Can minter.NextInflationRate() be turned into a types.InflationCalculationFn function so that it can be the default?
boz
approved these changes
Oct 12, 2021
Author
|
Added PR in origin cosmos#10441 |
This was referenced Oct 27, 2021
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The Akash whitepaper defines a time-based function for the inflation:
I(t). The waycosmos-sdkcurrently calculates inflation is different as compared to what the Akash whitepaper prescribes. So, we need thecosmos-sdkto accept a custom function to calculate inflation. When the custom function isn't provided, it should use the default inflation calculation logic as it currently does.The inflation function defined in the Akash whitepaper does not account for the inflation range that is an important piece of cosmos inflation mechanics. It is proposed that we add a chain parameter for deriving a range from
I(t). Let's call the chain parameterR. It will be a percentage ofI(t). So fromI(t), we can get a range[I(t) - I(t) * R, I(t) + I(t) * R], and then we can input that range as min, max inflation parameters of the current inflation mechanics.Author Checklist
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.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers 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...
!in the type prefix if API or client breaking change