-
Notifications
You must be signed in to change notification settings - Fork 774
chore!: add signing-info migration #2886
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
Merged
Merged
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
e085b40
chore: merge main into feat/sdk-47-ibc-7 branch (#2625)
sainoe a8f0e87
resolve merge conflicts
mpoke ec7c870
feat!: SDK v0.47 & IBC v7 Base (#2541)
glnro f5fc4ba
feat: refactor base E2E tests (#2587)
sainoe 0510ee7
feat: refactor global fee module for SDK v47 (#2660)
sainoe 861ba39
deps: bump ics to v3.1; chore: update e2e (#2663)
MSalopek 2e4d98d
chore: refactor remaining E2E tests for SDK v47 (#2744)
sainoe ff8acab
deps: bump go version to 1.21
MSalopek d0a672a
tests: update hermes images and setup (#2841)
MSalopek 21a192a
deps: use lsm cosmos-sdk fork and ics 3.3.0-rc0-lsm (#2842)
MSalopek b4730f5
chore!: merge main into feat/sdk-47-ibc7 (#2851)
MSalopek 925bfee
chore: merge main into feat/sdk-47-ibc-7; update broken tests (#2853)
MSalopek df6cb1a
Merge branch 'main' into feat/sdk-47-ibc-7
MSalopek a91f8cf
chore: post-merge cleanup
MSalopek fd63f6e
chore: post-merge cleanup
MSalopek ce86f31
chore: post-merge cleanup
MSalopek 1b54845
deps: update migration to use latest cosmos-sdk/lsm
MSalopek c9b7817
chore: appease linter
MSalopek 16a9c97
chore!: add min commission rates migration (prop 826)
MSalopek ed041ce
chore: add migration tests for v15
MSalopek ed08c80
chore: rm 3rd party
MSalopek 304e982
migration: change MaxRate to match 0.05 if not provided
MSalopek 89c5afe
nit: add back removed lines from historic v7 migration
MSalopek b5f8207
Merge branch 'feat/sdk-47-ibc-7' into masa/migrate-v15-validator-comm…
mpoke f9e494f
save
sainoe e75e9b6
lint
sainoe 4a30eee
nit
sainoe 1516387
refactoring
sainoe 8a5d155
add CHANGELOG entry
sainoe 8a0b312
nits
sainoe 6b0f529
lint
sainoe 18db793
nit
sainoe 8a85583
refactor
sainoe 9bb3ce7
add .changelog entry
sainoe 2e9e16a
nits
sainoe 726f35c
Merge branch 'masa/migrate-v15-validator-commission-rates' into saino…
sainoe 0aebe9b
doc
sainoe 5967097
remove MinCommissionRate migration rebase
sainoe 7e58f6b
simplify test
sainoe 2516a55
Update .changelog/unreleased/state-breaking/2866-migrate-signing-info…
sainoe a00cd0b
add logs
sainoe c57984f
remove panics
sainoe 238bd8d
Merge branch 'main' into sainoe/v15-si-upgrade
sainoe 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
5 changes: 5 additions & 0 deletions
5
.changelog/unreleased/state-breaking/2866-migrate-signing-infos.md
This file contains hidden or 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,5 @@ | ||
| Migrate the signing infos of validators for which the consensus address is missing. | ||
| ([\#2866](https://github.com/cosmos/gaia/pull/2866)) | ||
|
|
||
|
|
||
|
|
This file contains hidden or 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 hidden or 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,73 @@ | ||
| package v15_test | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
|
|
||
| tmproto "github.com/cometbft/cometbft/proto/tendermint/types" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/testutil/mock" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" | ||
|
|
||
| "github.com/cosmos/gaia/v15/app/helpers" | ||
| v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" | ||
| ) | ||
|
|
||
| func TestUpgradeSigningInfos(t *testing.T) { | ||
| gaiaApp := helpers.Setup(t) | ||
| ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) | ||
| slashingKeeper := gaiaApp.SlashingKeeper | ||
|
|
||
| signingInfosNum := 8 | ||
| emptyAddrSigningInfo := make(map[string]struct{}) | ||
|
|
||
| // create some dummy signing infos, half of which with an empty address field | ||
| for i := 0; i < signingInfosNum; i++ { | ||
| pubKey, err := mock.NewPV().GetPubKey() | ||
| require.NoError(t, err) | ||
|
|
||
| consAddr := sdk.ConsAddress(pubKey.Address()) | ||
| info := slashingtypes.NewValidatorSigningInfo( | ||
| consAddr, | ||
| 0, | ||
| 0, | ||
| time.Unix(0, 0), | ||
| false, | ||
| 0, | ||
| ) | ||
|
|
||
| if i < signingInfosNum/2 { | ||
| info.Address = "" | ||
| emptyAddrSigningInfo[consAddr.String()] = struct{}{} | ||
| } | ||
|
|
||
| slashingKeeper.SetValidatorSigningInfo(ctx, consAddr, info) | ||
| require.NoError(t, err) | ||
| } | ||
|
|
||
| require.Equal(t, signingInfosNum/2, len(emptyAddrSigningInfo)) | ||
|
|
||
| // check that signing info are correctly set before migration | ||
| slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { | ||
|
MSalopek marked this conversation as resolved.
|
||
| if _, ok := emptyAddrSigningInfo[address.String()]; ok { | ||
| require.Empty(t, info.Address) | ||
| } else { | ||
| require.NotEmpty(t, info.Address) | ||
| } | ||
|
|
||
| return false | ||
| }) | ||
|
|
||
| // upgrade signing infos | ||
| v15.UpgradeSigningInfos(ctx, slashingKeeper) | ||
|
|
||
| // check that all signing info are updated as expected after migration | ||
| slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { | ||
| require.NotEmpty(t, info.Address) | ||
|
|
||
| return false | ||
| }) | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.