-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
R4R: Inflation bug fixes #2982
R4R: Inflation bug fixes #2982
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2982 +/- ##
===========================================
+ Coverage 55.5% 55.57% +0.06%
===========================================
Files 120 120
Lines 8494 8488 -6
===========================================
+ Hits 4715 4717 +2
+ Misses 3457 3449 -8
Partials 322 322 |
Interesting, one seed failing: go test ./cmd/gaia/app -run TestGaiaSimulationAfterImport -SimulationEnabled=true -SimulationNumBlocks=50 -SimulationVerbose=true -SimulationCommit=true -SimulationSeed=981928 -v -timeout 24h with panic: invariant broken: loose token invariance:
pool.LooseTokens: 78540599.9265062257
sum of account tokens: 78540599.9265062218 [recovered]
panic: invariant broken: loose token invariance:
pool.LooseTokens: 78540599.9265062257
sum of account tokens: 78540599.9265062218 |
Pinned to these lines in app.assertRuntimeInvariantsWith(ctx)
fmt.Printf("pre-deletion")
// delete all distribution infos
// these will be recreated in InitGenesis
app.distrKeeper.RemoveValidatorDistInfos(ctx)
app.distrKeeper.RemoveDelegationDistInfos(ctx)
// assert again
app.assertRuntimeInvariantsWith(ctx)
fmt.Printf("post-deletion") Fails between "pre-deletion" and "post-deletion". Somehow, it's not safe to delete distribution infos after (theoretically) withdrawing everything from them. |
One --- FAIL: TestGaiaSimulationAfterImport (6.25s)
panic: valInfo: {OperatorAddr:35D5DAA716545B6F6A574E9F75061912DD08D0DF FeePoolWithdrawalHeight:50 DelAccum:{UpdateHeight:50 Accum:0.0000000000} DelPool:[{Denom:STAKE Amount:0.0000000039}] ValCommission:[]} [recovered]
panic: valInfo: {OperatorAddr:35D5DAA716545B6F6A574E9F75061912DD08D0DF FeePoolWithdrawalHeight:50 DelAccum:{UpdateHeight:50 Accum:0.0000000000} DelPool:[{Denom:STAKE Amount:0.0000000039}] ValCommission:[]} |
OK, confirmed that all the delegation infos have zero rewards, looks like occasional |
Let's benchmark the actual cost per block of this! |
@rigelrozanski Added benchmarks in 60cf1f4 - total for both looks like ~2200 ns. |
|
||
## NextInflationRate | ||
|
||
The target annual inflation rate is recalculated at the first block of each new | ||
hour. The inflation is also subject to a rate change (positive or negative) | ||
The target annual inflation rate is recalculated each block. |
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.
Does this warrant any changes to the distribution spec (e.g. Affects on Staking
)?
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.
Changes look good. Not sure if any further documentation needs to be updated? Also, not sure if this has any other implications on the state machine.
Sounds like we should get this in for GoS as #2984 depends on it? |
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.
few minor comments which should be addressed still, but approving
* PENDING.md; swap BeginBlocker ordering * Calculate inflation every block * Update x/mint spec * Reset distribution info bond height instead
@cwgoes @jackzampolin is it correct, that
|
Closes #2967
Changes:
Standard checklist:
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: