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 - staking functionalities #794

Merged
merged 79 commits into from
Apr 14, 2023

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Mar 20, 2023

Description

Implements the decisions about how the main staking methods should be handled for a chain going through a standalone to consumer changeover.

Linked issues

Closes: #781

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

Tests added in validators_test.go, integration test added in slashing.go

New behavior tests

Behavior of normal consumer and normal democracy consumer shouldn't be affected

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
Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>
Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM. Great work @smarshall-spitzbart

x/ccv/consumer/keeper/changeover.go Outdated Show resolved Hide resolved
@@ -427,7 +427,7 @@ func New(
authtypes.FeeCollectorName,
)

// Setting the staking keeper is only needed for standalone to consumer changeover chains
// Setting the standalone staking keeper is only needed for standalone to consumer changeover chains
Copy link
Contributor

Choose a reason for hiding this comment

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

Nomenclature is strange to me, why not just refer to it as Sovereign to Consumer? Or is there a precedent that was decided already for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea there is a precedent here: #757 (comment). "Sovereign" could make it seem like consumers have no sovereignty

Comment on lines 687 to 691
suite.consumerChain.NextBlock()
suite.consumerChain.NextBlock()
suite.consumerChain.NextBlock()
suite.consumerChain.NextBlock()
suite.consumerChain.NextBlock()
Copy link
Contributor

@glnro glnro Apr 13, 2023

Choose a reason for hiding this comment

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

Why not just iterate here or write a function to pass time?

func (suite *CCVTestSuite) produceEmptyBlocks(blocks int){
  for blocks > 0 {
    suite.consumerChain.NextBlock()
    blocks--
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"empty blocks" is kind of true since no txs are submitted. But when we do something like this it's usually a sanity check that beginblock/endblock do or do not trigger some code. Reasoning is usually a case by case basis

For loop makes sense tho cb9a1ec

Copy link
Contributor

@sainoe sainoe left a comment

Choose a reason for hiding this comment

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

Great work @smarshall-spitzbart! Check my comments

shaspitz and others added 4 commits April 14, 2023 08:56
Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
@shaspitz shaspitz merged commit 4933a7f into main Apr 14, 2023
@shaspitz shaspitz deleted the changeover-staking branch April 14, 2023 16:31
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.

Validate staking functionalities for sovereign -> consumer changeover
6 participants