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

feat!: Bump ICS to include inactive validators #3259

Merged
merged 12 commits into from
Aug 9, 2024

Conversation

p-offtermatt
Copy link
Contributor

@p-offtermatt p-offtermatt commented Aug 7, 2024

Description

Closes: #XXXX

Upgrades ICS to current main (which includes inactive validators).

Best reviewed by commit.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if API, client, or state breaking change (i.e., requires minor or major version bump)
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry in .changelog (for details, see contributing guidelines)
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

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

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

appKeepers.ProviderModule = icsprovider.NewAppModule(&appKeepers.ProviderKeeper, appKeepers.GetSubspace(providertypes.ModuleName))
// gov depends on provider, so needs to be set after
govConfig := govtypes.DefaultConfig()
// set the MaxMetadataLen for proposals to the same value as it was pre-sdk v0.47.x
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@insumity notice that this is already present before my changes

just in general, this is there to just get the same behaviour in terms of metadata length that Gaia has always had; it's just that in 47, something changed that makes it necessary to specify this now

func InitializeMaxValidatorsForExistingConsumers(ctx sdk.Context, providerKeeper providerkeeper.Keeper) {
maxVals := providerKeeper.GetParams(ctx).MaxProviderConsensusValidators
for _, chainID := range providerKeeper.GetAllRegisteredConsumerChainIDs(ctx) {
providerKeeper.SetValidatorSetCap(ctx, chainID, uint32(maxVals))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

proposed chains would not have their validator cap set to 180.
but all chains we have on the horizon are opt-in chains that specify a validator set cap, anyways.
if this is not ultimately the case, then we need to adjust this.

@@ -28,7 +28,7 @@ require (
github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.4.0
github.com/cosmos/interchain-security/v5 v5.1.1
github.com/cosmos/interchain-security/v5 v5.0.0-20240806104629-29327696b8e6
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks like a regression, but this is just temporary and stems from upgrading to a commit on main instead of teh v5.1 branch

This will be updated when we move to the actual ICS release


// InitializeLastProviderConsensusValidatorSet initializes the last provider consensus validator set
// by setting it to the first 180 validators from the current validator set of the staking module.
func InitializeLastProviderConsensusValidatorSet(ctx sdk.Context, providerKeeper providerkeeper.Keeper, stakingKeeper stakingkeeper.Keeper) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @insumity, yes the LastProviderConsensusValSet should be initialized here. Nice catch

app/upgrades/v20/upgrades.go Outdated Show resolved Hide resolved
app/upgrades/v20/upgrades.go Outdated Show resolved Hide resolved
app/upgrades/v20/upgrades.go Outdated Show resolved Hide resolved
app/upgrades/v20/upgrades.go Outdated Show resolved Hide resolved
Copy link
Contributor

@insumity insumity left a comment

Choose a reason for hiding this comment

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

Left a comment but otherwise looks good to me.
Would it also be possible to have the lint check pass before merging?

@p-offtermatt p-offtermatt merged commit 06f58d3 into marius/bump-version-v20 Aug 9, 2024
7 of 10 checks passed
@p-offtermatt p-offtermatt deleted the ph/inactive-vals-ics-upgrade branch August 9, 2024 15:57
@p-offtermatt p-offtermatt restored the ph/inactive-vals-ics-upgrade branch August 9, 2024 15:58
p-offtermatt added a commit that referenced this pull request Aug 9, 2024
p-offtermatt added a commit that referenced this pull request Aug 12, 2024
mpoke added a commit that referenced this pull request Aug 14, 2024
* replace gaia/v19 with gaia/v20

* add v20 upgrade handler

* update old gaia in upgrade-test

* Upgrade ICS version

* Change app wiring

* Add migration

* Fix linting

* Revert changes

* fix linter

* feat!: Bump ICS to include inactive validators (#3259)

* Upgrade ICS version

* Change app wiring

* Add migration

* Fix linting

* Add initialization for LastProviderConsensusValSet

* Use CamelCase for const names

* Remove unnecessary migration and parameter check

* Adjust comment to mention LastProviderConsensusValidatorSet initialization

* Remove panics and replace with error returns

* Improve logging

* Lint

* Revert "feat!: Bump ICS to include inactive validators (#3259)"

This reverts commit 06f58d3.

* tests: update config cmd usage in upgrade test

---------

Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com>
Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com>
Co-authored-by: MSalopek <matija.salopek994@gmail.com>
mpoke added a commit that referenced this pull request Aug 14, 2024
* replace gaia/v19 with gaia/v20

* add v20 upgrade handler

* update old gaia in upgrade-test

* Upgrade ICS version

* Change app wiring

* Add migration

* Fix linting

* Revert changes

* Upgrade ICS version

* Change app wiring

* Add migration

* Fix linting

* Add initialization for LastProviderConsensusValSet

* Use CamelCase for const names

* fix linter

* Remove unnecessary migration and parameter check

* Adjust comment to mention LastProviderConsensusValidatorSet initialization

* Remove panics and replace with error returns

* Improve logging

* Lint

* feat!: Bump ICS to include inactive validators (#3259)

* Upgrade ICS version

* Change app wiring

* Add migration

* Fix linting

* Add initialization for LastProviderConsensusValSet

* Use CamelCase for const names

* Remove unnecessary migration and parameter check

* Adjust comment to mention LastProviderConsensusValidatorSet initialization

* Remove panics and replace with error returns

* Improve logging

* Lint

* Revert "feat!: Bump ICS to include inactive validators (#3259)"

This reverts commit 06f58d3.

* add changelog entries

* Update app/upgrades/v20/upgrades.go

---------

Co-authored-by: mpoke <marius.poke@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants