-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
v0.36 supply changes to genesis migration #4686
Conversation
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Once done need to experiment with go plugins to switch types as make parameters Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
… sabau/4409-migrate-genesis
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
…-sdk into sabau/4409-migrate-genesis
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
// Migrate accepts exported genesis state from v0.34 and migrates it to v0.36 | ||
// genesis state. All entries are identical except for validator slashing events | ||
// which now include the period. | ||
func Migrate(oldGenState v034auth.GenesisState) GenesisState { |
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.
This should have a test case:
Given oldGenState
as input
When Migrate(oldGenState)
is called
Then output == expected
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 just added a basic test, I haven't tested the no-op, in this case Params is just forwarded, I was thinking to apply the same logic all over the migrate tests.
This won't hold if we decide to fix this https://github.com/cosmos/cosmos-sdk/pull/4686/files#r301969445
// Migrate accepts exported genesis state from v0.34 and migrates it to v0.36 | ||
// genesis state. It deletes the governance base accounts and creates the new module accounts. | ||
// The remaining accounts are updated to the new GenesisAccount type from 0.36 | ||
func Migrate( |
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.
Ditto - testing is needed here
x/auth/legacy/v0_36/migrate.go
Outdated
|
||
// Migrate accepts exported genesis state from v0.34 and migrates it to v0.36 | ||
// genesis state. All entries are identical except for validator slashing events | ||
// which now include the period. |
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.
Where is the period added?
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.
that comment doesn't apply here, the only change to auth was removing the FeeCollectorKeeper
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
…ed was present or not Signed-off-by: Karoly Albert Szabo <[email protected]>
Addressing this comment: #4686 (comment) Merged to latest commit of master, then made change in only migrate.go and types.go o fx/genaccounts/legacy/v0_36
Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
The simulation used ModuleAccount addresses for standard operations such as delegate, send, etc. To fix this the module account addresses were added to a map in simapp. Then random accounts are checked against this map to ensure the address does not match. Also, after pulling from genesis, accounts who have a module account address are removed from the accounts used for random activity.
I got two failed seeds running the long sim (1000 blocks) today. Genesis file used (exported from mainnet at height 1017669):
|
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 nits, but otherwise LGTM.
@@ -179,6 +169,18 @@ func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val exported.Validato | |||
} | |||
} | |||
|
|||
// update the outstanding rewards and the community pool only if the |
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.
These changes aren't necessary, but I don't see them causing any harm.
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.
ACK
Merging PR. Simulation passes on most seeds. Any subsequent failures should be followed up in new issues/PRs. |
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry:
clog add [section] [stanza] [message]
rereviewed
Files changed
in the github PR explorerFor Admin Use: