-
Notifications
You must be signed in to change notification settings - Fork 278
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
feat: strict inflation schedule #1578
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com>
also, I think it should be relatively straightforward to write an integration test that measures the exact amount of inflation, and ensures the correct amount (to some level of precision) is being dished out to the pools/funds whatever. I also think we can get a little clever and make the TimeIota consensus parameter very large to force tendermint to add time that never passed to the header. That way, we can simulate time increasing waaaay faster than it actual does and not have to change any constants to watch the rate of inflation decrease/measure a year's worth of inflation. |
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.
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 work on this 👍
// maybeSetGenesisTime sets the genesis time if the current block height is 1. | ||
func maybeSetGenesisTime(ctx sdk.Context, k keeper.Keeper) { | ||
if ctx.BlockHeight() == 1 { | ||
genesisTime := ctx.BlockTime() | ||
minter := k.GetMinter(ctx) | ||
minter.GenesisTime = &genesisTime | ||
k.SetMinter(ctx, minter) | ||
} | ||
} |
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.
I have an alternative proposal to this which you can do in a follow up PR if you choose to. Rather than this, add a line in:
Lines 571 to 578 in 1e60076
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { | |
var genesisState GenesisState | |
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { | |
panic(err) | |
} | |
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) | |
return app.mm.InitGenesis(ctx, app.appCodec, genesisState) | |
} |
Something like:
app.MintKeeper.SetGenesisTime(req.Time)
Which will set the genesis time. This also avoids the problem of PreviousBlockTime
being nil at height 1
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.
githaaaaaaa
for posterity, I asked @sweexordious to approve blindly since we've already approved and should start on any follow ups |
Description
Part of #1570
Implement the strict inflation schedule specified in #1584
Remaining tasks
MintDenom
from param tox/mint
stateTestRandomizedGenState
TestQueryGRPC
/ other integration tests are never runParams
entirelyBlocksPerYear
FLUPs
genesis_time
to mint module's genesis state #1757