-
Notifications
You must be signed in to change notification settings - Fork 286
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
[Feature] Prevent state reset of treasury after hard fork #318
Conversation
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.
Many changes are not related to the stated purpose of the PR. consider moving them to separate pull requests. Also, there is a spelling error in the PR title: pork --> fork
@@ -27,7 +27,6 @@ const ( | |||
BlocksPerWeek = util.BlocksPerWeek | |||
BlocksPerMonth = util.BlocksPerMonth | |||
BlocksPerYear = util.BlocksPerYear | |||
BlocksPerEpoch = util.BlocksPerEpoch |
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.
Removing blocksPerEpoch seems to be a big decision, also one that is quite different from the stated purpose of this pull request. Consider moving to another pull request to avoid future confusion.
@@ -36,7 +41,7 @@ func (k Keeper) alignCoins(ctx sdk.Context, coins sdk.DecCoins, denom string) (a | |||
|
|||
// UpdateIndicators updates interal indicators | |||
func (k Keeper) UpdateIndicators(ctx sdk.Context) { | |||
epoch := core.GetEpoch(ctx) |
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.
Also seems like code changes that are not relevant to treasury data reset
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.
Understood on necessary changes
Summary of changes
Now we introduce
CumulatedHeight
to keep indicator histories which are stored per each epoch even if the block height is reset (at hard fork).When we export genesis for zero height, it will update
CumulatedHeight
toCumulatedHeight
+ctx.BlockHeight()
for next chain without deleting indicator histories.close #317
Report of required housekeeping
(FOR ADMIN) Before merging