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

revert: Turn staking power reduction into an on-chain param #9495

Merged
merged 4 commits into from
Jun 14, 2021

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Jun 10, 2021

Description

Closes: #9447

This PR partially reverts #8505. Namely:


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 or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • 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
  • manually tested (if applicable)

@github-actions github-actions bot added the C:CLI label Jun 10, 2021
@amaury1093 amaury1093 marked this pull request as ready for review June 10, 2021 14:42
@amaury1093 amaury1093 requested review from sunnya97 and anilcse June 10, 2021 14:42
@amaury1093
Copy link
Contributor Author

Would love to have @sunnya97 @alexanderbez and/or @anilcse ACK before merging this

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Why not editing the Keeper.PowerReduction instead of removing it and doing lot of changes in the code?

x/bank/simulation/operations_test.go Outdated Show resolved Hide resolved
x/staking/keeper/params.go Show resolved Hide resolved
@amaury1093 amaury1093 closed this Jun 11, 2021
@amaury1093 amaury1093 force-pushed the am/9447-revert-powerred branch from a05b55c to 745154a Compare June 11, 2021 13:57
@github-actions github-actions bot removed C:x/feegrant C:Simulations C:x/bank C:x/staking C:CLI C:x/distribution distribution module related T:Docs Changes and features related to documentation. C:x/gov C:x/authz labels Jun 11, 2021
@amaury1093 amaury1093 reopened this Jun 11, 2021
@github-actions github-actions bot added C:CLI C:Simulations C:x/staking T:Docs Changes and features related to documentation. labels Jun 11, 2021
@amaury1093
Copy link
Contributor Author

amaury1093 commented Jun 11, 2021

Why not editing the Keeper.PowerReduction instead of removing it and doing lot of changes in the code?

Yeah, good idea, I changed. The diff is way smaller now, R4R again.

@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #9495 (0dc8a51) into master (179c819) will increase coverage by 0.05%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9495      +/-   ##
==========================================
+ Coverage   60.54%   60.59%   +0.05%     
==========================================
  Files         590      589       -1     
  Lines       37296    37211      -85     
==========================================
- Hits        22579    22547      -32     
+ Misses      12768    12721      -47     
+ Partials     1949     1943       -6     
Impacted Files Coverage Δ
x/staking/keeper/migrations.go 50.00% <0.00%> (ø)
x/staking/legacy/v043/store.go 100.00% <ø> (+7.89%) ⬆️
x/staking/types/params.go 40.00% <ø> (-4.88%) ⬇️
x/staking/client/testutil/suite.go 99.49% <100.00%> (-0.01%) ⬇️
x/staking/keeper/params.go 100.00% <100.00%> (ø)
x/staking/keeper/val_state_change.go 51.91% <100.00%> (ø)
x/staking/genesis.go 60.00% <0.00%> (+4.61%) ⬆️

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

utACK. Thanks for updating the PR.

@@ -112,7 +112,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate {
func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error) {
params := k.GetParams(ctx)
maxValidators := params.MaxValidators
powerReduction := params.PowerReduction
powerReduction := k.PowerReduction(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 14, 2021
@mergify mergify bot merged commit 5cd741a into master Jun 14, 2021
@mergify mergify bot deleted the am/9447-revert-powerred branch June 14, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:CLI C:Simulations C:x/staking T:Docs Changes and features related to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing PowerReduction param causing network halt
3 participants