-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Turn staking power reduction into an on-chain param #8505
Conversation
…on_chain_param power reduction as on-chain param
Codecov Report
@@ Coverage Diff @@
## master #8505 +/- ##
==========================================
- Coverage 59.00% 58.82% -0.19%
==========================================
Files 577 580 +3
Lines 32481 32643 +162
==========================================
+ Hits 19167 19203 +36
- Misses 11052 11174 +122
- Partials 2262 2266 +4
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Each param change set has a validation function, e.g. https://github.com/cosmos/cosmos-sdk/blob/master/x/mint/types/params.go#L93 |
@alexanderbez No, I mean that #8909 makes it such that a CreateValidator message with < 1 consensus power of self-bond fails the ValidateBasic of the MsgCreateValidator. But this can't be done now, because in this PR the MsgCreateValidator.ValidateBasic function doesn't have the ctx, and so can't know what the current power reduction is. |
Ahhh, yes, you're right. I think our only option is to remove it from the stateless |
Yeah, that's what I started doing, but actually I think that might be doubling down on the wrong solution. I wrote this on the #8909 (comment) PR.
|
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.
Code lgtm, but it seems like migrations (both JSON and in-place) are not handled correctly
@AmauryM, fixed the migrations issues |
Still not sure why |
If the PR breaks state then node data needs to be rebuilt. To rebuild rosetta with new state:
after that you can run: |
Thanks @fdymylja! |
Oops, I forgot the squash and merge 🤦 Is there a way to fix that? |
<!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: #9447 This PR partially reverts #8505. Namely: - it removes PowerReduction as a staking on-chain param - however, it keeps #8505's API changes regarding adding a `powerReduction` function argument to staking functions. This allows us to rely less on global variables in said functions. <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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 - [ ] manually tested (if applicable)
closes: #8365
Copied description from issue:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes