-
Notifications
You must be signed in to change notification settings - Fork 202
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
v4 upgrade #393
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7c9a5bf
Hieu/upgrade handler (#392)
asalzmann b52ac1a
Merge branch 'main' into v4
asalzmann 917b9ec
Merge branch 'main' into v4
faddat a547c6a
V4 updated (#399)
asalzmann 77379a9
v4.0.0 and changelog
asalzmann 1d435b4
Merge branch 'v4' of github.com:Stride-Labs/stride into v4
asalzmann eca40f4
added store key instructions to readme
sampocs 1d328c1
Merge branch 'main' into v4
faddat d676275
fix linter
faddat 7790f15
fix nits
faddat 5a6f5ff
increase timeout for golangci-lint
faddat 1c62630
changed snapshot-interval in dockernet to detect pruning issues
sampocs 0bd774a
fixed typo in test scripts
sampocs 56b41e6
v3 -> v4
asalzmann 4b89d37
v3 -> v4
asalzmann c0937f3
bump ledger
asalzmann 2b5b737
go mod tidy
asalzmann f0fd738
changelog
asalzmann b3d18cf
use custom storeloader to adjust authz store height (#405)
catShaark d95face
fixed typo in upgrade handler docstring
sampocs 9d5935c
added return nil to custom authz store loader
sampocs cc899e1
Revert "v3 -> v4"
sampocs 1a5de7d
Revert "v3 -> v4"
sampocs b0ddeb1
go mod tidy
sampocs d9a2054
Merge branch 'main' into v4
faddat 77ccbcc
Merge branch 'main' into v4
sampocs 5a990e1
removed authz store removal from upgrade
sampocs 1d2b8f3
Update CHANGELOG.md
sampocs a291585
fixed upgrade unit tests
sampocs 4735226
Merge branch 'v4' of github.com:Stride-Labs/stride into v4
sampocs 76c5ebf
removed authz from params init
sampocs 30cf02d
updated v4 changelog in upgrades directory
sampocs 32b585d
revert store loader in upgrades
sampocs 6160c14
trimmed upgrade handler
sampocs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
run: | ||
timeout: 5m | ||
timeout: 10m | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package v3_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/Stride-Labs/stride/v4/app/apptesting" | ||
) | ||
|
||
var ( | ||
airdropIdentifiers = []string{"stride", "gaia", "osmosis", "juno", "stars"} | ||
) | ||
|
||
const dummyUpgradeHeight = 5 | ||
|
||
type UpgradeTestSuite struct { | ||
apptesting.AppTestHelper | ||
} | ||
|
||
func (s *UpgradeTestSuite) SetupTest() { | ||
s.Setup() | ||
} | ||
|
||
func TestKeeperTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeTestSuite)) | ||
} | ||
|
||
func (suite *UpgradeTestSuite) TestUpgrade() { | ||
testCases := []struct { | ||
msg string | ||
preUpdate func() | ||
update func() | ||
postUpdate func() | ||
expPass bool | ||
}{ | ||
{ | ||
"Test that upgrade does not panic", | ||
func() { | ||
suite.Setup() | ||
}, | ||
func() { | ||
suite.ConfirmUpgradeSucceededs("v3", dummyUpgradeHeight) | ||
|
||
// make sure claim record was set | ||
afterCtx := suite.Ctx.WithBlockHeight(dummyUpgradeHeight) | ||
for _, identifier := range airdropIdentifiers { | ||
claimRecords := suite.App.ClaimKeeper.GetClaimRecords(afterCtx, identifier) | ||
suite.Require().NotEqual(0, len(claimRecords)) | ||
} | ||
}, | ||
func() { | ||
}, | ||
true, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { | ||
tc.preUpdate() | ||
tc.update() | ||
tc.postUpdate() | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Upgrade v4 Changelog | ||
|
||
1. Dependency bumps ([384178b2c](https://github.com/Stride-Labs/stride/commit/384178b2cf98e9af0815ffaf3c29649f41784f3e)), ([0a2297ea](https://github.com/Stride-Labs/stride/commit/0a2297eabe287d38723ab8213d5256ce34d2bb2d)) | ||
2. Add max claimable tokens query ([613e8571](https://github.com/Stride-Labs/stride/commit/613e85711485d3bebeeb5777ba35e701cc795a43)) | ||
3. Interchain query proto cleanup ([9d5e1f6d](https://github.com/Stride-Labs/stride/commit/9d5e1f6d9e24113afa5b7f21e72a736bc8059b7f)) | ||
4. Add undelegation logging ([e74c34d12](https://github.com/Stride-Labs/stride/commit/e74c34d12a462e2d23463d717abfe01db9490d8f)) | ||
5. v4 upgrade changes | ||
6. Revert HostZoneUnbonding status upon channel restoration ([730cf3d38](https://github.com/Stride-Labs/stride/commit/730cf3d38589887b57dfe3dd5de071273d5a9b73)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v4 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
// Note: ensure these values are properly set before running upgrade | ||
var ( | ||
UpgradeName = "v4" | ||
) | ||
|
||
// CreateUpgradeHandler creates an SDK upgrade handler for v4 | ||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package v4_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/Stride-Labs/stride/v4/app/apptesting" | ||
) | ||
|
||
const dummyUpgradeHeight = 5 | ||
|
||
type UpgradeTestSuite struct { | ||
apptesting.AppTestHelper | ||
} | ||
|
||
func (s *UpgradeTestSuite) SetupTest() { | ||
s.Setup() | ||
} | ||
|
||
func TestKeeperTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeTestSuite)) | ||
} | ||
|
||
func (suite *UpgradeTestSuite) TestUpgrade() { | ||
testCases := []struct { | ||
msg string | ||
preUpdate func() | ||
update func() | ||
postUpdate func() | ||
expPass bool | ||
}{ | ||
{ | ||
"Test that upgrade does not panic", | ||
func() { | ||
suite.Setup() | ||
}, | ||
func() { | ||
suite.ConfirmUpgradeSucceededs("v4", dummyUpgradeHeight) | ||
}, | ||
func() { | ||
}, | ||
true, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { | ||
tc.preUpdate() | ||
tc.update() | ||
tc.postUpdate() | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Rm this file
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.
chatted offline, leaving this in