Skip to content
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

v4 upgrade #393

Merged
merged 34 commits into from
Dec 3, 2022
Merged

v4 upgrade #393

merged 34 commits into from
Dec 3, 2022

Conversation

asalzmann
Copy link
Contributor

@asalzmann asalzmann commented Nov 25, 2022

Co-authored-by: Hieu Vu 72878483+hieuvubk@users.noreply.github.com
Co-authored-by: Jacob Gadikian jacobgadikian@gmail.com

Closes: #384

Context and purpose of the change

As part of the v3 upgrade, we added authz. However, we forgot to set the store key as part of the upgrade. As a consequence, after the upgrade, validators that attempted to prune had apphash errors. More details from @chillyvee here.

Brief Changelog

  • Add upgrade_tests to the v3 / v4 upgrade
  • Initialize the params store for the claim and authz modules
  • Add v4 upgrade handler and set the authzkeeper.StoreKey

Author's Checklist

I have...

  • Run and PASSED locally all GAIA integration tests
  • If the change is contentful, I either:
    • Added a new unit test OR
    • Added test cases to existing unit tests
  • OR this change is a trivial rework / code cleanup without any test coverage

If skipped any of the tests above, explain.

Reviewers 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...

  • reviewed state machine logic
  • reviewed API design and naming
  • manually tested (if applicable)
  • confirmed the author wrote unit tests for new logic
  • reviewed documentation exists and is accurate

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md?
  • This pull request updates existing proto field values (and require a backend and frontend migration)?
  • Does this pull request change existing proto field names (and require a frontend migration)?
    How is the feature or change documented?
    • not applicable
    • jira ticket XXX
    • specification (x/<module>/spec/)
    • README.md
    • not documented

Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
@asalzmann asalzmann requested a review from a team November 25, 2022 23:57
@asalzmann asalzmann changed the title Hieu/upgrade handler (#392) v4 upgrade Nov 25, 2022
@asalzmann asalzmann marked this pull request as ready for review November 26, 2022 00:09
@asalzmann
Copy link
Contributor Author

I couldn't push to the other branch (#384) to resolve the linting errors, so created a new one here. There are no changes aside from merging main into the original branch.

@sampocs
Copy link
Collaborator

sampocs commented Nov 26, 2022

See comments in #384
Also, can we add the param store key to the instructions inupgrades/README.md

@asalzmann asalzmann mentioned this pull request Nov 27, 2022
19 tasks
@faddat
Copy link
Collaborator

faddat commented Nov 27, 2022

Others should have a look also note that I merged in main.

@sampocs
Copy link
Collaborator

sampocs commented Nov 27, 2022

@asalzmann this diverged from #384 - wanna merge in the recent changes into this one?

Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com>
@asalzmann
Copy link
Contributor Author

Merged in. @faddat is it possible for me to get access to the notional stride fork? It would simplify the collaboration workflow (right now my workflow is to merge the notional branch into a separate stride branch, then that stride branch into main, which is a bit cumbersome)

@asalzmann asalzmann added the v4 label Nov 27, 2022
@github-actions github-actions bot added the C:CLI label Nov 27, 2022
Copy link
Collaborator

@sampocs sampocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Two nit comments

@@ -36,6 +39,7 @@ var (
type AppTestHelper struct {
suite.Suite

Context sdk.Context
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rm

@@ -57,6 +61,7 @@ func (s *AppTestHelper) Setup() {
GRPCQueryRouter: s.App.GRPCQueryRouter(),
Ctx: s.Ctx(),
}
s.Context = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: StrideChainID, Time: time.Now().UTC()})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rm

@faddat
Copy link
Collaborator

faddat commented Nov 28, 2022

Yes, I'll add you there.

@faddat
Copy link
Collaborator

faddat commented Nov 28, 2022

@asalzmann there's an invite for you at:

https://github.com/notional-labs/stride/invitations

Copy link
Collaborator

@faddat faddat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should change the import path, I think. If we'd like to do that separately, please let me know, and I'll un-request these changes :)

@github-actions github-actions bot added the T:CI label Nov 28, 2022
@sampocs
Copy link
Collaborator

sampocs commented Nov 29, 2022

@asalzmann was the renaming of Stride-LabsStride-labs intentional?

@sampocs
Copy link
Collaborator

sampocs commented Nov 29, 2022

I reverted the v4 import path updates - let's do that in a separate PR as we continue to debug this handler. @faddat can you remove the change request?

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -0,0 +1,6 @@
# Upgrade v4 Changelog
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rm this file

Copy link
Collaborator

@sampocs sampocs Dec 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chatted offline, leaving this in

app/app.go Outdated
@@ -1002,6 +1002,8 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacallbacksmoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

paramsKeeper.Subspace(claimtypes.ModuleName)
paramsKeeper.Subspace(authz.ModuleName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this out of this upgrade

app/upgrades.go Outdated
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
case "v4":
app.SetStoreLoader(AuthzHeightAdjustmentUpgradeStoreLoader(upgradeInfo.Height))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to v5

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// make sure authz module was init
afterCtx := suite.Ctx().WithBlockHeight(dummyUpgradeHeight)
actGenState := suite.App.AuthzKeeper.ExportGenesis(afterCtx)
expGenState := authz.DefaultGenesisState()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@github-actions github-actions bot removed the T:build label Dec 3, 2022
@asalzmann asalzmann merged commit 928618b into main Dec 3, 2022
sontrinh16 pushed a commit to notional-labs/stride that referenced this pull request Mar 27, 2023
Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
Co-authored-by: sampocs <sam.pochyly@gmail.com>
Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com>
Co-authored-by: sampocs <sam@stridelabs.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:app-wiring C:CLI dependencies Pull requests that update a dependency file T:CI v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants