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

Standalone to consumer changeover - recycle existing transfer channel #832

Merged
merged 95 commits into from
Apr 19, 2023

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Apr 7, 2023

Description

Allows previously standalone chains to use the already existing transfer channel from the standalone chain

Linked issues

Closes: #782

Epic: #756

Type of change

If you've checked more than one of the first three boxes, consider splitting this PR into multiple PRs!

  • Feature: Changes and/or adds code behavior, irrelevant to bug fixes
  • Fix: Changes and/or adds code behavior, specifically to fix a bug
  • Refactor: Changes existing code style, naming, structure, etc.
  • Testing: Adds testing
  • Docs: Adds documentation

Regression tests

Existing handshake tests like TestOnChanOpenAck

New behavior tests

CRUD unit tests, and new integration test in changeover.go

Versioning Implications

If the above box is checked, which version should be bumped?

  • MAJOR: Consensus breaking changes to both the provider and consumers(s), including updates/breaking changes to IBC communication between provider and consumer(s)
  • MINOR: Consensus breaking changes which affect either only the provider or only the consumer(s)
  • PATCH: Non consensus breaking changes

Targeting

Please select one of the following:

  • This PR is only relevant to main
  • This PR is relevant to main, and should also be back-ported to ____ (ex: v1.0.0 and v1.1.0)
  • This PR is only relevant to ____ (ex: v1.0.0, v1.1.0, and v1.2.0)

jstr1121 and others added 30 commits December 19, 2022 09:52
…o jstr/onchain_upgrade_to_consumer_chain_840
Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>
@shaspitz shaspitz marked this pull request as ready for review April 14, 2023 16:23
Base automatically changed from changeover-staking to main April 14, 2023 16:31
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

Looks good!

e2e tests will be added at a later point

@@ -111,7 +111,7 @@ func (k Keeper) Slash(ctx sdk.Context, addr sdk.ConsAddress, infractionHeight, p

// If this is a previously standalone chain and infraction happened before the changeover was completed,
// slash only on the standalone staking keeper.
if k.IsPrevStandaloneChain() && infractionHeight < k.FirstConsumerHeight(ctx) {
if k.IsPrevStandaloneChain(ctx) && infractionHeight < k.FirstConsumerHeight(ctx) {
k.standaloneStakingKeeper.Slash(ctx, addr, infractionHeight, power, slashFactor, stakingtypes.InfractionEmpty)
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to dig into how exactly consumer chains using the democracy module or other things will populate standaloneStakingKeeper

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? That's the staking module with the native token from when the chain was a standalone chain.

Copy link
Contributor

@jtremback jtremback left a comment

Choose a reason for hiding this comment

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

LGTM

@jtremback jtremback merged commit 952e2fe into main Apr 19, 2023
@jtremback jtremback deleted the recycle-transfer-channel branch April 19, 2023 21:55
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.

Maintain transfer channel before/after sovereign -> consumer changeover
5 participants